Target object identification method, electronic device and storage medium

文档序号:106337 发布日期:2021-10-15 浏览:22次 中文

阅读说明:本技术 目标对象识别的方法、电子设备及存储介质 (Target object identification method, electronic device and storage medium ) 是由 保长存 陈智超 朱海涛 江坤 户磊 于 2021-09-09 设计创作,主要内容包括:本发明实施例涉及图像识别领域,公开了一种目标对象识别的方法、电子设备及存储介质。本发明中目标对象识别的方法,包括:获取包含目标对象的目标图像;将目标图像输入预设的色彩校准网络,获得与目标图像匹配的色彩校准矩阵,色彩校准矩阵为N*3的矩阵,N为大于等于3的整数,色彩校准网络是基于预先训练的目标对象识别网络训练获得;根据色彩校准矩阵,逐像素点对目标图像的色彩进行校准,获得目标校准图像;将目标校准图像输入至目标对象识别网络中,获得识别结果。采用本实施例,提高目标对象识别网络对目标对象识别的准确性。(The embodiment of the invention relates to the field of image recognition, and discloses a target object recognition method, electronic equipment and a storage medium. The method for identifying the target object comprises the following steps: acquiring a target image containing a target object; inputting a target image into a preset color calibration network to obtain a color calibration matrix matched with the target image, wherein the color calibration matrix is a matrix of N x 3, N is an integer greater than or equal to 3, and the color calibration network is obtained by training based on a pre-trained target object identification network; calibrating the color of the target image pixel by pixel according to the color calibration matrix to obtain a target calibration image; and inputting the target calibration image into a target object identification network to obtain an identification result. By adopting the embodiment, the accuracy of the target object identification network in identifying the target object is improved.)

1. A method of target object identification, comprising:

acquiring a target image containing a target object;

inputting the target image into a preset color calibration network to obtain a color calibration matrix matched with the target image, wherein the color calibration matrix is a matrix of N x 3, N is an integer greater than or equal to 3, and the color calibration network is obtained based on pre-trained target object identification network training;

calibrating the color of the target image pixel by pixel according to the color calibration matrix to obtain a target calibration image;

and inputting the target calibration image into the target object identification network to obtain an identification result.

2. The method of claim 1, wherein before the inputting the target image into a preset color calibration network and obtaining a color calibration matrix matching the target image, the method further comprises:

obtaining standard color data for each sample object, the standard color data comprising: a standard RGB mean and a standard RGB variance;

and training an initial color calibration network to converge according to the image of each sample object and the corresponding standard color data to obtain the color calibration network.

3. The method for target object identification according to claim 2, wherein the obtaining the standard color data of each sample object according to the image training set comprises:

for each sample object, the following processing is performed:

acquiring an image of the sample object with the highest quality score as a standard image of the sample object;

acquiring a region covered by the sample object in the standard image as a standard image region;

determining an RGB mean of the standard image region as the standard RGB mean of the sample object, and determining an RGB variance of the standard image region as the standard RGB variance of the sample object.

4. The method of claim 3, wherein training an initial color calibration network to converge to obtain the color calibration network based on the image of each sample object and the corresponding standard color data comprises:

respectively determining a mean loss function and a variance loss function according to the standard color data of each sample object;

determining a classification loss function according to the image of each sample object and the target object identification network;

fusing the classification loss function, the mean loss function and the variance loss function to generate a color calibration loss function of the color calibration network;

training the initial color calibration network to converge according to the color calibration loss function.

5. The method of target object identification according to claim 4, wherein the mean loss function is expressed as:Loss mean = | mean rgb - Mean rgb l, wherein,Loss mean the mean loss function is expressed as a function of,mean rgb the RGB mean of the image area representing the sample object,Mean rgb representing the standard RGB mean;

the variance loss function is expressed as:Loss var = | var rgb -Var rgb l, wherein,Loss var the function of the loss of variance is expressed,var rgb the RGB variances of the image areas representing the sample objects,Var rgb representing the standard RGB variance.

6. The method of claim 4, wherein determining a classification loss function based on the image of each of the sample objects and the target object identification network comprises:

initializing a classifier in the target object recognition network;

inputting the image of each sample object into the initial color calibration network to obtain an initial calibration image;

