Face model training method, device, computer equipment, and storage medium

By obtaining sample data uploaded manually and reported by the device, adjusting the learning rate and optimizing the face recognition model, the problem of low update efficiency of the face recognition model in fixed scenarios is solved, and the recognition accuracy and applicability are improved.

CN116884064BActive Publication Date: 2025-10-03CHINA TELECOM CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310821435.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-05
Publication Date
2025-10-03
Estimated Expiration
2043-07-05

AI Technical Summary

Technical Problem

In the existing technology, the updating efficiency of face recognition models in fixed scenarios is low, resulting in low recognition accuracy, and it is difficult to adapt to the recognition needs of specific scenarios by modifying the general model.

Method used

By obtaining manually uploaded sample data and device-reported sample data, adjusting the learning rate, and training the face recognition model in a targeted manner, the model training is optimized by utilizing the relationship between the data volume of different data sources to improve the applicability of the model.

Benefits of technology

It improves the applicability and accuracy of face recognition models in specific scenarios, reduces human resource waste, and improves the efficiency and accuracy of model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116884064B_ABST
    Figure CN116884064B_ABST
Patent Text Reader

Abstract

This application relates to a facial model training method, apparatus, computer device, storage medium, and computer program product. The method comprises: in response to a model training task for a target location, obtaining a sample dataset and a facial recognition model; performing model training on the facial recognition model based on the sample dataset to obtain a trained facial recognition model; and deploying the trained facial recognition model to various facial recognition devices. This method can improve the accuracy of facial recognition in fixed scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a face model training method, apparatus, computer equipment, storage medium, and computer program product. Background Art

[0002] With the development of artificial intelligence technology, face recognition technology has emerged and is often used in identity recognition.

[0003] In traditional technologies, the application scenarios of facial recognition technology are often relatively fixed places, such as communities, schools, companies, etc. Facial recognition technology trains a general model to obtain a recognition model that conforms to the corresponding scenario, and then uses the trained recognition model to identify the identity of people in the scenario.

[0004] However, when current face recognition technology is applied in relatively fixed scenarios, it is difficult to obtain a suitable recognition model by modifying the general model when an individual case of misidentification occurs. The model update efficiency is low, which leads to low accuracy of face recognition in this fixed scenario. Summary of the Invention

[0005] Based on this, it is necessary to provide a face model training method, device, computer equipment, computer-readable storage medium and computer program product that can fix the face recognition accuracy in a fixed scene to address the above technical problems.

[0006] In a first aspect, the present application provides a face model training method for a model training device. The method comprises:

[0007] In response to a model training task for a target location, a sample data set and a face recognition model are obtained; the model training task is used to train the face recognition model on each face recognition device deployed in the target location; the sample data set includes manually uploaded sample data and device-reported sample data; the manually uploaded sample data is obtained by annotating face data that the face recognition model fails to recognize; the device-reported sample data is face data that the face recognition model successfully recognizes and that has a preset difference with the corresponding face background data;

[0008] Performing model training processing on the face recognition model according to the sample data set to obtain a trained face recognition model;

[0009] Deploy the trained face recognition model to each of the face recognition devices.

[0010] In one embodiment, the sample data set also includes an original data set, where the original data set is a data set used for the previous training of the face recognition model. The performing model training processing on the face recognition model based on the sample data set includes:

[0011] Training the face recognition model at a preset basic learning rate based on the original data set and the sample data reported by the device;

[0012] Adjusting the basic learning rate based on the data volume relationship between the original data set and the manually uploaded sample data to obtain a target learning rate;

[0013] The face recognition model is trained at the target learning rate according to the manually uploaded sample data.

[0014] In one embodiment, adjusting the basic learning rate based on the data volume relationship between the original data set and the manually uploaded sample data to obtain the target learning rate includes:

[0015] Obtaining a manual upload scaling factor according to the data volume of the original data set and the data volume of the manually uploaded sample data; the manual upload scaling factor includes a ratio of the data volume of the manually uploaded sample data to the data volume of the sample data set;

[0016] Calculating the difference between the basic learning rate and the preset peak learning rate to obtain a learning rate difference;

[0017] Merging the learning rate difference with the manual upload scaling factor to obtain a learning rate increment;

[0018] The learning rate increment is weighted with the base learning rate to obtain the target learning rate.

[0019] In one embodiment, obtaining a sample data set and a face recognition model includes:

[0020] Obtaining a device identifier of the face recognition device;

[0021] According to the device identifier, query and obtain a group identifier corresponding to the face recognition device;

[0022] According to the group identifier, the original data set and the face recognition model corresponding to the group identifier are obtained by querying.

[0023] In one embodiment, the method further comprises:

[0024] Get the current time;

