Configuration method of face recognition model, recognition system, computer equipment and medium

By generating serialized files of the face recognition model based on the hardware architecture on the server side, the problem of mismatch of the face recognition model in the hardware environment is solved, the configuration success rate and stability are improved, and the consumption of computing resources is reduced, realizing the hardware Efficient use of resources and diversity compatibility.

CN114596612BActive Publication Date: 2024-10-18PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210164017.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-22
Publication Date
2024-10-18
Estimated Expiration
2042-02-22

AI Technical Summary

Technical Problem

In the existing technology, face recognition models are difficult to apply normally when the hardware environment does not match, and training models separately for each system will increase development and operation and maintenance costs, making deployment difficult.

Method used

By receiving the hardware architecture information of the face recognition application, the server queries and obtains the corresponding target serialization file, sends it to the application to load the model, ensures that the model matches the hardware environment, and trains a general model on the server to generate corresponding responses based on different hardware architectures. serialized file.

Benefits of technology

It improves the success rate of model configuration and application stability, reduces the consumption of computing resources, improves the utilization of hardware resources, and achieves compatibility with different hardware architectures and productization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114596612B_ABST
    Figure CN114596612B_ABST
Patent Text Reader

Abstract

The present application discloses a configuration method, a recognition system, a computer device and a medium for a face recognition model. The face recognition model configuration method receives a model configuration request initiated by a face recognition application end; the model configuration request includes the hardware architecture information of the face recognition application end; according to the hardware architecture information, the target serialization file of the face recognition model corresponding to the hardware architecture information is queried and obtained in the face recognition model catalog library; the target serialization file is sent to the face recognition application end, so that the face recognition application end loads the face recognition model for face recognition. The face recognition model configuration method can improve the success rate of model configuration and the stability of application, and can reduce the consumption of computing resources and improve the utilization rate of hardware resources. The present application can be widely used in the field of face recognition technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of face recognition technology, and in particular to a configuration method, a recognition system, a computer device and a medium for a face recognition model. Background Art

[0002] In recent years, with the rapid development of artificial intelligence technology, various types of machine learning models have achieved relatively good application results in the fields of image classification, face recognition, and autonomous driving. Among them, face recognition is a biometric technology that identifies people based on their facial features. This technology uses a camera to capture images or video streams containing faces, and automatically detects and tracks faces in the images, and then performs facial recognition on the detected faces. It is also commonly called portrait recognition or facial recognition.

[0003] In related technologies, when using machine learning models for face recognition, it is generally necessary to train the machine learning models with large amounts of data in advance, and then configure the trained models to be applied in the specified system. However, in actual applications, it is found that due to the different hardware environments that may be faced during model training and application, there are cases where the trained models cannot be applied normally to the specified system; moreover, if the corresponding models are trained for the hardware environment of each system, the development and operation costs will increase, making it difficult to deploy and use.

[0004] In summary, the problems existing in related technologies need to be solved urgently. Summary of the invention

[0005] The purpose of this application is to solve one of the technical problems existing in the related art to at least a certain extent.

[0006] To this end, one purpose of an embodiment of the present application is to provide a configuration method for a face recognition model, which can improve the success rate of model configuration and the stability of application, and can reduce the consumption of computing resources and improve the utilization of hardware resources.

[0007] In order to achieve the above technical objectives, the technical solutions adopted by the embodiments of the present application include:

[0008] On the one hand, an embodiment of the present application provides a method for configuring a face recognition model, including:

[0009] Receiving a model configuration request initiated by a face recognition application; the model configuration request includes hardware architecture information of the face recognition application;

[0010] According to the hardware architecture information, query and obtain a target serialization file of the face recognition model corresponding to the hardware architecture information in the face recognition model catalog library;

[0011] The target serialization file is sent to the face recognition application end, so that the face recognition application end loads the face recognition model to perform face recognition.

[0012] In addition, according to the configuration method of a face recognition model of the above embodiment of the present application, it can also have the following additional technical features:

[0013] Furthermore, in one embodiment of the present application, the face recognition model catalog library is established by the following steps:

[0014] Acquire a training image and a label corresponding to the training image; the training image includes a face image, and the label is used to represent information of the face image;

[0015] Inputting the training image into an initialized face recognition model for face recognition to obtain a first recognition result; the first recognition result is used to characterize information of the face image;

[0016] According to the first recognition result and the label, updating the parameters of the initialized face recognition model to obtain a trained face recognition model;

[0017] According to a preset hardware architecture, the trained face recognition model is serialized to obtain multiple serialized files;

[0018] A face recognition model catalog library is established based on the multiple serialized files.

[0019] Further, in one embodiment of the present application, inputting the training image into an initialized face recognition model for face recognition to obtain a first recognition result includes:

