Out-of-school personnel authentication method and system based on face recognition
Through the off-campus personnel authentication method based on facial recognition, the problem of inefficient and susceptible to human factors in the existing technology is solved, and high accuracy and high efficiency identity authentication is achieved.
Patent Information
- Application Number
- CN202411253243.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-09-09
AI Technical Summary
The prior art is inefficient in off-campus personnel certification and is susceptible to human factors, resulting in misjudgment or misjudgment.
Using the off-campus personnel authentication method based on face recognition, the improved similarity is calculated to determine the judgment by collecting original face images, identifying key face areas, generating saliency maps and weighting fusion, adjusting contrast, extracting facial feature vectors and comparing. Whether the certified personnel are off-campus personnel.
It improves the accuracy and stability of facial feature extraction, adapts to the identity authentication needs under various lighting conditions, and significantly improves the efficiency and accuracy of off-campus personnel certification.
Smart Images

Figure CN119399806A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image recognition, and in particular to an off-campus personnel authentication method and system based on face recognition. Background Art
[0002] As a biometric identification method, face recognition technology uses computer vision and machine learning algorithms to confirm individual identity by analyzing and identifying facial features in images. In recent years, with the development of deep learning and computer vision technology, face recognition technology has been widely used in security monitoring, identity authentication, payment systems and other fields.
[0003] In order to ensure safety and maintain order in campuses, enterprises and institutions, the identity authentication of non-campus personnel is particularly important. Traditional identity verification methods, such as manual verification of ID cards, are not only inefficient, but also easily affected by human factors, resulting in misjudgment or missed judgments. Therefore, non-campus personnel authentication based on automated face recognition technology is an urgent problem to be solved. Summary of the invention
[0004] The purpose of the present invention is to provide a method and system for off-campus personnel authentication based on face recognition to solve the deficiencies in the prior art, and to optimize key area recognition, weighted fusion of saliency maps, contrast adjustment and improved similarity calculation, so as to improve the accuracy and stability of face feature extraction, so as to adapt to the needs of identity authentication under various lighting conditions, thereby effectively improving the efficiency and accuracy of off-campus personnel authentication.
[0005] An embodiment of the present application provides an off-campus personnel authentication method based on face recognition, the method comprising:
[0006] Collecting an original face image of the person to be authenticated, identifying a key face area in the original face image, and generating a key area mask;
[0007] Generating a saliency map of the original face image, weighting the saliency map using the key area mask, and fusing the weighted saliency map with the original face image to obtain a fused face image;
[0008] Adjusting the contrast of different regions of the fused face image to make the image consistent under various lighting conditions;
[0009] Performing feature extraction on the adjusted fused face image to obtain a facial feature vector, comparing the facial feature vector with a set of facial feature vectors of authenticated persons stored in a database, and calculating an improved similarity between the facial feature vector and the facial feature vectors of authenticated persons;
[0010] According to the improved similarity, it is determined whether the person to be authenticated is an off-campus person, so as to realize the authentication of the off-campus person.
[0011] Optionally, the step of weighting the saliency map by using the key area mask and fusing the weighted saliency map with the original face image to obtain a fused face image comprises:
[0012] Combine the saliency map with the key area mask, set the pixel values of the non-key areas in the saliency map that do not overlap with the key area mask to 0, and retain the saliency map pixel values corresponding to the key areas with pixel values of 1 in the mask;
[0013] The combined saliency map is weightedly fused with the original face image to obtain a fused face image.
[0014] Optionally, the fusion mode of the weighted fusion is:
[0015] I_{fused}(x,y)=alpha·I(x,y)+beta·S(x,y)
[0016] Among them, the I_{fused}(x,y) is the pixel value of the coordinate (x,y) in the fused face image, the I(x,y) is the pixel value of the coordinate (x,y) in the original face image, the S(x,y) is the pixel value of the coordinate (x,y) in the combined saliency map, and the alpha and beta are corresponding weight coefficients.
[0017] Optionally, the fusion mode of the weighted fusion is:
[0018] I_{fused}(x,y)=S(x,y)·I(x,y)+(1-S(x,y))·I(x,y)
[0019] Among them, the I_{fused}(x,y) is the pixel value of the coordinate (x,y) in the fused face image, the I(x,y) is the pixel value of the coordinate (x,y) in the original face image, and the S(x,y) is the pixel value of the coordinate (x,y) in the combined saliency map.
[0020] Optionally, the fusion mode of the weighted fusion is:
[0021] I_{fused}(x,y)=M(x,y)·S(x,y)+(1-M(x,y))·I(x,y)
[0022] Wherein, the I_{fused}(x,y) is the pixel value of the coordinate (x,y) in the fused face image, the M(x,y) is the pixel value of the coordinate (x,y) in the mask generated by the combined saliency map, the S(x,y) is the pixel value of the coordinate (x,y) in the combined saliency map, and the I(x,y) is the pixel value of the coordinate (x,y) in the original face image.
[0023] Optionally, adjusting the contrast of different regions of the fused facial image includes:
[0024] The contrast of different regions of the fused face image is adjusted using the following formula:
[0025]
[0026] Among them, I_{enhanced}(x,y) is the pixel value of the coordinate (x,y) in the adjusted fused face image, I_{local}(x,y) is the pixel average of the local area to be adjusted, I_{mean} is the pixel average of the entire fused face image, and k is the enhancement factor.
[0027] Optionally, the improved similarity is calculated by the following improved similarity function:
[0028]
[0029] Among them, S_i is the improved similarity between the facial feature vector and the facial feature vector of the i-th authenticated person, C is the facial feature vector, |C| is the modulus of C, R_i is the facial feature vector of the i-th authenticated person, |R_i| is the modulus of r_i, D(C,R_i) is the Euclidean distance between C and R_i, and sigma is a smoothing parameter to adjust the sensitivity of the improved similarity function.
[0030] Another embodiment of the present application provides an off-campus personnel authentication system based on face recognition, the system comprising:
[0031] The acquisition module is used to acquire the original face image of the person to be authenticated, identify the key face area in the original face image, and generate a key area mask;
[0032] A fusion module, used for generating a saliency map of the original face image, weighting the saliency map using the key area mask, and fusing the weighted saliency map with the original face image to obtain a fused face image;
[0033] An adjustment module, used for adjusting the contrast of different regions of the fused face image so that the image remains consistent under various lighting conditions;
[0034] A comparison module is used to extract features from the adjusted fused face image to obtain a facial feature vector, compare the facial feature vector with a set of facial feature vectors of authenticated persons stored in a database, and calculate an improved similarity between the facial feature vector and the facial feature vectors of authenticated persons;
[0035] The judgment module is used to judge whether the person to be authenticated is an off-campus person according to the improved similarity, so as to realize the authentication of the off-campus person.
[0036] Yet another embodiment of the present application provides a storage medium, wherein the storage medium stores a computer program, wherein the computer program is configured to execute any of the above methods when running.
[0037] Yet another embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute any of the methods described above.
[0038] Compared with the prior art, the present invention provides an off-campus personnel authentication method based on face recognition, which collects the original face image of the person to be authenticated, identifies the key face area to generate a key area mask; generates a saliency map of the original face image, weights the saliency map using the key area mask, fuses the weighted saliency map with the original face image to obtain a fused face image; adjusts the contrast of different areas of the fused face image; extracts features of the adjusted fused face image to obtain a facial feature vector, compares the facial feature vector with a set of facial feature vectors of authenticated persons stored in a database, and calculates an improved similarity; determines whether the person to be authenticated is an off-campus person based on the improved similarity, thereby optimizing key area identification, saliency map weighted fusion, contrast adjustment, and improved similarity calculation, and improving the accuracy and stability of facial feature extraction to meet the needs of identity authentication under various lighting conditions, thereby effectively improving the efficiency and accuracy of off-campus personnel authentication. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A hardware structure block diagram of a computer terminal for an off-campus personnel authentication method based on face recognition provided by an embodiment of the present invention;
[0040] Figure 2 A flowchart of a method for authenticating off-campus personnel based on face recognition provided by an embodiment of the present invention;
[0041] Figure 3 A structural diagram of an off-campus personnel authentication system based on face recognition provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, but should not be construed as limiting the present invention.
[0043] The embodiment of the present invention first provides an off-campus personnel authentication method based on face recognition, which can be applied to electronic devices such as computer terminals, specifically ordinary computers, etc.
[0044] The following describes it in detail by taking running on a computer terminal as an example. Figure 1 The hardware structure block diagram of a computer terminal of an off-campus personnel authentication method based on face recognition provided by an embodiment of the present invention. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the computer terminal may also include a transmission device 106 for communication functions and an input and output device 108. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0045] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / modules corresponding to the off-campus personnel authentication method based on face recognition in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0046] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0047] See also Figure 2 The embodiment of the present invention provides an off-campus personnel authentication method based on face recognition, which may include the following steps:
[0048] S201, collecting an original face image of a person to be authenticated, identifying a key face area in the original face image, and generating a key area mask;
[0049] This step is the key to achieving face recognition accuracy. By collecting the original images of the person to be authenticated and identifying the key facial areas, the accuracy of subsequent processing (such as saliency map generation and feature extraction) can be effectively improved. The goal of this step is to extract important areas of the face (such as eyes, nose, mouth, etc.) and convert them into key area masks, thereby providing an important basis for subsequent image processing. Specifically, by collecting the original facial images of the person to be authenticated, it is possible to ensure that real and diverse facial images are obtained, which is particularly important for accurately capturing individual features. At the same time, the process of identifying key facial areas can effectively focus on the most recognizable parts of the face (such as eyes, nose, and mouth), thereby improving the efficiency and accuracy of subsequent processing. Role and significance:
[0050] - Improved accuracy: By focusing on key facial areas, it avoids interference from irrelevant background information in the image, thereby improving the accuracy of the entire face recognition system.
[0051] - Reduce computational burden: The generated key area mask simplifies the computational workload of subsequent image processing and feature extraction, reducing unnecessary processing time and consumption of computing resources.
[0052] - Enhanced algorithm adaptability: Under different lighting and environmental conditions, the process makes face recognition more adaptable through flexible algorithm settings (such as dynamically adjusting thresholds), ensuring reliability in various situations.
[0053] -Forming a data closed loop: By timely collecting and processing user images, the system can continuously update its own database and improve the flexibility and intelligence level of future similarity calculations. One implementation method may include:
[0054] Step 1: Face image collection
[0055] - Equipment setup: Use a high-resolution camera with dedicated lighting equipment to ensure clear images under different lighting conditions. At the same time, adjust the focal length parameters of the camera to capture the detailed features of the face.
[0056] -Image collection: Place a screen in front of the person to be authenticated and play a video to guide facial image collection, instructing the user to show different expressions (such as smiling, looking straight, side face, etc.) to enhance image diversity.
[0057] - Standardization: Standardization is performed on each acquired face image, such as histogram equalization and noise filtering, to ensure stable image quality during subsequent processing. Geometric transformation is applied to standardize the image size so that the face images of different users have consistent proportions for easy subsequent processing.
[0058] Step 2: Identify key facial areas
[0059] -Preliminary face detection: Use deep learning convolutional neural network (CNN) models, such as MTCNN, integrated HaarCascades and deep learning YOLO technology, to perform preliminary face detection and obtain the bounding box of the face.
[0060] -Key point positioning:
[0061] -Use professional facial key point detection algorithms (such as the 68-point annotation model) to accurately identify the locations of key facial feature points (such as the corners of the eyes, the tip of the nose, the corners of the mouth, etc.) within the detected face frame.
[0062] -Based on these feature points, the relative position and size of facial feature areas (such as eyes, mouth, nose, etc.) are automatically calculated.
[0063] - Critical Area Mask Generation:
[0064] -Based on the detected key points, a binary mask is constructed, in which the pixel values of the key area are set to 1, and the pixel values of the background and non-key areas are set to 0.
[0065] - Specifically, an algorithm based on morphological operations is used to perform morphological dilation on the generated key area mask to enhance the connectivity of the final mask and ensure that there are no breaks between key areas.
[0066] - Post-processing:
[0067] - Use edge detection algorithms (such as the Canny algorithm) to smooth the mask edges and optimize the final key area mask outline to make it more consistent with the actual facial feature shape.
[0068] Step 3: Combine the image and the mask
[0069] -Mask application: Overlap the generated key area mask with the original face image to be authenticated, retain the pixel values of the original image that overlap with the key area mask, and set the pixel values of the non-key area to 0, ensuring that subsequent fusion processing only uses the information of the key area.
[0070] Through the above complex and meticulous steps, it is possible to effectively collect the original face image of the person to be authenticated, identify the key face area, and successfully generate the key area mask, which provides a solid foundation for subsequent image processing and face feature extraction. The implementation of this method not only improves the recognition efficiency and accuracy, but also lays the foundation for the system's adaptability under various environmental conditions.
[0071] S202, generating a saliency map of the original face image, weighting the saliency map using the key area mask, and fusing the weighted saliency map with the original face image to obtain a fused face image;
[0072] The purpose of generating a saliency map is to extract key features from the original face image, and to highlight those areas that are critical to face recognition by analyzing the local contrast and brightness distribution of the image. This process can be divided into the following key steps:
[0073] -Image preprocessing: Convert the original face image into grayscale to simplify subsequent processing.
[0074] - Local contrast calculation: Use the sliding window method to calculate the local contrast of each pixel and highlight the areas with large brightness changes.
[0075] -Global information integration: Calculate the overall brightness of the image to form global information to reduce feature extraction errors under uneven lighting conditions.
[0076] -Saliency map generation: Combine local contrast with global information to form a saliency map to highlight key feature areas.
[0077] - Feature highlighting: By extracting salient information, important features in the face image (such as eyes, nose, and mouth) are made more obvious, improving the accuracy of the recognition process.
[0078] - Improved robustness: Enhanced adaptability to lighting changes and environmental interference, able to maintain good recognition results under different conditions.
[0079] - Reduce computational burden: By focusing on salient regions, the complexity of subsequent feature extraction steps is reduced and processing efficiency is improved.
[0080] Specifically, the saliency map can be combined with the key area mask, and the pixel values of the non-key areas in the saliency map that do not overlap with the key area mask are set to 0, and the pixel values of the saliency map corresponding to the key areas with pixel values of 1 in the mask are retained;
[0081] In this step, the previously generated saliency map is first combined with the key region mask. The saliency map provides the importance weights of each region in the original image, while the key region mask indicates the feature regions in the face image that need special attention or processing. Through pixel-by-pixel operations, the pixel values corresponding to the mask in the saliency map are retained, and the pixel values of other regions are set to 0. This process can be achieved in the following ways:
[0082] -Pixel-by-pixel check: traverse the saliency map and mask image, and for each pixel, check its value in the mask.
[0083] -Region screening: If the pixel value in the mask is 1, the value of the corresponding pixel in the saliency map is retained; if it is 0, the pixel value is set to 0. Function:
[0084] -Focus on important features: This operation concentrates computing resources on those feature areas that are considered important, reducing the interference of background noise and unnecessary features, thereby providing cleaner data for subsequent processing.
[0085] -Refined feature extraction: By retaining the key features in the saliency map, the subsequent processing stages can better utilize this information, effectively improving the accuracy and efficiency of face recognition.
[0086] The combined saliency map is weightedly fused with the original face image to obtain a fused face image.
[0087] In this step, the combined saliency map is weighted fused with the original face image. This usually involves using a mathematical method (such as weighted averaging, etc.) to combine the data of the two images so that the key features are highlighted in the fused image. This weighted fusion process ensures that the key features are enhanced in the final image while retaining the detail information of the original face image, so that the final fused image can effectively support subsequent face recognition tasks.
[0088] In the process of weighted fusion, multiple methods can be used to adapt to different application requirements. The specific weighted fusion methods mainly include the following:
[0089] -Linear combination method: The saliency map and the original image are combined through simple linear weighting. It is suitable for situations where there is a need for a more balanced feature fusion of the two images.
[0090] -Saliency-based fusion method: This method emphasizes the impact of the saliency map on the original image and is suitable for use in scenarios where specific features need to be highlighted. By setting a higher value in the saliency map, its weight in the fused image can be increased.
[0091] -Mask weight fusion method: With the help of the variability in the key area mask, the degree of fusion between the saliency map and the original image is dynamically adjusted. In this way, different degrees of weight can be applied to different parts of the image according to actual needs, reflecting more refined feature attention. Function and significance:
[0092] - Diverse processing options: Provides a variety of weighted fusion methods to ensure that the most appropriate fusion method can be selected according to different task requirements (such as feature extraction requirements, environmental changes, etc.), thereby achieving better recognition results.
[0093] - Enhance system adaptability: This allows the overall system to maintain a keen grasp of facial features in the face of complex external environments, thereby improving the robustness and accuracy of the final recognition.
[0094] Through the detailed description and function analysis of the above steps, it can be seen that the design of each step is to achieve efficient and accurate face recognition. The combination of key area mask and saliency map, and the subsequent weighted fusion, ensures the effective processing of data, making the final generated face image more characteristic, thereby improving the performance of the system in various application environments.
[0095] Exemplarily, a fusion method of weighted fusion may be:
[0096] I_{fused}(x,y)=alpha·I(x,y)+beta·S(x,y)
[0097] The linear combination method is adopted so that the original image and the saliency map can complement each other when fused, thereby improving the recognizability of image features. The weights can be adjusted according to different input image characteristics to meet the needs of different lighting and environments.
[0098] Among them, the I_{fused}(x,y) is the pixel value of the coordinate (x,y) in the fused face image, the I(x,y) is the pixel value of the coordinate (x,y) in the original face image, the S(x,y) is the pixel value of the coordinate (x,y) in the combined saliency map, the alpha and beta are corresponding weight coefficients, alpha+beta=1.
[0099] By linearly combining the original face image with the saliency map, the features are enhanced, especially the key areas. The weighting coefficients can be flexibly adjusted so that the system can adapt to different environments and needs. For example, in the case of poor lighting or complex background, the weight of the saliency map can be increased to enhance the accuracy of feature extraction.
[0100] Exemplarily, a fusion method of weighted fusion may be:
[0101] I_{fused}(x,y)=S(x,y)·I(x,y)+(1-S(x,y))·I(x,y)
[0102] The value of the saliency map determines the amount of original image information to be retained, and flexibly adapts to areas with important features in the image. The saliency map gives higher importance to important feature areas, ensuring that the details of these areas are not lost.
[0103] Among them, I_{fused}(x,y) is the pixel value of the coordinate (x,y) in the fused face image, I(x,y) is the pixel value of the coordinate (x,y) in the original face image, and S(x,y) is the pixel value of the coordinate (x,y) in the saliency map after combination. The pixel value of the saliency map determines the degree of original image information retained in the fusion. The closer the value is to 1, the higher the importance of the area, and the more content of the original image is in the final result.
[0104] This approach emphasizes the influence of the saliency map, especially in areas with high saliency map values, and more original image details are retained after fusion. This formula is essentially a linear weighting of the saliency map, which is used to balance the relationship between key features and the original image, thereby achieving a more natural and accurate fusion effect.
[0105] Exemplarily, a fusion method of weighted fusion may be:
[0106] I_{fused}(x,y)=M(x,y)·S(x,y)+(1-M(x,y))·I(x,y)
[0107] The dynamic mask makes the fusion process more adaptive, which helps to enhance facial features more accurately in complex backgrounds. When processing complex scenes, it can effectively focus resources on important areas and reduce interference with the background.
[0108] Wherein, I_{fused}(x,y) is the pixel value of the coordinate (x,y) in the fused face image, M(x,y) is the pixel value of the coordinate (x,y) in the mask generated by the combined saliency map, and the mask value determines the applicability of the saliency map in a specific area. Through the mask, it can be determined which areas need the contribution of the saliency map more, thereby improving the accuracy of the overall fusion. S(x,y) is the pixel value of the coordinate (x,y) in the combined saliency map, and I(x,y) is the pixel value of the coordinate (x,y) in the original face image.
[0109] This method uses a dynamic mask to adjust the degree of fusion between the saliency map and the original image, so that the features of different regions can be appropriately emphasized or suppressed at the right time. This method increases the adaptability between the saliency map and the original image, and is particularly suitable for processing complex scenes.
[0110] Through the proposed multiple weighted fusion methods, the fusion effect of image features can be flexibly adjusted for different application scenarios, thereby effectively improving the accuracy and robustness of face recognition. These designs not only focus on the extraction of key features in the image processing process, but also take into account the changing environments that may be encountered in actual applications, and have high practical value.
[0111] S203, adjusting the contrast of different regions of the fused face image to make the image consistent under various lighting conditions;
[0112] This step involves adjusting the contrast of different areas of the fused face image, aiming to maintain image consistency under various lighting conditions. Through this adjustment process, the system can dynamically identify and compensate for visual differences caused by changes in light. Specifically, different areas may show different brightness and contrast due to differences in lighting, which will affect the overall readability of the image and the clarity of facial features. By adjusting the contrast, the system can enhance the recognizability of important features in the image while reducing the interference caused by uneven lighting. This approach ensures that the quality of the fused face image can be optimized even in complex environments, thereby improving the accuracy and robustness of face recognition. Significance:
[0113] - Enhance image recognizability: By adjusting the contrast, you can emphasize important features in the image, improve the recognition of faces under different lighting conditions, and enhance the visual effect of the image.
[0114] - Strong adaptability: Light changes in different areas will be monitored and adjusted in real time to ensure that the final image is still well recognizable even under complex lighting conditions.
[0115] -Wide application scenarios: This method can effectively adapt to a variety of external environments, such as shadows, strong light, etc., and improve the robustness and reliability of the system in practical applications.
[0116] Specifically, the contrast of different regions of the fused face image may be adjusted using the following formula:
[0117]
[0118] The formula introduces an enhancement factor k, which allows the magnitude of contrast enhancement to be adjusted according to specific application requirements. A larger k value will enhance the effect, while a smaller k value will weaken the contrast adjustment and increase flexibility. By combining local and global brightness information, the system can adaptively adjust in different scenes to ensure that the visual effect of the image is not affected by extreme lighting.
[0119] Among them, I_{enhanced}(x,y) is the pixel value of the coordinate (x,y) in the adjusted fused face image, which directly affects the quality and recognizability of the final image. I_{local}(x,y) is the average pixel value of the local area to be adjusted. By comparing it with the global mean, it is directly determined whether the contrast of the area needs to be enhanced. I_{mean} is the average pixel value of the entire fused face image, which serves as a reference standard for global brightness and helps determine whether each local area needs to be enhanced. k is the enhancement factor, which controls the intensity and range of contrast adjustment. By adjusting this parameter, the visual effect of the final fused image can be significantly changed.
[0120] The purpose of this formula is to adjust the contrast of the image by enhancing the factor k and the difference between the local area and the average value of the whole image. This process is achieved through the following steps:
[0121] 1. Local and global comparison: By comparing the local area average value of each pixel with the average value of the entire image, the change in local brightness is calculated to determine whether enhancement is needed, thus ensuring that the contrast is enhanced only when necessary.
[0122] 2. Dynamic adjustment by formula: Use the formula to convert local differences into contrast adjustment factors, which in turn affect the final brightness value of each pixel. Function and significance:
[0123] -Improve image quality: By dynamically adjusting the contrast, the facial features in the fused image are made more prominent, improving image quality and enhancing user experience.
[0124] -Optimize algorithm performance: Through this local adjustment method, ensure that the algorithm can maintain efficient and accurate recognition performance in various situations, and reduce misjudgments and missed judgments.
[0125] - Enhance visual consistency: Ensure image consistency under different lighting conditions, ensuring that the face recognition system can improve accuracy and recognition speed.
[0126] Through such design and parameter setting, the adjustment process can not only effectively improve the quality of the image, but also flexibly cope with various complex lighting conditions and improve the accuracy and efficiency of face recognition.
[0127] S204, extracting features from the adjusted fused face image to obtain a facial feature vector, comparing the facial feature vector with a set of facial feature vectors of authenticated persons stored in a database, and calculating a modified similarity between the facial feature vector and the facial feature vectors of authenticated persons;
[0128] The adjusted fused face image is subjected to feature extraction to obtain the facial feature vector, which is the core step in the face recognition and authentication process. Through feature extraction, the system can extract recognizable and distinguishing facial features from the image. These features usually include information such as facial geometry, texture, and color. Function and significance:
[0129] 1. Recognition capability: By extracting facial feature vectors, the system can represent the facial information of the person to be authenticated in digital form, so that the target can be identified effectively in a high-dimensional feature space, thereby improving the accuracy of face recognition.
[0130] 2. Matching efficiency: The feature vector is a compressed representation of the facial image, which avoids the complexity of processing the entire image and improves the system's operational efficiency during matching.
[0131] 3. Anti-interference: In various environments (such as different light, angles, etc.), by extracting feature vectors, the influence of external factors can be effectively reduced and the robustness of recognition can be improved.
[0132] 4. Database comparison: By comparing the extracted facial feature vector with the set of facial feature vectors of authenticated persons stored in the database, the system can quickly identify and determine the identity of the person to be authenticated.
[0133] Specifically, the improved similarity can be calculated by the following improved similarity function:
[0134]
[0135] Wherein, the S_i is the improved similarity between the facial feature vector and the facial feature vector of the ith authenticated person. The higher the similarity, the closer the two are, and the more likely the identity of the person to be authenticated corresponds to the authenticated person. The C is the facial feature vector, the |C| is the modulus of C, the R_i is the facial feature vector of the ith authenticated person, the |R_i| is the modulus of R_i, and |C| and |R_i| are used to normalize the similarity, eliminate the influence of the dimension, and ensure the fairness and rationality of the similarity calculation. The D(C, R_i) is the Euclidean distance between C and R_i. This distance measures the distance between the two feature vectors in space. The smaller the distance, the more similar they are. The sigma is a smoothing parameter to adjust the sensitivity of the improved similarity function. By setting this parameter by yourself, you can control the sensitivity of the similarity calculation to the distance and enhance the flexibility of the system.
[0136] Through the design of the above formula, the improved similarity function can effectively identify the similarity of two facial feature vectors, ensuring the accuracy and reliability of the authentication process. This method not only improves the robustness of the algorithm, but also adapts to the authentication needs in a variety of complex scenarios, ensuring the effective identification and management of off-campus personnel.
[0137] S205: judging whether the person to be authenticated is an off-campus person according to the improved similarity, so as to realize authentication of the off-campus person.
[0138] This step is to compare the extracted facial feature vector with the feature vector set of authenticated persons in the database, and evaluate the degree of identity matching through a modified similarity function. Finally, based on the degree of similarity, the system can effectively determine the identity of the person to be authenticated, thereby achieving accurate authentication of off-campus personnel.
[0139] 1. Identity verification accuracy: Through the scientific calculation of similarity, the accuracy of off-campus personnel identification can be greatly improved. Even if there are certain changes or deviations in the appearance of the person to be authenticated and the authenticated person, the improved similarity function can effectively match them from the perspective of features.
[0140] 2. System security: Effectively determining the identity of the person to be authenticated is a key link in ensuring the management and control of off-campus personnel. Highly accurate identity authentication can reduce potential security risks and prevent unauthorized personnel from entering restricted areas.
[0141] 3. Operational efficiency: By improving the similarity calculation method, the system can complete identity matching in a short time, thereby improving the efficiency of the overall authentication process and enhancing the user experience.
[0142] Specifically, the authenticated personnel stored in the database generally include on-campus personnel and some off-campus authenticated personnel who have entered and exited the campus multiple times. A similarity threshold T can be set, which is used to determine the identity of the person to be authenticated. The setting method can be set by itself based on the analysis results of historical data.
[0143] Traverse all S_i and check whether there is any similarity S_i greater than the threshold T:
[0144] - If S_i is greater than T, it means that the identity of the person to be authenticated matches that of the authenticated person, and is determined to be an authenticated person. Based on the specific identity of the authenticated person, it is determined whether the person is an authenticated off-campus person;
[0145] -If all S_i are less than or equal to T, they are directly judged as off-campus personnel (unauthenticated off-campus personnel).
[0146] Based on the final judgment result, the system outputs the authentication result and performs subsequent actions such as permission control or alarm triggering.
[0147] Through the above implementation, the off-campus personnel authentication method of the present invention can effectively achieve high-accuracy and high-efficiency identity judgment, and maintain good robustness under a variety of changing conditions.
[0148] It can be seen that the original face image of the person to be authenticated is collected, and the key face area is identified to generate a key area mask; the saliency map of the original face image is generated, the saliency map is weighted using the key area mask, and the weighted saliency map is fused with the original face image to obtain a fused face image; the contrast of different areas of the fused face image is adjusted; the features of the adjusted fused face image are extracted to obtain a facial feature vector, and the facial feature vector is compared with the set of facial feature vectors of authenticated persons stored in the database to calculate the improved similarity; according to the improved similarity, it is determined whether the person to be authenticated is an off-campus person, so as to optimize the key area identification, weighted fusion of the saliency map, contrast adjustment and improved similarity calculation, and improve the accuracy and stability of facial feature extraction to meet the needs of identity authentication under various lighting conditions, thereby effectively improving the efficiency and accuracy of off-campus person authentication.
[0149] Another embodiment of the present invention provides an off-campus personnel authentication system based on face recognition, see Figure 3 , the system may include:
[0150] The acquisition module 301 is used to acquire an original face image of the person to be authenticated, identify key face areas in the original face image, and generate a key area mask;
[0151] A fusion module 302 is used to generate a saliency map of the original face image, weight the saliency map using the key area mask, and fuse the weighted saliency map with the original face image to obtain a fused face image;
[0152] An adjustment module 303, used for adjusting the contrast of different regions of the fused face image so that the image remains consistent under various lighting conditions;
[0153] A comparison module 304 is used to extract features from the adjusted fused face image to obtain a facial feature vector, compare the facial feature vector with a set of facial feature vectors of authenticated persons stored in a database, and calculate an improved similarity between the facial feature vector and the facial feature vectors of authenticated persons;
[0154] The judgment module 305 is used to judge whether the person to be authenticated is an off-campus person according to the improved similarity, so as to realize the authentication of the off-campus person.
[0155] It can be seen that the original face image of the person to be authenticated is collected, and the key face area is identified to generate a key area mask; the saliency map of the original face image is generated, the saliency map is weighted using the key area mask, and the weighted saliency map is fused with the original face image to obtain a fused face image; the contrast of different areas of the fused face image is adjusted; the features of the adjusted fused face image are extracted to obtain a facial feature vector, and the facial feature vector is compared with the set of facial feature vectors of authenticated persons stored in the database to calculate the improved similarity; according to the improved similarity, it is determined whether the person to be authenticated is an off-campus person, so as to optimize the key area identification, weighted fusion of the saliency map, contrast adjustment and improved similarity calculation, and improve the accuracy and stability of facial feature extraction to meet the needs of identity authentication under various lighting conditions, thereby effectively improving the efficiency and accuracy of off-campus person authentication.
[0156] An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0157] Specifically, in this embodiment, the above storage medium may be configured to store a computer program for performing the following steps:
[0158] S201, collecting an original face image of a person to be authenticated, identifying a key face area in the original face image, and generating a key area mask;
[0159] S202, generating a saliency map of the original face image, weighting the saliency map using the key area mask, and fusing the weighted saliency map with the original face image to obtain a fused face image;
[0160] S203, adjusting the contrast of different regions of the fused face image to make the image consistent under various lighting conditions;
[0161] S204, extracting features from the adjusted fused face image to obtain a facial feature vector, comparing the facial feature vector with a set of facial feature vectors of authenticated persons stored in a database, and calculating a modified similarity between the facial feature vector and the facial feature vectors of authenticated persons;
[0162] S205: judging whether the person to be authenticated is an off-campus person according to the improved similarity, so as to realize authentication of the off-campus person.
[0163] It can be seen that the original face image of the person to be authenticated is collected, and the key face area is identified to generate a key area mask; the saliency map of the original face image is generated, the saliency map is weighted using the key area mask, and the weighted saliency map is fused with the original face image to obtain a fused face image; the contrast of different areas of the fused face image is adjusted; the features of the adjusted fused face image are extracted to obtain a facial feature vector, and the facial feature vector is compared with the set of facial feature vectors of authenticated persons stored in the database to calculate the improved similarity; according to the improved similarity, it is determined whether the person to be authenticated is an off-campus person, so as to optimize the key area identification, weighted fusion of the saliency map, contrast adjustment and improved similarity calculation, and improve the accuracy and stability of facial feature extraction to meet the needs of identity authentication under various lighting conditions, thereby effectively improving the efficiency and accuracy of off-campus person authentication.
[0164] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0165] Specifically, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0166] Specifically, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0167] S201, collecting an original face image of a person to be authenticated, identifying a key face area in the original face image, and generating a key area mask;
[0168] S202, generating a saliency map of the original face image, weighting the saliency map using the key area mask, and fusing the weighted saliency map with the original face image to obtain a fused face image;
[0169] S203, adjusting the contrast of different regions of the fused face image to make the image consistent under various lighting conditions;
[0170] S204, extracting features from the adjusted fused face image to obtain a facial feature vector, comparing the facial feature vector with a set of facial feature vectors of authenticated persons stored in a database, and calculating a modified similarity between the facial feature vector and the facial feature vectors of authenticated persons;
[0171] S205: judging whether the person to be authenticated is an off-campus person according to the improved similarity, so as to realize authentication of the off-campus person.
[0172] It can be seen that the original face image of the person to be authenticated is collected, and the key face area is identified to generate a key area mask; the saliency map of the original face image is generated, the saliency map is weighted using the key area mask, and the weighted saliency map is fused with the original face image to obtain a fused face image; the contrast of different areas of the fused face image is adjusted; the features of the adjusted fused face image are extracted to obtain a facial feature vector, and the facial feature vector is compared with the set of facial feature vectors of authenticated persons stored in the database to calculate the improved similarity; according to the improved similarity, it is determined whether the person to be authenticated is an off-campus person, so as to optimize the key area identification, weighted fusion of the saliency map, contrast adjustment and improved similarity calculation, and improve the accuracy and stability of facial feature extraction to meet the needs of identity authentication under various lighting conditions, thereby effectively improving the efficiency and accuracy of off-campus person authentication.
[0173] The above describes in detail the structure, features and effects of the present invention based on the embodiments shown in the drawings. The above is only a preferred embodiment of the present invention, but the present invention is not limited to the scope of implementation shown in the drawings. Any changes made according to the concept of the present invention, or modifications to equivalent embodiments with equivalent changes, which still do not exceed the spirit covered by the description and drawings, should be within the protection scope of the present invention.
Claims
1. A method for authenticating off-campus personnel based on face recognition, characterized in that: The method comprises: Collecting an original face image of the person to be authenticated, identifying a key face area in the original face image, and generating a key area mask; Generating a saliency map of the original face image, weighting the saliency map using the key area mask, and fusing the weighted saliency map with the original face image to obtain a fused face image; Adjusting the contrast of different regions of the fused face image to make the image consistent under various lighting conditions; Performing feature extraction on the adjusted fused face image to obtain a facial feature vector, comparing the facial feature vector with a set of facial feature vectors of authenticated persons stored in a database, and calculating an improved similarity between the facial feature vector and the facial feature vectors of authenticated persons; According to the improved similarity, it is determined whether the person to be authenticated is an off-campus person, so as to realize the authentication of the off-campus person.
2. The method according to claim 1, characterized in that The step of weighting the saliency map by using the key area mask and fusing the weighted saliency map with the original face image to obtain a fused face image comprises: Combine the saliency map with the key area mask, set the pixel values of the non-key areas in the saliency map that do not overlap with the key area mask to 0, and retain the saliency map pixel values corresponding to the key areas with pixel values of 1 in the mask; The combined saliency map is weightedly fused with the original face image to obtain a fused face image.
3. The method according to claim 2, characterized in that The fusion mode of the weighted fusion is: I_{fused}(x,y)=alpha·I(x,y)+beta·S(x,y); Among them, the I_{fused}(x,y) is the pixel value of the coordinate (x,y) in the fused face image, the I(x,y) is the pixel value of the coordinate (x,y) in the original face image, the S(x,y) is the pixel value of the coordinate (x,y) in the combined saliency map, and the alpha and beta are corresponding weight coefficients.
4. The method according to claim 2, characterized in that: The fusion mode of the weighted fusion is: I_{fused}(x,y)=S(x,y)·I(x,y)+(1-S(x,y))·I(x,y); Among them, the I_{fused}(x,y) is the pixel value of the coordinate (x,y) in the fused face image, the I(x,y) is the pixel value of the coordinate (x,y) in the original face image, and the S(x,y) is the pixel value of the coordinate (x,y) in the combined saliency map.
5. The method according to claim 2, characterized in that: The fusion mode of the weighted fusion is: I_{fused}(x,y)=M(x,y)·S(x,y)+(1-M(x,y))·I(x,y); Wherein, the I_{fused}(x,y) is the pixel value of the coordinate (x,y) in the fused face image, the M(x,y) is the pixel value of the coordinate (x,y) in the mask generated by the combined saliency map, the S(x,y) is the pixel value of the coordinate (x,y) in the combined saliency map, and the I(x,y) is the pixel value of the coordinate (x,y) in the original face image.
6. The method according to any one of claims 3 to 5, characterized in that: The adjusting the contrast of different regions of the fused face image includes: The contrast of different regions of the fused face image is adjusted using the following formula: Among them, I_{enhanced}(x,y) is the pixel value of the coordinate (x,y) in the adjusted fused face image, I_{local}(x,y) is the pixel average of the local area to be adjusted, I_{mean} is the pixel average of the entire fused face image, and k is the enhancement factor.
7. The method according to claim 6, characterized in that The improved similarity is calculated by the following improved similarity function: Wherein, S_i is the improved similarity between the facial feature vector and the facial feature vector of the i-th authenticated person, C is the facial feature vector, |C| is the modulus of C, R_i is the facial feature vector of the i-th authenticated person, |R_i| is the modulus of R_i, D(C,R_i) is the Euclidean distance between C and R_i, and sigma is a smoothing parameter to adjust the sensitivity of the improved similarity function.
8. An off-campus personnel authentication system based on face recognition, characterized in that: The system comprises: The acquisition module is used to acquire the original face image of the person to be authenticated, identify the key face area in the original face image, and generate a key area mask; A fusion module, used for generating a saliency map of the original face image, weighting the saliency map using the key area mask, and fusing the weighted saliency map with the original face image to obtain a fused face image; An adjustment module, used for adjusting the contrast of different regions of the fused face image so that the image remains consistent under various lighting conditions; A comparison module is used to extract features from the adjusted fused face image to obtain a facial feature vector, compare the facial feature vector with a set of facial feature vectors of authenticated persons stored in a database, and calculate an improved similarity between the facial feature vector and the facial feature vectors of authenticated persons; The judgment module is used to judge whether the person to be authenticated is an off-campus person according to the improved similarity, so as to realize the authentication of the off-campus person.
9. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 7 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Double camera-based intelligent human face identification method and system
CN106845328A
Image processing method and device
CN108776970A
Unsupervised learning scene feature rapid extraction method fusing semantic information
CN111242027A
Underwater image splicing method based on multi-scale image fusion and SIFT features
CN111260543A
Method and device for updating face features based on face recognition and computer equipment
CN111931718A