[0025] If the time interval between the current time and the last model training time is greater than a preset training cycle threshold, the model training task for the target location is triggered.

[0026] In one embodiment, deploying the trained face recognition model to each of the face recognition devices includes:

[0027] Performing an index analysis on the trained face recognition model based on the sample data set to obtain a model index; the model index includes at least any one of the following: detection rate, false detection rate, missed detection rate, and detection speed;

[0028] If the model indicator meets the preset indicator threshold range, deploying the trained face recognition model to each of the face recognition devices;

[0029] If the model indicator does not meet the indicator threshold range, the face recognition model corresponding to the model indicator is retrained.

[0030] In a second aspect, the present application provides a face model training method for a face recognition device. The method comprises:

[0031] Using the pre-deployed face recognition model, determine the similarity between the collected face data and the face database data;

[0032] If the facial feature similarity is greater than a preset first threshold, it is determined that the facial recognition model has successfully identified the person;

[0033] When the face recognition model successfully recognizes the face and the face feature value is less than a preset second threshold, the face data is uploaded to the model training device as device-reported sample data, so that the model training device executes the face model training method as described in any one of the first aspects above; the first threshold is less than the second threshold.

[0034] In a third aspect, the present application further provides a face model training device for a model training device. The device comprises:

[0035] A data set and model acquisition module is configured to acquire a sample data set and a face recognition model in response to a model training task for a target location; the model training task is configured to train the face recognition model on each face recognition device deployed at the target location; the sample data set includes manually uploaded sample data and device-reported sample data; the manually uploaded sample data is obtained by annotating face data that the face recognition model fails to recognize; the device-reported sample data is face data that the face recognition model successfully recognizes and that has a preset difference from the corresponding face background data;

[0036] A model training module is used to perform model training processing on the face recognition model according to the sample data set to obtain a trained face recognition model;

[0037] The model deployment module is used to deploy the trained face recognition model to each face recognition device.

[0038] In a fourth aspect, the present application further provides a face model training device for a face recognition device. The device comprises:

[0039] A similarity determination module is used to determine the similarity of facial features between the collected facial data and the facial database data using a pre-deployed facial recognition model;

[0040] A first judgment module is used to determine that the face recognition model has successfully recognized the person if the similarity of the facial features is greater than a preset first threshold;

[0041] The second judgment module is used to upload the facial data as device-reported sample data to the model training device when the facial recognition model successfully recognizes and the facial feature value is less than a preset second threshold, so that the model training device executes the facial model training method as described in any one of the above-mentioned first aspects; the first threshold is less than the second threshold.

[0042] In a fifth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements: the steps of the method described in any one of the first aspects above; or the steps of the method described in any one of the second aspects above.

[0043] In a sixth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements: the steps of the method described in any one of the first aspects above; or the steps of the method described in any one of the second aspects above.

[0044] In a seventh aspect, the present application further provides a computer program product, comprising a computer program that, when executed by a processor, implements: the steps of the method described in any one of the first aspects above; or the steps of the method described in any one of the second aspects above.

[0045] The above-mentioned face model training method, device, computer equipment, storage medium and computer program product train the model by obtaining manually uploaded sample data and device-reported sample data from different data sources, and deploy the trained face recognition model on the face recognition device for face recognition. The manually uploaded sample data and device-reported sample data are precisely the data that are difficult to recognize in the target scene. These data sets are used to train the face recognition model, thereby achieving adjustment of the face recognition model, improving the applicability of the face recognition model to the target scene, and thus improving the accuracy of face recognition in the fixed scene. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 A diagram showing an application environment of a face model training method according to an embodiment;

[0047] Figure 2 A diagram showing an application environment of a face model training method in another embodiment;

[0048] Figure 3 1 is a flow chart of a face model training method according to an embodiment;

[0049] Figure 4 Schematic diagram of the process of step S320 in one embodiment;

[0050] Figure 5 Schematic diagram of the process of step S420 in one embodiment;

[0051] Figure 6 Schematic diagram of the process of step S310 in one embodiment;

[0052] Figure 7 Schematic diagram of a flow chart of a face model training method in another embodiment;

[0053] Figure 8 Schematic diagram of the process of step S330 in one embodiment;

[0054] Figure 9 1 is a flow chart of a face model training method according to another embodiment;

[0055] Figure 10 is a structural block diagram of a face model training device in one embodiment;

[0056] Figure 11 is a structural block diagram of a face model training device in another embodiment;

[0057] Figure 12 is a diagram of the internal structure of a computer device in one embodiment;

[0058] Figure 13FIG. 4 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0060] The face model training method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown.