[0020] Inputting the training image into an initialized face recognition model, performing face detection on the training image, and segmenting the image to obtain a face image;

[0021] Extracting feature information of the face image;

[0022] According to the feature information, matching and recognition are performed in a preset face database to obtain a first recognition result.

[0023] Further, in one embodiment of the present application, querying and acquiring a target serialization file of a face recognition model corresponding to the hardware architecture information in a face recognition model catalog library according to the hardware architecture information includes:

[0024] Parsing the graphics card resource information of the face recognition application end from the hardware architecture information;

[0025] According to the graphics card resource information, a target serialization file of the face recognition model corresponding to the graphics card resource information is queried in the face recognition model catalog library and obtained.

[0026] Further, in one embodiment of the present application, the graphics card resource information includes graphics card category information and graphics card quantity information, and the querying and obtaining the target serialization file of the face recognition model corresponding to the graphics card resource information in the face recognition model catalog library according to the graphics card resource information includes:

[0027] Determine a first serialized file set from the face recognition model catalog library according to the graphics card quantity information;

[0028] According to the graphics card category information, a target serialization file is determined and obtained from the first serialization file set.

[0029] On the other hand, the embodiment of the present application also provides another configuration method of a face recognition model, including:

[0030] Initiate a model configuration request to the server; the model configuration request includes hardware architecture information of the face recognition application end;

[0031] Receive the target serialization file sent by the server, and load and configure the face recognition model according to the target serialization file;

[0032] Among them, the target serialization file is obtained by the server by querying and acquiring in the face recognition model catalog library according to the hardware architecture information.

[0033] On the other hand, the embodiment of the present application also provides another configuration method of a face recognition model, including:

[0034] The face recognition application terminal initiates a model configuration request to the server; the model configuration request includes hardware architecture information of the face recognition application terminal;

[0035] The server receives the model configuration request, and queries and obtains a target serialization file of the face recognition model corresponding to the hardware architecture information in a face recognition model catalog library according to the hardware architecture information;

[0036] The server sends the target serialization file to the face recognition application end;

[0037] The face recognition application receives the target serialization file sent by the server, and loads and configures the face recognition model according to the target serialization file.

[0038] On the other hand, an embodiment of the present application provides a face recognition system, including a server and a face recognition application terminal;

[0039] The face recognition application end is used to initiate a model configuration request to the server, receive the target serialization file sent by the server, load and configure the face recognition model according to the target serialization file to perform face recognition, and return the face recognition result to the server; the model configuration request includes the hardware architecture information of the face recognition application end;

[0040] The server is used to receive the model configuration request, query and obtain the target serialization file of the face recognition model corresponding to the hardware architecture information in the face recognition model catalog library according to the hardware architecture information, and send the target serialization file to the face recognition application end;

[0041] The server is also used to receive the face recognition result.

[0042] On the other hand, an embodiment of the present application provides a computer device, including:

[0043] at least one processor;

[0044] at least one memory for storing at least one program;

[0045] When the at least one program is executed by the at least one processor, the at least one processor implements the above-mentioned configuration method of the face recognition model.

[0046] On the other hand, an embodiment of the present application further provides a computer-readable storage medium, which stores a program executable by a processor. When the program executable by the processor is executed by the processor, it is used to implement the configuration method of the above-mentioned face recognition model.

[0047] The advantages and benefits of the present application will be partially given in the following description, and partially become apparent from the following description, or be understood through the practice of the present application:

[0048] The embodiment of the present application discloses a configuration method of a face recognition model, which receives a model configuration request initiated by a face recognition application end; the model configuration request includes the hardware architecture information of the face recognition application end; according to the hardware architecture information, the target serialization file of the face recognition model corresponding to the hardware architecture information is queried and obtained in the face recognition model catalog library; the target serialization file is sent to the face recognition application end, so that the face recognition application end loads the face recognition model for face recognition. The face recognition model configuration method can improve the success rate of model configuration and the stability of application, and can reduce the consumption of computing resources and improve the utilization of hardware resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following introduction is made to the drawings of the embodiments of the present application or the related technical solutions in the prior art. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solutions of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0050] Figure 1 A schematic diagram of an implementation environment of a configuration method of a face recognition model provided in an embodiment of the present application;

[0051] Figure 2 A schematic diagram of a flow chart of a method for configuring a face recognition model provided in an embodiment of the present application;

[0052] Figure 3 A flowchart of a method for training a face recognition model provided in an embodiment of the present application;

[0053] Figure 4 Provided in the embodiments of this application Figure 3 A specific flow chart of step 320;

[0054] Figure 5 A flowchart of another method for configuring a face recognition model provided in an embodiment of the present application;