inputting the initial calibration image into the target object identification network after initialization processing to obtain the calibration identification characteristics of the sample object;

inputting the standard image into the target object identification network after initialization processing to obtain standard identification characteristics of the sample object;

and determining the classification loss function according to the calibration identification features and the standard identification features.

7. The method of target object identification according to any of claims 4 to 6, wherein the color loss function comprises: a closed-loop loss function indicative of a difference between a first calibration image and a second calibration image, the first calibration image being an image of the color calibration network to which the sample image was trained, the second calibration image being an image of the color calibration network to which the first calibration image was trained.

8. The method of target object identification according to claim 7, wherein said fusing the classification loss function, the mean loss function, and the variance loss function to generate a color calibration loss function of the color calibration network comprises:

respectively setting respective weights of the mean loss function, the variance loss function, the classification loss function and the closed-loop loss function, wherein the weight of the classification loss function is 1;

and superposing the mean loss function, the variance loss function, the classification loss function and the closed-loop loss function according to respective weights of the mean loss function, the variance loss function, the classification loss function and the closed-loop loss function to generate the color calibration loss function.

9. An electronic device, comprising:

at least one processor; and the number of the first and second groups,

a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,

the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of target object identification according to any one of claims 1-8.

10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method of target object identification according to any one of claims 1 to 8.

Technical Field

The embodiment of the invention relates to the field of image recognition, in particular to a target object recognition method, electronic equipment and a storage medium.

Background

The method of target object recognition is a recognition technique for performing recognition based on the characteristics of an object, for example, a face recognition technique. With the development of face recognition technology, because of its characteristics of accurate data, high safety factor, convenient use and the like, face recognition technology is widely applied to various industries, such as unmanned retail machines, attendance machines, access control systems and other devices. Electronic devices with face recognition technology usually store images of the same person at different times and in different scenes; the electronic equipment collects the face image of the person in a face recognition scene, compares the collected face image with the stored face image of the person, and takes the comparison result as a face recognition result.

However, images of the same person in different environments often have differences in color, brightness and saturation, which causes a large difference between the similarity between an image of a person captured by an electronic device and a stored image of the person, and reduces the accuracy of face recognition.

Disclosure of Invention

The invention aims to provide a target object identification method, electronic equipment and a storage medium, which can improve the accuracy of target object identification of a target object identification network.

In order to solve the above technical problem, in a first aspect, an embodiment of the present application provides a method for target object identification, including: acquiring a target image containing a target object; inputting a target image into a preset color calibration network to obtain a color calibration matrix matched with the target image, wherein the color calibration matrix is a matrix of N x 3, N is an integer greater than or equal to 3, and the color calibration network is obtained by training based on a pre-trained target object identification network; calibrating the color of the target image pixel by pixel according to the color calibration matrix to obtain a target calibration image; and inputting the target calibration image into a target object identification network to obtain an identification result.

In a second aspect, an embodiment of the present application provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method for target object recognition.

In a third aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program, which when executed by a processor, implements the method for target object recognition described above.

In the embodiment of the application, a target image is input into a preset color calibration network, a color calibration matrix matched with the target image is obtained, and the color calibration matrixes of different target images are different, so that the color calibration accuracy of the color calibration matrix on the target image is ensured, and the brightness, the tone and the like of the calibrated target object tend to be uniform, so that the problem of inaccurate identification caused by the influence of the tone and the brightness when the target object is identified by the target object identification network is avoided, and the accuracy of the target object identification network in identifying the target object is improved; the calibration process is carried out through the color calibration matrix, so that the calculated amount is small, and the color of the target image is calibrated in a pixel-by-pixel mode, so that the loss of image details can be reduced, and the accuracy of subsequent target object identification is improved. In addition, the color calibration network is obtained based on the training of the pre-trained target object recognition network, and the training of the color calibration network and the training of the target object recognition network are decoupled because the pre-training of the target object recognition network is completed, that is, the target object recognition network is fixed.

Drawings

One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the figures in which like reference numerals refer to similar elements and which are not to scale unless otherwise specified.

Fig. 1 is a flowchart of a method for target object identification according to an embodiment of the present application;

FIG. 2 is a schematic diagram of an implementation of a training color calibration network according to an embodiment of the present application;

FIG. 3 is a schematic diagram of a sample image and an image region of the sample image provided according to an embodiment of the application;