[0061] Figure 1 The illustrated application environment includes a facial recognition device 110 and a model training device 120, which are communicatively connected to each other. The facial recognition device 110 may be, but is not limited to, a front-end camera with integrated image recognition capabilities, and there is at least one facial recognition device 110. The model training device 120 may be implemented using a standalone server or a server cluster consisting of multiple servers.

[0062] In one embodiment, the face recognition device 110 is used to collect and recognize face data, and is also used to upload face data to the model training device 120; the model training device 120 is used to train the face recognition model deployed in the face recognition device 110, and is also used to deploy the trained model on the face recognition device 110.

[0063] The face model training method provided in the embodiment of the present application can also be applied to Figure 2 In the application environment shown.

[0064] Figure 2 The illustrated application environment includes a facial recognition device 110 and a model training device 120, which are in communication with each other. Model training device 120 also includes a management platform 121 and a training platform 122. Facial recognition device 110 may be, but is not limited to, a front-end camera with integrated image recognition capabilities. There is at least one facial recognition device 110. Management platform 121 and training platform 122 may be implemented using a standalone server or a server cluster consisting of multiple servers.

[0065] In one embodiment, the face recognition device 110 is used to collect and identify face data, and is also used to upload face data to the model training device 120; the management platform 121 can be but is not limited to being deployed on a CPU server, and is used to manage and aggregate data for at least one face recognition device at the front end, and is used for data interaction between the training platform 122 and the face recognition device; the training platform 122 can be but is not limited to being deployed on a GPU server, and is used to train the face recognition model deployed in the face recognition device 110, and is also used to deploy the trained model on the face recognition device 110.

[0066] In one embodiment, Figure 3 As shown, a face model training method is provided, which is applied to Figure 1 The model training device 120 in FIG. 1 is used as an example to illustrate the method, which includes the following steps:

[0067] S310, in response to a model training task for a target location, obtaining a sample data set and a face recognition model;

[0068] Among them, the model training task is used to train the face recognition models on each face recognition device deployed in the target place; the target place is a place with relatively fixed personnel, and the target place can be but is not limited to a community, school, and company. The characteristic of the target place is that when individual cases of incorrect recognition occur during the face recognition process, it is difficult to obtain a suitable model by modifying the general model, that is, it is difficult to find a recognition model that meets all scenarios.

[0069] Specifically, the face recognition model is deployed on each face recognition device in the target location, and each face recognition device is used to collect face images and perform identity authentication on people in the target location.

[0070] Specifically, the sample data set includes manually uploaded sample data and device-reported sample data; among them, the manually uploaded sample data is obtained by marking the face data that the face recognition model fails to recognize; the device-reported sample data is the face data that the face recognition model successfully recognizes and has a preset difference with the corresponding face background data. The device-reported sample data represents the face data that reaches a certain threshold during the face recognition process but has a preset difference from the optimal threshold.

[0071] Among them, the role of the annotation in the manually uploaded sample data is to use the annotation to distinguish the manually uploaded sample data from the device-reported sample data, so that in the subsequent model training stage, different learning rates can be set for data from different sources, thereby achieving different effects on the trained model.

[0072] Specifically, manually uploaded sample data may include but is not limited to false detection data and missed detection data. The reporting method of manually uploaded sample data is: users can use the interface provided by the APP, mini program, and web platform to authenticate the relationship between user and device to realize the reporting of manually uploaded sample data.

[0073] Exemplarily, after the model training task for the target location is released, the model training device responds to the task to obtain data related to the model training, namely, a sample data set face recognition model, wherein the face recognition model is the model currently deployed in the face recognition device, and the sample data set is used to train the face recognition model.

[0074] S320, performing model training processing on the face recognition model according to the sample data set to obtain a trained face recognition model;

[0075] Among them, the sample data set can be divided into original data set, manually uploaded sample data and device reported sample data according to the data source, and can be divided into training set and test set according to the data function.

[0076] For example, since there are differences in the data sources of sample data sets, the differences between different data sets can be used to adjust the training methods of different data sets for the model, so that the model can be trained in a targeted manner, thereby improving the applicability of the face recognition model to the target scene; specifically, the learning rate of model training can be adjusted according to the data volume of data sets from different sources, thereby increasing the model's attention to certain data sets, thereby improving the recognition success rate of certain types of data in the target scene.

[0077] S330: Deploy the trained face recognition model to each face recognition device.

[0078] For example, the face recognition model can be deployed in the following two ways, but is not limited to:

[0079] (1) Figure 1 As shown, the model training device directly deploys the trained face recognition model on the face recognition device; specifically, the model training device sends the trained model parameters to the face recognition device through the communication network, and the face recognition device adjusts the original model according to the model parameters, and uses the adjusted face recognition model for subsequent face recognition.