[0055] Figure 6 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0056] The present application is further described below in conjunction with the accompanying drawings and specific embodiments. The described embodiments should not be regarded as limiting the present application, and all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.

[0057] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0058] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0059] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0060] 1) Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level technology and software-level technology. Basic artificial intelligence technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0061] 2) Machine Learning (ML) is a multi-disciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning (deep learning) usually includes artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.

[0062] 3) Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer. The underlying blockchain platform can include processing modules such as user management, basic services, smart contracts, and operation monitoring. Among them, the user management module is responsible for the identity information management of all blockchain participants, including maintaining the generation of public and private keys (account management), key management, and the maintenance of the corresponding relationship between the user's real identity and the blockchain address (authority management), and, under authorization, supervises and audits the transactions of certain real identities and provides risk control rule configuration (risk control audit); the basic service module is deployed on all blockchain node devices to verify the validity of business requests and record the valid requests to the storage after consensus is reached. For a new business request, the basic service first adapts the interface to parse and authenticate (interface adaptation), and then encrypts the business information through the consensus algorithm (consensus management). The smart contract module is responsible for the registration and issuance of contracts, contract triggering and contract execution. Developers can define the contract logic in a programming language and publish it to the blockchain (contract registration). According to the logic of the contract terms, the key or other events are called to trigger the execution and complete the contract logic. It also provides the function of contract upgrade and cancellation. The operation monitoring module is mainly responsible for the deployment, configuration modification, contract setting, cloud adaptation and real-time status visualization output of the product during the product release process, such as alarm, monitoring network status, monitoring node equipment health status, etc. The platform product service layer provides the basic capabilities and implementation framework of typical applications. Developers can implement the business logic on the blockchain based on these basic capabilities and superimpose the characteristics of the business. The application service layer provides application services based on the blockchain solution for business participants to use.

[0063] 4) Face recognition is a biometric technology that identifies people based on their facial features. This technology uses a camera to capture images or video streams containing faces, and automatically detects and tracks faces in the images, and then performs facial recognition on the detected faces. It is also commonly called portrait recognition or facial recognition.

[0064] In recent years, with the rapid development of artificial intelligence technology, various types of machine learning models have achieved relatively good application results in image classification, face recognition, autonomous driving and other fields.

[0065] In related technologies, when using machine learning models for face recognition, it is generally necessary to train the machine learning models with large amounts of data in advance, and then configure the trained models to be applied in the specified system. However, in actual applications, it is found that due to the different hardware environments that may be faced during model training and application, there are cases where the trained models cannot be applied normally to the specified system; moreover, if the corresponding models are trained for the hardware environment of each system, the development and operation costs will increase, making it difficult to deploy and use.

[0066] In order to solve the problem that the face recognition model in the related art is difficult to deploy due to the mismatch of the hardware environment during training and application, the embodiment of the present application provides a configuration method, recognition system, computer device and medium of a face recognition model. In the configuration method, on the one hand, the server can configure the serialized file of the face recognition model for the face recognition application end according to the hardware architecture information of the face recognition application end, so that the face recognition application can directly load the serialized file of the model to realize the local model call, and there will be no situation where the model application fails due to the mismatch of the hardware environment, which can improve the success rate of the model configuration and the stability of the application; on the other hand, the original face recognition model trained by each face recognition application end according to the local hardware architecture is converted into a universal face recognition model trained on the server first, and then the model algorithm is serialized into different files and configured to each face recognition application end according to different hardware architectures, which can significantly reduce the consumption of computing resources and improve the utilization rate of hardware resources. Moreover, for different hardware architectures, the model can be well compatible and extended, which can improve the efficiency of model productization.

[0067] Figure 1 Schematic diagram of the implementation environment of a configuration method of a face recognition model provided in an embodiment of the present application. Figure 1 The hardware and software components of the implementation environment mainly include a face recognition application terminal 101 and a server 102, and the face recognition application terminal 101 is in communication with the server 102. The configuration method of the face recognition model can be executed based on the interaction between the face recognition application terminal 101 and the server 102. In addition, the face recognition application terminal 101 and the server 102 can be nodes in the blockchain, which is not specifically limited in this embodiment.

[0068] Specifically, the face recognition application end 101 in the present application may include but is not limited to any one or more of smart camera devices, smart watches, smart phones, computers, personal digital assistants (PDA), intelligent voice interaction devices, smart home appliances or vehicle-mounted terminals. The server 102 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network) and big data and artificial intelligence platforms. The face recognition application end 101 and the server 102 can establish a communication connection through a wireless network or a wired network, which uses standard communication technology and / or protocols. The network can be set to the Internet or any other network, such as but not limited to any combination of a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a private network or a virtual private network. Of course, it is understandable that Figure 1 The implementation environment in the embodiment of the present application is only an optional application scenario of the configuration method of the face recognition model provided in the embodiment of the present application, and the actual application is not fixed. Figure 1 The hardware and software environment shown.

