The John Henry lens design challenge

70
Man vs. Machine: a Lens Design Challenge A friendly competition David Shafer vs . Don Dilworth

description

A contest between the world's best automatic lens design program and a human designer on a specific design problem

Transcript of The John Henry lens design challenge

Page 1: The John Henry lens design challenge

Man vs. Machine: a Lens Design Challenge

A friendly competition

David Shafer vs. Don Dilworth

Page 2: The John Henry lens design challenge

2

The John Henry Lens Design Challenge

A friendly competition

David Shafer vs. Don Dilworth

Page 3: The John Henry lens design challenge

Man vs. Machine

John Henry

Steam Drill

3

(MAN)

(MACHINE)

Page 4: The John Henry lens design challenge

Can a very good lens designer beat a very good

program?

This competition aims

to find out.

Who will win?

Place your bets now!

4

Page 5: The John Henry lens design challenge

Part 1: The Human Designer

5

David Shafer

(Human)

Page 6: The John Henry lens design challenge

We now wanted a lens design contest to pit man against machine on a particular problem – one based on human developed design principles and theories, to give our team (that’s you, people) an edge.

Page 7: The John Henry lens design challenge

I came up with a design contest problem from the early days of optical lithography that uses for its (human) solution a distinction between intrinsic and induced optical aberrations

Early computer chip

Page 8: The John Henry lens design challenge

Intrinsic and induced optical aberrations – how can you tell the difference?

Page 9: The John Henry lens design challenge

• Intrinsic aberrations of a surface depend on pupil position and conjugates. Are independent of incoming aberrations from previous surfaces.

• Induced aberrations are due to aberrations from previous surfaces coming into a surface and then interacting with the surface

• Induced aberrations are often more important than intrinsic ones, in a highly corrected design

Page 10: The John Henry lens design challenge

Incoming ray angle and conjugate change with wavelength, due to color from lens.

Mirror has Spherochromatism

Intrinsic spherochromatism of mirror = 0

There is induced spherochromatism due to color coming into mirror

Page 11: The John Henry lens design challenge

unachromatized

achromatized

My US patent #4,770,477

Page 12: The John Henry lens design challenge

• Correcting axial and lateral color in the right place reduces induced aberrations on strong power lenses elsewhere.

• Chromatic variation of spherical aberration, coma, and astigmatism can be corrected, almost without effort, by this method.

• Result is broad spectral band correction

Page 13: The John Henry lens design challenge

Contest problem specs

100 mm focal length.35 NA10X10 mm square fieldBack focus >10 mmLength<250 mm, including stop (if external)Telecentric imageNo vignettingNo cemented lensesOnly BK7 and LF5 glassesDistortion to be zero at edge of fieldDiffraction-limited over field at both .351u and .4461u laser lines at same focus position (= the hard part)

Page 14: The John Henry lens design challenge

11 lens design that is diffraction-limited over the field for both wavelengths.

Page 15: The John Henry lens design challenge

It is interesting that the 2nd lens is a negative BK7 lens. This design depends on a certain placement of the LF5 power in the design in order to get the chromatic variation of aberrations well corrected.

11 lens design

Page 16: The John Henry lens design challenge

10 lens design

Page 17: The John Henry lens design challenge

9 lens design

Page 18: The John Henry lens design challenge

8 lens design

Page 19: The John Henry lens design challenge

Designs can be stuck in a local minimum of the merit function. Hard to escape from.Various optimization “tricks” can be useful.

Page 20: The John Henry lens design challenge

7 lens design

= end of the road

Page 21: The John Henry lens design challenge

11 lenses

10 lenses

9 lenses

8 lenses

7 lenses

Design progression to simpler form

Page 22: The John Henry lens design challenge

Part 2: The Steam Drill

22

Don Dilworth

Steam Drill

Page 23: The John Henry lens design challenge

How to test Global Optimization?

• Get a hard problem…– Break the program

• … from a human expert (Dave Shafer).• See what a very fast idiot can do (the PC).• Compare results.