[0080] (2) Figure 2As shown, the training platform passes the model parameters after training to the management platform, and then the management platform deploys the trained face recognition model on the face recognition device; specifically, the training platform passes the model parameters after training to the management platform, and the management platform sends them to the face recognition device through the communication network. The face recognition device adjusts the original model according to the model parameters, and uses the adjusted face recognition model for subsequent face recognition.

[0081] Among them, the above-mentioned deployment method (1) is characterized by direct deployment and rapid response, and can realize model deployment relatively quickly; the deployment method (2) is characterized by separating the model training and model deployment functions, and accordingly, the management platform and the training platform can be deployed in different servers. For example, the training platform is deployed on the GPU server and the management platform is deployed on the CPU server, that is, servers with different processing capabilities are provided according to different functional requirements to improve the system operation efficiency, and at the same time, it is convenient for the management platform to centrally manage the front-end face recognition equipment.

[0082] In the above-mentioned face model training method, the model is trained by obtaining manually uploaded sample data and device-reported sample data from different data sources, and the trained face recognition model is deployed on the face recognition device for face recognition. The manually uploaded sample data and device-reported sample data are precisely the data that are difficult to recognize in the target scene. These data sets are used to train the face recognition model, thereby adjusting the face recognition model and improving the applicability of the face recognition model to the target scene, thereby improving the accuracy of face recognition in the fixed scene.

[0083] In one embodiment, Figure 4 As shown, Figure 3 The S320 also includes:

[0084] S410, training the face recognition model at a preset basic learning rate based on the original data set and the sample data reported by the device;

[0085] Among them, the original data is a data set in the sample data set. The original data set is the data set used for the previous training of the face recognition model, that is, the data set used to train the face recognition model deployed before the current model training; the sample data reported by the device is the face data that is successfully recognized by the face recognition model and has preset differences with the corresponding face background data; the basic learning rate is the fixed learning rate set by the user for the model training process.

[0086] Exemplarily, the present application may set learning rates for data sets from different data sources. In this embodiment, both the original data set and the sample data reported by the device are trained on the model at a basic learning rate.

[0087] S420, adjusting the basic learning rate based on the data volume relationship between the original data set and the manually uploaded sample data to obtain a target learning rate;

[0088] Among them, the manually uploaded sample data is the facial data obtained by marking the facial data that was misidentified by the facial recognition model; the data volume can be but is not limited to the number of units of facial data. For example, the unit of facial image data is sheets. When 100 facial images are manually uploaded this time, the data volume of the manually uploaded sample data is 100 sheets.

[0089] Exemplarily, the learning rate is adjusted based on the data volume relationship between the original data set and the manually uploaded sample data. Specifically, the learning rate is adjusted based on the ratio of the manually uploaded sample data to the data set. That is, the larger the ratio, the larger the target learning rate.

[0090] S430: Training the face recognition model at a target learning rate based on the manually uploaded sample data.

[0091] The target learning rate is the learning rate obtained after adjustment in step 420 .

[0092] For example, when performing model training, the learning rate of the manually uploaded sample data is set as the target learning rate, thereby specifically changing the degree of dependence of the trained model on the manually uploaded sample data.

[0093] In this embodiment, by setting the learning rate of the original data set and the sample data reported by the device as the basic learning rate, and setting the learning rate of the manually uploaded sample data as the target learning rate, different learning rates are provided for data sets from different data sources. The target learning rate is related to the data volume relationship between the original data set and the manually uploaded sample data. In this way, different learning rates can be set for different data sets according to their importance in the target scene, so that the trained model is more suitable for the target scene, thereby improving the success rate of face recognition in the target scene.

[0094] In one embodiment, Figure 5 As shown, Figure 4 The S420 also includes:

[0095] S510, obtaining a manual upload scaling factor based on the data volume of the original data set and the data volume of the manually uploaded sample data;

[0096] The manual upload scaling factor may be, but is not limited to, the ratio of the amount of manually uploaded sample data to the amount of sample data set.

[0097] For example, if the sample data set for this training only includes the original data set, the sample data reported by the device, and the manually uploaded sample data, the data volume of the original data set is a, the sample data reported by the device is b, and the data volume of the manually uploaded sample data is n, then the data volume of the sample data set N=a+b+n, and at this time, the manual upload scaling factor is n / N.

[0098] S520, calculating the difference between the basic learning rate and the preset peak learning rate to obtain a learning rate difference;

[0099] The peak learning rate is the maximum learning rate for model training, and the learning rate difference is used to combine with the manual upload scale factor to calculate the learning rate increment;

[0100] For example, if the base learning rate is A and the peak learning rate is B, the learning rate difference may be, but is not limited to, BA.