[0069] Combine the following Figure 1 The implementation environment shown is used to explain in detail the configuration method of the face recognition model provided in the embodiments of the present application.

[0070] Reference Figure 2 , Figure 2 is a flow chart of a configuration method of a face recognition model provided in an embodiment of the present application, Figure 2 The configuration method of the face recognition model shown is mainly executed on the server 102. The method can be applied to the relevant computer equipment in the server 102, but is not limited to the above form. Figure 2 The method includes but is not limited to steps 210 to 230.

[0071] Step 210: Receive a model configuration request initiated by the face recognition application; the model configuration request includes hardware architecture information of the face recognition application.

[0072] In this step, the face recognition application end refers to the relevant equipment for performing face recognition tasks. The specific equipment types have been illustrated in the previous examples and will not be repeated here. The face recognition application end in the embodiment of the present application mainly performs face recognition tasks based on the face recognition model, so the face recognition application end needs to be configured with relevant models. Specifically, the face recognition model in the embodiment of the present application can be uniformly trained in the server, without having to be trained separately on the face recognition application end, which can reduce the number of training times for models of the same or similar applications and save computing resources; moreover, for the face recognition application end, it does not have to be trained from scratch to apply the trained face recognition model, which can greatly improve the application efficiency of face recognition and reduce the pressure on the hardware equipment of the face recognition application end.

[0073] In this step, when configuring the face recognition model for the face recognition application, the server can receive a model configuration request initiated by the face recognition application. On the one hand, the model configuration request indicates that the face recognition application has a configuration requirement for the model. On the other hand, the model configuration request also includes the hardware architecture information of the face recognition application, which may include the number of cores of the processor of the face recognition application, the specifications and number of graphics cards, the memory size, and other information. Based on the hardware architecture information, the server can determine the file format of the model adapted by the face recognition application, so as to facilitate the configuration of the trained face recognition model for the face recognition application and perform related face recognition tasks.

[0074] It should be noted that in the embodiments of the present application, the configuration of the face recognition model on the face recognition application side is not limited to the initial configuration. In other words, the implementation of the present application includes both the initial configuration of the model on the face recognition application side that has not been configured with a face recognition model before, and the model update configuration on the face recognition application side that has been configured with a face recognition model before. The specific implementation application can be flexibly selected according to the needs.

[0075] Step 220: According to the hardware architecture information, query and obtain the target serialization file of the face recognition model corresponding to the hardware architecture information in the face recognition model catalog library.

[0076] In this step, after receiving the model configuration request initiated by the face recognition application, the server can query and obtain the target serialization file of the face recognition model corresponding to the hardware architecture information in the pre-established face recognition model catalog library according to the hardware architecture information in the model configuration request. Here, the face recognition model catalog library includes various types of serialization files of trained models. These serialization files are obtained by serializing the trained models multiple times according to different hardware architectures. For example, after the server has trained a face recognition model, it can be based on some commonly used graphics card architectures, such as V100, 1080, 1080Ti, 2080, 2080Ti, etc., and the relevant files of the model algorithm are serialized according to the data storage mode of the graphics card, thereby obtaining corresponding multiple serialization files.

[0077] In the embodiment of the present application, the serialized file of the face recognition model may include the structural information and structural parameter data of the model; more specifically, the structural information of the model may include one or more of the following items: the number of hidden layers of the model, the number of neurons in the input layer, the number of neurons in the output layer, the number of neurons in one or more hidden layers, the number of channels in the convolution layer, the connection relationship between multiple neurons, etc. The structural parameter data may include one or more of the following items: the connection weights between neurons, the bias value of neurons, the activation function, the number of channels in the convolution layer, the size of the convolution kernel, etc. Moreover, it can be understood that in the embodiment of the present application, the file format of the serialized file of the face recognition model can be any commonly used file format, and the present application does not limit this.

[0078] In this step, after obtaining multiple serialized files, the server can integrate these serialized files to establish a face recognition model directory library. Specifically, these serialized files can be stored in the form of a file list, and the corresponding hardware architecture information can be annotated for each serialized file, that is, the serialized file is obtained by serializing the algorithm file of the model with reference to the form of hardware architecture. When configuring a face recognition model for a face recognition application end, according to the hardware architecture information sent by the face recognition application end, the target serialized file of the corresponding face recognition model can be queried and determined in the face recognition model directory library.

[0079] Step 230: Send the target serialized file to the face recognition application end, so that the face recognition application end loads the face recognition model to perform face recognition.