23

Page 24: The John Henry lens design challenge

• Requirements set by customer• Designer adjusts them

– Must be possible; customer beware.• Designer – or computer – selects configuration• Designer optimizes that configuration.

24

This contest involves only the portion in

RED

Computer cannot solve the whole problem

Page 25: The John Henry lens design challenge

Can a machine find the best design?

• Can any algorithm find the absolute best lens design?– Yes, if you try an infinite number of designs.– But …”I want to still be young when we get there.”

• So we have to cut corners.– Need a way to generate trial designs.– Must be fast, thorough.

• Inevitable tradeoff.

– Have to find a trick; need some insight.

25

Page 26: The John Henry lens design challenge

26

A complex lens has many minima

Like a mountain range. You want the lowest valley

Imagine thisin 30 dimensions!

Page 27: The John Henry lens design challenge

Instead of trying 200,000 designs,

• Start at the top of a hill.• You can see many valleys.• Slide downhill until you reach a minimum.• Different directions will go to different minima.• Does it work?• What is an “optical hill”?

27

Insight

Page 28: The John Henry lens design challenge

• Curves can go either direction.• Any design might be reached (we hope).• How to implement?

– Generate a binary number, each bit is an element.– Each value of that number creates a unique lens

prescription.– Try them all, optimize.

• Feature is called DSEARCH, part of the SYNOPSYS™ program.

28

Plane-parallel plates!

Page 29: The John Henry lens design challenge

DSEARCH is a fast idiot

• It knows nothing about aberration theory– A human expert uses that knowledge– Knowledge is tailored to each lens– A commercial program has to work for every lens

you throw at it• DSEARCH has to be completely general

– No specialized knowledge– Everything (almost) is based on raytracing

29

Page 30: The John Henry lens design challenge

What can DSEARCH do?

• Random selection of curvatures, thicknesses, spacings (Very slow if number is large)– or

• Binary search (2n cases to analyze)– 11-elements needs 2048 cases (tiny subspace)

• Full optimization of each case– or

• Quick screening pass, pick winners and optimize only those

• Simulated annealing pass afterwards, optional– or

• Pure optimization only30

R/B

F/Q

A/O

Many Fast-Slow tradeoffs

Page 31: The John Henry lens design challenge

DSEARCH™ input specifies the goals

31

DSEARCH 1 QUIETSYSTEMID DSEARCH SAMPLEOBB 0 4 35WA1 .446 .351WT1 1 1CORD 2 1 UNITS MMEND

GOALSELEMENTS 8FNUM 1.43 BACK 0 0TOTL 0 0RSTAR 300THSTART 5ASTART 5STOP FIRSTSTOP FREEGLASS POSITIVES UBK7GLASS NEGS LF5

RT 0.75FOV 0.0 .5 .75 1FWT 1 1 1 1NPASS 60ANNEAL 10 10RANDOM 5000END

SPECIALLLL 10 1 1 A BACKLUL 240 1 1 A TOTLLUL 240 1 1 A TOTLS ENPM 0 2 A P HH 1M 0 5 A P YA 1S GIHTENDGO

System specs

Design goals

Options selected(fast/slow)

Special requirements:Back focus more than 10Total length more than 240Total length plus pupil distance more than 240Telecentric at imageDistortion corrected at edge of field.

The best results are then further optimized by a human, first with transverse ray targets, then OPDs, then MTF.

DSEARCH finds the construction, not the final design.

Page 32: The John Henry lens design challenge

DSEARCH works well for easy jobs

What about hard ones?

Dave suggested an 11-element lens

So I gave that a try

32

Page 33: The John Henry lens design challenge

Specifications:

• 0.35 NA (F/1.428)• 10x10 mm square field.• 100 mm focal length.• System length less than 250 mm.• Back focus at least 10 mm.• No vignetting.• Telecentric at image.• Distortion near zero.

…And…Two separated

wavelengths, onlytwo glass types

permitted.

