A method and system for authenticating off-campus personnel based on face recognition
Through methods of collecting, identifying key areas, generating significant map weighted fusion and adjusting contrast, the problem of traditional face recognition technology being inefficient in off-campus personnel identity authentication is solved, and efficient and accurate off-campus personnel recognition is achieved under multi-light conditions.
Patent Information
- Application Number
- CN202411253243.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2044-09-09
AI Technical Summary
Traditional facial recognition technology is inefficient in identity authentication for off-campus personnel and is easily affected by human factors, resulting in misjudgment or misjudgment, making it difficult to adapt to the identity authentication needs under various lighting conditions.
By collecting the original face images of the person to be verified, identifying the key face areas to generate masks, generating saliency maps and weighted fusion, adjusting image contrast, performing feature extraction and improving similarity calculations, to improve the accuracy and stability of face feature extraction.
It improves the efficiency and accuracy of off-campus personnel certification, can maintain consistency under various lighting conditions, and improves the robustness and accuracy of identification.
Smart Images

Figure CN119399806B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image recognition technology, and in particular to an off-campus personnel authentication method and system based on face recognition. Background Art
[0002] Facial recognition technology, as a biometric identification method, uses computer vision and machine learning algorithms to confirm individual identities by analyzing and identifying facial features in images. In recent years, with the development of deep learning and computer vision technologies, facial recognition technology has been widely used in security monitoring, identity verification, payment systems, and other fields.
[0003] In places like campuses, enterprises, and institutions, identity verification of non-campus personnel is crucial to ensure safety and maintain order. Traditional identity verification methods, such as manual ID verification, are not only inefficient but also susceptible to human error, leading to misjudgments or missed detections. Therefore, the use of automated facial recognition technology to verify non-campus personnel is a pressing issue. 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 address the deficiencies in the prior art. It can optimize key area identification, weighted fusion of saliency maps, contrast adjustment, and improved similarity calculation, thereby 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.
[0005] An embodiment of the present application provides a method for authenticating an off-campus person based on face recognition, the method comprising:
[0006] Collecting an original facial image of the person to be authenticated, identifying key facial areas in the original facial image, and generating a key area mask;
[0007] generating a saliency map of the original facial image, weighting the saliency map using the key region mask, and fusing the weighted saliency map with the original facial image to obtain a fused facial image;
[0008] Adjusting the contrast of different regions of the fused facial image to maintain image consistency under various lighting conditions;
[0009] Performing feature extraction on the adjusted fused facial 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 the authenticated persons;
[0010] Based on the improved similarity, it is determined whether the person to be authenticated is an off-campus person, so as to achieve authentication of the off-campus person.
[0011] Optionally, the weighting the saliency map by using the key region mask and fusing the weighted saliency map with the original face image to obtain a fused face image includes:
[0012] Combine the saliency map with the key region mask, set the pixel values of the non-key regions in the saliency map that do not overlap with the key region mask to 0, and retain the saliency map pixel values corresponding to the key regions 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 weighted fusion method is:
[0015] I_{fused}(x,y)=alpha·I(x,y)+beta·S(x,y)
[0016] Wherein, 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, S(x,y) is the pixel value of the coordinate (x,y) in the combined saliency map, and alpha and beta are corresponding weight coefficients.
[0017] Optionally, the weighted fusion method is:
[0018] I_{fused}(x,y)=S(x,y)·I(x,y)+(1-S(x,y))·I(x,y)
[0019] Wherein, 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 combined saliency map.
[0020] Optionally, the weighted fusion method is:
[0021] I_{fused}(x,y)=M(x,y)·S(x,y)+(1-M(x,y))·I(x,y)
[0022] 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, 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.
[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 average pixel value of the local area to be adjusted, I_{mean} is the average pixel value of the entire fused face image, and k is the enhancement factor.
[0027] Optionally, the improved similarity is calculated using the following improved similarity function:
[0028]
[0029] 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.
[0030] Another embodiment of the present application provides an off-campus personnel authentication system based on face recognition, the system comprising:
[0031] An acquisition module is used to acquire an original facial image of the person to be authenticated, identify key facial areas in the original facial image, and generate a key area mask;
[0032] a fusion module, configured to generate a saliency map of the original facial image, weight the saliency map using the key region mask, and fuse the weighted saliency map with the original facial image to obtain a fused facial image;
[0033] An adjustment module, configured to adjust the contrast of different regions of the fused facial image so that the image remains consistent under various lighting conditions;
[0034] a comparison module, configured to extract features from the adjusted fused facial 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 a modified similarity between the facial feature vector and the facial feature vectors of the authenticated persons;
[0035] The judgment module is used to judge whether the person to be authenticated is an off-campus person based on 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 run.
[0037] Yet another embodiment of the present application provides an electronic device, comprising 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 above methods.
[0038] Compared with the prior art, the present invention provides a non-school 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 from 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 a non-school person based on the improved similarity, thereby optimizing key area identification, saliency map weighted fusion, contrast adjustment, and improved similarity calculation, improving the accuracy and stability of facial feature extraction, and adapting to identity authentication needs under various lighting conditions, thereby effectively improving the efficiency and accuracy of non-school 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, and are not to 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.
[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 for 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) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) 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 will 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. For example, the computer terminal may also include Figure 1 More or fewer components than shown, or with Figure 1 Different configurations 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 facial 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, implementing the above-mentioned 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 located relative to the processor 102, and these remote memories can 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. A specific example of the aforementioned network may include a wireless network provided by a communications provider of a computer terminal. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may 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 a method for authenticating off-campus personnel based on face recognition, which may include the following steps:
[0048] S201, collecting an original facial image of a person to be authenticated, identifying key facial regions in the original facial image, and generating a key region mask;
[0049] This step is a key link in achieving face recognition accuracy. By collecting original images of the person to be authenticated and identifying 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 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. 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, this process makes face recognition more adaptable through flexible algorithm settings (such as dynamically adjusting thresholds), ensuring reliability in various situations.
[0053] - Forming a closed data loop: By timely collecting and processing user images, the system can continuously update its own database, improving the flexibility and intelligence of future similarity calculations. One implementation method may include:
[0054] Step 1: Face image acquisition
[0055] - Equipment Setup: Use a high-resolution camera equipped with dedicated lighting to ensure clear images under various lighting conditions. Also, adjust the camera's focal length to capture detailed facial features.
[0056] -Image collection: A screen is placed in front of the person to be authenticated and a video guiding facial image collection is played, instructing the user to display different expressions (such as smiling, looking straight ahead, side profile, etc.) to enhance image diversity.
[0057] - Standardization: Each acquired facial image is subjected to standardization, such as histogram equalization and noise filtering, to ensure stable image quality during subsequent processing. Geometric transformations are applied to normalize image size, ensuring consistent proportions across different users for easier 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] -Using professional facial key point detection algorithms (such as the 68-point annotation model), the system accurately identifies the locations of key facial features (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, where 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, a morphological dilation process is performed on the generated key region mask using an algorithm based on morphological operations to enhance the connectivity of the final mask and ensure that there are no breaks between key regions.
[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 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 overlaps with the key area mask, and set the pixel values of non-key areas to 0, ensuring that subsequent fusion processing only uses information from the key area.
[0070] Through these complex and meticulous steps, we can effectively capture the original facial image of the person being authenticated, identify key facial areas, and successfully generate a key area mask, providing a solid foundation for subsequent image processing and facial feature extraction. This method not only improves recognition efficiency and accuracy, but also lays the foundation for the system's adaptability in various environmental conditions.
[0071] S202, generating a saliency map of the original facial image, weighting the saliency map using the key region mask, and fusing the weighted saliency map with the original facial image to obtain a fused facial image;
[0072] The purpose of generating a saliency map is to extract key features from the original face image. By analyzing the local contrast and brightness distribution of the image, the regions that are crucial for face recognition are highlighted. This process can be divided into the following key steps:
[0073] -Image preprocessing: Convert the original face image into grayscale image to simplify subsequent processing.
[0074] - Local contrast calculation: Use the sliding window method to calculate the local contrast of each pixel and highlight 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 in uneven lighting conditions.
[0076] -Saliency map generation: Combining local contrast with global information to form a saliency map to highlight key feature areas.
[0077] - Feature highlighting: By extracting saliency 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, improving processing efficiency.
[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, while 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 characteristic regions in the face image that require special attention or processing. Through a pixel-by-pixel operation, the pixel values in the saliency map corresponding to the mask are retained, and the pixel values in other areas are set to 0. This process can be achieved by:
[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 and significance:
[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, 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 weightedly fused with the original facial image. This typically involves using a mathematical method (such as weighted averaging) to combine the data from the two images, highlighting key features in the fused image. This weighted fusion process ensures that key features are enhanced in the final image while preserving the detailed information of the original facial image, making the final fused image effective for subsequent face recognition tasks.
[0088] In the process of weighted fusion, a variety of methods can be used to adapt to different application requirements. 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: This method emphasizes the influence of the saliency map on the original image and is suitable for scenarios where specific features need to be highlighted. By setting higher values in the saliency map, its weight in the fused image is increased.
[0091] - Mask weight fusion method: Leveraging the variability of the key region mask, the degree of fusion between the saliency map and the original image is dynamically adjusted. In this way, different weights can be applied to different parts of the image according to actual needs, reflecting more refined feature attention.
[0092] -Diversified 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] - Enhanced system adaptability: This allows the overall system to maintain a keen grasp of facial features even in complex external environments, improving the robustness and accuracy of final recognition.
[0094] Through the detailed description and analysis of the above steps, it can be seen that each design step contributes to efficient and accurate face recognition. The combination of key region masks and saliency maps, followed by weighted fusion, ensures effective data processing, making the resulting facial images more distinctive and improving the system's performance in various application environments.
[0095] For example, a weighted fusion method may be:
[0096] I_{fused}(x,y)=alpha·I(x,y)+beta·S(x,y)
[0097] By using a linear combination approach, the original image and the saliency map complement each other during fusion, thereby improving the recognizability of image features. The weights can be adjusted based on the characteristics of the input image to meet the needs of different lighting and environments.
[0098] Wherein, 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, S(x,y) is the pixel value of the coordinate (x,y) in the combined saliency map, alpha and beta are corresponding weight coefficients, and alpha+beta=1.
[0099] By linearly combining the original facial image with the saliency map, features are enhanced, particularly emphasizing key areas. The weighting coefficients can be flexibly adjusted, allowing the system to adapt to different environments and needs. For example, in conditions of poor lighting or complex backgrounds, the weight of the saliency map can be increased to enhance feature extraction accuracy.
[0100] For example, a weighted fusion method may be:
[0101] I_{fused}(x,y)=S(x,y)·I(x,y)+(1-S(x,y))·I(x,y)
[0102] The saliency map determines how much original image information to retain, flexibly adapting to areas with important features in the image. The saliency map places greater emphasis on important feature areas, ensuring that details in these areas are not lost.
[0103] Where I_{fused}(x,y) is the pixel value at coordinate (x,y) in the fused face image, I(x,y) is the pixel value at coordinate (x,y) in the original face image, and S(x,y) is the pixel value at coordinate (x,y) in the combined saliency map. 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 more important the region is, and the more original image content is included in the final result.
[0104] This approach emphasizes the influence of the saliency map, especially in areas with high saliency map values, and preserves more original image details after fusion. This formula is essentially a linear weighting of the saliency map, used to balance the relationship between key features and the original image, thereby achieving a more natural and accurate fusion effect.
[0105] For example, a weighted fusion method may be:
[0106] I_{fused}(x,y)=M(x,y)·S(x,y)+(1-M(x,y))·I(x,y)
[0107] Dynamic masking makes the fusion process more adaptive, helping to more accurately enhance facial features against complex backgrounds. When processing complex scenes, it can effectively focus resources on important areas and reduce background interference.
[0108] Here, I_{fused}(x,y) is the pixel value at coordinate (x,y) in the fused face image, M(x,y) is the pixel value at coordinate (x,y) in the mask generated from the combined saliency map. The mask value determines the applicability of the saliency map in a specific area. The mask can clarify which areas require the saliency map's contribution, thereby improving the accuracy of the overall fusion. S(x,y) is the pixel value at coordinate (x,y) in the combined saliency map, and I(x,y) is the pixel value at coordinate (x,y) in the original face image.
[0109] This approach uses a dynamic mask to adjust the degree of fusion between the saliency map and the original image, allowing features in different regions to be appropriately emphasized or suppressed. This method increases the adaptability between the saliency map and the original image, making it particularly suitable for processing complex scenes.
[0110] By proposing various weighted fusion methods, the fusion effect of image features can be flexibly adjusted for different application scenarios, effectively improving the accuracy and robustness of face recognition. These designs not only focus on extracting key features in the image processing process, but also take into account the changing environments that may be encountered in actual applications, thus possessing high practical value.
[0111] S203, adjusting the contrast of different regions of the fused facial image to ensure that the image remains 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 exhibit 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 method 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: Lighting changes in different areas are monitored and adjusted in real time to ensure that the final image remains highly recognizable even under complex lighting conditions.
[0115] -Wide range of application scenarios: This method can effectively adapt to a variety of external environments, such as shadows and strong light, and improve the robustness and reliability of the system in practical applications.
[0116] Specifically, the contrast of different regions of the fused face image can be adjusted using the following formula:
[0117]
[0118] This formula introduces an enhancement factor, k, to adjust the degree of contrast enhancement based on specific application needs. Larger values of k enhance the effect, while smaller values reduce contrast adjustment, increasing flexibility. By combining local and global brightness information, the system can adapt to different scenarios, ensuring that the image's visual quality is not affected by extreme lighting conditions.
[0119] I_{enhanced}(x,y) is the pixel value at coordinate (x,y) in the adjusted fused facial 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 directly determines whether the contrast of that area needs to be enhanced. I_{mean} is the average pixel value of the entire fused facial image, which serves as a reference for global brightness and helps determine whether each local area needs enhancement. k is the enhancement factor that 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 vs. Global Comparison: By comparing the local average value of each pixel with the average value of the entire image, the local brightness change is calculated to determine whether enhancement is needed, ensuring that contrast is enhanced only when necessary.
[0122] 2. Dynamic adjustment using formula: Use formula to convert local differences into contrast adjustment factors, which in turn affect the final brightness value of each pixel.
[0123] -Improve image quality: By dynamically adjusting the contrast, 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, reducing false positives and missed positives.
[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 respond to various complex lighting conditions, thereby improving the accuracy and efficiency of face recognition.
[0127] S204, performing feature extraction on the adjusted fused facial 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 the authenticated persons;
[0128] The adjusted fused face image is subjected to feature extraction to obtain a facial feature vector, which is a 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.
[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 computational 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 using the following improved similarity function:
[0134]
[0135] Here, S_i is the modified similarity between the facial feature vector and the facial feature vector of the i-th 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. 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, and |R_i| is the modulus of R_i. |C| and |R_i| are used to normalize the similarity, eliminating the effects of dimension and ensuring the fairness and rationality of the similarity calculation. D(C, R_i) is the Euclidean distance between C and R_i. This distance measures the distance between two feature vectors in space; the smaller the distance, the greater the similarity. Sigma is a smoothing parameter used to adjust the sensitivity of the modified similarity function. By customizing this parameter, the sensitivity of the similarity calculation to distance can be controlled, enhancing the flexibility of the system.
[0136] Through the design of the above formula, the improved similarity function can effectively identify the similarity between 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 of various complex scenarios, ensuring the effective identification and management of non-campus personnel.
[0137] S205: judging whether the person to be authenticated is an off-campus person based on the improved similarity, so as to realize authentication of the off-campus person.
[0138] This step involves comparing the extracted facial feature vectors with the feature vectors of authenticated individuals in the database, and evaluating the degree of identity matching through a modified similarity function. Ultimately, based on the degree of similarity, the system can effectively determine the identity of the person to be authenticated, thereby achieving accurate authentication of non-school personnel.
[0139] 1. Identity Verification Accuracy: Through scientific similarity calculations, the accuracy of off-campus identification can be significantly 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 a feature perspective.
[0140] 2. System Security: Effectively determining the identity of individuals to be authenticated is crucial for ensuring the management and control of off-campus personnel. Highly accurate identity authentication can mitigate potential security risks and prevent unauthorized individuals 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 individuals stored in the database generally include both on-campus personnel and some off-campus authenticated individuals who have entered and exited the campus multiple times. A similarity threshold T can be set to determine the identity of the person being authenticated. This threshold can be customized based on the analysis 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, then the person is directly judged as an off-campus person (unauthenticated off-campus person).
[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 various changing conditions.
[0148] It can be seen that the original face image of the person to be authenticated is collected, 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, the facial feature vector is compared with the set of facial feature vectors of authenticated persons stored in the database, and the improved similarity is calculated; based on 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, saliency map weighted fusion, contrast adjustment and improved similarity calculation, improve the accuracy and stability of facial feature extraction, so as to adapt to the identity authentication needs under various lighting conditions, thereby effectively improving the efficiency and accuracy of off-campus 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 facial image of the person to be authenticated, identify key facial areas in the original facial image, and generate a key area mask;
[0151] a fusion module 302 for generating a saliency map of the original facial image, weighting the saliency map using the key region mask, and fusing the weighted saliency map with the original facial image to obtain a fused facial image;
[0152] An adjustment module 303 is configured to adjust the contrast of different regions of the fused facial image so that the image remains consistent under various lighting conditions;
[0153] a comparison module 304 for performing feature extraction on the adjusted fused facial 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 the authenticated persons;
[0154] The judgment module 305 is used to judge whether the person to be authenticated is an off-campus person based on 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, 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, the facial feature vector is compared with the set of facial feature vectors of authenticated persons stored in the database, and the improved similarity is calculated; based on 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, saliency map weighted fusion, contrast adjustment and improved similarity calculation, improve the accuracy and stability of facial feature extraction, so as to adapt to the identity authentication needs under various lighting conditions, thereby effectively improving the efficiency and accuracy of off-campus authentication.
[0156] An embodiment of the present invention further provides a storage medium storing a computer program, wherein the computer program is configured to execute the steps of any one of the above method embodiments when running.
[0157] Specifically, in this embodiment, the above-mentioned storage medium may be configured to store a computer program for performing the following steps:
[0158] S201, collecting an original facial image of a person to be authenticated, identifying key facial regions in the original facial image, and generating a key region mask;
[0159] S202, generating a saliency map of the original facial image, weighting the saliency map using the key region mask, and fusing the weighted saliency map with the original facial image to obtain a fused facial image;
[0160] S203, adjusting the contrast of different regions of the fused facial image to ensure that the image remains consistent under various lighting conditions;
[0161] S204, performing feature extraction on the adjusted fused facial 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 the authenticated persons;
[0162] S205: judging whether the person to be authenticated is an off-campus person based on 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, 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, the facial feature vector is compared with the set of facial feature vectors of authenticated persons stored in the database, and the improved similarity is calculated; based on 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, saliency map weighted fusion, contrast adjustment and improved similarity calculation, improve the accuracy and stability of facial feature extraction, so as to adapt to the identity authentication needs under various lighting conditions, thereby effectively improving the efficiency and accuracy of off-campus authentication.
[0164] An embodiment of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform 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 execute the following steps through a computer program:
[0167] S201, collecting an original facial image of a person to be authenticated, identifying key facial regions in the original facial image, and generating a key region mask;
[0168] S202, generating a saliency map of the original facial image, weighting the saliency map using the key region mask, and fusing the weighted saliency map with the original facial image to obtain a fused facial image;
[0169] S203, adjusting the contrast of different regions of the fused facial image to ensure that the image remains consistent under various lighting conditions;
[0170] S204, performing feature extraction on the adjusted fused facial 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 the authenticated persons;
[0171] S205: judging whether the person to be authenticated is an off-campus person based on 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, 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, the facial feature vector is compared with the set of facial feature vectors of authenticated persons stored in the database, and the improved similarity is calculated; based on 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, saliency map weighted fusion, contrast adjustment and improved similarity calculation, improve the accuracy and stability of facial feature extraction, so as to adapt to the identity authentication needs under various lighting conditions, thereby effectively improving the efficiency and accuracy of off-campus 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 scope of implementation of the present invention is not limited to what is shown in the drawings. Any changes made in accordance with the concept of the present invention, or modifications to equivalent embodiments with equivalent changes, which do not exceed the spirit covered by the description and drawings, should be within the scope of protection 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 facial image of the person to be authenticated, identifying key facial areas in the original facial image, and generating a key area mask; Generate a saliency map of the original facial image, weight the saliency map using the key region mask, and fuse the weighted saliency map with the original facial image to obtain a fused facial image; wherein the saliency map is combined with the key region mask, pixel values of non-key regions in the saliency map that do not overlap with the key region mask are set to 0, and pixel values of the saliency map corresponding to key regions with pixel values of 1 in the mask are retained; perform weighted fusion on the combined saliency map and the original facial image to obtain a fused facial image; the weighted fusion method is as follows: Among them, the is the coordinate in the fused face image The pixel value of is the coordinate in the original face image The pixel value of is the coordinate in the saliency map after combination The pixel value of is the coordinate in the mask generated by the combined saliency map Pixel value of Adjusting the contrast of different regions of the fused facial image to maintain image consistency under various lighting conditions; wherein the contrast of different regions of the fused facial image is adjusted using the following formula: Among them, the The coordinates of the adjusted fused face image The pixel value of is the average pixel value of the local area to be adjusted, is the average pixel value of the entire fused face image, and k is the enhancement factor; Perform feature extraction on the adjusted fused facial 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 a modified similarity between the facial feature vector and the facial feature vectors of the authenticated persons; wherein the modified similarity is calculated using the following modified similarity function: Among them, the is the improved similarity between the facial feature vector and the facial feature vector of the i-th authenticated person, is the facial feature vector, for The mold, is the facial feature vector of the i-th authenticated person, for The mold, for and The Euclidean distance, is a smoothing parameter to adjust the sensitivity of the improved similarity function; Based on the improved similarity, it is determined whether the person to be authenticated is an off-campus person, so as to achieve authentication of the off-campus person.
2. An off-campus personnel authentication system based on face recognition, characterized in that: The system comprises: An acquisition module is used to acquire an original facial image of the person to be authenticated, identify key facial areas in the original facial image, and generate a key area mask; A fusion module is configured to generate a saliency map of the original facial image, weight the saliency map using the key region mask, and fuse the weighted saliency map with the original facial image to obtain a fused facial image; wherein the saliency map is combined with the key region mask, pixel values of non-key regions in the saliency map that do not overlap with the key region mask are set to 0, and pixel values of the saliency map corresponding to key regions with pixel values of 1 in the mask are retained; the combined saliency map is weightedly fused with the original facial image to obtain a fused facial image; the weighted fusion method is as follows: Among them, the is the coordinate in the fused face image The pixel value of is the coordinate in the original face image The pixel value of is the coordinate in the saliency map after combination The pixel value of is the coordinate in the mask generated by the combined saliency map Pixel value of An adjustment module is configured to adjust the contrast of different regions of the fused facial image so that the image remains consistent under various lighting conditions. The following formula is used to adjust the contrast of different regions of the fused facial image: Among them, the The coordinates of the adjusted fused face image The pixel value of is the average pixel value of the local area to be adjusted, is the average pixel value of the entire fused face image, and k is the enhancement factor; A comparison module is configured to extract features from the adjusted fused facial 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 the authenticated persons; wherein the improved similarity is calculated using the following improved similarity function: Among them, the is the improved similarity between the facial feature vector and the facial feature vector of the i-th authenticated person, is the facial feature vector, for The mold, is the facial feature vector of the i-th authenticated person, for The mold, for and The Euclidean distance, is a smoothing parameter to adjust the sensitivity of the improved similarity function; The judgment module is used to judge whether the person to be authenticated is an off-campus person based on the improved similarity, so as to realize the authentication of the off-campus person.
3. 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 claim 1 when executed.
4. 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 claim 1 .
Citation Information
Patent Citations
Image processing method and device
CN108776970A
Object detection method and device and electronic equipment
CN113469976A
Intelligent campus access control system based on identity recognition
CN118172860A