# Deep Learning and Face Recognition: Face Recognition Approach Based on the DS-CDCN Algorithm
## 3 Design of Face Recognition Method Based on DS-CDCN Algorithm
### Face Data Preprocessing Method  
Large-scale face datasets are typically required for DL training in the FR domain. Preprocessing the face datasets is a crucial step in ensuring the quality of the dataset, which can enhance the model's resilience and classification accuracy [16]. The FDP process is shown in Figure 1.  
FDP includes data cleaning, data enhancement, data labeling, dataset segmentation, and data enhancement and labeling. Data cleaning removes noise, errors, duplicates, or missing data from face datasets, and commonly used data cleaning algorithms include singular value detection, connectivity detection, and missing value filling [17]. Data enhancement can expand the dataset and improve the robustness and generalization of the model through operations such as rotation, scaling, translation, flipping and morphing. For some FR tasks, manual labeling is required to obtain more accurate classification results. In addition, the labeling operations can include labeling information such as key points, angles, and proportions of each face. To facilitate cross-validation and model performance evaluation, the dataset must be split into training, validation, and test sets prior to model training. Data improvement and tagging are crucial processes since DL models need a lot of face datasets for training [18]. In FI data processing, the image's gray level is shown in Equation (1). \[\left\{ \begin{array}{l}q=\sum\limits_{g=0}^{255}q_{g}\\ p_{g}=\dfrac{q_{g}}{q}\end{array} \right. \tag{1}\]  
In Equation (1), the pixel point is \(g\), the pixel gray level probability is \(p_{g}\), the sum of the pixels is \(q\), and the gray level pixels is \(q_{g}\). After the binarized segmentation of the image, the image is divided into two parts. The probabilities of the two classes of pixel points are shown in Equation (2). \[\left\{ \begin{array}{l}P_{0}=\sum\limits_{g=0}^{t}p_{g}\\ P_{1}=\sum\limits_{g=t+1}^{255}p_{g}=1-P_{0}\end{array} \right. \tag{2}\]  
Figure 1: Face data preprocessing process. In Equation (2), the probability of classifying to a pixel greater than the threshold is \(P_{0}\), the probability of classifying to a pixel less than the threshold is \(P_{1}\), and the pixel threshold is \(t\). The average gray value is calculated as shown in Equation (3). \[m=\sum_{g=0}^{255}gp_{g} \tag{3}\]  
In Equation (3), the overall average gray value of the image is \(m\). Based on the interclass variance and maximizing the interclass variance, the threshold value is obtained as shown in Equation (4). \[t=\underset{t\in(0,255)}{\text{argmax}}(H^{2}(t))=\{I\Big{|}\forall t:H^{2}(t) \leq H^{2}(I)\} \tag{4}\]  
In Equation (4), the inter-class variance is \(H^{2}\), and the gray level of the image is \(I\). Based on the above points, the study proposes an FDP method based on the DBSCAN algorithm, which aims to obtain high-quality datasets from noisy and erroneous face datasets. The algorithm first determines the neighborhood parameters, including the distance threshold of the neighbor threshold and the density threshold of the core object. Then, the parameter initialization setting is performed to determine the sample set, cluster division and number of clusters for which the data need to be clustered. Next, the core objects are randomly selected from the sample set, initialized with category order numbers and noted as sets. The domain subsample sets of the core objects are found through the distance constraints, and these sample sets are added to the cluster sample set. At the same time, consider the intersection of domain samples and remove the intersection samples. Repeat this process until the set of unvisited samples is found. Finally, the core objects are merged into the set and the cluster sample set is updated to a new set containing the core objects [19].