[0101] S530, fusing the learning rate difference with the manual upload scale factor to obtain a learning rate increment;

[0102] Specifically, the learning rate increment is used to adjust the base learning rate to obtain the target learning rate;

[0103] For example, if the manual upload scaling factor is n / N and the learning rate difference is BA, the learning rate increment may be, but is not limited to, (BA)*(n / N).

[0104] S540: Weight the learning rate increment and the basic learning rate to obtain a target learning rate.

[0105] For example, if the learning rate increment is (BA)*(n / N), the target learning rate may be, but is not limited to, (BA)*(n / N)+A.

[0106] In this embodiment, the data volume of the entire sample data set is obtained by the data volume of different types of data sets in the sample data set, and then the manual upload scaling factor is obtained, and the manual upload scaling factor is integrated with the learning rate difference, and then weighted with the basic learning rate, so as to achieve the purpose of adjusting the basic learning rate by using the data volume of data sets from different sources in the sample data set. Since the manual upload scaling factor is a positive value, the target learning rate is greater than the basic learning rate, which improves the learning rate corresponding to the manually uploaded sample data, and can enhance the influence of false detection data and missed detection data in the manually uploaded sample data on the model, thereby making the trained model more suitable for the target scene and improving the accuracy of face recognition in the target scene.

[0107] In one embodiment, Figure 6 As shown, Figure 3 The S310 also includes:

[0108] S610, obtaining a device identifier of a face recognition device;

[0109] Among them, the face recognition device includes a front-end camera integrated with image recognition function, and the device identification is the device ID of the face recognition device, which is used to mark the identity of the face recognition device.

[0110] For example, when the model training device executes the model training task for the target scene, it needs to retrieve data related to the face recognition device, and the basis for data retrieval includes the device identification of the face recognition device.

[0111] S620, querying and obtaining a group identifier corresponding to the face recognition device based on the device identifier;

[0112] Among them, the number of face recognition devices can be at least two, and each face recognition is divided into different groups according to the area where it is located, and the sign of group division is the group identifier.

[0113] For example, if the unit of regional division is a cell, the face recognition devices in different cells have different group identifiers, and the group identifier can be used to query the corresponding database to obtain data matching the group identifier.

[0114] S630: According to the group identifier, query and obtain the original data set and face recognition model corresponding to the group identifier.

[0115] Among them, the face recognition model is the model currently deployed on each face recognition device at the target location, and the original data set is the data set used for the last training of the face recognition model.

[0116] Exemplarily, the group identifier is used to query the corresponding database to obtain the original data set and face recognition model corresponding to the group identifier, that is, the latest version of the data set and model is obtained through the query.

[0117] In this embodiment, a query is performed based on the device ID and group ID of the face recognition device to obtain the matching original data set and face recognition model, thus achieving the collection of the required data, which is then used in the subsequent model training and deployment process.

[0118] In one embodiment, Figure 7 As shown, the face model training method of the present application also includes the following steps:

[0119] S710, obtaining the current time;

[0120] The current time refers to the current system time, which is used to determine whether the time limit of the model training cycle is met, and further used to determine whether to trigger the corresponding model training task.

[0121] S720: If the time interval between the current time and the last model training time is greater than a preset training cycle threshold, a model training task for the target location is triggered.

[0122] The training cycle threshold is the maximum time period for model training set by the system.

[0123] For example, if the time interval between the current time and the last model training time is greater than the training cycle threshold, the system will automatically trigger the model training task for the target location to update the face recognition model.

[0124] It should be noted that the triggering method of the model training task also includes: if the user of the model training device has the need to perform model training immediately, the model training device can be controlled to publish the training task to complete the update of the model.

[0125] In this embodiment, by configuring two different triggering methods for the model training process, namely, different periodic triggering and device active triggering, flexibility in triggering the training task can be achieved, allowing users to adopt different training task triggering strategies according to their own needs.

[0126] In one embodiment, Figure 8 As shown, Figure 3 The S330 also includes:

[0127] S810, performing an index analysis on the trained face recognition model based on the sample data set to obtain model indicators;

[0128] Model indicators include at least one of the following: detection rate, false detection rate, missed detection rate, and detection speed;

[0129] For example, the detection rate can be but is not limited to being verified using a training set to ensure that the new model achieves a high detection rate for identifying people in the target scene; the false detection rate can be but is not limited to being verified using a test set to ensure that the new model does not have an excessively high false detection rate for identifying ordinary people.

[0130] S820: If the model indicator meets the preset indicator threshold range, deploy the trained face recognition model to each face recognition device;

[0131] For example, if after the indicator analysis of S810, the model indicators show that the corresponding indicators for the people in the target scene have reached the indicator threshold range, you can choose to further increase the basic threshold, thereby improving the accuracy of face recognition while reducing false detections.