FIG. 4 is a schematic diagram illustrating an embodiment of training an initial color calibration network to converge according to an image of each sample object and corresponding standard color data according to an embodiment of the present application;

FIG. 5 is a diagram illustrating an implementation of determining a classification loss function according to an embodiment of the present application;

FIG. 6 is a schematic diagram of a specific implementation of color calibration network training provided in accordance with an embodiment of the present application;

FIG. 7 is a schematic diagram of obtaining a color calibration loss function according to an embodiment of the present application;

FIG. 8 is a diagram illustrating another specific implementation of determining a classification loss function according to an embodiment of the present application;

fig. 9 is a schematic structural diagram of an electronic device provided according to an embodiment of the present application.

Detailed Description

In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments.

The following embodiments are divided for convenience of description, and should not constitute any limitation to the specific implementation manner of the present invention, and the embodiments may be mutually incorporated and referred to without contradiction.

Currently, a target object in an Image is identified, and the identification accuracy is related to the brightness and the color tone of the target object in the Image, whereas the traditional color calibration is performed at the level of Image Signal Processing (ISP), that is, post-Processing is performed on a picture after the camera finishes shooting. Two common methods for conventional color calibration are: calibration for a camera. And shooting a standard color plate, calculating a color calibration matrix according to the shot color and the actual color, and calibrating the shot image based on the color calibration matrix. And secondly, self-adaptive calibration for the scene, such as automatic exposure, white balance algorithm and the like.

The above two methods are not calibration for a specific target object, for example, in face recognition, since color calibration is not performed for a face, the face area still has inconsistent brightness, color tone and the like after the traditional color calibration. The greater the difference in color and appearance of different face images of the same person is, the greater the difference in similarity between the stored different face images of the same person and the acquired face images is, resulting in lower accuracy of face recognition.

The embodiment of the application relates to a target object identification method. The method for target object recognition may be performed by an electronic device, such as a robot, a face recognition device, an unmanned vending machine, etc. The flow of the target object identification method is shown in fig. 1:

step 101: a target image containing a target object is acquired.

Specifically, the target object may be an object such as cola, mineral water, etc.; but also a human body such as a human face. The electronic device can acquire a target image containing a target object through a camera of the electronic device, and can also receive the target image containing the target object acquired by other devices. For the convenience of understanding, the target object in the present application is described by taking a human face as an example.

Step 102: inputting the target image into a preset color calibration network to obtain a color calibration matrix matched with the target image, wherein the color calibration matrix is a matrix of N x 3, N is an integer greater than or equal to 3, and the color calibration network is obtained based on training of a pre-trained target object identification network.

Specifically, a color calibration network is trained in advance, which may employ a Convolutional Neural network (Convolutional Neural Networks,CNN) Networks of structures, e.g.CCNetThe network, the input data of the color calibration network is an image, the output data is a color calibration matrix matched with the input image, the dimension of the color calibration matrix can be N x 3, N can be 3 and above, for example, N is 10. The training set in which the color calibration network is trained includes sample images of different target objects. If the target image is a face image, the face image is input into the color calibration network, the color calibration network outputs a color calibration matrix matched with the face image, and the dimension of the color calibration matrix is 10 x 3.

Step 103: and calibrating the color of the target image pixel by pixel according to the color calibration matrix to obtain a target calibration image.

Specifically, the electronic device performs color calibration on the target image pixel by pixel, and the processing for each pixel is as follows: and filling the current pixel points to the length of N according to a preset rule to form a new matrix of 1 x N, and multiplying the new matrix by the color calibration matrix to obtain new pixel points. For example, if the color calibration image has dimensions 10 × 3, denoted as C, the current pixel point is denoted as (r,g,b) (ii) a The new pixel point is marked as (r new ,g new ,b new ) (ii) a The new matrix after filling is a matrix of 1 × 10, as shown in formula (1):

[r g b r*r g*g b*b r*g r*b b*g r*g*b]formula (1);

the calibration may be as shown in equation (2):

[r new g new b new ]=[r g b r*r g*g b*b r*g r*b b*g r*g*b]*Cformula (2);

the electronic equipment fills the original pixel points, and the expression of the original pixels can be enriched, so that the calibrated pixel points are more accurate.

