# Focused and TSOM Images Two-Input Deep-Learning Method for Through-Focus Scanning Measuring
## 2 Materials and Methods
### The Dataset  
The image dataset is captured by the measuring target composed of a series of isolated gold lines (Au) with a length of 100 \(\upmu\)m and height of 100 nm. The measuring parameter is the linewidths (LW) of the gold lines. The model of the gold line is shown in Figure 3. The linewidths to be measured ranged, increasing from 247 nm to 1010 nm with a total of 37 sizes. The results of scanning electron microscopy (SEM) are used as the truth values of the linewidths of the gold lines.  
The gold lines are placed on the displacement table, and the TSOM imaging system built in 2.1 is used to obtain a series of images of the lines including a focused image and many defocused images. Then, the images are stacked in spatial positions to form a three-dimensional cube (TSOM cube), as shown by the yellow cube in Figure 4.  
Figure 2: TSOM imaging system: (**a**) Schematic and (**b**) Photograph of the system. LS: LED light source (520 nm wavelength); OL1: objective lens (5\(\times\)); AD: aperture diaphragm (diameter = 1 mm); L1: lens (focal length = 100 mm); P: polarizer; FD: field diaphragm; L2: lens (focal length = 150 mm); L3: lens (focal length = 200 mm); BS: beam-splitting prism; PZ: piezoelectric objective locator; OL2: objective lens (50\(\times\)); Collection numerical aperture (CNA) of the objective lens OL2 is 0.55. Since AD coincides with the rear focal plane of L1, the light spot is magnified by 1.5 times after passing L1 and L2; therefore, the size of the light spot on the rear focal plane of the objective lens is Dspot = 1.5 mm. Illumination numerical aperture (INA) is calculated as \(\text{INA}=\sin\frac{\theta}{2}=\tan\frac{\theta}{2}=\frac{\text{Dspot}}{2 \times\text{L02}}=0.1875\), in which \(\theta\) is the angle of illumination and fOL2 is the focal length of OL2.  
The pixel size of each image as shown in Figure 5 to form the TSOM cube is 89 \(\times\) 89 pixels, and each gold line to be measured locates in the middle of each image. The image closer to the focused position has higher definition, and the definition of the image gradually decreases with the increase in the defocused distance.  
A focused image and a TSOM image used to construct the dataset could be extracted from a TSOM cube. There are 10 identical gold lines in each linewidth (making a total of 370 gold lines). In total, 1000 different positions on the 10 identical gold lines are selected randomly to collect 1000 TSOM cubes of each linewidth. Therefore, 1000 focused images and 1000 TSOM images are captured from each linewidth (i.e., from 10 identical gold lines). The entire dataset consists of 37,000 focused images and 37,000 TSOM images. A TSOM image corresponds to a focused image, both of them are labeled with a corresponding  
Figure 4: The TSOM cube consists of a series of images collected by through-focus scanning, as shown by the yellow cube. The optical axis is along the z direction of the coordinate system and the imaging plane is parallel to the xoy plane while scanning.  
Figure 5: Captured images with different defocus distances: (**a**) the defocus distance is 0, (**b**) the defocus distance is 4 \(\upmu\)m and (**c**) the defocus distance is 8 \(\upmu\)m.  
Figure 3: Model of the gold line to be measured.  
linewidth. The dataset is divided into a training set, a validation set and a test set in a 3:1:1 ratio.  
Sections 2.2.1 and 2.2.2 introduce the generation of focused images and TSOM images in more detail.