[0080] In this step, after the server determines the target serialization file that matches the hardware architecture of the face recognition application, it can send the target serialization file to the face recognition application so that the face recognition application loads the face recognition model and performs the face recognition task.

[0081] It can be understood that in the embodiments of the present application, on the one hand, the server can configure the serialized file of the face recognition model for the face recognition application end according to the hardware architecture information of the face recognition application end, so that the face recognition application end can directly load the serialized file of the model to realize local model call, and there will be no situation where the model application fails due to hardware environment mismatch, which can improve the success rate of model configuration and the stability of application; on the other hand, the method provided in the embodiments of the present application converts the original face recognition model trained by each face recognition application end according to the local hardware architecture into a method of first training a universal face recognition model on the server, and then serializing the model algorithm into different files configured to each face recognition application end according to different hardware architectures, which can significantly reduce the consumption of computing resources and improve the utilization rate of hardware resources. Moreover, for different hardware architectures, the model can be well compatible and extensible, which can improve the efficiency of model productization.

[0082] Reference Figure 3 In some embodiments, in the server, the face recognition model of the present application can be trained by the following steps:

[0083] Step 310: Obtain training images and labels corresponding to the training images; the training images include face images, and the labels are used to represent information of the face images.

[0084] In this step, when training the face recognition model, multiple training images and labels corresponding to the training images can be obtained. The training image can be an image including a human face, that is, at least one part of the training image is a human face image, and the label is used to represent the information of the human face image, for example, the label can represent the gender information, identity information, etc. of the person corresponding to the face in the training image.

[0085] Step 320: Input the training image into the initialized face recognition model to perform face recognition to obtain a first recognition result; the first recognition result is used to characterize information of the face image.

[0086] Step 330: Update the parameters of the initialized face recognition model according to the first recognition result and the label to obtain a trained face recognition model.

[0087] In the embodiments of the present application, the face recognition model can be built using any machine learning algorithm, without limitation. Machine Learning (ML) is a multi-disciplinary cross-discipline involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning (deep learning) usually includes artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and teaching learning.

[0088] Specifically, before using the above-mentioned machine learning model, it needs to be trained based on supervised learning. In the embodiment of the present application, it can be trained by training images. After preprocessing the training images, they can be randomly divided into training sets and test sets. For example, a 5-fold cross-validation method is used for division, that is, 80% of the training images are taken as the training set, and the remaining 20% ​​of the training images are taken as the test set.

[0089] For the training images in the training set, they can be input into the initialized face recognition model to obtain the prediction result output by the face recognition model, which is recorded as the first recognition result. After obtaining the first recognition result, the accuracy of the model recognition can be evaluated based on the result and the aforementioned label to perform back propagation training on the model and update its relevant parameters.

[0090] Specifically, for a machine learning model, the accuracy of its prediction results can be measured by a loss function (LossFunction). The loss function is defined on a single training data and is used to measure the prediction error of a training data. Specifically, the loss value of the training data is determined by the label of a single training data and the prediction result of the model for the training data. In actual training, a training data set has a lot of training data, so a cost function (CostFunction) is generally used to measure the overall error of the training data set. The cost function is defined on the entire training data set and is used to calculate the average value of the prediction error of all training data, which can better measure the prediction effect of the model. For a general machine learning model, based on the aforementioned cost function, plus a regularization term that measures the complexity of the model, it can be used as the objective function of the training. Based on this objective function, the loss value of the entire training data set can be calculated. There are many types of commonly used loss functions, such as 0-1 loss function, square loss function, absolute loss function, logarithmic loss function, cross entropy loss function, etc., which can all be used as loss functions of machine learning models, which will not be described one by one here. In practical applications, you can choose any one of the loss functions to determine the loss value of the training, that is, the loss value between the prediction result and the label. Based on the training loss value, the back propagation algorithm is used to update the parameters of the model, and the trained machine learning model can be obtained by iterating the preset rounds. Through the above training method, a trained face recognition model can be obtained.

[0091] Reference Figure 4 In some embodiments, in the present application, the training image is input into the initialized face recognition model for face recognition to obtain a first recognition result, including:

[0092] Step 321: Input the training image into the initialized face recognition model, perform face detection on the training image, and segment it to obtain a face image.

[0093] Step 322: Extract feature information of the face image.

[0094] Step 323: Based on the feature information, matching and recognition are performed in a preset face database to obtain a first recognition result.

