Search

CN-115830339-B - Target identification method, device, terminal equipment and readable storage medium

CN115830339BCN 115830339 BCN115830339 BCN 115830339BCN-115830339-B

Abstract

The application is suitable for the technical field of image recognition, and provides a target recognition method, a target recognition device, terminal equipment and a readable storage medium. The target identification method specifically comprises the steps of obtaining a target image of a target to be identified, extracting features of the target image to obtain image features in the target image, and inputting the image features into a target identification network model to obtain an identification result of a class to which the target to be identified belongs, wherein a loss function of the target identification network model is a function obtained based on intra-class constraints and inter-class constraints, the intra-class constraints are used for constraining intra-class distances between sample image features of a sample target and class centers of the class to which the sample target belongs, and the inter-class constraints are used for constraining inter-class distances between class centers of different classes and/or inter-class angles between the class centers of different classes. The embodiment of the application can improve the robustness of target identification.

Inventors

  • WANG KAN
  • PANG JIANXIN
  • TAN HUAN

Assignees

  • 深圳市优必选科技股份有限公司

Dates

Publication Date
20260508
Application Date
20221212

Claims (9)

  1. 1. A method of target identification, comprising: acquiring a target image of a target to be identified; extracting features of the target image to obtain image features in the target image; Inputting the image features into a target recognition network model to obtain a recognition result of the class to which the target to be recognized belongs, wherein a loss function of the target recognition network model is a function obtained based on intra-class constraints and inter-class constraints, the intra-class constraints are used for constraining intra-class distances between sample image features of a sample target and class centers of the class to which the sample target belongs, and the inter-class constraints are used for constraining inter-class distances between class centers of different classes and/or inter-class angles between the class centers of different classes; Wherein the inter-class constraints include orthogonal constraints for constraining the inter-class angles, the orthogonal constraints for increasing the difference in direction between class centers of different classifications, expressed as: ; Wherein, the Representing a sub-function corresponding to the orthogonal constraint in the loss function, Representing the total number of classifications, Representing the class center of the i-th class, Representing the class center of the j-th class, The norms are represented by the numbers, Representation of And a maximum value between 0.
  2. 2. The target recognition method of claim 1, wherein the inter-class constraints include a metric constraint for constraining the inter-class distances, the metric constraint expressed as: ; Wherein, the Representing a sub-function corresponding to the metric constraint in the loss function, Representing the total number of classifications, Representing the class center of the i-th class, Representing the class center of the j-th class, Is a preset distance threshold value, and the distance threshold value is set, Representation of And a maximum value between 0 and 0, Representation of And Distance between them.
  3. 3. The object recognition method of claim 1, wherein the intra-class constraint is expressed as: ; Wherein, the Representing the total number of sample images, Represent the first The sample image features of each of the sample images, Represent the first The sample targets of the sample images belong to the class center of the class, Representation of And Distance between them.
  4. 4. The object recognition method of claim 1, wherein the loss function is expressed as: ; Wherein, the Representing the total number of sample images, Represent the first The sample image features of each of the sample images, Represent the first The sample targets of the sample images belong to the class center of the class, Representation of And The distance between the two plates is set to be equal, Representing the total number of classifications, Representing the class center of the i-th class, Representing the class center of the j-th class, The norms are represented by the numbers, Representation of And a maximum value between 0 and 0, Is a preset distance threshold value, and the distance threshold value is set, Representation of And Distance between them.
  5. 5. The method according to any one of claims 1 to 4, wherein the training process of the object recognition network model includes: Acquiring a sample image of the sample target; and carrying out iterative training on the identification network model to be trained by using the sample image with the loss function as a target, until the loss value of the loss function is smaller than or equal to a preset loss value threshold value, or until the iteration times of the identification network model to be trained is larger than or equal to a time threshold value, so as to obtain the target identification network model.
  6. 6. The method for identifying an object according to claim 5, wherein in the process of iteratively training the identification network model to be trained using the sample image, comprising: And carrying out iterative updating on the class center of the class to which the sample target belongs.
  7. 7. An object recognition apparatus, comprising: The image acquisition unit is used for acquiring a target image of a target to be identified; The feature extraction unit is used for extracting features of the target image to obtain image features in the target image; The target recognition unit is configured to input the image feature into a target recognition network model to obtain a recognition result of a class to which the target to be recognized belongs, where a loss function of the target recognition network model is a function obtained based on an intra-class constraint and an inter-class constraint, where the intra-class constraint is used to constrain an intra-class distance between a sample image feature of a sample target and a class center of the class to which the sample target belongs, and the inter-class constraint is used to constrain an inter-class distance between class centers of different classes and/or an inter-class angle between class centers of different classes, where the inter-class constraint includes an orthogonal constraint used to constrain the inter-class angle, and the orthogonal constraint is used to increase a difference in direction between the class centers of different classes, and is expressed as: ; Wherein, the Representing a sub-function corresponding to the orthogonal constraint in the loss function, Representing the total number of classifications, Representing the class center of the i-th class, Representing the class center of the j-th class, The norms are represented by the numbers, Representation of And a maximum value between 0.
  8. 8. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the object recognition method according to any one of claims 1 to 6 when the computer program is executed.
  9. 9. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the object recognition method according to any one of claims 1 to 6.

