# Optical Element Surface Defect Size Recognition Based on Decision Regression Tree
## 3 The Principle of Defect Size Recognition
### The Far Field Light Intensity Distribution of the Defect  
To collect a series of known size defect gray distribution (i.e., light intensity distribution) as the training data set of the DRT, a simulation model based on the FDTD method is established in FDTD  
Figure 1: The layout of the microscopic scattering dark-field imaging (MSDI) system.  
solution software to simulate the imaging environment of the MSDI system. As illustrated in Figure 2, the incident light irradiates on the optical element surface, and a part of them is scattered by the defect. The scattered light firstly travels to the near field and then is collected by the objective lens. Finally, it reaches the far-field where the dark-field image of the defect is obtained. The specific illustration is as follows.  
The total-field scattered-field (TFSF) source is chosen as the light source, and the medium around the optical element is set to air. The boundary is set to the perfectly matched layer (PML) to absorb the reflected light on the boundary, which can eliminate the effect of reflected light on the spatial distribution of the scattered light. Scattered field (SF) monitor is put in near field to acquire the electric field \(\mathbf{E}_{\text{near}}\) of scattered light.  
The electric field in the far-field is solved by the built-in function of FDTD solution, and this procedure can be described as a Fourier transform from near field to far-field as follows,  
\[\mathbf{E}_{\text{far}}=c\mathcal{F}(\mathbf{E}_{\text{near}}) \tag{1}\]  
where \(c\) is a constant, and \(\mathcal{F}(\ )\) represents Fourier transform. Thus, the far-field light intensity distribution \(I_{\text{far}}(x)\) in far-field can be expressed as  
\[I_{\text{far}}(x)=\left|\mathbf{E}_{\text{far}}(x)\right|^{2} \tag{2}\]  
Equation (2) is the ideal solution where the diffraction effect caused by the limit of the aperture to the scattered light in the actual MSDI system is not calculated. In the actual MSDI system, the objective lens has a certain numerical aperture. Limited by the aperture, the scattered light induced by the defect will generate diffraction during imaging in the MSDI system, which leads to the inconsistency between the simulation light intensity distribution and the actual gray distribution in the far-field. Thus, \(I_{\text{far}}(x)\) needs to be revised. Since the diffraction effect caused by the numerical aperture can be expressed by the PSF in theory, \(I_{\text{far}}(x)\) is revised by PSF as follows,  
\[I^{\prime}_{\text{far}}(x)=I_{\text{far}}(x)\otimes PSF(x) \tag{3}\]  
where \(I^{\prime}_{\text{far}}(x)\) is the revised result of \(I_{\text{far}}(x)\), and \(\otimes\) is a convolution operator. By collecting the actual image gray distribution of the step source \(I^{\prime}_{\text{s}}(x)\), PSF can be obtained as follows,  
\[PSF(x)=\frac{dI^{\prime}_{\text{s}}(x)}{dx} \tag{4}\]  
Figure 2: Simulation model of MSDI based on the finite-difference time-domain (FDTD) method.  
where the idea image gray distribution of the step source \(I_{s}(x)\) is expressed as,  
\[I_{s}(x)=\left\{\begin{array}{c}0,\ (x<0)\\ 255,\ (x\geq 0)\end{array}\right. \tag{5}\]