That’s hard to

do!

33

Page 34: The John Henry lens design challenge

DSEARCH results for 11-element lens:

34

(Drum roll, please)

Page 35: The John Henry lens design challenge

DSEARCH results for 11-element lens:

Settings::Binary search methodQuick screening passAnneal best 10Time: 25 minutes.

35

B+Q+A = 25

Page 36: The John Henry lens design challenge

36

DSEARCH returns the best 10 configurations.

The top three here are all pretty good.

11 elements gives 2048 binary possibilities.

Too easy!

Page 37: The John Henry lens design challenge

Give me a harder problem, please• 10-elements?

– Too easy• 9-elements?

– Too easy

37

8-ELEMENTS!HARD!

Page 38: The John Henry lens design challenge

How do you solve a hard problem?

• Pull out all the stops– Random search

• 5000 cases

– Full optimization of each case• 60 passes

– Simulated annealing on every lens• … And it is slow

– But of course it works!

38

Page 39: The John Henry lens design challenge

First try, 8-element design:

39

8 hours!

Page 40: The John Henry lens design challenge

8-elements, slowest options

40

R 5000, F, A = 8 hours!

The slow, brute-force approach

works.

That’s not surprising.

Try enough cases and the computer

always wins

Page 41: The John Henry lens design challenge

Okay, it works. But it was slow.

41

To be practical, the process has to run in just a few minutes.

Otherwise nobody will use it.

How to make it

practical?If we stopped here, I would declare Shafer the winner. (I am not willing to spend 8 hours!)

Page 42: The John Henry lens design challenge

How can we speed things up?

42

Reduce the number of cases to try.

Systematic search, not

random (BINARY)

Bypass cases that are obviously no

good

Quick screening pass

Make each case run faster.

Fewer cycles

Annealing?

Multicore!(All of the

timings are for a single-core PC)

Page 43: The John Henry lens design challenge

Quick mode for faster results

43

Screening pass, merit function has only 3rd and 5th

order aberrations (plus 3 real rays)

Maybe the best quick design is not best when

higher orders are considered

Page 44: The John Henry lens design challenge

Randomness plays a role

44

Our mountain metaphor may not be accurate

Binary search might miss good

solutions

Page 45: The John Henry lens design challenge

Can we go faster? What did we learn?

45

Local minima

Many local minima!

A good one

Page 46: The John Henry lens design challenge

Let’s use our heads, not our hammer.

• Try the binary search method (faster).– Results not as good as Dave’s lens! Why?

• Binary number determines the direction you head down from the top of the hill.– Initial radii set by user input.– All radii equal +/- that value. (Bending = 0).

• How far from the top should you start?– Does it matter?

46

Page 47: The John Henry lens design challenge

47

Start here… and you go here

Start here… and you go here

Plane-parallel plates

Page 48: The John Henry lens design challenge

48

This is a plot of the merit function when Dave’s geometry was selected (P N N P P P N P) and only the initial radius was varied.

A longer radius starts closer to the top of the mountain.

Too short or too long, results are not as good. (Ray failure correction alters the construction.)

Sweet spot at about 600 mm.

Looks like a rule: about 6 x FOCL (applies to binary mode).

Start downslope

Start near top

Sweet spot!

Lesson learned:

Page 49: The John Henry lens design challenge

49

Okay, we have several options:

FAST

Thorough

Page 50: The John Henry lens design challenge

Let’s try some combinations

50

R 1000, Q, A = 11 minutes

Very nice results! Let’s see what else

we can find.

Can quick mode find any good lenses?

Random mode makes random jump

downhill

Can Binary modeget there?

Page 51: The John Henry lens design challenge

Binary, full optimization:

51

B, F, A = 50 minutes

Slower, but slightly better.

60 optimization passes

Page 52: The John Henry lens design challenge

Here’s more:

52

B, F, A = 16 minutes

Only 10 cycles of optimization + 5 cycles of annealing.

One can trade off several fast/slow

options.

