Advanced Fitting Tutorial

Deep dive into optimization algorithms and parameter bounds

Back to Metrology Suite

Introduction

This advanced tutorial explores the optimization algorithms used for thickness extraction, focusing on when and how to use each method effectively. We'll cover parameter selection, convergence diagnostics, and troubleshooting common issues.

The Optimization Problem

Objective Function

All thickness extraction methods minimize the difference between measured and modeled reflectance:

χ²(d) = Σᵢ [Rmeas(λᵢ) - Rmodel(λᵢ, d)]²

Where:

Why Optimization is Needed

Unlike FFT which gives a direct estimate, finding the exact thickness requires solving a nonlinear inverse problem. The reflectance R(λ, d) has a complex functional form involving:

No closed-form solution exists → iterative optimization required.

Algorithm 1: Levenberg-Marquardt (L-M)

Mathematical Foundation

L-M is a damped least-squares method that interpolates between gradient descent and Gauss-Newton approaches:

dk+1 = dk - [JTJ + λI]-1 JTr

Where:

How It Works

  1. Start: Initial guess d₀ (typically from FFT)
  2. Compute: Calculate Rmodel(λ, dk) and residuals
  3. Gradient: Numerical Jacobian: J ≈ [R(d+h) - R(d-h)] / 2h
  4. Update: Solve linear system for step direction
  5. Accept/Reject: If χ² decreases, accept step and reduce λ. Else, increase λ and retry
  6. Converge: Stop when |dk+1 - dk| < tolerance

Parameter Selection

ParameterRecommended ValueDescription
Initial λ0.001-0.01Smaller for good initial guess
λ increase×10When step rejected
λ decrease÷10When step accepted
Max iterations50-100Typical convergence: 10-20 iterations
Tolerance0.01 nmStop criterion for parameter change

When to Use

✓ Advantages:
  • Very fast convergence (0.1 seconds typical)
  • High precision (±0.5 nm)
  • Provides uncertainty estimate from Jacobian
  • Standard method in commercial tools
✗ Limitations:
  • Requires good initial guess (within ~20% of true value)
  • Can converge to local minima
  • Sensitive to measurement noise at edges

Best Practice

Always use FFT estimate as initial guess for L-M. This hybrid approach combines FFT's robustness with L-M's precision.

Algorithm 2: Differential Evolution (DE)

Population-Based Global Search

DE is a stochastic evolutionary algorithm that maintains a population of candidate solutions and evolves them toward the global optimum.

Algorithm Steps

  1. Initialize: Create population of NP random thickness values within bounds
  2. Mutation: For each individual xᵢ, create mutant:
    vᵢ = xr1 + F(xr2 - xr3)
    where r1, r2, r3 are random distinct indices
  3. Crossover: Mix parent and mutant with probability CR:
    uᵢⱼ = vᵢⱼ if rand() < CR, else uᵢⱼ = xᵢⱼ
  4. Selection: Keep offspring if χ²(offspring) < χ²(parent)
  5. Iterate: Repeat for G generations until convergence

Hyperparameters

ParameterTypical ValueEffect
Population size (NP)10-20Larger = better global search, slower
Mutation factor (F)0.5-1.0Step size in parameter space
Crossover rate (CR)0.7-0.9Probability of using mutant
Max generations100-300Budget for convergence

When to Use

✓ Advantages:
  • No initial guess needed
  • Finds global minimum (avoids local minima)
  • Robust to noisy data
  • Simple to implement
✗ Limitations:
  • Slower (1-2 seconds typical)
  • More function evaluations (300-500 vs 10-20 for L-M)
  • Stochastic (slightly different result each run)
  • No uncertainty estimate from algorithm itself

When DE is Essential

Unknown samples: If you don't know approximate thickness (no FFT possible due to too few fringes), DE can search the entire physically reasonable range.

Multi-modal problems: Some configurations have multiple local minima. DE explores globally and avoids getting trapped.

Algorithm Comparison

Levenberg-Marquardt

Type: Local gradient-based

Speed: ⚡⚡⚡ Fast (0.1s)

Accuracy: ★★★ Excellent (±0.5 nm)

Robustness: ★★☆ Needs good guess

Best for: Production QC, high-throughput

Differential Evolution

Type: Global stochastic

Speed: ⚡☆☆ Slow (1.5s)

