# Reliability-Enhanced Camera Lens Module Classification Using Semi-Supervised Regression Method
## 3 Methodology  
### Dataset Preprocessing  
Raw data goes through a series of steps, called pre-processing so that it becomes readily actionable, or structured as in the view of a data scientist. One example of this includes the labeling of the MTF outcome that should be assigned with either '0' if the value is above a threshold or '1' otherwise. The labels indicate'satisfactory' and 'unsatisfactory' status of products respectively. The class-labeled data is only used for classification. Then, the input variables are normalized to values within range from 0 to 1. In this study, camera lens module data obtained by various sensors is used as an input. Table 2 shows the types of input variables used for training, while the output variable is MTF.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & \multicolumn{6}{c}{**Input Variables**} \\ \hline Process condition & \multicolumn{3}{c}{Lens properties} & \multicolumn{3}{c}{Barrel} & \multicolumn{1}{c}{Spacer} \\ \hline Lens angle & Outer diameter & Inner diameter & Roundness & Thickness & Concentricity & Inner diameter & Thickness \\ \hline \hline \end{tabular}
\end{table}
Table 2: Independent variables as inputs of DNN.  
However, the number of collected data samples from the sensors is less than a few hundred, making it extremely challenging to predict the output. To solve this issue, the unlabeled data set is synthesized using SRS on each input variable. SRS takes samples of each element of the variables based on equal probability distribution [39]. Then, they are given labels following the simple semi-supervised pseudo-labeling method as illustrated in Figure 2.  
First, a model is selected to train the raw data set. The best performing model on the raw data is then used to assign pseudo-labels on the synthesized data. For selecting a model, we take account of only machine learning algorithms because they are known to be much more suitable with small amount of data. Of the various algorithms (Random Forest, XGBoost, Gradient Boost, K-nearest Neighbor, Extra Trees, and Multi-layer Perceptron), the selected model is Extra Trees since it showed the best performance on the raw data. Lastly, the newly labeled data is shuffled well with the raw data, thus leading to a better performing model with an increased number of data samples. The disadvantage of this simplified pseudo-labeling method is that the selection of the model determines the quality of synthesized data labeling. Moreover, the error might add up because of an increase in the number of data samples. Therefore, the optimal number of samples for the best prediction is determined by an exhaustive method, where 10 different data sets with the number of samples increasing in order are tested respectively.  
Table 3 is a list of the aforementioned data sets with each corresponding number of samples. Furthermore, 5-fold cross-validation is implemented to ensure a more generalized test result and to avoid overfitting. The performance metrics used for the regression task are RMSE, MAE, and R-squared. For the computation, we used GeForce RTX 2080 (NVIDIA, Santa Clara, California, CA, USA, 1993) that was used to run Python 3.5.3 and Tensorflow 1.13.1.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Sampling Method** & **Training Data Set** & **Number of Sampled Data** \\ \hline \hline \multirow{8}{*}{Simple Random Sample (SRS)} & 1 & 128 \\  & 2 & 256 (multiples, 2\(\times\)) \\  & 3 & 384 (multiples, 3\(\times\)) \\  & 4 & 512 (multiples, 4\(\times\)) \\  & 5 & 640 (multiples, 5\(\times\)) \\  & 6 & 768 (multiples, 6\(\times\)) \\  & 7 & 1280 (multiples, 10\(\times\)) \\  & 8 & 2560 (multiples, 20\(\times\)) \\  & 9 & 5120 (multiples, 40\(\times\)) \\  & 10 & 10,240 (multiples, 80\(\times\)) \\ \hline \hline \end{tabular}
\end{table}
Table 3: Raw data and nine data sets augmented by Simple Random Sample.  
Figure 2: Schematic diagram of pseudo-labeling.