Fewer cycles = faster.

Page 53: The John Henry lens design challenge

…and here’s a surprise:

53

B, Q, A = 4.8 minutes

20 quick cycles, 20 cycles of optimization, 5 cycles of

annealing…

… but most of the very fast runs were not this good.

Why?

Page 54: The John Henry lens design challenge

Predicting optimization results is not easy.

54

Well-behaved optimization

Erratic optimization

Acceleration methods do not always work!

Page 55: The John Henry lens design challenge

Acceleration techniques:

• Binary search– Might miss good configurations.

• Quick mode = screening pass– No guarantee that best 3rd and 5th order design is really best.

Some are not.• Fewer optimization cycles

– Can be misleading.• Filter out obvious lemons

– All flints, for example: not likely to correct color.– Can use optics knowledge:

• Best 8-element lenses will probably have 2 or 3 flint elements.• Try only those cases. 55

Page 56: The John Henry lens design challenge

This is a good combination

56

BinaryFull optimization (not quick)Anneal3 flint4.8 minutes

Is this cheating? (Using optics knowledge)

Well, we assume the user has

some knowledge!

Page 57: The John Henry lens design challenge

The most varied results:• Used either random search

– or -- • simulated annealing.• Neither one is purely deterministic.

57

What does that tell us?

Perhaps our metaphor is not

quite right!

If not a mountain, what is it?

Page 58: The John Henry lens design challenge

Here’s a new metaphor: a WWI battlefield.

58

Trench Crater

Page 59: The John Henry lens design challenge

That would explain our results

• Sliding down from a mountain cannot always get you into a deep crater.

• Random search can do it.• Simulated annealing can do it.• So what’s the most efficient way to search?

– Binary search– Quick mode is worth a try– Filter out lemons– Annealing at the end.

• Random search as last resort.• Multicore, of course, if you can.

59

Page 60: The John Henry lens design challenge

60

Human

R5000, F, A, 8 hours

R1000, Q, A, 11 minutes

B, F, A, 50 minutes

B, F, A, 16 minutes

Contest summary

Page 61: The John Henry lens design challenge

61

Faster runs sometimes work too, but not always

B, Q, A, 4.8 minutes

B, Q, A, 2.9 minutes

B, Q, A, 1.75 mins.

Page 62: The John Henry lens design challenge

62

Page 63: The John Henry lens design challenge

63

… and two more.

Each of these 23 designs is as good or better than the human-designed lens

A human would probably stop when he found the first design that met specs.

DSEARCH gives you many possibilities.

What about 7 elements?

Page 64: The John Henry lens design challenge

7 elements!

64

The goal was to break the algorithm.

It broke.

Many attempts failed...

… but then we got smart.

Success!

Page 65: The John Henry lens design challenge

Adjusting the aperture weight works!

65

2.9 minutes.Construction identical to

Shafer’s version!

BinaryQuickAnneal

Page 66: The John Henry lens design challenge

So here’s a lesson:

66

Some knowledge of optics comes

in handy!

But if we didn’t know Shafer’s solution exists, we probably would

have given up.

Score this round for the

human.

Page 67: The John Henry lens design challenge

And here’s the score:

67

Round 1: Eight elements:Steam Drill wins, 23 to 1

Round 2: Seven elements:

Human wins, 1 to 0

Page 68: The John Henry lens design challenge

… And the winner is …

• Well, it seems to be a draw.– David Shafer is impressed that a mere PC can

sometimes do as well or better than a human expert.

– The steam drill is impressed that a mere human (Shafer) can come up with a design that is a challenge for even the best algorithms (SYNOPSYS™).

• But one thing seems certain …

68

Page 69: The John Henry lens design challenge

If John Henry had used his head instead of his hammer …

69

… and would have enjoyed a comfortable retirement.

He would have applied for a job

running the steam drill…

Page 70: The John Henry lens design challenge

Thank you

70

David Shafer Optical [email protected]

Don DilworthOptical Systems Design, [email protected]