Accuracy: ★★★ Excellent (±0.5 nm)

Robustness: ★★★ Very robust

Best for: Unknown samples, R&D

Decision Tree

Do you have FFT estimate? ─┐ │ ┌───────┴───────┐ │ │ YES NO │ │ Use L-M with Use DE with FFT as guess wide bounds (fast & accurate) (slower but robust) │ │ └───────┬───────┘ │ Does it converge? │ ┌───────┴───────┐ YES NO │ │ Done! Try DE or adjust bounds

Setting Parameter Bounds

Why Bounds Matter

Proper bounds prevent unphysical solutions and improve convergence:

Recommended Bounds

SituationLower BoundUpper Bound
With FFT estimate dFFT 0.7 × dFFT 1.3 × dFFT
Process spec (e.g., 250±25 nm) 225 nm 275 nm
Unknown, visible fringes 50 nm 1000 nm
Unknown, few/no fringes 10 nm 100 nm

Bounds Too Tight

If true thickness falls outside bounds, optimizer will converge to boundary value. Check residuals - large systematic errors indicate this problem.

Adaptive Bounds Strategy

  1. Run FFT → get dFFT
  2. Set bounds: [0.7 × dFFT, 1.3 × dFFT]
  3. Run L-M fitting
  4. If converged thickness is near boundary (within 5%), expand bounds and refit

Convergence Diagnostics

How to Know if Fitting Succeeded

1. Chi-Squared Value

χ² < 10⁻⁴ : Excellent fit
χ² < 10⁻³ : Good fit
χ² < 10⁻² : Acceptable
χ² > 10⁻² : Poor fit (check data/model)

2. Residual Analysis

Plot residuals: Rmeas(λ) - Rmodel(λ)

3. Convergence History

Plot χ² vs iteration number:

4. Parameter Uncertainty

From L-M covariance matrix: σd < 2 nm typically

Troubleshooting Common Issues

Issue 1: Non-Convergence

Symptoms: Maximum iterations reached, χ² still large

Causes & Solutions:

Issue 2: Boundary Convergence

Symptoms: Fitted thickness exactly at lower or upper bound

Solutions:

  1. Expand bounds (e.g., double the range)
  2. Check if thickness truly outside initial guess range
  3. Verify FFT estimate is reasonable

Issue 3: Multiple Solutions

Symptoms: Different initial guesses converge to different values

Cause: Thick films can have ambiguous fringe counting

Solutions:

Issue 4: Slow Convergence

Symptoms: Takes >100 iterations for L-M

Solutions:

Advanced Techniques

1. Hybrid Two-Stage Fitting

Stage 1: Global Search - Run DE with wide bounds [50, 1000] nm - Find approximate global minimum: d_DE ≈ 245 nm - Time: 1.5 seconds Stage 2: Local Refinement - Run L-M with initial guess d_DE - Narrow bounds: [0.9×d_DE, 1.1×d_DE] - Precise result: d = 250.15 ± 0.82 nm - Time: 0.1 seconds Total: 1.6 seconds for guaranteed global optimum

2. Multi-Start L-M

Run L-M from 5-10 different random initial guesses, keep best result:

guesses = [100, 200, 300, 400, 500] # nm results = [] for guess in guesses: d_fit, chi2 = run_LM(guess) results.append((d_fit, chi2)) best_d = min(results, key=lambda x: x[1])[0] # Best result has lowest χ²

3. Uncertainty Quantification via Bootstrap

Estimate uncertainty by resampling data with noise:

n_bootstrap = 100 thicknesses = [] for i in range(n_bootstrap): # Add random noise to measured spectrum R_perturbed = R_measured + noise_level * randn() d_fit = run_fitting(R_perturbed) thicknesses.append(d_fit) d_mean = mean(thicknesses) d_std = std(thicknesses) # Report: d = d_mean ± d_std nm

Summary & Recommendations

Use CaseRecommended Strategy
Production QC (known process) FFT + L-M with tight bounds
R&D (unknown samples) DE with wide bounds, or Hybrid
Thin films (<50 nm, few fringes) DE with [10, 100] nm bounds
Thick films (>500 nm, many fringes) Multi-start L-M to handle ambiguity
Critical measurements Hybrid + Bootstrap for uncertainty

Key Takeaways

Further Reading