Face recognition method and device, equipment and medium
By introducing a dynamic loss function within and between the perspectives in the face recognition model, and combining the first and second classifier layers, the problem of viewing in the prior art affecting the accuracy of face recognition is solved, and higher recognition accuracy is achieved.
Patent Information
- Application Number
- CN202411716967.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-18
AI Technical Summary
The prior art ignores the problem of image acquisition perspective in face recognition in self-service areas, resulting in low accuracy of recognition results.
An improved identification model is adopted, and its network structure includes a feature extraction layer, a clustering layer, a first classifier layer, and a second classifier layer. The feature extraction layer is trained through dynamic loss functions within and between view angles to reduce the impact of view angles on the image. The first classifier layer and the second classifier layer are respectively used to identify face images of the same viewpoint and different viewpoint angles.
By comprehensively applying analysis within and between perspectives, the accuracy of face recognition is improved and the impact of perspective on recognition results is reduced.
Smart Images

Figure CN119649429A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of face recognition technology, and in particular to a face recognition method, device, equipment and medium. Background Art
[0002] With the emergence of self-service areas, the safety of self-service areas has become an urgent problem to be solved. The traditional method is to install cameras in the self-service area to monitor the entire area in real time. The camera can be connected to a video recording device to record the monitoring screen in real time. When necessary, the video can be played back to find and analyze problems or events and provide evidence.
[0003] Banks usually have dedicated monitoring personnel or security personnel responsible for managing the monitoring system to detect and respond to abnormal situations in a timely manner. They will pay close attention to the monitoring screen and perform facial recognition by observing the monitoring screen to keep a close eye on the people entering the bank. Although this method can help banks monitor and record the activities of people in the self-service area in real time and provide responses to abnormal situations, it consumes a lot of manpower and material resources.
[0004] To solve this problem, the existing technology uses network models instead of manual face recognition, specifically inputting the collected images directly into the network model to obtain the recognition results, ignoring the problem of image acquisition perspective. The perspective will directly affect the image parameters, environment, and lighting, which further leads to the low accuracy of the network model recognition results in the existing technology. Summary of the invention
[0005] Based on the above problems, the present application provides a face recognition method, device, equipment and medium, the purpose of which is to improve the accuracy of face recognition.
[0006] The embodiments of the present application disclose the following technical solutions:
[0007] The first aspect of the present application provides a face recognition method, the method comprising:
[0008] Acquire an image to be identified, and input the image to be identified into a pre-trained recognition model; the network structure of the recognition model includes: a feature extraction layer, a clustering layer, a first classifier layer and a second classifier layer; wherein the feature extraction layer is trained using intra-view training data and an intra-view dynamic loss function and inter-view training data and an inter-view dynamic loss function; the first classifier layer includes a plurality of first classifiers; the first classifier is trained using intra-view training data and an intra-view dynamic loss function; the second classifier layer includes a second classifier; the second classifier is trained using inter-view training data and an inter-view dynamic loss function; the intra-view training data includes a plurality of groups of first data, a group of the first data corresponds to a view, a group of the first data includes a plurality of images captured from the corresponding view, and the number of groups of the first data is consistent with the number of the first classifiers; the inter-view training data includes a plurality of groups of second data, a group of the second data includes a plurality of images captured from different viewpoints;
[0009] The feature extraction layer performs feature extraction on the image to be identified, and the clustering layer performs clustering. The first classifier layer and the second classifier layer are used in combination to jointly analyze from the dimensions within and between viewing angles to generate a face recognition result for the image to be identified.
[0010] Optionally, the training process of the pre-trained recognition model specifically includes:
[0011] Collect raw training data;
[0012] Constructing the intra-view training data based on the original training data according to the view, and constructing the inter-view training data based on the original training data according to the image similarity;
[0013] Construct an initialized recognition model;
[0014] Based on the in-view training data, each first classifier of the first classifier layer in the initialized recognition model and the feature extraction layer in the initialized recognition model are trained using the in-view dynamic loss function to obtain the in-view trained recognition model;
[0015] Based on the training data between the perspectives, the dynamic loss function between the perspectives is used to train the second classifier layer and the feature extraction layer in the recognition model trained within the perspective to obtain the pre-trained recognition model.
[0016] Optionally, the training of each first classifier of the first classifier layer in the initialized recognition model and the feature extraction layer in the initialized recognition model using the in-view dynamic loss function based on the in-view training data to obtain the in-view trained recognition model specifically includes:
[0017] Inputting the in-view training data into the feature extraction layer of the initialized recognition model to obtain a feature value of each image in each group of first data;
[0018] Inputting the feature value of each image in each group of first data into the clustering layer in the initialized recognition model, performing clustering processing on the image feature values in the same group of first data, and determining a pseudo label for the feature value of each image in each group of first data;
[0019] Based on the one-to-one correspondence between the first data and the first classifier in the initialized recognition model, the image feature values in the first data are input into the corresponding first classifier to obtain a predicted first classification result, and based on the first classification result, the pseudo-labels of the image feature values in the corresponding first data and the in-viewing angle dynamic loss function, the first classifier layer and the feature extraction layer in the initialized recognition model are iteratively trained until the value of the in-viewing angle dynamic loss function is minimized, thereby obtaining the in-viewing angle trained recognition model.
[0020] Optionally, the intra-view dynamic loss function is:
[0021]
[0022] Among them, L IN-DI represents the dynamic loss function within the viewing angle; N represents the number of images in the first data; C represents the total number of viewing angles; s represents the sth viewing angle; i represents the i-th image in the first data; A pseudo label representing the feature value corresponding to the i-th image in the first data of the s-th viewing angle; Represents a first classification result of the prediction of the feature value corresponding to the i-th image in the first data of the s-th viewing angle.
[0023] Optionally, inputting the feature value of each image in each group of first data into the clustering layer in the initialized recognition model, performing clustering processing on the image feature values in the same group of first data, and determining the pseudo label of each image feature value in each group of first data specifically includes:
[0024] The clustering layer in the initialized recognition model performs similarity clustering processing on the feature value of each image in each group of first data based on the original sample set, and uses the samples in the original sample set whose similarity with the image feature value meets preset conditions as pseudo labels of the corresponding image feature values, and determines the pseudo labels of each image feature value in each group of first data; the original sample set includes multiple samples.
[0025] Optionally, the step of training the second classifier layer and the feature extraction layer in the recognition model trained within the view using the dynamic loss function between the view based on the training data between the view to obtain the pre-trained recognition model specifically includes:
[0026] Inputting the training data between the viewing angles into the feature extraction layer of the recognition model trained within the viewing angle to obtain the feature value of each image in each group of second data;
[0027] Inputting the feature value of each image in each group of second data into the clustering layer of the recognition model trained within the viewing angle for clustering processing, and determining a pseudo label of the feature value of each image in each group of second data;
[0028] The feature value of each image in each group of second data is input into the second classifier layer in the recognition model trained within the viewing angle to obtain a predicted second classification result, and based on the second classification result, the pseudo-label of the feature value of each image in the corresponding second data and the dynamic loss function between viewing angles, the second classifier layer and the feature extraction layer in the recognition model trained within the viewing angle are iteratively trained until the value of the dynamic loss function between viewing angles is minimized, thereby obtaining the pre-trained recognition model.
[0029] Optionally, the dynamic loss function between viewing angles is:
[0030]
[0031] Among them, L Cro-DI represents the dynamic loss function between viewing angles; N' represents the number of images in the second data; i' represents the i'th image in the second data; y i' F represents the pseudo label of the feature value corresponding to the i'th image in the second data; i' The predicted second classification result represents the feature value corresponding to the i'th image in the second data.
[0032] A second aspect of the present application provides a face recognition device, the device comprising:
[0033] An acquisition unit is used to acquire an image to be identified and input the image to be identified into a pre-trained recognition model; the network structure of the recognition model includes: a feature extraction layer, a clustering layer, a first classifier layer and a second classifier layer; wherein the feature extraction layer is trained using intra-view training data and an intra-view dynamic loss function and inter-view training data and an inter-view dynamic loss function; the first classifier layer includes a plurality of first classifiers; the first classifier is trained using intra-view training data and an intra-view dynamic loss function; the second classifier layer includes a second classifier; the second classifier is trained using inter-view training data and an inter-view dynamic loss function; the intra-view training data includes a plurality of groups of first data, a group of the first data corresponds to a view, a group of the first data includes a plurality of images captured by the corresponding view, and the number of groups of the first data is consistent with the number of the first classifiers; the inter-view training data includes a plurality of groups of second data, a group of the second data includes a plurality of images captured by different viewpoints;
[0034] The recognition unit is used to extract features of the image to be recognized through the feature extraction layer, and cluster it through the clustering layer, and comprehensively use the first classifier layer and the second classifier layer to jointly analyze from the dimensions within and between viewing angles to generate a face recognition result for the image to be recognized.
[0035] The third aspect of the present application provides a computer device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the face recognition method introduced in the first aspect.
[0036] The fourth aspect of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the face recognition method introduced in the first aspect is implemented.
[0037] Compared with the prior art, this application has the following beneficial effects:
[0038] The present application aims to solve the problem in the prior art that viewing angle affects the accuracy of face recognition, and improves the network structure of the network model. The network structure of the recognition model of the present application includes a feature extraction layer, a first classifier layer and a second classifier layer. The feature extraction layer can extract features from images of different viewing angles to reduce the influence of viewing angle on the image. The first classifier layer is for image recognition at the same viewing angle and the second classifier layer is for image recognition at different viewing angles, so that the recognition model can accurately recognize multiple images collected at the same viewing angle and images collected at different viewing angles, thereby improving the accuracy of face recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0040] Figure 1 A flow chart of a face recognition method provided in an embodiment of the present application;
[0041] Figure 2 A network structure diagram of the recognition model provided in the embodiment of the present application;
[0042] Figure 3 A schematic diagram of the training process of a pre-trained recognition model provided in an embodiment of the present application;
[0043] Figure 4 A parameter adjustment diagram of the first classifier layer and the feature extraction layer in the initialized recognition model provided in an embodiment of the present application;
[0044] Figure 5 A structural diagram of a feature extraction layer in a recognition model provided in an embodiment of the present application;
[0045] Figure 6 A schematic diagram of iterative update provided in an embodiment of the present application;
[0046] Figure 7 A parameter adjustment diagram of the second classifier layer and the feature extraction layer in the recognition model after in-view training provided in an embodiment of the present application;
[0047] Figure 8 A structural diagram of a face recognition device provided in an embodiment of the present application;
[0048] Fig. 9 A schematic diagram of a model training unit provided in an embodiment of the present application;
[0049] Fig.10 A structural diagram of the first training subunit provided in an embodiment of the present application;
[0050] Fig.11 This is a structural diagram of the second training subunit provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] As described above, the current prior art ignores the problem of image acquisition perspective, resulting in low accuracy of face recognition results. The inventors have found through research that changing the network structure can solve the problems existing in the prior art.
[0052] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0053] It is understandable that in the specific implementation of the present application, image information, samples and other related data are involved. When the above embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0054] Explanation of relevant professional terms:
[0055] Feature Extraction: Use the network model to map the input features and extract key features to reduce data dimensions and organize features.
[0056] Unsupervised Learning: Traditional recognition methods require the identity information of samples to be labeled, which consumes a lot of manpower and material resources. Unsupervised learning classifies samples through clustering or model transfer methods to reduce the cost of labeling samples and improve its adaptability in practical applications.
[0057] See also Figure 1 The flowchart of a face recognition method shown in FIG. 1 illustrates a face recognition method:
[0058] S101, obtaining an image to be recognized, and inputting the image to be recognized into a pre-trained recognition model.
[0059] Because the present application improves the network structure of the recognition model, the recognition model can accurately recognize faces of both face images from the same perspective and face images from different perspectives. Therefore, the images to be recognized input into the pre-trained recognition model can be multiple face images of the same person captured by the same camera or face images of the same person captured by different cameras. Figure 2 As shown in the network structure diagram of the recognition model, it can be seen that the network structure of the recognition model includes: a feature extraction layer 4, a clustering layer 5, a first classifier layer 6 and a second classifier layer 7.
[0060] Among them, the improvement of the network structure of the recognition model is mainly in the feature extraction layer 4, the first classifier layer 6 and the second classifier layer 7. The feature extraction layer 4 is trained using the intra-view training data and the intra-view dynamic loss function as well as the inter-view training data and the inter-view dynamic loss function. Because the feature extraction layer 4 is first trained based on the intra-view training data and the intra-view dynamic loss function, and then trained for the second time based on the inter-view training data and the inter-view dynamic loss function, the feature extraction layer 4 can extract features from both intra-view and inter-view face images, thereby reducing the influence of the view on the face image.
[0061] The first classifier layer 6 includes multiple first classifiers, each of which is trained by in-view training data and in-view dynamic loss function. The in-view training data includes multiple groups of first data, and each group of first data corresponds to a view. A group of first data contains multiple images captured by the corresponding view. The first classifier and the first data also have a one-to-one correspondence, so that multiple first classifiers can identify multiple viewpoints. It can be understood that one first classifier corresponds to one camera, and there are as many first classifiers in the network structure of the recognition model as there are cameras in the self-service area, so as to achieve targeted recognition of the face images captured by each camera.
[0062] The second classifier layer 7 includes a second classifier, which is trained by the training data between viewpoints and the dynamic loss function between viewpoints, wherein the training data between viewpoints includes multiple sets of second data, and each set of second data includes multiple images collected from different viewpoints. The second classifier is trained by the training data between viewpoints and the dynamic loss function between viewpoints, so that the second classifier can recognize the face images of the same person at different viewpoints, thereby realizing recognition between viewpoints.
[0063] S102, extracting features of the image to be identified through the feature extraction layer, and clustering the image through the clustering layer, and comprehensively using the first classifier layer and the second classifier layer to jointly analyze from the dimensions within and between viewing angles to generate a face recognition result for the image to be identified.
[0064] like Figure 2The network structure diagram of the recognition model shown in the figure shows that after the collected face image 3 is input into the pre-trained recognition model, the feature extraction layer 4 in the pre-trained recognition model extracts the features of the face image, and then the input face image is clustered by similarity through the clustering layer 5. The purpose is to cluster the face images of the same person. If there are multiple face images of the same person in the same viewing angle, they can be input into the first classifier corresponding to the camera to generate a face recognition result for the face image. If there are multiple face images of the same person in different viewing angles, they can be input into the second classifier to generate a face recognition result for the face image.
[0065] This application performs face recognition within and between viewing angles, mainly because each person's walking speed and the capture capability of each camera are different. In practical applications, it cannot be guaranteed that the same camera can capture multiple valid face images. Therefore, the research direction of this application is of practical significance.
[0066] According to the above, the purpose of this application is to comprehensively utilize the first classifier layer and the second classifier layer to realize face image recognition within and between viewing angles. To achieve this purpose, it is necessary to adjust the parameters of the first classifier layer and the second classifier layer. The parameter adjustment generally depends on the training of the model. Figure 3 The schematic diagram of the training process of the pre-trained recognition model shown in FIG. 1 illustrates the training process of the pre-trained recognition model of the present application:
[0067] S301, collecting original training data.
[0068] The original training data includes multiple face images, which are generally acquired by cameras.
[0069] S302: construct the intra-view training data based on the original training data according to the view, and construct the inter-view training data based on the original training data according to the image similarity.
[0070] Because the intra-view training data includes multiple groups of first data, and each group of first data is a view, it is necessary to cluster the face images of the same view in the original training data to obtain multiple groups of first data, and construct the intra-view training data based on the multiple groups of first data.
[0071] The training data between perspectives includes multiple groups of second data, which are multiple images collected from different perspectives. Therefore, it is necessary to cluster the facial images of the same person at different perspectives in the original training data to obtain multiple groups of second data, and construct the training data between perspectives based on the multiple groups of second data.
[0072] S303: construct an initialized recognition model.
[0073] The difference between the initialized recognition model and the pre-trained recognition model lies in the model parameters, while the network structures of the initialized recognition model and the pre-trained recognition model are the same. Therefore, the network structure of the initialized recognition model can be found in Figure 2 The network structure diagram of the recognition model shown.
[0074] S304. Based on the in-view training data, each first classifier of the first classifier layer in the initialized recognition model and the feature extraction layer in the initialized recognition model are trained using the in-view dynamic loss function to obtain the in-view trained recognition model.
[0075] Due to the differences in shooting conditions of different cameras, it is easier to identify facial images with the same logo in the same camera than between different cameras. Therefore, the similarity calculation of facial images is decomposed into two stages, namely, the calculation within the view and between the view, and reliable pseudo-labels are gradually found. When clustering, the similarity and distance between different clusters must be considered, and a corresponding feature matrix needs to be generated, which consumes a lot of memory and time. From the perspective of improving efficiency and sample balancing, this invention proposes a view-based random sampling method.
[0076] This application divides the model parameter adjustment process into two parts. The first part is the parameter adjustment of the first classifier layer, and the second part is the parameter adjustment of the second classifier layer. Figure 4 The parameter adjustment diagram of the first classifier layer and the feature extraction layer in the initialized recognition model shown in the figure specifically illustrates the training process of the first classifier layer:
[0077] S401, inputting the in-view training data into the feature extraction layer in the initialized recognition model to obtain the feature value of each image in each group of first data.
[0078] like Figure 5 The structural diagram of the feature extraction layer in the recognition model shown illustrates the feature extraction layer, which performs feature mapping on multiple face images 1 to be extracted to obtain a feature value 2 for each face image to be extracted.
[0079] S402, inputting the feature value of each image in each group of first data into the clustering layer in the initialized recognition model, performing clustering processing on the image feature values in the same group of first data, and determining a pseudo label for each image feature value in each group of first data.
[0080] Because each face image in the original sample set has corresponding face information as a label, the clustering layer can pseudo-label the unlabeled image feature values according to the labels of the face images in the original sample set by performing similarity clustering on the unlabeled image feature values and the original sample set.
[0081] The pseudo-label determination process includes:
[0082] The clustering layer in the initialized recognition model performs similarity clustering processing on the feature value of each image in each group of first data based on the original sample set, and uses the samples in the original sample set whose similarity with the image feature value meets preset conditions as pseudo labels of the corresponding image feature values, and determines the pseudo labels of each image feature value in each group of first data; the original sample set includes multiple samples.
[0083] The samples in the original sample set can be understood as labeled face images.
[0084] This application first performs network training in the same viewing angle. By clustering samples of the same viewing angle, pseudo labels in each viewing angle are generated. Then, the first classifier corresponding to different cameras is trained with the generated pseudo labels, which simplifies the generation of pseudo labels and ensures the robustness of the recognition model under different cameras.
[0085] S403. Based on the one-to-one correspondence between the first data and the first classifier in the initialized recognition model, the image feature value in the first data is input into the corresponding first classifier to obtain a predicted first classification result, and based on the first classification result, the pseudo-label of the image feature value in the corresponding first data and the in-viewing angle dynamic loss function, the first classifier layer and the feature extraction layer in the initialized recognition model are iteratively trained until the value of the in-viewing angle dynamic loss function is minimized, thereby obtaining the in-viewing angle trained recognition model.
[0086] Clustering-based face recognition methods rely heavily on iterations between clustering and model optimization stages. Since the pseudo-labels generated by clustering change after each iteration, their centroids may also change. Traditional cross-entropy loss requires a fixed number of identities, which hinders the optimization of the loss function. This paper proposes a dynamic iterative loss to resist feature changes during the clustering process. See Figure 6 The iterative update diagram shown illustrates the iterative update, which updates the pseudo-label 10 of the image of the next iteration based on the classification result 8 of the classifier of the previous iteration and the pseudo-label 9 of the image of the previous iteration. A feature memory space is maintained to store the features of all samples, and the features are dynamically updated during the training process, which can be effectively used to counter the change of the center.
[0087] In addition, the feature memory space can dynamically construct new cluster centers to adapt to changes in clustering. During training, by directly averaging the memory features of the same pseudo-label, online centroids are constructed from memory to alleviate the negative impact of noise samples and adapt to changes after each clustering step.
[0088] The dynamic loss function within the viewing angle proposed in this application is:
[0089]
[0090]
[0091] Among them, L IN-DI represents the dynamic loss function within the viewing angle; N represents the number of images in the first data; C represents the total number of viewing angles; s represents the sth viewing angle; i represents the i-th image in the first data; y s i F represents the pseudo label of the feature value corresponding to the i-th image in the first data of the s-th perspective; s i represents the first classification result of the prediction of the feature value corresponding to the i-th image in the first data of the s-th viewing angle; T s Indicates a feature center determined by averaging pseudo labels of feature values corresponding to multiple images in the first data of the s-th viewing angle; represents the network parameters of the s-th view; Represents the eigenvalue corresponding to the i-th image at the s-th viewing angle.
[0092] The loss function is based on the actual scene. The face image information may be affected by the shooting angle and camera, including its parameters, viewing angle, environment, and random factors such as posture, lighting, and occlusion. Therefore, the focus is on learning effective features to reduce the impact of environmental factors, enhance the robustness of face images, and find their image clusters. The existing pseudo-label generation method is used to train in each camera according to the clustering results.
[0093] The traditional s-th view training loss L in It can be expressed as:
[0094]
[0095] In the in-view training phase, the training set is divided into subsets according to the camera label, and then each subset is clustered according to feature similarity to generate a labeled dataset. Each camera is regarded as a training task, and the cross entropy loss on the classifier output and the true value label is calculated. It is trained on multiple tasks and the same feature extraction network is shared to perform calculations on different cameras and generate a multi-branch network structure, thus ensuring the robustness of the model under different cameras.
[0096] The traditional total training loss function L IN-cam It can be expressed as:
[0097]
[0098] The training phase between viewing angles is to calculate a more robust inter-camera similarity. The present invention uses the network model obtained from the training data at different viewing angles as a benchmark for feature extraction, and identifies whether it is the same face image according to the classification criteria of different cameras. The possibility of them being the same identity is determined by comparing the features of different samples. Multiple tasks are used for optimization, and their classification scores are used as new feature vectors to enhance the recognition ability of the classifier in different fields. Finally, clustering is performed based on the similarity between cameras and pseudo labels are generated, and the network model is optimized through pseudo labels generated in the two stages of within and between viewing angles.
[0099] S305 , based on the inter-perspective training data, the inter-perspective dynamic loss function is used to train the second classifier layer and the feature extraction layer in the intra-perspective trained recognition model to obtain the pre-trained recognition model.
[0100] The training process of the first classifier layer and the feature extraction layer in the initialized recognition model is specifically described through S401 to S403. Figure 7 The parameter adjustment diagram of the second classifier layer and the feature extraction layer in the recognition model after in-view training shown in the figure specifically illustrates the training process of the second classifier layer and the feature extraction layer in the recognition model after in-view training:
[0101] S701, inputting the training data between the viewing angles into the feature extraction layer of the recognition model trained within the viewing angle to obtain the feature value of each image in each group of second data.
[0102] The function of the feature extraction layer in S701 can be found in Figure 5 The structural diagram of the feature extraction layer in the recognition model shown.
[0103] S702: Input the feature value of each image in each group of second data into the clustering layer of the recognition model trained within the viewing angle for clustering processing, and determine a pseudo label for the feature value of each image in each group of second data.
[0104] The pseudo-label determination process of S702 can refer to the detailed description of S402, which will not be described in detail here.
[0105] S703. Input the feature value of each image in each group of second data into the second classifier layer in the recognition model trained within the viewing angle to obtain a predicted second classification result, and based on the second classification result, the pseudo-label of the feature value of each image in the corresponding second data, and the dynamic loss function between viewing angles, iteratively train the second classifier layer and the feature extraction layer in the recognition model trained within the viewing angle until the value of the dynamic loss function between viewing angles is minimized, thereby obtaining the pre-trained recognition model.
[0106] The dynamic loss function between perspectives is:
[0107]
[0108] F i' =log(Tw i' f i' ).
[0109] Among them, L Cro-DI represents the dynamic loss function between viewing angles; N' represents the number of images in the second data; i' represents the i'th image in the second data; y i' F represents the pseudo label of the feature value corresponding to the i'th image in the second data; i' represents the predicted second classification result of the feature value corresponding to the i'th image in the second data; T represents the feature center determined by averaging the pseudo labels of the feature values corresponding to multiple images in the second data; w i' represents the network parameters of the second classifier; f i' Represents the eigenvalue corresponding to the i'th image in the second data.
[0110] The loss function formula for feature classification between traditional cameras is as follows.
[0111]
[0112] In addition, the ternary loss function is also used. The ternary loss function shortens the distance between the same samples and maximizes the distance between different samples. The ternary loss function is shown below.
[0113]
[0114] Where ||·|| represents the norm, subscripts p and n represent the positive and negative samples in the small batch of images selected by the ternary loss, respectively, and N D represents the total number of samples, and g represents the samples obtained from the sample set (gallery).
[0115] The traditional overall loss L for clustering between views CRO-cam The calculation is shown below.
[0116] L CRO-cam =L cro +λL tri .
[0117] λ represents the weight of the ternary loss function.
[0118] In order to make the model have good convergence in specific applications, the present invention finally uses memory features to adapt to the changing clustering in face recognition. After each back propagation step, the feature memory is updated according to the following formula, and the update rate ∈ [0,1].
[0119]
[0120] Among them, T k+1 represents the feature center of the k+1th iteration; Represents the weight of the feature center at the k+1th iteration.
[0121] In a specific application, this application captures face images in real time by installing cameras in the self-service area. The image is processed through the feature extraction layer and key feature values are extracted as the unique identifier of each image. The feature values of customers or employees are associated with their identity information and stored in the database. Finally, the pre-trained recognition model is used for subsequent face matching and recognition.
[0122] The existing traditional supervised method requires manual labeling of each image, which consumes a lot of manpower and material resources. However, this application abandons the traditional labeling training mode and does not require manual labeling information when training the model, which saves manpower and material resources while improving work efficiency.
[0123] Most current recognition methods directly extract features of images for classification and verification, ignoring the impact of viewing angles on samples, resulting in poor results. This application classifies images of different viewing angles, and based on the classification results, trains a first classifier layer that can identify within the viewing angle and a second classifier layer that can identify between viewing angles, thereby eliminating the impact of different views and external factors on the captured face images.
[0124] The traditional method of checking and monitoring suspicious persons is to rely on manpower to use cameras to identify suspicious persons. The method is single and extremely time-consuming. However, this application can be used to automatically monitor suspicious persons in the self-service area and conduct fraud detection and prevention. And if necessary, this application can also set an alarm function to identify known fraudsters or individuals who have stolen identities by analyzing the facial features of customers. If the match is successful and confirmed as a legitimate user, the identity is recognized, otherwise the alarm is triggered. This reduces the damage caused by fraud to banks and customers.
[0125] Figure 8 is a structural diagram of a face recognition device, see Figure 8 A face recognition device is described, and the face recognition device includes:
[0126] The acquisition unit is used to acquire the image to be recognized and input the image to be recognized into a pre-trained recognition model.
[0127] Because the present application improves the network structure of the recognition model, the recognition model can accurately recognize faces of both face images from the same perspective and face images from different perspectives. Therefore, the images to be recognized input into the pre-trained recognition model can be multiple face images of the same person captured by the same camera or face images of the same person captured by different cameras. Figure 2 As shown in the network structure diagram of the recognition model, it can be seen that the network structure of the recognition model includes: a feature extraction layer 4, a clustering layer 5, a first classifier layer 6 and a second classifier layer 7.
[0128] Among them, the improvement of the network structure of the recognition model is mainly in the feature extraction layer 4, the first classifier layer 6 and the second classifier layer 7. The feature extraction layer 4 is trained using the intra-view training data and the intra-view dynamic loss function as well as the inter-view training data and the inter-view dynamic loss function. Because the feature extraction layer 4 is first trained based on the intra-view training data and the intra-view dynamic loss function, and then trained for the second time based on the inter-view training data and the inter-view dynamic loss function, the feature extraction layer 4 can extract features from both intra-view and inter-view face images, thereby reducing the influence of the view on the face image.
[0129] The first classifier layer 6 includes multiple first classifiers, each of which is trained by in-view training data and in-view dynamic loss function. The in-view training data includes multiple groups of first data, and each group of first data corresponds to a view. A group of first data contains multiple images captured by the corresponding view. The first classifier and the first data also have a one-to-one correspondence, so that multiple first classifiers can identify multiple viewpoints. It can be understood that one first classifier corresponds to one camera, and there are as many first classifiers in the network structure of the recognition model as there are cameras in the self-service area, so as to achieve targeted recognition of the face images captured by each camera.
[0130] The second classifier layer 7 includes a second classifier, which is trained by the training data between viewpoints and the dynamic loss function between viewpoints, wherein the training data between viewpoints includes multiple sets of second data, and each set of second data includes multiple images collected from different viewpoints. The second classifier is trained by the training data between viewpoints and the dynamic loss function between viewpoints, so that the second classifier can recognize the face images of the same person at different viewpoints, thereby realizing recognition between viewpoints.
[0131] The recognition unit is used to extract features of the image to be recognized through the feature extraction layer, and cluster it through the clustering layer, and comprehensively use the first classifier layer and the second classifier layer to jointly analyze from the dimensions within and between viewing angles to generate a face recognition result for the image to be recognized.
[0132] like Figure 2 As shown in the network structure diagram of the recognition model, after the collected face image 3 is input into the pre-trained recognition model, the network structure of the pre-trained recognition model will process the face image 3, the feature extraction layer 4 extracts the features of the face image, and then the input face image is clustered by similarity through the clustering layer 5, in order to cluster the face images of the same person. If there are multiple face images of the same person in the same viewing angle, they can be input into the first classifier corresponding to the camera to generate the face recognition result of the image. If there are multiple face images of the same person in different viewing angles, they can be input into the second classifier to generate the face recognition result of the image.
[0133] This application performs face recognition within and between viewing angles, mainly because each person's walking speed and the capture capability of each camera are different. In practical applications, it cannot be guaranteed that the same camera can capture multiple valid face images. Therefore, the research direction of this application is of practical significance.
[0134] According to the above, the purpose of the present application is to comprehensively utilize the first classifier layer and the second classifier layer to realize face image recognition within and between viewing angles. To achieve this purpose, it is necessary to adjust the parameters of the first classifier layer and the second classifier layer. The parameter adjustment generally depends on the training of the model. Therefore, the face recognition device also includes a model training unit. Fig. 9 The schematic diagram of the model training unit shown in the figure illustrates the functions of the collection subunit, the training data construction subunit, the training data construction subunit, the model construction subunit, the first training subunit and the second training subunit in the model training unit of the present application:
[0135] The collection subunit is used to collect original training data.
[0136] The original training data includes multiple face images, which are generally acquired by cameras.
[0137] The training data construction subunit is used to construct the intra-view training data based on the original training data according to the view angle, and to construct the inter-view training data based on the original training data according to the image similarity.
[0138] Because the intra-perspective training data includes multiple groups of first data, and each group of first data is a perspective, it is necessary to cluster the facial images of the same perspective in the original training data to obtain the first data, and the between-perspective training data includes multiple groups of second data, and the second data is multiple images collected from different perspectives. Therefore, it is necessary to cluster the facial images of the same person at different perspectives in the original training data to obtain the second data.
[0139] The model building subunit is used to build an initialized recognition model.
[0140] The network structure of the initialized recognition model is consistent with that of the pre-trained recognition model, see Figure 2 The network structure diagram of the recognition model shown.
[0141] The first training subunit is used to train each first classifier of the first classifier layer in the initialized recognition model and the feature extraction layer in the initialized recognition model based on the in-view training data and adopt the in-view dynamic loss function to obtain the in-view trained recognition model.
[0142] Due to the differences in shooting conditions of different cameras, it is easier to identify facial images with the same logo in the same camera than between different cameras. Therefore, the similarity calculation of facial images is decomposed into two stages, namely, the calculation within the view and between the view, and reliable pseudo-labels are gradually found. When clustering, the similarity and distance between different clusters must be considered, and a corresponding feature matrix needs to be generated, which consumes a lot of memory and time. From the perspective of improving efficiency and sample balancing, this invention proposes a view-based random sampling method.
[0143] This application divides the model parameter adjustment process into two parts. The first part is the parameter adjustment of the first classifier layer, and the second part is the parameter adjustment of the second classifier layer. Fig.10 The structure diagram of the first training subunit shown in FIG. 1 specifically describes the functions of the first feature extraction module, the first clustering module and the intra-view training module in the first training subunit:
[0144] The first feature extraction module is used to input the training data within the viewing angle into the feature extraction layer in the initialized recognition model to obtain the feature value of each image in each group of first data.
[0145] like Figure 5 The structural diagram of the feature extraction layer in the recognition model shown illustrates the feature extraction layer, which performs feature mapping on multiple face images 1 to be extracted to obtain a feature value 2 for each face image to be extracted.
[0146] The first clustering module is used to input the feature value of each image in each group of first data into the clustering layer in the initialized recognition model, perform clustering processing on the image feature values in the same group of first data, and determine the pseudo label of each image feature value in each group of first data.
[0147] Because each face image in the original sample set has corresponding face information as a label, the clustering layer can pseudo-label the unlabeled image feature values according to the labels of the face images in the original sample set by performing similarity clustering on the unlabeled image feature values and the original sample set.
[0148] The pseudo-label determination process includes:
[0149] The clustering layer in the initialized recognition model performs similarity clustering processing on the feature value of each image in each group of first data based on the original sample set, and uses the samples in the original sample set whose similarity with the image feature value meets preset conditions as pseudo labels of the corresponding image feature values, and determines the pseudo labels of each image feature value in each group of first data; the original sample set includes multiple samples.
[0150] The samples in the original sample set can be understood as labeled face images.
[0151] This application first performs network training in the same viewing angle. By clustering samples of the same viewing angle, pseudo labels in each viewing angle are generated. Then, the first classifier corresponding to different cameras is trained with the generated pseudo labels, which simplifies the generation of pseudo labels and ensures the robustness of the recognition model under different cameras.
[0152] The in-view training module is used to input the image feature values in the first data into the corresponding first classifier based on the one-to-one correspondence between the first data and the first classifier in the initialized recognition model to obtain a predicted first classification result, and iteratively train the first classifier layer and the feature extraction layer in the initialized recognition model based on the first classification result, the pseudo-label of the image feature value in the corresponding first data and the in-view dynamic loss function until the value of the in-view dynamic loss function is minimized, thereby obtaining the in-view trained recognition model.
[0153] Clustering-based face recognition methods rely heavily on iterations between clustering and model optimization stages. Since the pseudo-labels generated by clustering change after each iteration, their centroids may also change. Traditional cross-entropy loss requires a fixed number of identities, which hinders the optimization of the loss function. This paper proposes a dynamic iterative loss to resist feature changes during the clustering process. See Figure 6 The iterative update diagram shown illustrates the iterative update, which updates the pseudo-label 10 of the image of the next iteration based on the classification result 8 of the classifier of the previous iteration and the pseudo-label 9 of the image of the previous iteration. A feature memory space is maintained to store the features of all samples, and the features are dynamically updated during the training process, which can be effectively used to counter the change of the center.
[0154] In addition, the feature memory space can dynamically construct new cluster centers to adapt to changes in clustering. During training, by directly averaging the memory features of the same pseudo-label, online centroids are constructed from memory to alleviate the negative impact of noise samples and adapt to changes after each clustering step.
[0155] The dynamic loss function within the viewing angle proposed in this application is:
[0156]
[0157]
[0158] Among them, L IN-DI represents the dynamic loss function within the viewing angle; N represents the number of images in the first data; C represents the total number of viewing angles; s represents the sth viewing angle; i represents the i-th image in the first data; A pseudo label representing the feature value corresponding to the i-th image in the first data of the s-th viewing angle; represents the first classification result of the prediction of the feature value corresponding to the i-th image in the first data of the s-th viewing angle; T s Indicates a feature center determined by averaging pseudo labels of feature values corresponding to multiple images in the first data of the s-th viewing angle; represents the network parameters of the s-th view; Represents the eigenvalue corresponding to the i-th image at the s-th viewing angle.
[0159] The loss function is based on the actual scene. The face image information may be affected by the shooting angle and camera, including its parameters, viewing angle, environment, and random factors such as posture, lighting, and occlusion. Therefore, the focus is on learning effective features to reduce the impact of environmental factors, enhance the robustness of face images, and find their image clusters. The existing pseudo-label generation method is used to train in each camera according to the clustering results.
[0160] The traditional s-th view training loss L in It can be expressed as:
[0161]
[0162] In the in-view training phase, the training set is divided into subsets according to the camera label, and then each subset is clustered according to feature similarity to generate a labeled dataset. Each camera is regarded as a training task, and the cross entropy loss on the classifier output and the true value label is calculated. It is trained on multiple tasks and the same feature extraction network is shared to perform calculations on different cameras and generate a multi-branch network structure, thus ensuring the robustness of the model under different cameras.
[0163] The traditional total training loss function L IN-cam It can be expressed as:
[0164]
[0165] The training phase between viewing angles is to calculate a more robust inter-camera similarity. The present invention uses the network model obtained from the training data at different viewing angles as a benchmark for feature extraction, and identifies whether it is the same face image according to the classification criteria of different cameras. The possibility of them being the same identity is determined by comparing the features of different samples. Multiple tasks are used for optimization, and their classification scores are used as new feature vectors to enhance the recognition ability of the classifier in different fields. Finally, clustering is performed based on the similarity between cameras and pseudo labels are generated, and the network model is optimized through pseudo labels generated in the two stages of within and between viewing angles.
[0166] The second training subunit is used to train the second classifier layer and the feature extraction layer in the recognition model trained within the perspective based on the training data between perspectives and adopt the dynamic loss function between perspectives to obtain the pre-trained recognition model.
[0167] The training process of the first classifier layer is specifically described through the first feature extraction module, the first clustering module and the intra-view training module. Fig.11 The structural diagram of the second training subunit shown in FIG. 1 specifically describes the functions of the second feature extraction module, the second clustering module and the inter-view training module in the second training subunit:
[0168] The second feature extraction module is used to input the training data between the viewing angles into the feature extraction layer of the recognition model trained within the viewing angle to obtain the feature value of each image in each group of second data.
[0169] The second clustering module is used to input the feature value of each image in each group of second data into the clustering layer in the recognition model trained within the viewing angle for clustering processing, and determine the pseudo label of the feature value of each image in each group of second data.
[0170] The pseudo-label determination process of the second clustering module can be found in the detailed description of the first clustering module, which will not be elaborated here.
[0171] The between-view training module is used to input the feature value of each image in each group of second data into the second classifier layer in the recognition model trained within the view to obtain a predicted second classification result, and based on the second classification result, the pseudo-label of the feature value of each image in the corresponding second data and the dynamic loss function between views, iteratively train the second classifier layer and the feature extraction layer in the recognition model trained within the view until the value of the dynamic loss function between views is minimized, thereby obtaining the pre-trained recognition model.
[0172] The dynamic loss function between perspectives is:
[0173]
[0174] F i' =log(Tw i' f i' ).
[0175] Among them, L Cro-DI represents the dynamic loss function between viewing angles; N' represents the number of images in the second data; i' represents the i'th image in the second data; y i' F represents the pseudo label of the feature value corresponding to the i'th image in the second data; i' represents the predicted second classification result of the feature value corresponding to the i'th image in the second data; T represents the feature center determined by averaging the pseudo labels of the feature values corresponding to multiple images in the second data; w i' represents the network parameters of the second classifier; f i' Represents the eigenvalue corresponding to the i'th image in the second data.
[0176] The loss function formula for feature classification between traditional cameras is as follows.
[0177]
[0178] In addition, the ternary loss function is also used. The ternary loss function shortens the distance between the same samples and maximizes the distance between different samples. The ternary loss function is shown below.
[0179]
[0180] Here, ||·|| represents the norm, and the subscripts p and n represent the positive and negative samples in the mini-batch of images selected by the ternary loss, respectively.
[0181] The traditional overall loss L for clustering between views CRO-cam The calculation is shown below.
[0182] L CRO-cam =L cro +L tri .
[0183] λ represents the weight of the ternary loss function.
[0184] In order to make the model have good convergence in specific applications, the present invention finally uses memory features to adapt to the changing clustering in face recognition. After each back propagation step, the feature memory is updated according to the following formula, and the update rate ∈ [0,1].
[0185]
[0186] In a specific application, this application captures face images in real time by installing cameras in the self-service area. The image is processed through the feature extraction layer and key feature values are extracted as the unique identifier of each image. The feature values of customers or employees are associated with their identity information and stored in the database. Finally, the pre-trained recognition model is used for subsequent face matching and recognition.
[0187] A computer device comprises: a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement a face recognition method.
[0188] A computer-readable storage medium stores a computer program, which implements a face recognition method when executed by a processor.
[0189] This application can be used for security monitoring in bank branches and self-service areas. In actual applications, alarm equipment can also be added. If an abnormal situation is detected, suspicious persons, such as individuals on the blacklist or potential threats, can be automatically identified and the alarm can be promptly issued, thereby strengthening security precautions and protection.
[0190] The application of facial recognition technology in bank anti-fraud monitoring can provide functions such as real-time identification, fraud analysis and early warning, which can help banks effectively prevent and identify potential fraud and protect the financial security of banks and customers.
[0191] The present invention implements data protection, ensures the safe storage and transmission of facial images and personal identity information, and complies with relevant laws and regulations.
[0192] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment and product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device, equipment and product embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components indicated as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0193] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A face recognition method, characterized in that: The face recognition method comprises: Acquire an image to be identified, and input the image to be identified into a pre-trained recognition model; the network structure of the recognition model includes: a feature extraction layer, a clustering layer, a first classifier layer and a second classifier layer; wherein the feature extraction layer is trained using intra-view training data and an intra-view dynamic loss function and inter-view training data and an inter-view dynamic loss function; the first classifier layer includes a plurality of first classifiers; the first classifier is trained using intra-view training data and an intra-view dynamic loss function; the second classifier layer includes a second classifier; the second classifier is trained using inter-view training data and an inter-view dynamic loss function; the intra-view training data includes a plurality of groups of first data, a group of the first data corresponds to a view, a group of the first data includes a plurality of images captured at the corresponding view, and the number of groups of the first data is consistent with the number of the first classifiers; the inter-view training data includes a plurality of groups of second data, a group of the second data includes a plurality of images captured at different viewpoints; The feature extraction layer performs feature extraction on the image to be identified, and the clustering layer performs clustering. The first classifier layer and the second classifier layer are used in combination to jointly analyze from the dimensions within and between viewing angles to generate a face recognition result for the image to be identified.
2. The face recognition method according to claim 1, characterized in that: The training process of the pre-trained recognition model specifically includes: Collect raw training data; Constructing the intra-view training data based on the original training data according to the view, and constructing the inter-view training data based on the original training data according to the image similarity; Construct an initialized recognition model; Based on the in-view training data, each first classifier of the first classifier layer in the initialized recognition model and the feature extraction layer in the initialized recognition model are trained using the in-view dynamic loss function to obtain the in-view trained recognition model; Based on the training data between the perspectives, the dynamic loss function between the perspectives is used to train the second classifier layer and the feature extraction layer in the recognition model trained within the perspective to obtain the pre-trained recognition model.
3. The face recognition method according to claim 2, characterized in that: The step of training each first classifier of the first classifier layer in the initialized recognition model and the feature extraction layer in the initialized recognition model using the in-view dynamic loss function based on the in-view training data to obtain the in-view trained recognition model specifically includes: Inputting the in-view training data into the feature extraction layer of the initialized recognition model to obtain a feature value of each image in each group of first data; Inputting the feature value of each image in each group of first data into the clustering layer in the initialized recognition model, performing clustering processing on the image feature values in the same group of first data, and determining a pseudo label for the feature value of each image in each group of first data; Based on the one-to-one correspondence between the first data and the first classifier in the initialized recognition model, the image feature values in the first data are input into the corresponding first classifier to obtain a predicted first classification result, and based on the first classification result, the pseudo-labels of the image feature values in the corresponding first data and the in-viewing angle dynamic loss function, the first classifier layer and the feature extraction layer in the initialized recognition model are iteratively trained until the value of the in-viewing angle dynamic loss function is minimized, thereby obtaining the in-viewing angle trained recognition model.
4. The face recognition method according to claim 3, characterized in that: The dynamic loss function within the viewing angle is: Among them, L IN-DI represents the dynamic loss function within the viewing angle; N represents the number of images in the first data; C represents the total number of viewing angles; s represents the sth viewing angle; i represents the i-th image in the first data; A pseudo label representing the feature value corresponding to the i-th image in the first data of the s-th viewing angle; Represents a first classification result of the prediction of the feature value corresponding to the i-th image in the first data of the s-th viewing angle.
5. The face recognition method according to claim 3, characterized in that: The step of inputting the feature value of each image in each group of first data into the clustering layer in the initialized recognition model, performing clustering processing on the feature values of the images in the same group of first data, and determining the pseudo label of the feature value of each image in each group of first data specifically includes: The clustering layer in the initialized recognition model performs similarity clustering processing on the feature value of each image in each group of first data based on the original sample set, and uses the samples in the original sample set whose similarity with the image feature value meets preset conditions as pseudo labels of the corresponding image feature values, and determines the pseudo labels of each image feature value in each group of first data; the original sample set includes multiple samples.
6. The face recognition method according to claim 2, characterized in that: The step of training the second classifier layer and the feature extraction layer in the recognition model trained within the view using the dynamic loss function between the view based on the training data between the view to obtain the pre-trained recognition model specifically includes: Inputting the training data between the viewing angles into the feature extraction layer of the recognition model trained within the viewing angle to obtain the feature value of each image in each group of second data; Inputting the feature value of each image in each group of second data into the clustering layer of the recognition model trained within the viewing angle for clustering processing, and determining a pseudo label of the feature value of each image in each group of second data; The feature value of each image in each group of second data is input into the second classifier layer in the recognition model trained within the viewing angle to obtain a predicted second classification result, and based on the second classification result, the pseudo-label of the feature value of each image in the corresponding second data and the dynamic loss function between viewing angles, the second classifier layer and the feature extraction layer in the recognition model trained within the viewing angle are iteratively trained until the value of the dynamic loss function between viewing angles is minimized, thereby obtaining the pre-trained recognition model.
7. The face recognition method according to claim 6, characterized in that: The dynamic loss function between the perspectives is: Among them, L Cro-DI represents the dynamic loss function between viewing angles; N' represents the number of images in the second data; i' represents the i'th image in the second data; y i ' represents the pseudo label of the feature value corresponding to the i'th image in the second data; F i ' represents the predicted second classification result of the feature value corresponding to the i'th image in the second data.
8. A face recognition device, characterized in that: The face recognition device comprises: An acquisition unit is used to acquire an image to be identified and input the image to be identified into a pre-trained recognition model; the network structure of the recognition model includes: a feature extraction layer, a clustering layer, a first classifier layer and a second classifier layer; wherein the feature extraction layer is trained using intra-view training data and an intra-view dynamic loss function and inter-view training data and an inter-view dynamic loss function; the first classifier layer includes a plurality of first classifiers; the first classifier is trained using intra-view training data and an intra-view dynamic loss function; the second classifier layer includes a second classifier; the second classifier is trained using inter-view training data and an inter-view dynamic loss function; the intra-view training data includes a plurality of groups of first data, a group of the first data corresponds to a view, a group of the first data includes a plurality of images captured by the corresponding view, and the number of groups of the first data is consistent with the number of the first classifiers; the inter-view training data includes a plurality of groups of second data, a group of the second data includes a plurality of images captured by different viewpoints; The recognition unit is used to extract features of the image to be recognized through the feature extraction layer, and cluster it through the clustering layer, and comprehensively use the first classifier layer and the second classifier layer to jointly analyze from the dimensions within and between viewing angles to generate a face recognition result for the image to be recognized.
9. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the face recognition method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the face recognition method described in any one of claims 1 to 7 is implemented.