Step 104: and inputting the target calibration image into a target object identification network to obtain an identification result.

And identifying the target calibration image through a target object identification network trained to be converged in advance to obtain an identification result. The method for recognizing the target object is assumed to be applied to a face recognition scene, and the brightness, the tone and the like of the calibrated face image tend to the brightness and the tone of the standard image, so that the problem of recognition error caused by different colors of the image can be avoided when the target object recognition network performs face recognition.

The method can improve the quality of the image in the scene with poor illumination environment and also improve the accuracy of target object identification.

In the embodiment of the application, a target image is input into a preset color calibration network, a color calibration matrix matched with the target image is obtained, and the color calibration matrixes of different target images are different, so that the color calibration accuracy of the color calibration matrix on the target image is ensured, and the brightness, the tone and the like of the calibrated target object tend to be uniform, so that the problem of inaccurate identification caused by the influence of the tone and the brightness when the target object is identified by the target object identification network is avoided, and the accuracy of the target object identification network in identifying the target object is improved; the calibration process is carried out through the color calibration matrix, so that the calculated amount is small, and the color of the target image is calibrated in a pixel-by-pixel mode, so that the loss of image details can be reduced, and the accuracy of subsequent target object identification is improved. In addition, the color calibration network is obtained based on the training of the pre-trained target object recognition network, and the training of the color calibration network and the training of the target object recognition network are decoupled because the pre-training of the target object recognition network is completed, that is, the target object recognition network is fixed.

In one embodiment, before inputting the target image into the preset color calibration network, the present embodiment provides a way to train the color calibration network, and the training process is as shown in fig. 2.

Step 101-1: obtaining standard color data for each sample object, the standard color data comprising: standard RGB mean and standard RGB variance.

The electronic device performs the following for each sample object: acquiring an image of a sample object with the highest quality score as a standard image of the sample object; acquiring a region covered by a sample object in a standard image as a standard image region; the RGB mean of the standard image region is determined as the standard RGB mean of the sample object and the RGB variance of the standard image region is determined as the standard RGB variance of the sample object.

Specifically, the image training set includes different respective images of different sample objects, for example, different images of 1 ten thousand different persons, each of which has 1000 different images. For training purposes, each person may be provided with unique identification information, for example, images of ten thousand persons in an image training set may be provided with an ID number. And acquiring standard color data of each sample object, wherein the processing process of each sample object is the same.

Assume that the image training set includes 3 different sample images, corresponding to ID1, ID2, and ID3, respectively; the example of obtaining the standard color data of ID2 will now be described.

The electronic equipment acquires a sample image with the highest quality score from all the images of the ID2 as a standard image of the ID2, wherein the standard with the highest quality score is as follows: clear image, ID2 is front lit, no occlusion, no shadow, etc. The electronic device can receive the sample image with the highest quality score selected by the user; and quality scoring can be carried out on each sample image in the ID2 through a pre-trained quality scoring network, the quality scores are ranked, and the sample image with the highest quality score is obtained as the standard image of the ID 2. The electronic device acquires the area covered by the ID2 in the standard image as the standard image area of the ID2, that is, the standard image area is only the sample object without a background image or the like. The mode of the electronic device for acquiring the standard image area can be that the key points of the sample object are acquired, the area of the irrelevant key points is taken as a non-standard image area, and the positions of all the key points in the sample object form the standard image area. The mode of acquiring the standard image region by the electronic device may be to train a segmentation network for segmenting the standard image region in advance, where input data of the segmentation network is an image and output data of the segmentation network is the standard image region. For example, if the sample object is a face, the electronic device inputs the sample image into the segmentation network to obtain an image including a face contour, that is, the standard image region is a contour region of the face, as shown in fig. 3, the left side of the arrow is the standard image, and the right side of the arrow is the standard image region. The electronic device calculates the RGB mean of the standard image region as the standard RBG mean of ID2, and the RGB variance of the standard image region as the standard RGB variance of ID 2.

The electronic equipment acquires a sample image with the highest quality score in each sample object as a standard image, acquires a region covered by the sample object in the standard image as a standard image region, can objectively reflect the color of the sample object in the standard image based on the RGB mean value and the RGB variance of the standard image region, and has high accuracy for identifying the target object by the target object identification network due to the highest quality score; therefore, the color calibration network is trained based on the standard color data, so that the color calibration matrix obtained by the color calibration network is more accurate.