[0095] In the embodiment of the present application, when performing face recognition on the training image through the face recognition model, two processes may be included. The first process is to detect and segment the face position in the training image, that is, input the training image into the face recognition model, perform face detection on the training image through the model, determine the face area in the training highlight, and then segment the face image from the training image according to the face area; the second process is to identify the identity information of the person corresponding to the face image. In this process, the feature information of the face image can be extracted by the face recognition model. For example, a vector composed of pixel data of several pixels in the face image can be used as feature information, which is recorded as the first feature vector. Then, according to the extracted feature information, the face image can be matched and identified in the preset face database to determine the identity information of the person corresponding to the face image. Here, the face database includes multiple pre-collected face images of people and the identity information corresponding to the people; of course, it should be noted that in the implementation of this application, the data collection and application of face images should comply with the relevant privacy policy and user terms.

[0096] Specifically, in the embodiment of the present application, when matching feature information through a face image in a face database, a feature vector of the face image in the face database can also be extracted and recorded as a second feature vector. Then, the similarity between the first feature vector and the second feature vector is calculated. If the similarity between the two is greater than a preset similarity threshold, the first recognition result can be determined based on the identity information of the person corresponding to the second feature vector at this time.

[0097] In some embodiments, according to the hardware architecture information, querying and acquiring a target serialization file of a face recognition model corresponding to the hardware architecture information in a face recognition model catalog library includes:

[0098] Analyze the graphics card resource information of the face recognition application from the hardware architecture information;

[0099] According to the graphics card resource information, query and obtain the target serialization file of the face recognition model corresponding to the graphics card resource information in the face recognition model catalog library.

[0100] In the embodiment of the present application, a graphics processing unit (GPU), also known as a display core, a visual processor, a graphics card, etc., is a microprocessor that is specifically used to perform image and graphics related operations on personal computers, workstations, game consoles, and some mobile devices (such as tablet computers, smart phones, etc.). In the field of machine learning, the file of the GPU resource configuration model is generally used. Therefore, in the embodiment of the present application, the serialized file of the adapted face recognition model can be determined mainly based on the graphics card resource information of the face recognition application end. At this time, the graphics card resource information can be parsed from the hardware architecture information sent by the face recognition application end, and then the GPU configuration of the face recognition application end is determined according to the graphics card resource information, thereby determining the corresponding target serialized file.

[0101] Specifically, in some embodiments, the graphics card resource information may include graphics card category information and graphics card quantity information. When determining the target serialized file, the face recognition model catalog library can be queried based on the graphics card quantity information to determine the serialized files corresponding to the hardware architecture with the same number of graphics cards as the face recognition application end, and these files are recorded as the first serialized file set. Since the data storage conditions of graphics cards of different models and categories are also different, it is necessary to further determine and obtain the target serialized file from the first serialized file set based on the graphics card category information. In the embodiment of the present application, a basic file set range is first determined based on the total number of graphics cards, and then the hardware architecture within the file set range that is the same as the face recognition application end is compared and searched, which can greatly speed up the matching speed, facilitate the rapid configuration of the face recognition model to the face recognition application end, and help improve the efficiency of face recognition.

[0102] Reference Figure 5 In an embodiment of the present application, a configuration method of a face recognition model is also provided. Figure 5 The configuration method of the face recognition model shown is mainly executed on the face recognition application terminal 101. The method can be applied to the face recognition application terminal 101, for example, it can be applied to the software installed in the face recognition application terminal 101 to implement a part of the software functions, but is not limited to the above form. Figure 5 The method mainly includes steps 510 to 520.

[0103] Step 510: initiate a model configuration request to the server; the model configuration request includes hardware architecture information of the face recognition application end.

[0104] Step 520: Receive the target serialization file sent by the server, and load and configure the face recognition model according to the target serialization file.

[0105] Among them, the target serialization file is queried and obtained by the server in the face recognition model catalog library according to the hardware architecture information.

[0106] In the embodiment of the present application, when the face recognition application terminal 101 needs to configure or update the face recognition model, it can send a model configuration request to the server and send its own hardware architecture information to the server, so that the server can query and obtain the target serialization file corresponding to the face recognition application terminal in the face recognition model catalog according to the hardware architecture information of the face recognition application terminal itself. After obtaining the target serialization file, the server can send it to the face recognition application terminal, and the face recognition application terminal can configure the face recognition model by loading the target serialization file, thereby performing the face recognition task.

[0107] In the embodiment of the present application, a configuration method of a face recognition model is also provided, and the method is performed based on the interaction between the face recognition application terminal 101 and the server 102. The method can be applied to the relevant software or computer equipment in the face recognition application terminal 101 and the server 102, but is not limited to the above form. The method mainly includes the following steps:

[0108] The face recognition application terminal initiates a model configuration request to the server; the model configuration request includes hardware architecture information of the face recognition application terminal;

[0109] The server receives the model configuration request, and queries and obtains the target serialization file of the face recognition model corresponding to the hardware architecture information in the face recognition model catalog library according to the hardware architecture information;

