Face recognition comparison method and system based on multi-source weighting strategy, and storage medium
By employing a multi-source weighting strategy, the inefficiency and isolated results of multi-reference source analysis in existing technologies are resolved. This approach enables efficient and scientific comprehensive scoring and integrated management, thereby improving the operational efficiency and accuracy of the face recognition comparison system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-11
- Publication Date
- 2026-03-10
AI Technical Summary
Existing face recognition comparison systems cannot effectively support joint analysis of multiple reference sources, lack weighted fusion computing capabilities, resulting in wasted computing resources and isolated results. They are also cumbersome and inefficient, and lack unified task management and report generation capabilities.
It adopts a multi-source weighting strategy, sets weights by specifying the main reference source and related reference sources, performs weighted calculations, generates a comprehensive similarity score, and provides integrated task management and report generation, including feature extraction, initial screening and multi-source weighted fusion, supporting multi-dimensional analysis.
It achieves scientific, multi-dimensional comprehensive scoring, improves computational efficiency, simplifies operation processes, reduces the risk of human error, provides full lifecycle task management and detailed reports, and enhances work efficiency.
Smart Images

Figure CN121640545A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a face recognition comparison method, system, and storage medium based on a multi-source weighting strategy, belonging to the fields of artificial intelligence and biometric recognition technology. Background Technology
[0002] Facial recognition technology, as an important component of biometric identification, has been widely applied in various fields such as security monitoring, identity authentication, and human-computer interaction. Existing facial recognition comparison systems typically employ a "one-to-one" or "one-to-many" comparison paradigm. Under this paradigm, the system calculates the similarity between a probe image to be compared and one or more Gallery images registered in a database, and returns the comparison result.
[0003] However, in complex real-world applications, especially in public safety and criminal investigation, investigators often prefer to utilize multiple related information sources for comprehensive judgment. For example, when searching for a missing person, investigators may have not only a photo of the missing person but also photos of their parents and siblings. Intuitively, candidates who resemble their parents are more likely to be the missing person.
[0004] Existing technical solutions have the following significant drawbacks when dealing with such needs: Existing systems typically do not support the simultaneous inclusion of multiple reference sources for joint analysis within a single task. Users must manually perform multiple independent alignment tasks: first, aligning the primary reference source with the target database, then aligning the father's photo with the target database, and finally aligning the mother's photo with the target database. This process is cumbersome, inefficient, and the results of each alignment are isolated from each other.
[0005] Different sources of reference have varying degrees of importance or probative value when determining similarity. For example, a photograph of a missing person should theoretically carry more weight than a photograph of their relatives. However, current technology lacks the ability to assign different weights to different sources and perform weighted fusion calculations. This results in the final judgment failing to accurately and scientifically reflect the value of evidence from different sources.
[0006] To achieve multi-source alignment, an intuitive but inefficient approach is to calculate and fuse the similarity of each image in the target database with all reference sources. When the target database is huge, the computational load of this "full-database multi-source alignment" is extremely large, requiring a significant amount of computing resources and time, making it difficult to meet the timeliness requirements of practical applications.
[0007] The results are isolated and difficult to analyze: after multiple manual comparisons, users obtain multiple discrete similarity lists. For comprehensive analysis, users need to manually record, summarize, calculate, and analyze these results using external tools. This process is not only tedious but also prone to errors and cannot automatically generate a unified, intuitive, and multi-dimensional comprehensive analysis report.
[0008] For complex analytical tasks that may require phased execution, existing tools lack a unified mechanism for task management, status tracking, and progress monitoring. Users find it difficult to effectively control, trace, and audit the entire lifecycle of analytical tasks.
[0009] Therefore, there is an urgent need in this field for a new face recognition comparison technology that can support weighted fusion of multiple reference sources, balance comparison efficiency and accuracy, and provide integrated task management and report generation capabilities. Summary of the Invention
[0010] To address the aforementioned technical problems, this invention provides a face recognition comparison method, system, and storage medium based on a multi-source weighting strategy. This allows for the simultaneous introduction of a primary reference source and multiple related reference sources in a single comparison task, enabling users to set differentiated weights for different reference sources and obtain a more scientific and reasonable comprehensive score through weighted calculation. It also automatically generates comprehensive reports containing multi-dimensional analysis data, providing comprehensive data support for professional decision-making; and offers a full lifecycle management mechanism for tasks, achieving integrated processing of parameter configuration, task scheduling, status monitoring, and result traceability.
[0011] The technical solution adopted by this invention to solve its technical problem is: A face recognition comparison method based on a multi-source weighted strategy, the specific steps of which include: S100. Configure the comparison task, the comparison task includes: specifying a primary reference source and at least one associated reference source, and assigning weights to the primary reference source and each of the associated reference sources; S200. Perform the coarse screening stage. Based on the main reference source, select the top K candidate images with the highest similarity from the target image library, where K is a positive integer. S300. Perform multi-source weighted fusion. For each of the K candidate images, calculate its similarity with the main reference source and each of the associated reference sources to obtain the original similarity set. S400. Based on the original similarity set and the weights corresponding to each reference source, a weighted calculation is performed to obtain the comprehensive similarity score of each candidate image.
[0012] Preferably, step S100 further includes: The weights are received by user input via a graphical user interface; Verify whether the sum of the weights of the primary reference source and all associated reference sources is 100%; The configuration information of the main reference source, associated reference sources and their corresponding weights is serialized into a structured data format and stored.
[0013] Preferably, step S200 further includes: Extract the facial feature vectors from the main reference source and all images in the target image library; Calculate the cosine of the angle between the feature vectors of the main reference source and the feature vectors of each image in the target image library; The images in the target image library are sorted in descending order based on the cosine value of the angle between the feature vectors, and the top K images are selected as the candidate images.
[0014] Preferably, in step S400, the specific calculation method for the comprehensive similarity score is as follows: Let the similarity between the candidate image and the main reference source be . , and the The similarity of the associated reference sources is The weight of the primary reference source is: , No. The weights of the associated reference sources are ,in , This represents the total number of associated reference sources; The comprehensive similarity score The calculation method is as follows: .
[0015] Preferably, after step S400, the method further includes: Step S500: Generate a comparison report, which includes at least task configuration information, a comprehensive similarity score for each candidate image, and the original scores of each candidate image and each reference source.
[0016] Preferably, the comparison report is a spreadsheet file containing multiple worksheets, which are used to present a task overview, reference source configuration, detailed score details, and summary statistics.
[0017] A face recognition comparison system based on a multi-source weighted strategy includes: The task configuration module is used to receive user configuration, which includes: specifying a primary reference source and at least one associated reference source, and assigning weights to each reference source; The feature extraction and initial screening module is used to select the top K candidate images with the highest similarity from the target image library based on the main reference source, where K is a positive integer; The multi-source weighted comparison module is used to calculate the similarity between each of the K candidate images and all reference sources to obtain the original similarity set, and to perform weighted calculation based on the weights to obtain the comprehensive similarity score of each candidate image. The results storage and report generation module is used to store the comprehensive similarity score and each original score in the database, and in response to user requests, generate an electronic spreadsheet report containing task configuration, detailed scores and summary statistics. The task scheduling and execution module is used to manage the lifecycle of multiple comparison tasks, which includes states such as pending execution, in execution, paused, completed, and failed; and is used to schedule task execution and respond to user pause, resume, and reset commands.
[0018] Preferably, the task configuration module is further used for: Provide user interaction through a graphical user interface; The total weight of all verified items is 100%; The task configuration information is serialized into JSON format and stored in the database.
[0019] Preferably, the feature extraction and initial screening module is further used for: Extract facial feature vectors using a pre-defined facial recognition model; An asynchronous concurrency mechanism is used to process images in the target image library in batches. The selection of the K candidate images is completed by calculating the cosine value of the angle between the feature vectors and sorting them.
[0020] A computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the method.
[0021] Compared with the prior art, the beneficial effects of the present invention are as follows: By introducing a multi-source weighted fusion model, the system can simulate the thought process of experts making comprehensive judgments, so that the final similarity score not only depends on the main reference source, but also scientifically incorporates the contributions of related reference sources, and distinguishes their importance through weights, making the results more in line with actual business logic. By employing a two-stage architecture of initial screening and multi-source weighted fine-tuning, the computationally intensive multi-source comparison is limited to a very small candidate set, avoiding complex calculations across the entire database. This allows the system to maintain a high response speed even when processing a database of millions of targets, achieving a perfect balance between accuracy and efficiency. The complex analysis process that originally required multiple manual operations and external tools has been integrated into a unified platform. Users only need to configure it once, and the system can automatically complete all the work from feature extraction and two-stage comparison to report generation, which greatly simplifies the operation, reduces the risk of human error, and improves work efficiency. A robust task management mechanism enables users to easily create, configure, execute, monitor, pause, resume, and rewind historical tasks. The persistent storage of task configurations and results facilitates auditing of the analysis process and reuse of experience. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0023] Figure 1 This is a flowchart of the face recognition comparison method of the present invention; Figure 2 This is a system block diagram of the face recognition comparison system of the present invention. Detailed Implementation
[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0025] Example 1, Please see Figure 1 The present invention provides a technical solution: like Figure 1 As shown, a face recognition comparison method based on a multi-source weighting strategy includes the following steps: S100. Configure the comparison task. The comparison task includes: specifying a primary reference source and at least one associated reference source, and assigning weights to the primary reference source and each associated reference source. S200. Perform the coarse screening stage. Based on the main reference source, select the top K candidate images with the highest similarity from the target image library, where K is a positive integer. S300. Perform multi-source weighted fusion. For each of the K candidate images, calculate its similarity with the main reference source and each associated reference source to obtain the original similarity set. S400. Based on the original similarity set and the weights corresponding to each reference source, a weighted calculation is performed to obtain the comprehensive similarity score of each candidate image.
[0026] Furthermore, step S100 further includes: The system receives user-inputted weights through a graphical user interface. Specifically, the input weights include metadata such as task name and task description. It also receives the weight percentages set by the user as the primary reference source through interface elements. ,generally This is set to the highest level, such as 50%-70%; user interface controls are provided to allow users to dynamically add one or more associated reference sources. For each associated reference source... It receives the identification information, uploads the corresponding image, and sets the weight percentage. ; Verify that the sum of the weights of the primary reference source and all associated reference sources is 100%, i.e., the constraint condition is satisfied. If the sum of the user inputs does not match, the system will prompt an error and require adjustment; it will receive the target image library path uploaded or specified by the user, and at the same time set the screening parameter K for the coarse screening stage, which is the number of candidate images to be pre-screened from the target library; The configuration information sequence of the main reference source, associated reference sources and their corresponding weights is assembled into a structured task configuration object. This object is serialized into a JSON string and stored together with the basic task information in a specific table of a relational database, thereby achieving traceability and reusability of task configuration.
[0027] Furthermore, the purpose of step S200 is to quickly filter out a small number of highly similar candidate targets from a massive target database using the main reference source, thereby significantly reducing the processing scope of the second stage. Specific steps further include: The face feature vectors of all images in the main reference source and the target image library are extracted. Specifically, the face detector in the open-source computer vision library is used to detect faces in all images in the main reference source and the target library and locate the face regions. Then, face alignment processing is performed. The face images are normalized to standard pose and size according to the face key points to eliminate the influence of pose and scale changes. This paper uses a pre-trained deep learning face recognition model to extract features from aligned face images. The model maps a face image to a vector in a high-dimensional feature space, namely the feature vector. This vector typically has 512 dimensions, which can compactly and discriminatively represent the identity information of a face; To improve feature extraction efficiency, especially when processing large-scale target libraries, asynchronous I / O and concurrent programming techniques are used to process images in the target library in parallel, which significantly accelerates the feature extraction process. Calculate the eigenvectors of the primary reference source The cosine of the angle between the feature vectors of each image in the target image library and the feature vectors of the primary reference source. Using it as a benchmark, the feature vectors of each image in the target database are calculated sequentially. The similarity between them, To determine the total number of target data points, in this embodiment, the cosine of the angle between feature vectors is preferably used as the metric, and its calculation formula is as follows: This value ranges from [-1, 1]. The closer the value is to 1, the more consistent the directions of the two vectors are, and the higher the similarity. After calculation, all target images are sorted in descending order based on their similarity scores with the main reference source.
[0028] Images in the target image library are sorted in descending order based on the cosine of the angle between feature vectors, and the top K images are selected as candidate images. During implementation, the top K images are selected from the sorted list according to a preset K value to form a preliminary candidate image set. At this point, the coarse screening stage is complete, and subsequent processing will be limited to this small candidate set.
[0029] Furthermore, step S300 performs a comprehensive and refined comparison of the initially selected K candidate images, incorporating weighted information. Specific steps include: For candidate image set Each image in Perform the following steps; Calculate candidate images Similarity to the primary and associated reference sources configured in the task, including: calculate Similarity to the main reference source , The similarity calculated in S200; For each associated reference source ,calculate Similarity to The calculation method also uses the cosine value of the angle between the eigenvectors, that is... ; For candidate images A set of original similarity values was obtained through calculation. ; Furthermore, step S400 specifically includes: Based on the weights set in the task configuration, the original scores are weighted and fused to obtain candidate images. The final overall similarity score The calculation formula is as follows: in, The weights of the primary reference sources. It is the first The weights of each associated source, and satisfying Overall similarity score It can comprehensively reflect the candidate image Overall similarity to the entire family of reference sources, taking into account the differences in importance of evidence from different sources; Candidate images The detailed comparison results are stored in the database. The stored information includes at least: image path, original similarity with the main reference source, etc. Original similarity with each associated source Weights of each reference source , and the final comprehensive similarity score. In this embodiment, a matching tag marked by the system or user may also be included.
[0030] Furthermore, step S500, which involves presenting the comparison results to the user in a clear and comprehensive manner, includes the following specific steps: When a user requests to view or export a report for a task, the system queries the database for all relevant result data for that task, including task configuration information and detailed scores for all candidate images. The data is organized into multiple structured data frames using a data processing library. In this embodiment, four data frames are constructed to store basic task information, reference source configuration, detailed score table, and summary statistics, respectively. Using a report generation library, write the above multiple data frames into different worksheets of the same spreadsheet file; The generated Excel file is provided to users for download or online preview. This report fully documents the entire process from task configuration, initial screening, detailed analysis to result summarization, providing solid data support for decision-making.
[0031] In one embodiment, the system and method described in this invention were applied in a practical operation by a local public security bureau to locate a missing person. Specifically: S100: Investigators create a mission titled "Find Zhang". A recent photo of the missing person, Zhang, was uploaded as the primary reference source, and its weight was assigned. ; Dynamically add two related reference sources: upload a photo of Mr. Zhang's father, weight... Mother's photo weight The total system verification weight is 100%. Specify the city's population database containing 500,000 facial images as the target image database, and set the filtering parameter K=1000; The system serializes the above configuration into a JSON string and stores it in the tasks table of the SQLite database.
[0032] S200: Using an integrated FaceNet model, face detection, alignment, and 512-dimensional feature vector extraction are performed on the main reference source and 500,000 target images. Feature extraction is completed quickly through asynchronous concurrent processing. Calculate the cosine of the angle between the feature vectors of the primary reference source and the feature vectors of 500,000 target vectors, and sort them in descending order of score. Select the top 1000 images with the highest scores to form a candidate set. .
[0033] S300: The system performs a fine comparison of 1000 candidate images. For each image in the candidate set : Calculate the similarity between it and a photo of Zhang's father. , Calculate the similarity between it and a photo of Zhang's mother. , S400: Applying the weighted formula: A comprehensive similarity score is obtained. .
[0034] Will Path , , Weights and Store in the table.
[0035] S500: After the comparison is complete, the investigator clicks "Export Report". The system queries the database for all results of the task; Use Pandas to create four DataFrames and write the four DataFrames into four Sheets of the file "Find Zhang's Analysis Report.xlsx"; Investigators opened the report and found that in the detailed scoring worksheet, the candidate ranked first, Li Moumou, had a much higher overall similarity score than the others. Combined with other information, they confirmed that Li Moumou was indeed the missing person, Zhang Mou.
[0036] Example 2, like Figure 2 As shown, a face recognition comparison system based on a multi-source weighted strategy includes: The task configuration module receives user configuration, which includes specifying a primary reference source and at least one associated reference source, and assigning weights to each reference source. Specifically, this module provides a graphical user interface to implement the functions described in S100, including a form for inputting task information, a file selector for uploading images, a slider or input box for setting weights, and interactive controls for dynamically adding / deleting associated sources. This module also includes a weight validator and a JSON serializer, and persists the configuration data to a database. The feature extraction and initial screening module is used to select the top K candidate images with the highest similarity from the target image library based on the main reference source, where K is a positive integer. Specifically, this module encapsulates the functions of the S200 stage. The feature extraction and initial screening module integrates models for face detection, alignment and feature extraction, and manages an asynchronous task executor for efficient batch processing of images. The feature extraction and initial screening module is also responsible for calculating the cosine value of the angle between feature vectors, sorting them and generating the Top-K candidate set. The multi-source weighted comparison module is used to calculate the similarity between each of the K candidate images and all reference sources to obtain the original similarity set, and to perform weighted calculation based on weights to obtain the comprehensive similarity score of each candidate image. The multi-source weighted comparison module receives the feature vectors of the candidate set and all reference sources, iterates through and calculates the similarity between each candidate and each reference source, and applies the weighted formula to calculate the final score. The logic of the multi-source weighted comparison module is the core algorithm engine of the system. The results storage and report generation module is used to store the comprehensive similarity score and each original score in the database, and in response to user requests, generate an electronic spreadsheet report containing task configuration, detailed scores and summary statistics. The task scheduling and execution module manages the lifecycle of multiple comparison tasks, including pending, executing, paused, completed, and failed states. It also schedules task execution and responds to user pause, resume, and reset commands. In this embodiment, the task scheduling and execution module maintains a task queue, uses background threads to execute tasks to avoid blocking the UI, listens for user control commands, manages task states through a state machine, updates progress information during task execution, and provides real-time feedback to the user interface through a signal mechanism.
[0037] Furthermore, the task configuration module is further used for: Provide user interaction through a graphical user interface; The total weight of all verified items is 100%; The task configuration information is serialized into JSON format and stored in the database.
[0038] Furthermore, the feature extraction and initial screening module is further used for: Extract facial feature vectors using a pre-defined facial recognition model; An asynchronous concurrency mechanism is used to process images in the target image library in batches. The selection of K candidate images is completed by calculating the cosine value of the angle between the feature vectors and sorting them.
[0039] Example 3, A computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements a face recognition comparison method based on a multi-source weighting strategy.
[0040] The workflow of this embodiment is as follows: Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A face recognition comparison method based on multi-source weighting strategy, characterized in that, The specific steps include: S100, configuring a comparison task, the comparison task including: specifying one main reference source and at least one associated reference source, and assigning a weight to the main reference source and each associated reference source; S200, performing a rough screening stage, screening K candidate images with top K similarity from a target image library based on the main reference source, K being a positive integer; S300, performing multi-source weighted fusion, for each of the K candidate images, respectively calculating the similarity of the candidate image with the main reference source and each associated reference source to obtain an original similarity set; S400, based on the original similarity set and the weight corresponding to each reference source, performing weighted calculation to obtain a comprehensive similarity score of each candidate image.
2. The face recognition comparison method based on multi-source weighting strategy according to claim 1, characterized in that, The step S100 further includes: receiving the weight input by a user through a graphical user interface; checking whether the sum of the weights of the main reference source and all associated reference sources is 100%; serializing the configuration information of the main reference source, associated reference sources and corresponding weights into a structured data format and storing. 3.The face recognition comparison method based on multi-source weighting strategy according to claim 1, characterized in that, The step S200 further includes: extracting the feature vector of the main reference source and all images in the target image library; calculating the cosine value of the feature vector intersection angle between the feature vector of the main reference source and the feature vector of each image in the target image library; descendingly sorting the images in the target image library according to the cosine value of the feature vector intersection angle, and selecting the top K images as the candidate images.
4. The face recognition comparison method based on multi-source weighting strategy according to claim 1, characterized in that, In the step S400, the specific calculation method of the comprehensive similarity score is: Let the similarity of the candidate image to the primary reference source be the similarity of the candidate image to the jth associated reference source be ; the weight of the primary reference source be ; the weight of the jth associated reference source be ; and the total number of associated reference sources be the integrated similarity score is calculated as follows: .
5. The face recognition comparison method based on multi-source weighting strategy according to any one of claims 1-4, characterized in that, After the step S400, further including: Step S500: generating a comparison report, the comparison report including at least task configuration information, a comprehensive similarity score of each candidate image, and an original score of each candidate image with each reference source.
6. The face recognition comparison method based on multi-source weighting strategy according to claim 5, characterized in that, The comparison report is an electronic spreadsheet file, which includes multiple worksheets for presenting task overview, reference source configuration, detailed score details and summary statistical information.
7. A face recognition comparison system based on multi-source weighting strategy, characterized in that, including: a task configuration module for receiving user configuration, the configuration including: specifying one main reference source and at least one associated reference source, and assigning a weight to each reference source; a feature extraction and preliminary screening module for screening K candidate images with top K similarity from a target image library based on the main reference source, K being a positive integer; a multi-source weighted comparison module for, for each of the K candidate images, respectively calculating the similarity of the candidate image with all reference sources to obtain an original similarity set, and based on the weight, performing weighted calculation to obtain a comprehensive similarity score of each candidate image; a result storage and report generation module for storing the comprehensive similarity score and each original score to a database, and in response to a user request, generating an electronic spreadsheet report including task configuration, detailed score and summary statistics; a task scheduling and execution module for managing the life cycle of multiple comparison tasks, the life cycle including to-be-executed, executing, paused, completed and failed states; and for scheduling task execution, and responding to user pause, resume and reset instructions.
8. The face recognition comparison system based on multi-source weighting strategy according to claim 7, characterized in that, The task configuration module is further used for: providing user interaction through a graphical user interface; checking that the sum of all weights is 100%; serializing the task configuration information into a JSON format and storing it into a database.
9. The face recognition comparison system based on multi-source weighting strategy according to claim 7, characterized in that, The feature extraction and preliminary screening module is further used for: extracting a face feature vector by using a preset face recognition model; batch processing images in a target image library by using an asynchronous concurrent mechanism; completing screening of the K candidate images by calculating cosine values of angles between feature vectors and sorting.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the method in any one of claims 1 to 6.
Citation Information
Patent Citations
Face retrieval method and apparatus as well as storage medium and device
CN108108499A
Similar face retrieval method and device and storage medium
CN109993102A
Lost person information matching method and device, electronic equipment and storage medium
CN118820505A
System and Method for Searching Missing Family Using Facial Information and Storage Medium of Executing The Program
KR1020160044858A
Relationship-based image feature matching method, device, and system
WO2017197826A1