Step 101-2: and training the initial color calibration network to be convergent according to the image of each sample object and the corresponding standard color data, and obtaining the color calibration network.

Specifically, input data of a color calibration network is an image, output data of the color calibration network is a color calibration matrix, an electronic device inputs the image of a sample object into the color calibration network in a training process, the input image is calibrated according to the output training calibration matrix, an area covered by the calibrated sample object is obtained as a sample object area, an RGB mean value and an RGB variance of the sample object area are obtained, a first difference value between the RGB mean value of the sample object area and a standard RGB mean value of the sample object is judged, a second difference value between the RGB variance of the sample object area and the RGB variance of the sample object is obtained, if the first difference value and the second difference value are both smaller than a preset threshold value, the color calibration network converges, and if not, the color calibration network is iteratively trained.

In the embodiment, the RGB mean value and the RGB variance can accurately reflect the color, the tone and the like in the image; the quality of the image influences the accuracy rate of the identification of the target object identification network, so that the standard color data of the sample object is obtained, and the color calibration network obtained by training is accurate; the accuracy of the target object identified by the target object identification network is high due to the highest quality score; therefore, the color calibration network is trained based on the standard color data, so that the color calibration matrix obtained by the color calibration network is more accurate.

In one embodiment, a specific way will be described for the step 101-2 to train the initial color calibration network to converge and obtain the color calibration network according to the image of each sample object and the corresponding standard color data, and the implementation process is as shown in fig. 4:

step 101-1: obtaining standard color data for each sample object, the standard color data comprising: standard RGB mean and standard RGB variance.

Step 101-21: and respectively determining a mean loss function and a variance loss function according to the standard color data of each sample object.

Specifically, the mean loss function is expressed as:Loss mean = | mean rgb - Mean rgb l, wherein,Loss mean the mean loss function is expressed as a function of,mean rgb RGB mean value of image region representing sample object, i.e. in this embodimentmean rgb The RGB mean value representing the face region,Mean rgb represents the standard RGB mean; the variance loss function is expressed as:Loss var = | var rgb - Var rgb l, wherein,Loss var the function of the loss of variance is expressed,var rgb the RGB variance of the image region representing the sample object, in this embodiment the RGB variance of the face region,Var rgb standard RGB variance is indicated.

Wherein,mean rgb Can be calculated in the manner of equation (3):

formula (3);

mean rgb RGB mean value of image area representing sample object, i.e. in the present embodimentmean rgb The RGB mean value representing the face region,CCNeta network of color calibration is represented that,CCNetI) Represents the image after the color calibration and the color calibration,Maskan image region representing a sample object.

The calculation formula of the variance may be as in formula (4):

formula (4);

var rgb representing the RGB variance of the image area of the sample object, i.e. in this embodimentvar rgb The RGB variance representing the face region is represented,Var rgb represents standard RGB variance,CCNetA network of color calibration is represented that,CCNetI) Represents the image after the color calibration and the color calibration,Maskan image region representing a sample object, i.e., a face region in the present embodiment.

For example, in the field of face recognition, the RGB mean and the RGB variance of the face region of each image after being calibrated in the training process are counted according to the image region of the face corresponding thereto, and the RGB mean and the RGB variance of the face region in each image are constrained to approach the uniform standard RGB mean and standard RGB variance.

The variance loss function and the mean loss function only count the mean value and the variance of RGB of the face area, and constrain the mean value and the variance of RGB of the face area to be close to the standard value after calibration; so that the brightness, tone and other aspects of the calibrated face picture tend to the standard image. The electronic equipment calculates the standard RGB mean value and the RGB variance of the standard image with high quality score, and trains by the standard RGB mean value and the RGB variance, so that the accuracy of the color calibration network can be improved.

Step 101-22: and determining a classification loss function according to the image of each sample object and the target object identification network.

In particular, the classification loss function may be determined by the target object recognition network.

Step 101-23: and fusing the classification loss function, the mean loss function and the variance loss function to generate the color calibration loss function of the color calibration network.

Specifically, the fusion mode may be that the electronic device superimposes the classification loss function, the mean loss function, and the variance loss function to obtain the color calibration loss function of the color calibration network.