[0110] The server sends the target serialized file to the face recognition application;

[0111] The face recognition application receives the target serialization file sent by the server, and loads and configures the face recognition model according to the target serialization file.

[0112] based on Figure 2 and Figure 5 The contents of the configuration method embodiment of the face recognition model shown in the figure can be understood from the contents of the configuration method embodiment of the face recognition model, so it will not be repeated here. The functions specifically implemented by this method embodiment are similar to those of the embodiment of the face recognition model. Figure 2 as well as Figure 5 The configuration method of the face recognition model shown in the embodiment is the same as that of Figure 2 as well as Figure 5 The beneficial effects achieved by the embodiment of the configuration method of the face recognition model shown are also the same.

[0113] Based on the above configuration method, the embodiment of the present application also provides a face recognition system, including a server and a face recognition application end:

[0114] The face recognition application is used to initiate a model configuration request to the server, receive the target serialization file sent by the server, load and configure the face recognition model according to the target serialization file to perform face recognition, and send the face recognition result back to the server; the model configuration request includes the hardware architecture information of the face recognition application;

[0115] The server is used to receive the model configuration request, query and obtain the target serialization file of the face recognition model corresponding to the hardware architecture information in the face recognition model catalog library according to the hardware architecture information, and send the target serialization file to the face recognition application end;

[0116] The server is also used to receive face recognition results.

[0117] In an embodiment of the present application, a face recognition system based on a face recognition application and a server is provided, in which face recognition can be realized based on the interaction between the face recognition application and the server. Among them, the face recognition application has at least the function of initiating a model configuration request to the server, receiving a target serialization file sent by the server, loading and configuring the face recognition model according to the target serialization file for face recognition, and returning the face recognition result to the server; the server has at least the function of receiving the model configuration request, querying and obtaining the target serialization file of the face recognition model corresponding to the hardware architecture information in the face recognition model catalog library according to the hardware architecture information, and sending the target serialization file to the face recognition application, and receiving the face recognition result. In this way, the face recognition application can obtain and configure the trained face recognition model from the server side, and then perform the face recognition task, and send the face recognition result to the server, and the server side can obtain and save the face recognition result.

[0118] Reference Figure 6 , the embodiment of the present application further discloses a computer device, including:

[0119] at least one processor 610;

[0120] At least one memory 620, used to store at least one program;

[0121] When at least one program is executed by at least one processor 610, the at least one processor 610 implements the following Figure 2 or Figure 5 An embodiment of a method for configuring a face recognition model is shown.

[0122] It is understandable that if Figure 2 or Figure 5 The contents of the configuration method of the face recognition model shown in the embodiment are all applicable to the computer device embodiment. The functions specifically implemented by the computer device embodiment are similar to those in the embodiment shown in the embodiment. Figure 2 or Figure 5 The configuration method of the face recognition model shown in the embodiment is the same as that of the embodiment shown in the embodiment, and the beneficial effects achieved are the same as those of the embodiment shown in the embodiment. Figure 2 or Figure 5 The beneficial effects achieved by the embodiment of the configuration method of the face recognition model shown are also the same.

[0123] The present application also discloses a computer-readable storage medium in which a program executable by a processor is stored. When the program executable by the processor is executed by the processor, it is used to implement the following Figure 2 or Figure 5 An embodiment of a method for configuring a face recognition model is shown.

[0124] It is understandable that if Figure 2 or Figure 5 The contents of the configuration method of the face recognition model shown in the embodiment are all applicable to the embodiment of the computer-readable storage medium. The functions specifically implemented by the embodiment of the computer-readable storage medium are similar to those in the embodiment of the face recognition model shown in the embodiment. Figure 2 or Figure 5 The configuration method of the face recognition model shown in the embodiment is the same as that of the embodiment shown in the embodiment, and the beneficial effects achieved are the same as those of the embodiment shown in the embodiment. Figure 2 or Figure 5 The beneficial effects achieved by the embodiment of the configuration method of the face recognition model shown are also the same.

[0125] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the application is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part described as a larger operation is performed independently.

[0126] In addition, although the present application is described in the context of functional modules, it should be understood that, unless otherwise specified, one or more of the functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present application. More specifically, in view of the properties, functions, and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional techniques of the engineer. Therefore, those skilled in the art can implement the present application set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present application, which is determined by the full scope of the attached claims and their equivalents.

[0127] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.

[0128] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0129] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0130] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0131] In the above description of this specification, the description with reference to the terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0132] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.

[0133] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.

[0134] In the description of this specification, the description with reference to the terms "one embodiment", "another embodiment" or "certain embodiments" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0135] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.

Claims