[0132] S830: If the model indicator does not meet the indicator threshold range, retrain the face recognition model corresponding to the model indicator.

[0133] For example, when the corresponding indicators of the trained model do not meet the requirements of the preset indicator threshold range, the model is retrained to ensure the quality of the model.

[0134] In current face recognition technology, in order to ensure the detection pass rate, the general model will not set the score threshold too high. In this embodiment, the application is applied for targeted learning of people in the target scene, so that the corresponding indicators are improved to a certain extent after each model training, and then the accuracy of face recognition is improved by raising the basic threshold.

[0135] In one embodiment, Figure 9 As shown, a face model training method is provided, which is applied to Figure 1 Taking the face recognition device 110 in FIG. 1 as an example, the following steps are included:

[0136] S910, using a pre-deployed face recognition model, determining the similarity of facial features between the collected face data and the face database data;

[0137] For example, the collected facial data is the facial image that needs to be recognized, and the facial database data is the facial data stored in the database. The similarity of the facial features of the two is used to determine whether the facial recognition process is successful or not.

[0138] S920, if the facial feature similarity is greater than a preset first threshold, determining that the facial recognition model has successfully performed the recognition;

[0139] Exemplarily, the first threshold is a facial feature similarity threshold set by the system for determining whether face recognition is successful or not.

[0140] S930: If the face recognition model successfully recognizes the person and the facial feature value is less than a preset second threshold, uploading the facial data as device-reported sample data to the model training device, so that the model training device executes any one of the face model training methods for the model training device;

[0141] Exemplarily, the second threshold is a facial feature similarity threshold set by the system for determining whether to upload the facial data as device-reported sample data to the model training device. Specifically, the first threshold is smaller than the second threshold.

[0142] In the above-mentioned face model training method, the face feature similarity between the face data and the face database data is obtained, and the face feature similarity is judged. When it is greater than a preset first threshold, it is determined that the face recognition model has successfully recognized the face. When it is greater than the preset first threshold and less than a preset second threshold, the face data is uploaded to the model training device as device-reported sample data, thereby realizing the update of the data set, and the updated data set can be used for subsequent model training processes, thereby improving the applicability of the face recognition model to the target scene, and then improving the accuracy of face recognition in the fixed scene.

[0143] Without changing the deep learning model, this application optimizes the training set and collects facial data in a fixed scene to generate a data set with the characteristics of the fixed scene. That is, sample data is manually uploaded and sample data is reported by the device. Based on the automatic training of the general recognition model, the current model is corrected to obtain a special recognition model. Under the premise of meeting the general recognition threshold, higher recognition accuracy is achieved for the data of this fixed scene. At the same time, the automatic collection and reporting of facial data and the training triggering process all reflect the automation of model iteration, avoiding the waste of human resources in model training in the target scene and improving the efficiency of model training.

[0144] The following describes the face model training method in detail using a specific embodiment. It is worth noting that the following description is only for illustrative purposes and is not intended to limit the application.

[0145] It should be noted that, in this embodiment, the target scene is a community, the face recognition device is a face recognition camera in the community, multiple cameras in the community belong to the same group, and the group identifier is the community ID.

[0146] Because the number of people who have the right to enter and exit the same community is relatively fixed, and there are multiple cameras in the community, when the model of the community is automatically iterated, it can be updated to multiple cameras in the community at the same time to achieve synchronous update of face recognition, so the community ID is required for regional division.

[0147] When the camera performs daily recognition work, it will extract the features of the facial data and compare them with the facial features of the facial database data. When the similarity of the facial features reaches the first threshold, the facial database data with the highest similarity is selected, and the system considers that the facial data belongs to the residents of the community.

[0148] If the facial feature similarity reaches the first threshold but there is a difference with the second threshold, the model needs to be updated to avoid misidentification, and the facial data and its corresponding user ID, device ID, group ID and other information are uploaded to the model training platform as a cumulative data set, and the data is marked as device-reported sample data.

[0149] Community equipment managers can also use pre-processing tools to manually label the false detections, missed detections, and new personnel found in daily life and upload them to the data training device, add them to the accumulated data set, and mark the data as manually uploaded sample data.

[0150] After receiving the two types of data, the model training device will query the group ID based on the device ID and store it. The model training device will trigger the model training task periodically or actively request the triggering of the model training task based on user needs.

[0151] After the model training task is triggered, the most recent face recognition model and original data set are queried based on the group identifier, the device reports the sample data and the manually uploaded sample data, and the newly added data is merged into the most recent training set.