Step 101-24: the initial color calibration network is trained to converge according to a color calibration loss function.

And the electronic equipment trains the initial color calibration network according to the image training set, and when the color calibration loss function value is minimum, the color calibration network is obtained.

In this embodiment, a method for obtaining the mean loss function and the variance loss function is provided.

In one embodiment, a specific implementation of determining a classification loss function is provided, and a schematic diagram thereof is shown in fig. 5:

step 101-1: obtaining standard color data for each sample object, the standard color data comprising: standard RGB mean and standard RGB variance.

Step 101-21: and respectively determining a mean loss function and a variance loss function according to the standard color data of each sample object.

Step 101-221: and initializing a classifier in the target object recognition network.

The target object recognition network may be pre-trained to converge, and to improve the accuracy of the trained color calibration network, the classifier in the target object recognition network may be initialized with a standard image, for example, for each face ID, the electronic device acquires the standard image of the face ID, and then initializes the classifier Classfier with the recognition features extracted by the FRNet network. The classifier Classfier only serves as an auxiliary layer, which remains fixed during the training process, and FRNet identifies the network for the target object trained to converge.

The electronic device initializes the classifier by using the recognition features of the standard image of each sample object, and calculates the simplest classification loss in the form of softmax, so that the recognition under multiple actual scenes can be simulated. The classifier is initialized in a manner similar to the electronic device binning the standard image of each sample object. The initialization operation ensures better recognition of the color calibrated sample image.

Step 101-222: the image of each sample object is input to an initial color calibration network to obtain an initial calibration image.

Step 101-223: and inputting the initial calibration image into the target object identification network after initialization processing to obtain the calibration identification characteristics of the sample object.

The electronic equipment calculates the classification loss by means of a trained target object recognition network FRNet so as to ensure that the face picture recognition effect after color calibration is better. The target object recognition network acts as an auxiliary network that remains fixed during the training process. The color calibration network training process is shown in fig. 6, that is, a sample image passes through a CCNet network in training to obtain a color calibration matrix of the sample image, the electronic device performs color calibration on the sample image according to the color calibration matrix to obtain a calibrated sample image, the calibrated sample image is input into a target object identification network FRNet to obtain an identification feature of the calibrated sample image, wherein,Ia representation of the image of the sample is shown,CCNetrepresenting the color calibration network in the training,I Aligned indicating calibrationThe image of the sample after that is taken,Embeddingrepresenting the identifying features of the calibrated sample image.

It should be noted that the currently used image training set is different from the image training set used for training the FRNet, which can improve the verification effect of the target object identification network, thereby improving the accuracy of the color calibration network.

Step 101-224: and inputting the standard image into the target object identification network after initialization processing to obtain the standard identification characteristics of the sample object.

Step 101-225: and determining a classification loss function according to the calibration identification features and the standard identification features.

The formula for the classification loss function can be as shown in formula (5):

formula (5);

wherein the content of the first and second substances,Embedding =FRNetCCNetI) That is to sayEmbeddingRepresenting the identifying features of the calibrated sample image,w i 、w j represents the first in the classifieri、jA standard identification characteristic of the individual; the upper typeIIndex number of target object corresponding to sample image in classifieriw i 、w j AndEmbeddingthe modular normalization processing is carried out on the data,w i * Embeddingand expressing cosine similarity, and representing the similarity between the sample image and the standard image.

Step 101-23: and fusing the classification loss function, the mean loss function and the variance loss function to generate the color calibration loss function of the color calibration network.

Step 101-24: the initial color calibration network is trained to converge according to a color calibration loss function.

In the embodiment, the target object recognition network is used as an auxiliary layer, so that the accuracy of the color calibration network in training can be improved in an auxiliary manner.

In one embodiment, the color calibration loss function further includes a closed-loop loss function, and a specific implementation of obtaining the color calibration loss function is provided in this example, and a schematic diagram thereof is shown in fig. 7:

step 101-1: obtaining standard color data for each sample object, the standard color data comprising: standard RGB mean and standard RGB variance.

Step 101-21: and respectively determining a mean loss function and a variance loss function according to the standard color data of each sample object.

Step 101-221: and initializing a classifier in the target object recognition network.

Step 101-222: the image of each sample object is input to an initial color calibration network to obtain an initial calibration image.