1. A method for configuring a face recognition model, characterized in that: include: Receiving a model configuration request initiated by a face recognition application; the model configuration request includes hardware architecture information of the face recognition application; According to the hardware architecture information, query and obtain a target serialization file of the face recognition model corresponding to the hardware architecture information in the face recognition model catalog library; Sending the target serialized file to the face recognition application end, so that the face recognition application end loads the face recognition model to perform face recognition; The step of querying and acquiring a target serialization file of a face recognition model corresponding to the hardware architecture information in a face recognition model catalog library according to the hardware architecture information includes: Parsing the graphics card resource information of the face recognition application end from the hardware architecture information; the graphics card resource information includes graphics card category information and graphics card quantity information; Determine a first serialized file set from the face recognition model catalog library according to the graphics card quantity information; According to the graphics card category information, a target serialization file is determined and obtained from the first serialization file set.

2. The method for configuring a face recognition model according to claim 1, characterized in that: The face recognition model catalog library is established by the following steps: Acquire a training image and a label corresponding to the training image; the training image includes a face image, and the label is used to represent information of the face image; Inputting the training image into an initialized face recognition model to perform face recognition to obtain a first recognition result; The first recognition result is used to represent information of the facial image; According to the first recognition result and the label, updating the parameters of the initialized face recognition model to obtain a trained face recognition model; According to a preset hardware architecture, the trained face recognition model is serialized to obtain multiple serialized files; A face recognition model catalog library is established based on the multiple serialized files.

3. The configuration method of a face recognition model according to claim 2, characterized in that: The step of inputting the training image into an initialized face recognition model for face recognition to obtain a first recognition result includes: Inputting the training image into an initialized face recognition model, performing face detection on the training image, and segmenting the image to obtain a face image; Extracting feature information of the face image; According to the feature information, matching and recognition are performed in a preset face database to obtain a first recognition result.

4. A method for configuring a face recognition model, characterized in that: include: Initiate a model configuration request to the server; the model configuration request includes hardware architecture information of the face recognition application end; Receive the target serialization file sent by the server, and load and configure the face recognition model according to the target serialization file; The target serialization file is obtained by the server through the following steps: Parsing the graphics card resource information of the face recognition application end from the hardware architecture information; the graphics card resource information includes graphics card category information and graphics card quantity information; Determine a first serialized file set from a face recognition model catalog library according to the graphics card quantity information; According to the graphics card category information, a target serialization file is determined and obtained from the first serialization file set.

5. A method for configuring a face recognition model, characterized in that: include: The face recognition application terminal initiates a model configuration request to the server; the model configuration request includes hardware architecture information of the face recognition application terminal; The server receives the model configuration request, and queries and obtains a target serialization file of the face recognition model corresponding to the hardware architecture information in a face recognition model catalog library according to the hardware architecture information; The server sends the target serialization file to the face recognition application end; The face recognition application receives the target serialization file sent by the server, and loads and configures the face recognition model according to the target serialization file; The step of querying and acquiring a target serialization file of a face recognition model corresponding to the hardware architecture information in a face recognition model catalog library according to the hardware architecture information includes: Parsing the graphics card resource information of the face recognition application end from the hardware architecture information; the graphics card resource information includes graphics card category information and graphics card quantity information; Determine a first serialized file set from the face recognition model catalog library according to the graphics card quantity information; According to the graphics card category information, a target serialization file is determined and obtained from the first serialization file set.

6. A face recognition system, characterized in that: Including server and face recognition application end; The face recognition application end is used to initiate a model configuration request to the server, receive the target serialization file sent by the server, load and configure the face recognition model according to the target serialization file to perform face recognition, and return the face recognition result to the server; the model configuration request includes the hardware architecture information of the face recognition application end; The server is used to receive the model configuration request, query and obtain the target serialization file of the face recognition model corresponding to the hardware architecture information in the face recognition model catalog library according to the hardware architecture information, and send the target serialization file to the face recognition application end; The server is also used to receive the face recognition result; The step of querying and acquiring a target serialization file of a face recognition model corresponding to the hardware architecture information in a face recognition model catalog library according to the hardware architecture information includes: Parsing the graphics card resource information of the face recognition application end from the hardware architecture information; the graphics card resource information includes graphics card category information and graphics card quantity information; Determine a first serialized file set from the face recognition model catalog library according to the graphics card quantity information; According to the graphics card category information, a target serialization file is determined and obtained from the first serialization file set.

7. A computer device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the configuration method of the face recognition model as described in any one of claims 1-4.

8. A computer-readable storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to implement the configuration method of the face recognition model as described in any one of claims 1-4 when executed by the processor.

Citation Information

Patent Citations

  • Model management method, electronic equipment and medium

    CN112036558A

  • Face recognition model training method and device and computer program product

    CN113657269A