Man vs. Machine: a
Lens Design Challenge
A friendly competition
The John Henry Lens
A friendly competition
Man vs. Machine
Can a very good lens
designer beat a very
to find out.
Part 1: The Human Designer
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.
I came up with a
problem from the
early days of optical
lithography that uses
for its (human)
solution a distinction
and induced optical
Early computer chip
Intrinsic and induced optical aberrations – how can you tell the difference?
• 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
• Induced aberrations are often more important than
intrinsic ones, in a highly corrected design
Mirror has Spherochromatism
of mirror = 0
There is induced
due to color coming
Incoming ray angle and conjugate
change with wavelength, due to
color from lens.
My US patent
• 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
Contest problem specs
100 mm focal length
10X10 mm square field
Back focus >10 mm
Length<250 mm, including stop (if external)
No cemented lenses
Only BK7 and LF5 glasses
Distortion to be zero at edge of field
Diffraction-limited over field at both .351u and .4461u laser lines
at same focus position (= the hard part)
11 lens design that is
over the field for both
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
Design progression to simpler form
Part 2: The Steam Drill
• 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.
• Requirements set by customer
• Designer adjusts them
– Must be possible; customer beware.
• Designer – or computer – selects
• Designer optimizes that configuration.
This contest involves
only the portion in
• Can any algorithm find the absolute best lens
– 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.
A complex lens has many minima
in 30 dimensions!
Like a mountain range. You want the lowest valley
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”?
• 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
– Try them all, optimize.
• Feature is called DSEARCH, part of the
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
Many Fast-Slow tradeoffs
• Random selection of curvatures, thicknesses, spacings
(Very slow if number is large)
• Binary search (2n cases to analyze)
– 11-elements needs 2048 cases (tiny subspace)
• Full optimization of each case
• Quick screening pass, pick winners and optimize only
• Simulated annealing pass afterwards, optional
• Pure optimization only
DSEARCH™ input specifies the goals
DSEARCH 1 QUIET
ID DSEARCH SAMPLE
OBB 0 4 35
WA1 .446 .351
WT1 1 1
CORD 2 1
BACK 0 0
TOTL 0 0
FOV 0.0 .5 .75 1
FWT 1 1 1 1
ANNEAL 10 10
LLL 10 1 1 A BACK
LUL 240 1 1 A TOTL
LUL 240 1 1 A TOTL
M 0 2 A P HH 1
M 0 5 A P YA 1
Back focus more than 10
Total length more than 240
Total length plus pupil
distance more than 240
Telecentric at image
Distortion 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
DSEARCH works well for easy jobs
Dave suggested an
So I gave that
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.
Telecentric at image.
two glass types
Distortion near zero.
DSEARCH results for 11-element lens:
(Drum roll, please)
DSEARCH returns the best
The top three here are all
11 elements gives 2048
– Too easy
– Too easy
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!
8-elements, slowest options
The slow, bruteforce approach
R 5000, F, A = 8 hours!
Try enough cases
and the computer
Okay, it works. But it was slow.
process has to
run in just a
will use it.
If we stopped here, I would declare Shafer the
winner. (I am not willing to spend 8 hours!)
How can we speed things up?
Reduce the number
of cases to try.
Make each case
Bypass cases that
are obviously no
(All of the
timings are for a
Quick mode for faster results
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
Randomness plays a role
Our mountain metaphor
may not be accurate
might miss good
Can we go faster? What did we learn?
Let’s use our heads, not
• 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?
and you go
and you go
Start near top
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).
Okay, we have several options:
Let’s try some combinations
Random mode makes
Can quick mode find
any good lenses?
R 1000, Q, A = 11 minutes
Very nice results!
Let’s see what else
we can find.
Can Binary mode
Binary, full optimization:
B, F, A = 50 minutes
Fewer cycles =
B, F, A = 16 minutes
Only 10 cycles of
optimization + 5 cycles of
One can trade off
…and here’s a surprise:
20 quick cycles, 20 cycles
of optimization, 5 cycles
B, Q, A = 4.8 minutes
… but most of the very fast
runs were not this good.
Predicting optimization results is not easy.
Acceleration methods do not always work!
• 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.
This is a good combination
Full optimization (not quick)
Is this cheating? (Using
Well, we assume
the user has
The most varied results:
• Used either random search
– or -• simulated annealing.
• Neither one is purely deterministic.
What does that tell us?
If not a
at is it?
metaphor is not
Here’s a new metaphor: a WWI battlefield.
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?
Quick mode is worth a try
Filter out lemons
Annealing at the end.
• Random search as last resort.
• Multicore, of course, if you can.
R5000, F, A, 8 hours
B, F, A, 50 minutes
B, F, A, 16 minutes
R1000, Q, A, 11 minutes
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.
… and two more.
A human would probably stop when he
found the first design that met specs.
DSEARCH gives you many possibilities.
Each of these 23 designs is as good or
better than the human-designed lens
The goal was to break the
Many attempts failed...
… but then we got smart.
Adjusting the aperture weight works!
Construction identical to
So here’s a lesson:
of optics comes
But if we didn’t know Shafer’s
solution exists, we probably would
have given up.
round for the
And here’s the score:
Steam Drill wins, 23 to 1
Human wins, 1 to 0
• 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
– 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
• But one thing seems certain …
If John Henry had used his head
instead of his hammer …
He would have
applied for a job
running the steam
… and would have
enjoyed a comfortable
David Shafer Optical Design
Optical Systems Design, Inc.