Step 101-223: and inputting the initial calibration image into the target object identification network after initialization processing to obtain the calibration identification characteristics of the sample object.

Step 101-224: and inputting the standard image into the target object identification network after initialization processing to obtain the standard identification characteristics of the sample object.

Step 101-225: and determining a classification loss function according to the calibration identification features and the standard identification features.

Step 101-231: a closed-loop loss function is obtained.

The color loss function includes: a closed-loop loss function indicative of a difference between a first calibration image and a second calibration image, the first calibration image being an image of the trained color calibration network of the sample image, the second calibration image being an image of the trained color calibration network of the first calibration image. The formula for the closed-loop loss function can be shown as formula (6):

Loss cycle = | CCNetCCNetI))-CCNetI) Equation (6);

wherein the content of the first and second substances,CCNetrepresenting the color calibration network in the training,CCNetI) A first calibration image is represented which is,CCNetCCNetI) Represents a second calibration image. Training colorThe purpose of the color calibration network is to calibrate the colors of the image to the colors in the standard image; and a closed loop constraint is added, so that the robustness of the calibration network can be increased, and the accuracy of the color calibration network can be improved.

Step 101-232: and respectively setting the respective weights of the mean loss function, the variance loss function, the classification loss function and the closed-loop loss function.

The respective weights of the loss function, the variance loss function, the classification loss function, and the closed-loop loss function may be set as necessary.

Step 101-233: and superposing the average loss function, the variance loss function, the classification loss function and the closed-loop loss function according to respective weights to generate a color calibration loss function.

The color calibration loss function can be shown as equation (7):

Loss all =Loss classify +w 1*Loss cycle +w 2*Loss mean +w 3*Loss var formula (7);

wherein the content of the first and second substances,Loss all a function representing the loss of color calibration is expressed,Loss classify a function representing the loss of classification is represented,Loss cycle a function representing the loss of the closed loop,Loss mean representing a mean loss function;Loss var the function of the loss of variance is expressed,w 1is the weight of the closed-loop loss function,w 2is the weight of the mean loss function,w 3the weight of the classification loss function is fixed to 1 as the weight of the variance loss function.

Step 101-24: the initial color calibration network is trained to converge according to a color calibration loss function.

Training the color calibration loss network as a whole, the training includes two stages, as shown in fig. 8, the first stage is: i.e. sample images are trainedCCNetA network for obtaining a color calibration matrix of the sample imageThe electronic equipment carries out color calibration on the sample image according to the color calibration matrix to obtain a calibrated sample image, and the calibrated sample image is input to the target object identification networkFRNetObtaining an identification feature of the calibrated sample image, wherein,Ia representation of the image of the sample is shown,CCNetrepresenting the color calibration network in the training,I Aligned representing the image of the sample after calibration,Embeddingrepresenting the identifying features of the calibrated sample image,Classfierrepresenting classifiers in a target object recognition network. The second stage, i.e. the electronic device passes the calibrated sample image throughCCNetThe network obtains a new calibrated sample image, wherein,I Aligned2 indicating that a new calibrated sample image is obtained.

The steps of the above methods are divided for clarity, and the implementation may be combined into one step or split some steps, and the steps are divided into multiple steps, so long as the same logical relationship is included, which are all within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.

An embodiment of the present invention relates to an electronic device, and a structure of the electronic device is shown in the figure, and includes: at least one processor 201; and a memory 202 communicatively coupled to the at least one processor 201; the memory 202 stores instructions executable by the at least one processor 201, and the instructions are executed by the at least one processor 201 to enable the at least one processor to perform the above-mentioned target object identification method.

Where the memory 202 and the processor 201 are connected by a bus, the bus may comprise any number of interconnected buses and bridges, the buses linking together one or more of the various circuits of the processor and the memory. The bus may also link various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor 201 is transmitted over a wireless medium through an antenna, which further receives the data and transmits the data to the processor.

The processor 201 is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And the memory may be used to store data used by the processor in performing operations.

Embodiments of the present application relate to a computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the above-mentioned method of target object recognition.

Those skilled in the art can understand that all or part of the steps in the method of the foregoing embodiments may be implemented by a program to instruct related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.

18页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于可变形图谱的医学影像配准网络训练数据集扩充方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!