A method, device, electronic device and storage medium for recognizing face images
By chunking and extracting texture features of the face images to be recognized in the face image library, combined with the clustering method of weight matrix similarity graphs, the problems of low face recognition accuracy and low calculation efficiency in the prior art are solved. Efficient face recognition is achieved.
Patent Information
- Application Number
- CN202110326821.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-26
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2041-03-26
AI Technical Summary
In the prior art, face recognition based on low-dimensional data has information loss, resulting in low recognition accuracy; while high-dimensional data clustering has a large amount of data and slow calculation speed, which affects efficiency.
By chunking the face images to be identified in the face image library, the texture features of the high-dimensional data of the image block are extracted to obtain the texture feature vector set. Then, based on the weight matrix determination algorithm, a weight matrix similarity graph is obtained, and the similar graph is clustered using the preset clustering algorithm to determine the classification results of the face image to be recognized.
It improves the speed of clustering recognition of high-dimensional face data, solves the problem of information loss caused by low-dimensional face data, and improves the accuracy and efficiency of face recognition.
Smart Images

Figure CN112906652B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to artificial intelligence technology, specifically to image recognition technology, and more particularly to a method, device, electronic device and storage medium for recognizing facial images. Background Art
[0002] The recognition and classification of facial images can be applied in various fields, providing great convenience in residential security and self-service.
[0003] In the prior art, image recognition is performed based on low-dimensional data of images. Low-dimensional data contains less facial description information, resulting in information loss and relatively low face recognition accuracy. For clustering of high-dimensional data, the large amount of data leads to slow calculation, which affects the efficiency of face recognition. Summary of the invention
[0004] The embodiments of the present invention provide a method, device, electronic device and storage medium for recognizing a facial image, so as to improve the recognition accuracy of a facial image.
[0005] In a first aspect, an embodiment of the present invention provides a method for recognizing a face image, the method comprising:
[0006] Acquire a face image to be identified from a face image library to be identified, and divide the face image to be identified into at least two image blocks based on a preset image division rule;
[0007] According to a preset feature extraction algorithm, feature extraction is performed on the image block to obtain a texture feature vector set of the face image library to be identified;
[0008] According to the texture feature vector set of the face image library to be identified, based on a preset weight matrix determination algorithm, a weight matrix similarity graph is obtained;
[0009] Image clustering is performed on the weight matrix similarity graph according to a preset image clustering algorithm to determine the classification results of the face images to be identified in the face image library to be identified.
[0010] In a second aspect, an embodiment of the present invention further provides a facial image recognition device, the device comprising:
[0011] An image segmentation module is used to obtain a face image to be identified from a face image library to be identified, and to segment the face image to be identified into at least two image blocks based on a preset image segmentation rule;
[0012] A texture feature extraction module, used to extract features from the image block according to a preset feature extraction algorithm to obtain a texture feature vector set of the face image library to be identified;
[0013] A similarity map acquisition module is used to obtain a weight matrix similarity map based on a preset weight matrix determination algorithm according to the texture feature vector set of the face image library to be identified;
[0014] The image recognition module is used to perform image clustering on the weight matrix similarity graph according to a preset image clustering algorithm to determine the classification results of the face images to be recognized in the face image library to be recognized.
[0015] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for recognizing a facial image as described in any embodiment of the present invention is implemented.
[0016] In a fourth aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the method for recognizing a facial image as described in any embodiment of the present invention.
[0017] The embodiment of the present invention obtains more facial description information and avoids information loss by dividing the facial images to be identified in the facial image library into blocks and extracting the texture features of the high-dimensional data of the image blocks. A texture feature vector set is obtained based on the texture features of all facial images in the entire facial image library. Based on the texture feature vector set, a weight matrix similarity graph that can describe the similarity of facial images is obtained, and the similarity graph is clustered according to a preset clustering algorithm to obtain the recognition and classification results of the facial images, thereby improving the speed of clustering and recognition of high-dimensional facial data. The problem of information loss caused by low-dimensional facial data in the prior art is solved, and the accuracy and efficiency of facial recognition are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a flowchart of a method for recognizing a facial image in Embodiment 1 of the present invention;
[0019] Figure 2 is a schematic diagram of pixel points of an image block and a pixel point comparison result in Embodiment 1 of the present invention;
[0020] Figure 3 It is a flowchart of a method for recognizing a facial image in Embodiment 2 of the present invention;
[0021] Figure 4 It is a structural block diagram of a facial image recognition device in Embodiment 3 of the present invention;
[0022] Figure 5 It is a structural schematic diagram of a facial image recognition device in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0023] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0024] Embodiment 1
[0025] Figure 1 This is a flow chart of a facial image recognition method provided by Embodiment 1 of the present invention. This embodiment is applicable to the case of recognizing and classifying facial images. The method can be executed by a facial image recognition device. Figure 1 As shown, the method specifically comprises the following steps:
[0026] Step 110: Obtain a face image to be identified from a face image library to be identified, and divide the face image to be identified into at least two image blocks based on a preset image division rule.
[0027] The face image library to be identified includes a plurality of face images to be identified. The face image library to be identified in this embodiment may be a Yale face database, for example, a Yale B face database. A face image to be identified is obtained from the face image library to be identified, and the face image to be identified is divided into blocks. Therefore, the obtained face image to be identified is a face image that has not been divided into blocks. An image division rule is pre-set, and the face image to be identified is divided into a plurality of image blocks according to the image division rule. For example, the image division rule may be to divide the image into four equal areas.
[0028] In this embodiment, optionally, a face image to be identified is obtained from a face image library to be identified, and based on a preset image segmentation rule, the face image to be identified is divided into at least two image blocks, including: obtaining an un-blocked face image to be identified from the face image library to be identified; grid-dividing the un-blocked face image to be identified to obtain m×n image blocks; wherein, m×n>2.
[0029] Specifically, the facial images in the face image library to be identified include segmented facial images and unsegmented facial images, and the unsegmented facial images are obtained as the facial images to be identified. The preset image segmentation rule can be to grid-divide the facial images to be identified, and m×n image blocks can be divided, where m and n are the number of image blocks divided horizontally and vertically, respectively. In this embodiment, m and n can both be 7, that is, the facial images to be identified are divided into 49 blocks. The beneficial effect of such a setting is that the facial images to be identified can be automatically segmented, which is convenient for determining the local features of the facial images to be identified, avoiding information loss caused by directly extracting features from the entire image, and improving the recognition accuracy of facial images.
[0030] In this embodiment, optionally, the image block is a grid image block or a circular image block.
[0031] Specifically, the face image to be identified can be divided into a grid to form multiple rectangular image blocks, or the face image to be identified can be divided into circular image blocks or image blocks of other shapes. The shape of the image blocks is not restricted, so that the face image to be identified can be completely divided, avoiding the omission of image information, and increasing the diversity of image division and the accuracy of image recognition.
[0032] Step 120: extract features from the image blocks according to a preset feature extraction algorithm to obtain a texture feature vector set of the face image library to be identified.
[0033] Among them, the feature extraction algorithm can be used to extract the texture features of the image. According to the preset feature extraction algorithm, the texture features of the image block can be obtained. According to the texture features of all image blocks in the face image to be identified, the texture features of the entire face image to be identified can be obtained. The texture features of all face images in the face image library to be identified can be combined into a texture feature vector set of the face image library to be identified. For example, the texture feature of the i-th face image to be identified is y i , the texture feature vector set of the face image library to be recognized is Y = [y1, y2, ..., y N ], N is the number of face images in the face image library to be recognized, 1≤i≤N.
[0034] In this embodiment, optionally, feature extraction is performed on the image block according to a preset feature extraction algorithm to obtain a texture feature vector set of the face image library to be identified, including: obtaining local texture features of the image block according to the preset feature extraction algorithm; obtaining a texture feature set of the face image to be identified based on the local texture features of the image block; and generating a texture feature vector set of the face image library to be identified based on the texture feature set of the face image to be identified.
[0035] Specifically, the preset feature extraction algorithm can be an LBP (Local Binary Pattern) algorithm, which can be used to extract texture features of an image. The feature vector obtained by the basic LBP algorithm has thousands of dimensions, so the feature vector of high-dimensional data can be obtained according to the LBP algorithm. In order to reduce the data dimension, the LBP algorithm of the equivalent mode can be used to reduce the thousands of dimensional data to hundreds of dimensions, reduce the amount of data calculation, and still maintain the feature vector of high-dimensional data to avoid information loss. The preset equivalent mode LBP algorithm is used to extract features from each image block to obtain the local texture features of each image block. According to the local texture features of the image block, the overall texture features of the face image to be identified corresponding to the image block can be obtained and combined into a texture feature set. The texture feature set of all face images in the face image library to be identified can be combined to obtain the texture feature vector set of the face image library to be identified. The beneficial effect of this setting is that the texture features of the entire image can be obtained in blocks, and then the texture features of the entire image library can be obtained. Most of the existing face recognition is based on low-dimensional data. Low-dimensional data contains less face description information, there is information loss, and the face recognition accuracy is relatively low. The general high-dimensional data clustering is slow to calculate due to the large amount of data. The face recognition method based on high-dimensional data clustering provided in this embodiment divides the face image into blocks, and after the block division, the image texture information is calculated based on the LBP operator to obtain the face texture feature vector of the high-dimensional data. The equivalent mode LBP algorithm is used to obtain high-dimensional data. The equivalent mode LBP algorithm can represent more than 90% of the image texture information, which not only avoids information loss, but also reduces the amount of calculation for subsequent data clustering, and improves the accuracy and efficiency of face image recognition.
[0036] In this embodiment, optionally, local texture features of the image block are obtained according to a preset feature extraction algorithm, including: determining a basic LBP value of the image block according to a preset LBP algorithm; and selecting an LBP value of an equivalent mode in the basic LBP value as the local texture feature of the image block.
[0037] Specifically, the value of each pixel in the image block is obtained. For example, the image block is a 3*3 neighborhood window with a pixel as the center point. The pixel values of the 8 points other than the center point are compared with the center point pixel value. If it is greater than or equal to the center pixel value, it is marked as 1, otherwise it is marked as 0. Figure 2 Schematic diagram of pixel points of an image block and pixel point comparison results in this embodiment. Arrange the 0s and 1s around the center point to obtain an 8-bit binary number. For example, the arrangement can be in clockwise order. Figure 2The binary number of the pixel comparison result is 11010011. Convert the binary number to a decimal number, and this decimal integer can represent the basic LBP value of this window, and use this value to reflect the texture information of the area. According to the preset LBP algorithm, the basic LBP value of each image block can be obtained. There are too many basic LBP values. In order to reduce the dimension of the data of the LBP operator, the LBP value of the equivalent mode can be selected from the basic LBP value, and the LBP value of the equivalent mode is used as the local texture feature of the image block. The equivalent mode means that when the binary number corresponding to a certain LBP value has at most two jumps from 0 to 1 or from 1 to 0, the binary corresponding to the LBP value is called an equivalent mode class. For example, 00000000 has 0 jumps; 00000111 contains only one jump from 0 to 1; 10001111 first jumps from 1 to 0, and then jumps from 0 to 1, with a total of two jumps. The above three cases are all equivalent mode classes. All patterns other than the equivalent pattern class are classified into another class, called the mixed pattern class. By selecting the equivalent pattern class from all basic LBP values, the types of binary patterns are greatly reduced without losing useful information of the image. This not only ensures the high dimension of the data, but also reduces the dimension of the feature vector and improves the calculation speed.
[0038] Step 130: According to the texture feature vector set of the face image library to be identified, based on a preset weight matrix determination algorithm, a weight matrix similarity graph is obtained.
[0039] After obtaining the texture feature vector set of the face image library to be identified, the similarity between any two face images to be identified in the face image library to be identified can be determined. A weight matrix determination algorithm is pre-set, and the weight matrix determination algorithm is used to determine the weight matrix similarity graph of any two face images to be identified in the face image library to be identified based on the texture feature vector set. The elements in the weight matrix are used to represent the similarity of the face images to be identified, and the weight matrix similarity graph can be a mesh graph. That is, by drawing a weight matrix similarity graph based on the weight matrix, the face recognition images can be connected in pairs, and the higher the similarity, the tighter the connection.
[0040] In this embodiment, optionally, according to the texture feature vector set of the face image library to be identified, based on the preset weight matrix determination algorithm, a weight matrix similarity graph is obtained, including: according to the texture feature vector set of the face image library to be identified, based on the preset data clustering algorithm, an intermediate matrix is obtained; according to the intermediate matrix and the preset weight matrix calculation formula, a weight matrix is obtained; according to the weight matrix, a weight matrix similarity graph is constructed.
[0041] Specifically, the weight matrix determination algorithm can first obtain the weight matrix based on the texture feature vector set of the face image library to be identified, and then obtain the weight matrix similarity graph based on the weight matrix. The weight matrix can be obtained by first obtaining an intermediate matrix based on a preset data clustering algorithm, and then obtaining the weight matrix based on the intermediate matrix. The preset data clustering algorithm can be a sparse subspace clustering algorithm. According to the sparse subspace clustering algorithm, a sparse matrix of the texture feature vector set can be obtained, and the sparse matrix is the intermediate matrix. The sparse matrix can be determined according to the following formula:
[0042]
[0043] stY=YC+E+Z,diag(C)=0;
[0044] Among them, Y is the texture feature vector set, C is the sparse matrix, E is the isolated point set matrix, Z is the noise matrix, λ e and λ z is an intermediate parameter, l means that the l norm can make C and E sparse, F means that the Frobenius norm is used to make the column of Z have fewer data points, and the Frobenius norm refers to the square root of the sum of the squares of each element of the matrix. C, E and Z can be calculated according to the system of equations using the convex optimization toolkit. The weight matrix calculation formula is pre-set, and the weight matrix is calculated according to the intermediate matrix, and then the similarity between the face images to be identified is obtained. Then, according to the weight matrix, a weight matrix similarity graph is constructed. The beneficial effect of this setting is that a sparse matrix is obtained according to the preset sparse subspace clustering algorithm, which is convenient for subsequent determination of the similarity of the face images to be identified and automatic classification of face images is realized. When determining the texture feature vector set, the LBP value of the equivalent mode is selected to reduce the data dimension. Therefore, when the sparse subspace clustering algorithm is used, the calculation speed is effectively improved.
[0045] In this embodiment, optionally, obtaining a weight matrix according to an intermediate matrix and a preset weight matrix calculation formula includes: obtaining a weight matrix according to a sparse matrix and a preset weight matrix calculation formula; and determining the weight matrix according to the following formula:
[0046] W=|C|+|C| T ;
[0047] Among them, W is the weight matrix and C is the sparse matrix.
[0048] Specifically, after obtaining the sparse matrix, the weight matrix is calculated according to the sparse matrix. The preset weight matrix calculation formula may be:
[0049] W=|C|+|C| T ;
[0050] The weight matrix W can be calculated by permuting the sparse matrix C and the sparse matrix. The element w in the weight matrix W is ij Represents the similarity between the face image i to be identified and the face image j to be identified. By calculating the weight matrix through the sparse matrix, the similarity between images can be quickly determined, which is conducive to image classification and clustering of high-dimensional data.
[0051] Step 140: Perform image clustering on the weight matrix similarity graph according to a preset image clustering algorithm to determine the classification results of the face images to be identified in the face image library to be identified.
[0052] Among them, a weight matrix similarity graph is constructed according to the weight matrix to realize intuitive viewing of the similarity of each face image to be identified. According to the preset image clustering algorithm, the face images to be identified in the weight matrix similarity graph are clustered, and the images with high similarity are clustered into one category. In this embodiment, the preset image clustering algorithm can be a K-means algorithm. Through the weight matrix similarity graph, high-dimensional data can be clustered, the problem of slow calculation due to large data volume is reduced, and the efficiency of face recognition is improved. According to the clustering results, the classification of the face images to be identified is realized, that is, the category to which the image belongs is obtained, and the recognition result of the face image to be identified is determined. For example, it can be determined that multiple face images to be identified are in the category of positive emotions, and another multiple face images to be identified are in the category of negative emotions.
[0053] The technical solution of this embodiment extracts more facial description information by dividing the facial images to be identified in the facial image library into blocks, extracting the texture features of the high-dimensional data of the image blocks, and avoiding information loss. A texture feature vector set is obtained based on the texture features of all facial images in the entire facial image library. Based on the texture feature vector set, a weight matrix similarity graph that can describe the similarity of facial images is obtained, and the similarity graph is clustered according to a preset clustering algorithm to obtain the recognition and classification results of the facial images, thereby improving the speed of clustering and recognition of high-dimensional facial data. The problem of information loss caused by low-dimensional facial data in the prior art is solved, and the accuracy and efficiency of facial recognition are improved.
[0054] Embodiment 2
[0055] Figure 3 The flowchart of a facial image recognition method provided by the second embodiment of the present invention is further optimized based on the above embodiment. The method can be executed by a facial image recognition device. Figure 3 As shown, the method specifically comprises the following steps:
[0056] Step 310: Obtain a face image to be identified from a face image library to be identified, and divide the face image to be identified into at least two image blocks based on a preset image division rule.
[0057] Step 320: Obtain local texture features of the image block according to a preset feature extraction algorithm.
[0058] Step 330: Obtain a texture feature set of the face image to be identified based on the local texture features of the image block.
[0059] The texture feature set of a face image to be identified is obtained based on the local texture features of all image blocks of the face image to be identified. If the texture feature sets of all face images to be identified in the face image library to be identified are generated, the texture feature vector set of the face image library to be identified can be obtained.
[0060] In this embodiment, optionally, after obtaining a texture feature set of the face image to be identified based on the local texture features of the image block, it also includes: determining whether there is an unblocked face image to be identified in the face image library to be identified; if not, generating a texture feature vector set for the face image library to be identified based on the texture feature set of the face image to be identified.
[0061] Specifically, after obtaining the texture feature set of the face image to be identified, first determine whether all the face images to be identified in the face image library to be identified have obtained their own texture feature set, that is, determine whether there are still unblocked face images to be identified in the face image library to be identified. If there are no unblocked face images to be identified in the face image library to be identified, it is determined that all the face images to be identified have completed the process of blocking and feature extraction, and the texture feature vector set of the entire face image library to be identified can be obtained based on the texture feature set of each face image to be identified. The beneficial effect of such a setting is that it can ensure that all images in the face image library to be identified obtain the texture feature set, thereby obtaining a complete texture feature vector set, avoiding information omission, and improving the recognition accuracy of images in the face image library to be identified.
[0062] In this embodiment, optionally, after determining whether there is an un-blocked face image to be identified in the face image library to be identified, it also includes: if there is an un-blocked face image to be identified in the face image library to be identified, dividing the un-blocked face image to be identified into at least two image blocks, and obtaining a texture feature set of the un-blocked face image to be identified.
[0063] Specifically, it is determined whether there are unblocked face images to be identified in the face image library to be identified. If there are, it is determined that the texture feature vector set of the face image library to be identified cannot be generated. The face image to be identified that has not been segmented is obtained from the face image library to be identified, and the face image to be identified is divided into at least two image blocks based on a preset image segmentation rule. Then, according to a preset feature extraction algorithm, feature extraction is performed on the image block to obtain a texture feature set of the face image to be identified. It is determined again whether there are unblocked face images to be identified in the face image library to be identified, until there are no unblocked face images to be identified in the face image library to be identified, then a texture feature vector set of the face image library to be identified is generated. The beneficial effect of such a setting is that it ensures that all images in the face image library to be identified are segmented and texture features are extracted, so as to avoid missing face images to be identified, resulting in face recognition classification errors, improving the recognition accuracy and efficiency of face images, and realizing automatic recognition of face images.
[0064] Step 340: Generate a texture feature vector set of a library of face images to be identified based on the texture feature set of the face images to be identified.
[0065] Step 350: According to the texture feature vector set of the face image library to be identified, based on a preset weight matrix determination algorithm, a weight matrix similarity graph is obtained.
[0066] Step 360: Perform image clustering on the weight matrix similarity graph according to a preset image clustering algorithm to determine the classification results of the face images to be identified in the face image library to be identified.
[0067] The embodiment of the present invention extracts more facial description information by dividing the facial images to be identified in the facial image library into blocks, extracting the texture features of the high-dimensional data of the image blocks, and avoiding information loss. After determining that all the images in the facial image library to be identified have been processed, a texture feature vector set is obtained based on the texture features of all facial images in the entire facial image library. Based on the texture feature vector set, a weight matrix similarity graph that can describe the similarity of the facial images is obtained, and the similarity graph is clustered according to a preset clustering algorithm to obtain the recognition and classification results of the facial images, thereby improving the speed of clustering and recognition of high-dimensional facial data. The problem of information loss caused by low-dimensional facial data in the prior art is solved, avoiding the omission of facial images during recognition, reducing the user's inspection process for whether the image is missed, and improving the accuracy and efficiency of facial recognition.
[0068] Embodiment 3
[0069] Figure 4 This is a structural block diagram of a facial image recognition device provided in Embodiment 3 of the present invention, which can execute a facial image recognition method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. Figure 4As shown, the device specifically includes:
[0070] The image division module 401 is used to obtain a face image to be identified from a face image library to be identified, and divide the face image to be identified into at least two image blocks based on a preset image division rule;
[0071] The texture feature extraction module 402 is used to extract features from the image block according to a preset feature extraction algorithm to obtain a texture feature vector set of the face image library to be identified;
[0072] A similarity map acquisition module 403 is used to obtain a weight matrix similarity map based on a preset weight matrix determination algorithm according to the texture feature vector set of the face image library to be identified;
[0073] The image recognition module 404 is used to perform image clustering on the weight matrix similarity graph according to a preset image clustering algorithm to determine the classification results of the face images to be recognized in the face image library to be recognized.
[0074] Optionally, the image segmentation module 401 includes:
[0075] An image acquisition unit, used for acquiring an unblocked face image to be recognized from the face image library to be recognized;
[0076] The image block division unit is used to divide the un-blocked face image to be recognized into grids to obtain m×n image blocks; wherein m×n>2.
[0077] Optionally, the image block is a grid image block or a circular image block.
[0078] Optionally, the texture feature extraction module 402 includes:
[0079] A local feature acquisition unit, used to obtain local texture features of the image block according to a preset feature extraction algorithm;
[0080] A feature set obtaining unit, used to obtain a texture feature set of the face image to be identified according to the local texture features of the image block;
[0081] The vector set generating unit is used to generate a texture feature vector set of a library of face images to be identified based on the texture feature set of the face images to be identified.
[0082] Optionally, the preset feature extraction algorithm is an LBP algorithm.
[0083] Optionally, a local feature obtaining unit is specifically used for:
[0084] Determining a basic LBP value of the image block according to a preset LBP algorithm;
[0085] An LBP value of an equivalent mode among the basic LBP values is selected as a local texture feature of the image block.
[0086] Optionally, the texture feature extraction module 402 further includes:
[0087] The face image judgment unit is used to determine whether there is an unblocked face image to be identified in the face image library after obtaining the texture feature set of the face image to be identified based on the local texture features of the image block; if not, generate a texture feature vector set of the face image library to be identified based on the texture feature set of the face image to be identified.
[0088] Optionally, the texture feature extraction module 402 further includes:
[0089] The image continuing segmentation unit is used to, after determining whether there is an un-blocked face image to be identified in the face image library to be identified, divide the un-blocked face image to be identified into at least two image blocks if there is an un-blocked face image to be identified in the face image library to be identified, and obtain a texture feature set of the un-blocked face image to be identified.
[0090] Optionally, the similar graph obtaining module 403 includes:
[0091] An intermediate matrix obtaining unit, used to obtain an intermediate matrix based on a preset data clustering algorithm according to the texture feature vector set of the face image library to be identified;
[0092] A weight matrix obtaining unit, used to obtain a weight matrix according to the intermediate matrix and a preset weight matrix calculation formula;
[0093] The similarity graph construction unit is used to construct a weight matrix similarity graph according to the weight matrix.
[0094] Optionally, the intermediate matrix obtaining unit is specifically used for:
[0095] According to the texture feature vector set of the face image library to be identified, a sparse matrix is obtained based on a preset sparse subspace clustering algorithm.
[0096] Optionally, a weight matrix obtaining unit is used to:
[0097] Obtaining the weight matrix according to the sparse matrix and a preset weight matrix calculation formula;
[0098] The weight matrix is determined according to the following formula:
[0099] W=|C|+|C| T ;
[0100] Among them, W is the weight matrix and C is the sparse matrix.
[0101] Optionally, the preset image clustering algorithm is a K-means clustering algorithm.
[0102] The embodiment of the present invention extracts more facial description information by dividing the facial images to be identified in the facial image library into blocks, extracting the texture features of the high-dimensional data of the image blocks, and avoiding information loss. A texture feature vector set is obtained based on the texture features of all facial images in the entire facial image library. Based on the texture feature vector set, a weight matrix similarity graph that can describe the similarity of facial images is obtained, and the similarity graph is clustered according to a preset clustering algorithm to obtain the recognition and classification results of the facial images, thereby improving the speed of clustering and recognition of high-dimensional facial data. The problem of information loss caused by low-dimensional facial data in the prior art is solved, and the accuracy and efficiency of facial recognition are improved.
[0103] Embodiment 4
[0104] Figure 5 FIG. 1 is a schematic diagram of the structure of a face image recognition device provided by Embodiment 4 of the present invention. The face image recognition device is an electronic device, Figure 5 A block diagram of an exemplary electronic device 500 suitable for implementing embodiments of the present invention is shown. Figure 5 The electronic device 500 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0105] like Figure 5 As shown, the electronic device 500 is in the form of a general computing device. The components of the electronic device 500 may include but are not limited to: one or more processors or processing units 501, a system memory 502, and a bus 503 connecting different system components (including the system memory 502 and the processing unit 501).
[0106] Bus 503 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.
[0107] The electronic device 500 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 500, including volatile and non-volatile media, removable and non-removable media.
[0108] System memory 502 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 504 and / or cache memory 505. Electronic device 500 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 506 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, usually called a "hard drive"). Although Figure 5 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 503 via one or more data medium interfaces. The memory 502 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the embodiments of the present invention.
[0109] A program / utility 508 having a set (at least one) of program modules 507 may be stored, for example, in the memory 502, such program modules 507 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 507 generally perform the functions and / or methods of the embodiments described herein.
[0110] The electronic device 500 may also communicate with one or more external devices 509 (e.g., keyboard, pointing device, display 510, etc.), one or more devices that enable a user to interact with the electronic device 500, and / or any device that enables the electronic device 500 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed through an input / output (I / O) interface 511. Furthermore, the electronic device 500 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 512. Figure 5 As shown, the network adapter 512 communicates with other modules of the electronic device 500 via the bus 503. It should be understood that although Figure 5 Not shown, other hardware and / or software modules may be used in conjunction with electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0111] The processing unit 501 executes various functional applications and data processing by running the program stored in the system memory 502, for example, implementing a facial image recognition method provided by an embodiment of the present invention, including:
[0112] Acquire a face image to be identified from a face image library to be identified, and divide the face image to be identified into at least two image blocks based on a preset image division rule;
[0113] According to a preset feature extraction algorithm, feature extraction is performed on the image block to obtain a texture feature vector set of the face image library to be identified;
[0114] According to the texture feature vector set of the face image library to be identified, based on a preset weight matrix determination algorithm, a weight matrix similarity graph is obtained;
[0115] Image clustering is performed on the weight matrix similarity graph according to a preset image clustering algorithm to determine the classification results of the face images to be identified in the face image library to be identified.
[0116] Embodiment 5
[0117] Embodiment 5 of the present invention further provides a storage medium containing computer executable instructions, on which a computer program is stored. When the program is executed by a processor, a method for recognizing a facial image provided in the embodiment of the present invention is implemented, including:
[0118] Acquire a face image to be identified from a face image library to be identified, and divide the face image to be identified into at least two image blocks based on a preset image division rule;
[0119] According to a preset feature extraction algorithm, feature extraction is performed on the image block to obtain a texture feature vector set of the face image library to be identified;
[0120] According to the texture feature vector set of the face image library to be identified, based on a preset weight matrix determination algorithm, a weight matrix similarity graph is obtained;
[0121] Image clustering is performed on the weight matrix similarity graph according to a preset image clustering algorithm to determine the classification results of the face images to be identified in the face image library to be identified.
[0122] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.
[0123] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0124] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0125] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0126] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for recognizing a face image, characterized in that: include: Acquire a face image to be identified from a face image library to be identified, and divide the face image to be identified into at least two image blocks based on a preset image division rule; According to a preset feature extraction algorithm, feature extraction is performed on the image block to obtain a texture feature vector set of the face image library to be identified; According to the texture feature vector set of the face image library to be identified, based on a preset weight matrix determination algorithm, a weight matrix similarity graph is obtained; Performing image clustering on the weight matrix similarity graph according to a preset image clustering algorithm to determine the classification results of the face images to be identified in the face image library to be identified; Wherein, the weight matrix similarity graph is obtained based on the texture feature vector set of the face image library to be identified and a preset weight matrix determination algorithm, including: According to the texture feature vector set of the face image library to be identified, based on a preset data clustering algorithm, an intermediate matrix is obtained; Obtaining a weight matrix according to the intermediate matrix and a preset weight matrix calculation formula; According to the weight matrix, construct a weight matrix similarity graph; Wherein, the intermediate matrix is obtained based on the texture feature vector set of the face image library to be identified and a preset data clustering algorithm, including: According to the texture feature vector set of the face image library to be identified, a sparse matrix is obtained based on a preset sparse subspace clustering algorithm; Wherein, the weight matrix is obtained according to the intermediate matrix and the preset weight matrix calculation formula, including: Obtaining the weight matrix according to the sparse matrix and a preset weight matrix calculation formula; The weight matrix is determined according to the following formula: W=|C|+|C| T ; Among them, W is the weight matrix and C is the sparse matrix.
2. The method according to claim 1, characterized in that Acquire a face image to be identified from a face image library to be identified, and divide the face image to be identified into at least two image blocks based on a preset image division rule, including: Acquire an unblocked face image to be recognized from the face image library to be recognized; The unblocked face image to be recognized is grid-divided to obtain m×n image blocks; wherein m×n>2.
3. The method according to claim 1, characterized in that The image block is a grid image block or a circular image block.
4. The method according to claim 1, characterized in that: According to a preset feature extraction algorithm, feature extraction is performed on the image block to obtain a texture feature vector set of the face image library to be identified, including: Obtaining local texture features of the image block according to a preset feature extraction algorithm; Obtaining a texture feature set of the face image to be identified according to the local texture features of the image block; A texture feature vector set of a library of face images to be identified is generated based on the texture feature set of the face images to be identified.
5. The method according to claim 4, characterized in that The preset feature extraction algorithm is the LBP algorithm.
6. The method according to claim 5, characterized in that According to a preset feature extraction algorithm, local texture features of the image block are obtained, including: Determining a basic LBP value of the image block according to a preset LBP algorithm; An LBP value of an equivalent mode among the basic LBP values is selected as a local texture feature of the image block.
7. The method according to claim 4, characterized in that After obtaining the texture feature set of the face image to be recognized according to the local texture features of the image block, the method further includes: It is determined whether there are unblocked face images to be identified in the face image library to be identified. If not, a texture feature vector set of the face image library to be identified is generated according to the texture feature set of the face image to be identified.
8. The method according to claim 7, characterized in that After determining whether there is an unblocked face image to be recognized in the face image library to be recognized, the method further includes: If there are unblocked human face images to be recognized in the human face image library to be recognized, the unblocked human face images to be recognized are divided into at least two image blocks, and a texture feature set of the unblocked human face images to be recognized is obtained.
9. The method according to claim 1, characterized in that: The preset image clustering algorithm is the K-means clustering algorithm.
10. A facial image recognition device, characterized in that: include: An image segmentation module is used to obtain a face image to be identified from a face image library to be identified, and to segment the face image to be identified into at least two image blocks based on a preset image segmentation rule; A texture feature extraction module, used to extract features from the image block according to a preset feature extraction algorithm to obtain a texture feature vector set of the face image library to be identified; A similarity map acquisition module is used to obtain a weight matrix similarity map based on a preset weight matrix determination algorithm according to the texture feature vector set of the face image library to be identified; An image recognition module, used for performing image clustering on the weight matrix similarity graph according to a preset image clustering algorithm, and determining a classification result of a face image to be recognized in a face image library to be recognized; Wherein, the similar graph obtaining module includes: An intermediate matrix obtaining unit, used to obtain an intermediate matrix based on a preset data clustering algorithm according to the texture feature vector set of the face image library to be identified; A weight matrix obtaining unit, used to obtain a weight matrix according to the intermediate matrix and a preset weight matrix calculation formula; A similarity graph construction unit, used for constructing a weight matrix similarity graph according to the weight matrix; Wherein, the intermediate matrix obtaining unit is specifically used for: According to the texture feature vector set of the face image library to be identified, a sparse matrix is obtained based on a preset sparse subspace clustering algorithm; Wherein, the weight matrix obtaining unit is specifically used for: Obtaining the weight matrix according to the sparse matrix and a preset weight matrix calculation formula; The weight matrix is determined according to the following formula: W=|C|+|C| T ; Among them, W is the weight matrix and C is the sparse matrix.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the facial image recognition method as described in any one of claims 1-9 is implemented.
12. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are used to execute the facial image recognition method as described in any one of claims 1 to 9 when executed by a computer processor.
Citation Information
Patent Citations
Face recognition method and equipment
CN103150561A
Face recognition method and device
CN107423690A