[0152] When testing the model, manually uploaded sample data is used as the focus data for testing. For example, if a user uploads five photos of the same person from different angles, four of them can be used for training and one for testing. The automatically trained iterative model needs to achieve a 100% detection rate for the labeled manually uploaded sample data. Among the manually uploaded sample data, historically labeled data and newly uploaded labeled data have the same high priority.

[0153] The model training device retrains the most recent model belonging to the device group based on the merged training set. During the training process, a dynamic learning rate is used along with the training set labels in a batch to adjust the impact of the batch data on the model parameters.

[0154] Specifically, the basic learning rate is A, and the peak learning rate is B. When the sample data set contains N data, and a batch of training data contains n manually uploaded sample data, the learning rate this time is (BA)*(n / N)+A, thereby increasing the impact of false positives and missed positives reported by users on the model.

[0155] Assume that the model has an accuracy of 99% for the sample data set, but the recognition effect is poor for 1% of the people in the target community. In this case, the device reports sample data and fine-tunes the model at a learning rate A, making the model pay more attention to the user data in this community. At the same time, the learning rate of the manually uploaded sample data is increased to shift the model distribution, making it pay more attention to the user data in this community, so that the user data in this community falls into the 99% easily identifiable data area.

[0156] The parameters of the face recognition model have the following characteristics during the update process: new parameters = previous parameters - learning rate * error derivative. A larger learning rate will cause the new parameters to deviate further from the previous parameters and deviate from the original local optimal value point. As the learning rate slowly decreases with each iteration, the training stabilizes and reaches a new local optimal value point, thereby increasing the attention to user data in the community.

[0157] After a certain number of rounds of iterative training, the resulting new model is validated using training and test sets to measure model metrics such as detection rate and false positive rate. The training set ensures high accuracy within the group dataset, ensuring no missed detections of residents in the community; the test set ensures general accuracy to avoid excessive false positives. If model metrics improve, the face recognition threshold is further increased to avoid the possibility of false positives exceeding the threshold.

[0158] After model training is complete, the model training device sends the trained model to multiple cameras in the device group. The automatic training platform stores the training set, test set, and model, and resets the tags in the training set to normal tags.

[0159] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0160] Based on the same inventive concept, embodiments of the present application also provide a face model training device for implementing the face model training method described above. The solution provided by this device is similar to the solution described in the method described above. Therefore, the specific limitations in one or more face model training device embodiments provided below can be found in the limitations of the face model training method described above and will not be further elaborated here.

[0161] In one embodiment, Figure 10 As shown, a face model training device for a model training device is provided, comprising: a data set and model acquisition module 101, a model training module 102, and a model deployment module 103, wherein:

[0162] The data set and model acquisition module is used to obtain a sample data set and a face recognition model in response to a model training task for a target location. The model training task is used to train the face recognition model on each face recognition device deployed at the target location. The sample data set includes manually uploaded sample data and device-reported sample data. The manually uploaded sample data is obtained by annotating face data that the face recognition model fails to recognize. The device-reported sample data is face data that the face recognition model successfully recognizes and that has a preset difference with the corresponding face background data.

[0163] The model training module is used to perform model training processing on the face recognition model according to the sample data set to obtain the trained face recognition model;

[0164] The model deployment module is used to deploy the trained face recognition model to various face recognition devices.

[0165] In one embodiment, Figure 11 As shown, a face model training device for a face recognition device is provided, comprising: a similarity determination module 111, a first judgment module 112, and a second judgment module 113, wherein:

[0166] A similarity determination module is used to determine the similarity of facial features between the collected facial data and the facial data in the database through a pre-deployed facial recognition model;

[0167] A first judgment module is used to determine that the face recognition model has successfully recognized the face when the facial feature similarity is greater than a preset first threshold;

[0168] The second judgment module is used to upload the facial data as device-reported sample data to the model training device when the facial recognition model successfully recognizes the face and the facial feature value is less than a preset second threshold, so that the model training device executes the facial model training method as any one of the above-mentioned first aspects; the first threshold is less than the second threshold.

[0169] Each module in the above-mentioned face model training device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a memory in the computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0170] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 12As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store facial data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a facial model training method is implemented.

[0171] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 13 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a face model training method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse.

[0172] Those skilled in the art will understand that Figure 12-13The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0173] In one embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.

[0174] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0175] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0176] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.

