Face recognition method based on sham neural network
Patent Information
- Application Number
- JP2023206524
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-31
- Filing Date
- 2023-12-06
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2043-12-06
Smart Images

Figure 2025035988000001_ABST
Abstract
Description
[Technical field]
[0001] The present application relates to the technical field of power grid management, in particular to a facial recognition system based on a Siamese neural network. It concerns the recognition method. [Background technology]
[0002] With the rapid development of the power industry and the popularity of intelligent applications, the security of the power grid Face recognition technology, a non-contact biometric authentication technology, is an important issue. It is widely used in network system security monitoring and management. However, currently, facial recognition methods have low accuracy and are vulnerable to changes in light in a power grid environment. Due to issues such as occlusion, demand cannot be met. Summary of the Invention
[0003] The embodiment of the present application is based on the idea that the face recognition method in the prior art has low accuracy and is suitable for use in a power grid environment. The problem is that the demand cannot be met due to issues such as light changes and occlusion. To solve the above problem, a face recognition method based on a Siamese neural network is provided. An embodiment of the present application provides a face recognition method based on a Siamese neural network, The neural networks are composed of completely identical first and second neural networks. The face recognition method includes: The first image is input to the first neural network, and the second image is input to the second neural network. Here, the first image and the second image are images of the same object. the law of nature, A first output result of the first neural network for the first image and a second output result of the first neural network for the second image. Obtaining a second output result of the second neural network; Calculate and compare the first output result and the second output result, and based on the comparison result, calculate the first image and the second image. determining a target object of the In a possible embodiment, the comparison result is a similarity score, and the method for obtaining the similarity score includes: extracting and processing a first feature of the first image with a first neural network; extracting and processing second features of the second image with a second neural network; calculating the difference between the first feature and the second feature, obtaining a similarity score, and outputting the result. nothing. In a possible embodiment, the first neural network and the second neural network are Both contain convolutional and pooling layers, The convolution layer is used to extract nearby spatial features from the first or second image, and the pool The ring layer is used to process the neighborhood spatial features for dimensionality reduction. In a possible embodiment, a contrast loss function is used to compare the first neural network with the Optimize the second neural network, The contrast loss function estimates the similarity of images based on distance loss, where Two similar points have a small Euclidean distance, and two different points have a large Euclidean distance. It has a distance of 1. In a possible implementation, the contrast loss function includes: TIFF2025035988000002.tif1265 formula (1) Here, the x values are either 1 or 0, and if the model predicts that the inputs are similar, then the value of x is 0, otherwise Y is 1, max() is a function that represents the maximum value between 0 and m-Dw, and Dw is the Siamese neural network. is defined as the Euclidean distance between the outputs of the network. TIFF2025035988000003.tif76 is calculated based on the Euclidean distance, specifically according to formula (2). TIFF2025035988000004.tif947 formula (2) TIFF2025035988000005.tif76 indicates the output value of similarity, and y1 and y2 indicate the input data pair. In a possible embodiment, a triple loss function is used to compare the first and second neural networks. Optimizing the global network is Input training images to the first and second neural networks. Including training triple losses with force, The training images include a positive image, a target image, and a negative image, where the positive image is evaluated based on its similarity to the target image. , and negative images have low similarity to the target image. In a possible embodiment, the triple loss function includes: JPEG2025035988000006.jpg17155, where TIFF2025035988000007.tif620 shows the calculation result of the loss function. TIFF2025035988000008.tif611, TIFF2025035988000009.tif611, TIFF2025035988000010.tif612 shows the positive and negative feature embedding of the target point, respectively. TIFF2025035988000011.tif54 shows the growth rate. The embodiment of the present application provides a face recognition method based on a Siamese neural network, In face recognition methods based on neural networks, Siamese neural networks are completely The face recognition method includes: Then, the first image is input to the first neural network, and the second image is input to the second neural network. Here, the first image and the second image are images of the same object. a first output result of the first neural network for the first image and a second output result of the first neural network for the second image; obtaining a second output result of the second neural network; and Calculate and compare the force results, and determine the target objects of the first image and the second image based on the comparison results. through a first neural network and a second neural network. ,Compute and compare two images of the same object, and calculate the similarity and dissimilarity between the two images. Based on the determination result, the target can be recognized, and the accuracy of face recognition can be improved. [Brief description of the drawings]
[0004] The accompanying drawings described herein are used to provide a further understanding of the present invention and are intended to illustrate, but not to limit the scope of the present invention. The schematic embodiment of the present invention and its description are to be used for interpreting the present application. However, it does not constitute an undue limitation of the present invention. [Figure 1] FIG. 1 is a schematic diagram of a face recognition method based on a Siamese neural network provided by an embodiment of the present application. [Diagram 2] FIG. 1 is a structural schematic diagram of a Siamese neural network provided by an embodiment of the present application. [Diagram 3] FIG. 1 is a schematic diagram of Siamese neural network convolution kernel pruning provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0005] In order to enable those skilled in the art to better understand the technical solution of the present application, the following is a summary of the present application: The technical solutions of the embodiments of this application are clearly and completely described in conjunction with the accompanying drawings in the embodiments. However, it is apparent that the described embodiments are merely some of the embodiments of the present application, and all of the embodiments are not included. Based on the examples of the present application, a person skilled in the art can obtain other inventions without creative labor. All of the above embodiments are within the scope of protection of this application. With the rapid development of the power industry and the popularity of intelligent applications, the security of the power grid Face recognition technology, a non-contact biometric authentication technology, is an important issue. It is widely used in network system security monitoring and management. However, currently, facial recognition methods have low accuracy and are vulnerable to changes in light in a power grid environment. Due to issues such as occlusion, demand cannot be met. To solve the above problems, the embodiment of the present application is based on a Siamese neural network. A face recognition method is provided, and the solutions provided by the embodiments of the present application are described below in conjunction with the accompanying drawings of the specification. will be explained in detail.
[0006] FIG. 1 shows a face recognition method based on a Siamese neural network provided in one embodiment of the present application. FIG. As shown in FIG. 1, the embodiment of the present application is a face recognition method based on a Siamese neural network. The Siamese neural network provides a method for the first and second neural networks. The face recognition method includes a neural network. S100: A first image is input to a first neural network. In some examples, after recognizing a first image captured by a camera or a photographic device, the first image is a first neural network; and a first image captured by the recognition camera. It may also be a photograph of the subject. S200: A second image is input to a second neural network. In response to S100, the second neural network receives a second image. After collecting a second image by a camera or a scanner, the second image is fed to a second neural network. the second image is a photo of the object to be collected taken by a recognition camera; Good too. Further, the first image and the second image are taken at different angles by different cameras. These are photographs of the same subject. S300: The first neural network and the second neural network are respectively Calculate and compare the first and second images. The first neural network generates a first neural network based on the data in the database and the computational model. The second neural network calculates and compares the image and the data in the database. and calculating and comparing the second image based on the computational model to determine the target object of the first image and the second image. and recognizes the identity of the target image. Illustratively, the comparison result is a similarity score, and the method for obtaining the similarity score includes: extracting and processing a first feature of the first image with a second neural network; extracting and processing a second feature of the second image by the network; This involves calculating the differences, obtaining similarity scores, and outputting the results. For example, a power grid face recognition method based on a Siamese neural network is The two identical images collected, i.e. two photographs taken at different angles, are compared. This is achieved by finding the similarity between two objects. They consist of identical neural networks, each of which receives two copies of the input image, The weights can be shared and trained. Note that the Siamese neural network is It can learn similarities and differences between images and achieve high accuracy in face recognition tasks. This can improve the accuracy and reliability of facial recognition. In other words, the embodiment of the present application provides a face recognition method based on a Siamese neural network. The Siamese neural network is a completely identical first neural network. and a second neural network, the face recognition method including: inputting a second image to said neural network; and inputting a second image to said second neural network. Here, the first image and the second image are images of the same object, A first output result of the first neural network for the first image and a second output result of the second neural network for the first image. obtaining a second output result of the second neural network relating to the first output and the second output result, and based on the comparison result, the first image and determining a target object in the second image. 2. Through neural network, calculate and compare two images of the same object, and Calculate the similarity and dissimilarity between images, recognize targets based on the judgment results, and improve the accuracy of face recognition. It can be improved.
[0007] In some examples, the first neural network and the second neural network are both Both of them contain a convolutional layer and a pooling layer, and the convolutional layer calculates the image from the first and second images. Each layer is used to extract nearby spatial features, and the pooling layer reduces the dimensionality of the nearby spatial features. It is used to reduce The image inputs of the first and second neural networks are the same. It can be two photos of Gori or other categories, and Siamese neural network calculates the similarity score between images of different categories, and in face recognition tasks, each face is different category. If the two photos are of the same category (i.e., identical), the output is 1, otherwise and the result is zero (i.e., not identical). In addition, the max pooling of each neural network is performed by finding the maximum feature mapping block. Define the feature mapping for downsampling (pooling) and ensure translational invariance. This means that most of the pooled output values are sensitive to small changes in the image. It is not affected. A fully connected layer is one that is closely connected to the upper layer, and all neurons in that layer are connected to the upper layer. It is the most commonly used layer of neural networks, interconnected with neurons. The Siamese neural network plays the role of feature propagation and feature mapping. We only need to distinguish three categories: samples, negative samples, and target samples. Unlike traditional datasets that require labeling for each image, the Siamese neural network It is very easy to create training data for the architecture. To create a highly accurate model, we first need to collect a dataset. The database is made up of images taken from various angles by all employees in the company. Then, use the Array() method to convert the data into a NumPy array and convert the image values from integers to After converting to floating point numbers, it is divided by 255. The range of each value is 0 to 1. We introduce it into the dataset and use a transformation method to compress the image dimensions to 100 pixels in height and width. Shrink. Since only 0s and 1s are used, it effectively performs gradient descent and results in a better performing model. In the TensorFlow dataset generator, we use our anchor images, positive samples, Positive and negative samples can be used. In some examples, the Siamese neural network system is adapted to improve face recognition accuracy. To achieve this, the contrast loss function is Optimize your network. Here, the contrast loss function estimates image similarity based on distance loss, where Two similar points in an image have a small Euclidean distance, and two different points have a large Euclidean distance. Specifically, the contrast loss function is used to learn embeddings. It is used to extract the output vector information of the network to estimate the similarity, and if two similar points are has small Euclidean distance, and two distinct points have large Euclidean distance. If the samples are coded the same and the negative samples are coded differently, the loss is reduced. The contrast loss function is shown in Equation (1). TIFF2025035988000012.tif1265 formula (1) Here, the x values are either 1 or 0. If the model predicts that the inputs are similar, then the x values is 0, otherwise Y is 1. max() represents the maximum value between 0 and m-Dw function, and Dw is defined as the Euclidean distance between the outputs of the Siamese neural network. Be righteous, TIFF2025035988000013.tif76 is calculated based on the Euclidean distance, specifically according to formula (2). TIFF2025035988000014.tif947 formula (2) TIFF2025035988000015.tif76 indicates the output value of similarity, and y1 and y2 indicate the input data pair. In another example, a triple loss function is used to evaluate the first and second neural networks. Optimizing your network is Input training images to the first and second neural networks. Including training triple losses with force, The training images include a positive image, a target image, and a negative image, where the positive image is evaluated based on its similarity to the target image. , and negative images have low similarity to the target image. Exemplarily, the triple loss function includes: JPEG2025035988000016.jpg17155, where TIFF2025035988000017.tif620 shows the calculation result of the loss function. TIFF2025035988000018.tif611, TIFF2025035988000019.tif611, TIFF2025035988000020.tif612 shows the positive and negative feature embedding of the target point, respectively. TIFF2025035988000021.tif54 shows the growth rate.
[0008] Exemplarily, the training steps of the first neural network and the second neural network are The groups are as follows: First, we consider the Siamese neural network, and we consider the loss function and Adam function optimizer. Next, the first image and the second image are respectively input to the first neural network. The first image and the second image are used as inputs to the neural network. Finally, we determine the gradient of the model and update the weights using the optimizer. do. In addition, binary cross-entropy loss is used for embedding learning to find the similarity between two points. have a small Euclidean distance, and two distinct points have a fairly large Euclidean distance Finally, the optimizer adjusts the weight parameters to minimize the loss function. For example, Adam is a well-known gradient descent optimization method. It is computationally efficient and memory-efficient. The usage is also small. Finally, the recognition and classification performance parameters precision and recall can be evaluated. It is also useful for detecting overfitting because the precision of each instruction is different, e.g., the function If is overfitted, then the model is overfitted. FIG. 2 is a structural schematic diagram of a Siamese neural network provided in one embodiment of the present application. As shown in Figure 2, for example, two face images are input to the face recognition network, and the Chamneuve Two related sub-networks of the neural network (the first neural network and The forward and backpropagation calculations are performed by the second neural network. Since the neural network design, parameters and weights are the same, these sub- The network generates a code to calculate the distance between two input images. The neural network takes an image as input, just like any other convolutional neural network. The neural network extracts hidden features and converts them into numerical values. However, the output of the Siamese neural network is different from that of other convolutional neural networks. In classical CNNs, the parameters are fine-tuned during training in order to correctly classify each image. It is necessary to. In addition, the Siamese neural network calculates the distance and similarity between two input image features. When comparing inputs, a similarity function is used to compare the inputs without directly assigning images to output categories. do. In some examples, the Siamese neural network also uses convolutional kernel shearing. The convolution kernel pruning is generally done by pruning the convolution kernel at regular intervals using a specific method. In other words, the convolution kernels that need pruning are pruned by a certain operation. Structured pruning refers to pruning partial weights by applying a structured pruning algorithm. The level is also very easy to handle. In addition, convolution kernel pruning can not only reduce the amount of calculation and memory occupied, but also improve the network performance. It can improve the generalization ability of the work. Furthermore, it can be used in embedded systems and mobile devices. Accelerate the operation speed of neural networks on the It can further improve the quality and performance. FIG. 3 shows a convolution kernel of a Siamese neural network provided in one embodiment of the present application. FIG. 1 is a schematic diagram of pruning. As shown in Figure 3, the lower brackets represent the matrix of input feature maps of a layer and a convolution kernel row. According to the conventional convolution operation method, the input matrix and the convolution kernel are used for the operation. Divide the matrix, and finally combine the results of the convolution operations of each part to create the convolution as shown in the parentheses above. After dividing the convolution kernel, the convolution kernel structure is calculated by setting a constant step size and offset. In the figure, the step size is set to 2 and the offset is set to 0 or 1, and then the convolution is performed. The red numbers in the kernel are the retained weights after pruning, and the black numbers are the pruned weights. The entire convolution kernel matrix is reduced from the original 12×2 to 6×2, Here, the convolution kernel weights after retention are the red weights in the figure, which are actually The weights used are also reduced from the original 4×12 to 4×6, i.e., convolution kernel pruning. We only use the weights that correspond to the later retained weights, and the blue number matrix in the figure is the output feature map after pruning. matrix, and the corresponding black number matrix is the output feature map matrix before pruning. Table 1. Recognition results of face recognition method based on Siamese neural network and advanced method It is. As shown in Table 1, we evaluate the accuracy of the face recognition method based on the Siamese neural network. The examples in this application compare the recognition results with advanced methods: dense and sigmoid After training with activation function, we compared the results of training with other classifiers and other activation functions. At present, the methods and results of face recognition technology are generally good, with an accuracy rate of 96%. It has an accuracy of 90% to 96% and is a Siamese neural network on the "Outdoor Face Tagging" dataset. The search produces the best recognition results. Table 1. Recognition results of face recognition method based on Siamese neural network and advanced method TIFF2025035988000022.tif71129Table 2. Statistics of test results when existing methods are applied to the dataset of the examples of this application. This application statistically analyzes the results of tests performed on the data set of the examples of this application. The results are shown in Table 2. As can be seen from the results, the recognition rate of the Resnet method is 81.2 The recognition rate of the TripleNet method was 84.32%, while that of the FaceNet method was 1. The recognition rate of our method was 85.52%. The recognition rate of the SN-LF method was 90.31%. The face recognition method based on the Siamese neural network of this application has a recognition rate of 96%. This is much higher than the recognition rate of the previous method. Table 2. Statistics of test results of existing methods applied to the data set of the examples of this application TIFF2025035988000023.tif69128 Those skilled in the art can combine the embodiments of this application based on some of the embodiments provided in this application. , division, rearrangement, etc. to obtain other embodiments, all of which are not intended to be limiting. It is easily understood that this does not exceed the scope of protection of the application. The above specific embodiments achieve the objectives, technical solutions and beneficial effects of the embodiments of the present application. Although described in more detail, the above is merely a specific embodiment of the present application, and the present application It does not limit the scope of protection of the embodiments, but is based on the technical solutions of the embodiments of this application. Any modifications, equivalent replacements, improvements, etc., made herein are within the scope of protection of the embodiments of this application. do.
Claims
1. A face recognition method based on a Siamese neural network, comprising: The network includes identical first and second neural networks. The face recognition method includes: A first image is input to the first neural network, and a second image is input to the second neural network. and inputting the first image and the second image into a network, wherein the first image and the second image are respectively identical pairs. It was a photo of an elephant. A first output result of the first neural network for the first image and the second image. obtaining a second output result of the second neural network relating to an image; The first output result and the second output result are calculated and compared, and based on the comparison result, determining a target object in the first image and the second image. A face recognition method based on neural networks.
2. The comparison result is a similarity score, and the method of obtaining the similarity score includes: extracting and processing a first feature of the first image with the first neural network; and, extracting and processing second features of the second image with the second neural network. and, calculating the difference between the first feature and the second feature, obtaining a similarity score, and outputting the result; and Face recognition methods.
3. The first neural network and the second neural network are both convolutional. It includes a convolution layer and a pooling layer, The convolution layer is used to extract nearby spatial features from the first image or the second image. The pooling layer is used to reduce the dimensions of the neighboring spatial features. The face recognition method based on the Siamese neural network according to claim 1 .
4. Before inputting the first image or the second image, a contrast loss function is used to optimizing the first neural network and the second neural network; The contrast loss function estimates the similarity of images based on distance loss, where Two similar points in have a small Euclidean distance, and two different points in have a large Euclidean distance.
2. The Siamese neural network of claim 1, having a lid distance. A face recognition method based on
5. The contrast loss function includes: Formula (1) where x values are 1 or 0, and if the model predicts that the inputs are similar, then the value of x is 0, otherwise Y is 1, max() is a function that represents a large value between 0 and m-Dw, and Dw is the Siamese neural network. is defined as the Euclidean distance between the outputs of the network. is calculated based on the Euclidean distance, specifically according to formula (2): Formula (2) denotes the output value of similarity, and y 1 Andy 2 denotes an input data pair.
4. A face recognition method based on a Siamese neural network as described in claim 4.
6. Before inputting the first image or the second image, the first neural network is subjected to a triple loss function. optimizing the neural network and the second neural network, The first neural network and the second neural network are trained. It involves inputting an image and training a triple loss, The training images include a positive image, a target image, and a negative image, where the positive image is a and the negative image has a low similarity to the target image.
2. The face recognition method based on the Siamese neural network according to claim 1.
7. The triple loss function includes: Where: indicates the calculation result of the loss function, 、 、 denote the positive and negative feature embeddings of the target point, respectively, The Siamese neural network-based method according to claim 6, wherein A facial recognition method based on the
Citation Information
Patent Citations
Information processing device and combination specifying method
JP2021002105A
Mosaic processing program and mosaic processing system
JP2021002116A
Deep Learning System
JP2021526253A