Description

Target identification method, device, terminal equipment and readable storage medium Technical Field The present application belongs to the technical field of image recognition, and in particular, relates to a target recognition method, a device, a terminal device, and a readable storage medium. Background Object recognition is an important application field of computer vision technology, and is often implemented by using a network model based on deep learning in the related art. The loss function is one of the important components of the network model. The network model is typically model trained with data as input by minimizing a loss function to optimize the model by minimizing the error between the predicted value of the network model for the data and the true value of the data. In the related art, model training is generally performed using a Center Loss function (Center Loss), which can optimize the intra-class distance. However, in practical application, the robustness of the model obtained by training the center loss function is often insufficient when the target identification is performed. Disclosure of Invention The embodiment of the application provides a target identification method, a device, terminal equipment and a readable storage medium, which can improve the robustness of target identification. The first aspect of the embodiment of the application provides a target identification method, which comprises the steps of obtaining a target image of a target to be identified, extracting features of the target image to obtain image features in the target image, and inputting the image features into a target identification network model to obtain an identification result of a class to which the target to be identified belongs, wherein a loss function of the target identification network model is a function obtained based on intra-class constraint and inter-class constraint, the intra-class constraint is used for constraining intra-class distances between sample image features of a sample target and class centers of the class to which the sample target belongs, and the inter-class constraint is used for constraining inter-class distances between class centers of different classes and/or inter-class angles between the class centers of different classes. The object recognition device provided by the second aspect of the embodiment of the application comprises an image acquisition unit, a feature extraction unit and an object recognition unit, wherein the image acquisition unit is used for acquiring an object image of an object to be recognized, the feature extraction unit is used for extracting features of the object image to obtain image features in the object image, the object recognition unit is used for inputting the image features into an object recognition network model to obtain a recognition result of a class to which the object to be recognized belongs, the loss function of the object recognition network model is a function obtained based on intra-class constraint and inter-class constraint, the intra-class constraint is used for constraining intra-class distances between sample image features of a sample object and class centers of the class to which the sample object belongs, and the inter-class constraint is used for constraining inter-class distances between class centers of different classes and/or inter-class angles between the class centers of different classes. A third aspect of the embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the above-mentioned target recognition method when executing the computer program. A fourth aspect of the embodiments of the present application provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the above-described target recognition method. A fifth aspect of an embodiment of the present application provides a computer program product for causing a terminal device to execute the object recognition method as described in the first aspect above when the computer program product is run on the terminal device. In the embodiment of the application, the image features in the target image are obtained by extracting the features of the target image of the target to be identified, and then the image features are input into the target identification network model to obtain the identification result of the class to which the target to be identified belongs, wherein the loss function of the target identification network model is a function obtained based on intra-class constraint and inter-class constraint, the intra-class constraint is used for constraining the intra-class distance between the sample image features of the sample target and the class centers of the class to which the sample target belongs, the inter-cla