[0177] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0178] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A face model training method, characterized in that: The method comprises: In response to a model training task for a target location, a sample data set and a face recognition model are obtained; the model training task is used to train the face recognition model on each face recognition device deployed in the target location; the sample data set includes manually uploaded sample data, device-reported sample data, and an original data set; the manually uploaded sample data is obtained by annotating face data that the face recognition model fails to recognize; the device-reported sample data is face data that the face recognition model successfully recognizes and has a preset difference with the corresponding face background data; the original data set is the data set used for the previous training of the face recognition model; Performing model training on the face recognition model based on the sample data set to obtain a trained face recognition model; wherein the face recognition model is trained at a preset basic learning rate based on the original data set and the sample data reported by the device; adjusting the basic learning rate based on the data volume relationship between the original data set and the manually uploaded sample data to obtain a target learning rate; and training the face recognition model at the target learning rate based on the manually uploaded sample data; Deploy the trained face recognition model to each of the face recognition devices.

2. The method according to claim 1, characterized in that The adjusting the basic learning rate based on the data volume relationship between the original data set and the manually uploaded sample data to obtain a target learning rate includes: Obtaining a manual upload scaling factor according to the data volume of the original data set and the data volume of the manually uploaded sample data; the manual upload scaling factor includes a ratio of the data volume of the manually uploaded sample data to the data volume of the sample data set; Calculating the difference between the basic learning rate and the preset peak learning rate to obtain a learning rate difference; Merging the learning rate difference with the manual upload scaling factor to obtain a learning rate increment; The learning rate increment is weighted with the base learning rate to obtain the target learning rate.

3. The method according to claim 1, characterized in that The obtaining of the sample data set and the face recognition model includes: Obtaining a device identifier of the face recognition device; According to the device identifier, query and obtain a group identifier corresponding to the face recognition device; According to the group identifier, the original data set and the face recognition model corresponding to the group identifier are obtained by querying.

4. The method according to claim 1, wherein The method further comprises: Get the current time; If the time interval between the current time and the last model training time is greater than a preset training cycle threshold, the model training task for the target location is triggered.

5. The method according to any one of claims 1 to 4, characterized in that The deploying the trained face recognition model to each of the face recognition devices includes: Performing an index analysis on the trained face recognition model based on the sample data set to obtain a model index; the model index includes at least any one of the following: detection rate, false detection rate, missed detection rate, and detection speed; If the model indicator meets the preset indicator threshold range, deploying the trained face recognition model to each of the face recognition devices; If the model indicator does not meet the indicator threshold range, the face recognition model corresponding to the model indicator is retrained.

6. A face model training method, characterized in that: The method comprises: Using the pre-deployed face recognition model, determine the similarity between the collected face data and the face database data; If the facial feature similarity is greater than a preset first threshold, it is determined that the facial recognition model has successfully identified the person; When the face recognition model successfully recognizes and the facial feature similarity is less than a preset second threshold, the face data is uploaded to the model training device as device-reported sample data, so that the model training device executes the face model training method according to any one of claims 1 to 5; the first threshold is less than the second threshold.

7. A face model training device, characterized in that: The device comprises: The data set and model acquisition module is used to obtain a sample data set and a face recognition model in response to a model training task for a target location; the model training task is used to train the face recognition model on each face recognition device deployed in the target location; the sample data set includes manually uploaded sample data, device-reported sample data, and an original data set; the manually uploaded sample data is obtained by annotating face data that the face recognition model fails to recognize; the device-reported sample data is face data that the face recognition model successfully recognizes and has a preset difference with the corresponding face background data; the original data set is the data set used for the previous training of the face recognition model; a model training module, configured to perform model training processing on the face recognition model based on the sample data set to obtain a trained face recognition model; wherein the face recognition model is trained at a preset basic learning rate based on the original data set and the sample data reported by the device; the basic learning rate is adjusted based on the data volume relationship between the original data set and the manually uploaded sample data to obtain a target learning rate; and the face recognition model is trained at the target learning rate based on the manually uploaded sample data; The model deployment module is used to deploy the trained face recognition model to each face recognition device.

8. A face model training device, characterized in that: The device comprises: A similarity determination module is used to determine the similarity of facial features between the collected facial data and the facial database data using a pre-deployed facial recognition model; A first judgment module is used to determine that the face recognition model has successfully recognized the person if the similarity of the facial features is greater than a preset first threshold; The second judgment module is used to upload the facial data as device-reported sample data to the model training device when the facial recognition model successfully recognizes and the facial feature similarity is less than a preset second threshold, so that the model training device executes the facial model training method according to any one of claims 1 to 5; the first threshold is less than the second threshold.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the processor implements: the steps of the method according to any one of claims 1 to 5; or the steps of the method according to claim 6.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements: the steps of the method according to any one of claims 1 to 5; or the steps of the method according to claim 6.

11. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements: the steps of the method according to any one of claims 1 to 5; or the steps of the method according to claim 6.

Citation Information

Patent Citations

  • Face authentication model generation method, authentication method, equipment and storage medium

    CN114360008A

  • Environment-specific training of machine learning models

    US20220343205A1