Method and device for identifying target object

By using freezing and distillation techniques in the neural network model, combined with data from the laboratory and actual environment, the problem of low recognition accuracy in the actual environment is solved, and higher recognition accuracy and anti-forgetful effect are achieved.

CN119068314BActive Publication Date: 2025-02-18ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411573181.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-02-18
Estimated Expiration
2044-11-06

AI Technical Summary

Technical Problem

The accuracy of the trained neural network model to identify target objects in the actual environment is low, mainly because the data trained in the laboratory is difficult to fully cover the data in the actual environment.

Method used

By acquiring the first neural network model and the second neural network model, the first neural network is used to identify the target object in the second sample image set, and the recognition results are obtained, and the recognition results and the second sample image set are used to match the second The neural network model is trained to obtain the target neural network model. This method combines freezing and distillation techniques to ensure that the model maintains original knowledge and learns new data during training.

Benefits of technology

The accuracy of the target neural network model for the recognition of target objects in the target area is improved, and the problem of the model forgetting the original data distribution in the actual environment is avoided, achieving the anti-forgotten effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119068314B_ABST
    Figure CN119068314B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a method and device for identifying a target object, including: obtaining a first neural network model and a second neural network model, the first neural network model and the second neural network model are the same neural network model trained using a first sample image set; identifying the target object in the second sample image set by the first neural network to obtain a recognition result, the second sample image set is an image set obtained by photographing the target object in the target area; using the recognition result and the second sample image set to train the second neural network model to obtain a target neural network model; using the target neural network image to identify the target object in the target area. The present invention solves the problem of low accuracy in identifying target objects when the trained neural network model in the related art is applied to the actual environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of artificial intelligence, and in particular, to a method and device for identifying a target object. Background Art

[0002] With the improvement of hardware computing power and the development of related technologies, machine learning has penetrated into all aspects of life. For example, the neural network model obtained through machine learning training can identify target objects such as people and vehicles. The effect of the neural network model obtained by machine learning is driven by the training data. What kind of training data is used will determine what kind of neural network model is obtained. Moreover, once the neural network model is trained, the parameters are fixed and the effect is basically solidified.

[0003] A neural network model that works well in laboratory tests may not work well when deployed in some real-world environments. This is because the neural network model has not been trained with data from real-world environments. There are thousands of real-world environments, and it is difficult to fully cover all the data trained in the laboratory. This leads to the problem of low accuracy in identifying target objects when the trained neural network model is applied to real-world environments.

[0004] There is currently no effective solution to the above problems. Summary of the invention

[0005] The embodiments of the present invention provide a method and device for identifying a target object, so as to at least solve the problem in the related art that the trained neural network model has a low accuracy rate in identifying the target object when applied to an actual environment.

[0006] According to one embodiment of the present invention, there is provided a method for identifying a target object, comprising: obtaining a first neural network model and a second neural network model, wherein the first neural network model and the second neural network model are the same neural network model trained using a first sample image set; identifying target objects in the second sample image set using the first neural network to obtain a recognition result, wherein the second sample image set is an image set obtained by photographing target objects in a target area; training the second neural network model using the recognition result and the second sample image set to obtain a target neural network model; and identifying the target objects in the target area using the target neural network image.

[0007] In an exemplary embodiment, the second neural network model is trained using the recognition result and the second sample image set to obtain a target neural network model, including: determining freezing parameters and distillation parameters of the second neural network model through a detection module of the second neural network model; in the process of training the second neural network model, updating the distillation parameters and not updating the freezing parameters.

[0008] In an exemplary embodiment, the method further includes: during the training process of the second neural network model, model parameters of the first neural network model remain unchanged.

[0009] In an exemplary embodiment, the number of sample images in the first sample image set is greater than the number of sample images in the second sample image set.

[0010] In an exemplary embodiment, the second neural network model is trained using the recognition result and the second sample image set to obtain a target neural network model, including: when the neural network model obtained by performing the i-th round of training on the second neural network model satisfies a target loss condition, ending the training to obtain the target neural network model, wherein i is an integer greater than or equal to 1; wherein the target loss condition includes: a target loss value is less than or equal to a preset threshold, and the target loss value includes at least one of the following: a first loss value between an output result of the neural network model obtained by the i-th round of training and a recognition result of the first neural network model, a second loss value between model parameters of the first neural network model and model parameters of the neural network model obtained by the i-th round of training, and a third loss value between annotation information of a sample image input to the neural network model obtained by the i-th round of training and the output result.

[0011] In an exemplary embodiment, the method further includes: determining the first loss value between the recognition result and the output result; when the first loss value is less than or equal to the preset threshold, determining the neural network model obtained by the i-th round of training as the target neural network model.

[0012] In an exemplary embodiment, the method also includes: determining the first loss value between the recognition result and the output result; determining the second loss value between the model parameters of the first neural network model and the model parameters of the neural network model obtained by the i-th round of training; determining the third loss value between the target output result and the annotation information of the target sample image; and obtaining the target loss value through the first loss value, the second loss value and / or the third loss value.

[0013] In an exemplary embodiment, the target loss value is obtained by using the first loss value, the second loss value and / or the third loss value, including: determining the weighted sum of the first loss value and the second loss value as the target loss value; or, determining the weighted sum of the first loss value and the third loss value as the target loss value; or, determining the weighted sum of the first loss value, the second loss value and the third loss as the target loss value.

[0014] According to another embodiment of the present invention, there is provided a device for identifying a target object, comprising: an acquisition module, used to acquire a first neural network model and a second neural network model, wherein the first neural network model and the second neural network model are the same neural network model trained using a first sample image set; a first recognition module, used to identify the target object in the second sample image set through the first neural network to obtain a recognition result, wherein the second sample image set is an image set obtained by photographing the target object in a target area; a training module, used to train the second neural network model using the recognition result and the second sample image set to obtain a target neural network model; and a second recognition module, used to identify the target object in the target area using the target neural network image.

[0015] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of any of the above methods when executed by a processor.

[0016] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0017] According to yet another embodiment of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0018] According to the present invention, the first neural network model and the second neural network model are the same neural network model trained using the first sample image set. The target object in the second sample image set is identified by the first neural network to obtain an identification result, and the second sample image set is an image set obtained by photographing the target object in the target area; the second neural network model is trained using the identification result and the second sample image set to obtain a target neural network model.

[0019] Since the target neural network model is trained using a second sample image set obtained by photographing the target object in the target area, this can achieve the effect of improving the accuracy of the target neural network model in identifying the target object in the target area.

[0020] In addition, during the training process of the target neural network model, the recognition results of the first neural network on the target objects in the second sample image set are also used. This can prevent the trained neural network model from forgetting the data distribution when trained using the first sample image set, thereby achieving an anti-forgetting effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a hardware structure block diagram of a mobile terminal of a method for identifying a target object according to an embodiment of the present invention;

[0022] Figure 2 is a flow chart of a method for identifying a target object according to an embodiment of the present invention;

[0023] Figure 3 is a schematic diagram of model pruning according to an embodiment of the present invention;

[0024] Figure 4 is a schematic diagram of a flow chart according to an embodiment of the present invention;

[0025] Figure 5 is a structural block diagram of a device for identifying a target object according to an embodiment of the present invention. DETAILED DESCRIPTION

[0026] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.

[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0028] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal for a method of identifying a target object according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0029] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for identifying a target object in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0030] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0031] In this embodiment, a method for identifying a target object running on the mobile terminal is provided. Figure 2 is a flow chart of a method for identifying a target object according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0032] Step S202, obtaining a first neural network model and a second neural network model, wherein the first neural network model and the second neural network model are the same neural network model trained using a first sample image set;

[0033] The first sample image set is a data set of a large batch of images, and the first neural network model and the second neural network model can be neural network models trained using data of a large batch of images before being deployed in an actual environment.

[0034] The first neural network model and the second neural network model have the same model structure and model parameters. The first neural network model can be referred to as A T Model, the second neural network model as a retraining model can be called A model. T model to guide the retraining of model A.

[0035] Step S204, identifying the target object in the second sample image set by the first neural network to obtain a recognition result, wherein the second sample image set is an image set obtained by photographing the target object in the target area;

[0036] The second sample image set is a data set of small batch images collected in the actual environment where the target neural network model is to be deployed. That is, the data volume of the images in the second sample image set can be smaller than the data volume of the images in the first sample image set. The number of sample images in the first sample image set is greater than the number of sample images in the second sample image set.

[0037] Step S206, training the second neural network model using the recognition result and the second sample image set to obtain a target neural network model;

[0038] In an exemplary embodiment, the second neural network model may be retrained (also referred to as fine-tuning training or model optimization) using a small batch of data (a second set of sample images) collected in the actual environment (target area) to be deployed.

[0039] In the process of retraining the second neural network model using the second sample image set, in addition to using image data in the actual environment to optimize the effect of the model, the previous effect of the model must be maintained to avoid catastrophic forgetting.

[0040] The so-called catastrophic forgetting means that the model completely fits the current small batch data (the second sample image set) and forgets its own other data distribution (the data distribution of the first sample image set). Taking the identification of target objects (which can be people or vehicles, etc.) as an example, the second neural network model itself can detect two major types of targets: people and vehicles. However, in the second sample image set collected in the actual environment (target area), there is only labeled data of people. In this way, when the second neural network model is retrained using the second sample image set, the model forgets how to identify vehicles, which is catastrophic forgetting.

[0041] Because models are data-driven. Conventional training, if based on small batches of data in the actual environment without any adjustments, will cause the model to completely fit the data distribution of the second sample image set, forgetting the data distribution of the first sample image set, resulting in abnormal results.

[0042] The present application adopts the freezing and distillation method to freeze some model parameters in the second neural network model, so that the second neural network model can remember the previously learned content to achieve the anti-forgetting effect, and distill some model parameters of the network. These model parameters can learn new content through the first sample image set, and also need to refer to the model parameters of the original second neural network model. At the same time, in order to maximize the optimization of anti-forgetting and learning new knowledge, the freezing and distillation strategies can be adaptively customized. Important parts of the model parameters can be selected for freezing, and the remaining parts can be distilled.

[0043] Specifically, the freezing parameters and distillation parameters of the second neural network model can be determined through the detection module of the second neural network model; in the process of training the second neural network model, the distillation parameters are updated and the freezing parameters are not updated.

[0044] To analyze the retrained second neural network model, model compression technology can be used. Model pruning refers to removing unimportant parameters or structures in the neural network model, thereby reducing the complexity and computational complexity of the model and improving the model's reasoning speed and efficiency. The original intention is to remove unimportant parameters and retain important parameters. Based on this theory, model compression can be used to learn which parameters in the model are important and which are unimportant. Important parameters are used as frozen parameters. These parameters contribute the most to the original model. Keeping these parameters unchanged during training can guarantee the original effect of the original model to the greatest extent, which is called anti-forgetting. We set unimportant parameters as distillation parameters. These parameters will change with the training of the network. The changes take two aspects into consideration. On the one hand, they come from the new data set (the second sample image set). The changes in these parameters will allow the network to optimize the effect of the new data. At the same time, in order to prevent the network from being completely biased towards the new data, these parameters will also consider the parameter values ​​of the original model, that is, these parameters need to be distilled. Figure 3 As shown in the figure, based on the model pruning module, the model parameters are analyzed. The solid line is the distilled model parameters, and the dotted line is the frozen model parameters. When compressing the model, the compression percentage can be set according to the actual situation, for example, 60%, that is, 60% is set as the frozen model parameters and 40% of the weight is set as the distilled model parameters.

[0045] Step S208: Use the target neural network image to identify the target object in the target area.

[0046] Optionally, the executor of the above steps may be a background processor, or other devices with similar processing capabilities, or a machine that integrates at least an image acquisition device and a data processing device, wherein the image acquisition device may include a graphics acquisition module such as a camera, and the data processing device may include a computer, a mobile phone or other terminal, but is not limited thereto.

[0047] The first neural network model and the second neural network model are the same neural network model trained using the first sample image set. The target object in the second sample image set is identified by the first neural network to obtain an identification result, and the second sample image set is an image set obtained by photographing the target object in the target area; the second neural network model is trained using the identification result and the second sample image set to obtain a target neural network model.

[0048] Since the target neural network model is trained using a second sample image set obtained by photographing the target object in the target area, this can achieve the effect of improving the accuracy of the target neural network model in identifying the target object in the target area.

[0049] In addition, during the training process of the target neural network model, the recognition results of the first neural network on the target objects in the second sample image set are also used. This can prevent the trained neural network model from forgetting the data distribution when trained using the first sample image set, thereby achieving an anti-forgetting effect.

[0050] It should be noted that during the training process of the second neural network model, the model parameters of the first neural network model remain unchanged.

[0051] As an optional implementation, the second neural network model is trained using the recognition result and the second sample image set to obtain a target neural network model, including:

[0052] When the neural network model obtained by performing the i-th round of training on the second neural network model satisfies the target loss condition, the training is terminated to obtain the target neural network model, wherein i is an integer greater than or equal to 1;

[0053] Among them, the target loss condition includes: the target loss value is less than or equal to a preset threshold (the preset threshold can be set arbitrarily according to actual conditions), and the target loss value includes at least one of the following: a first loss value between the output result of the neural network model obtained by the i-th round of training and the recognition result of the first neural network model, a second loss value between the model parameters of the first neural network model and the model parameters of the neural network model obtained by the i-th round of training, and a third loss value between the annotation information of the sample image input into the neural network model obtained by the i-th round of training and the output result.

[0054] In the above embodiment, the first loss value between the output result of the neural network model obtained by the i-th round of training and the recognition result of the first neural network can be expressed as It means that the neural network models A and A obtained in the i-th round of training T The loss of the head output layer is used to guide the features of A not to forget the original information.

[0055] Taking the neural network model obtained by the i-th round of training of the second neural network model as an example: obtaining a target sample image in the second sample image set; obtaining a target recognition result of the target sample image by the first neural network model; inputting the target sample image into the neural network model obtained by the i-th round of training to obtain a target output result of the neural network model obtained by the i-th round of training; when the target recognition result and the target output result meet the target loss condition, determining the neural network model obtained by the i-th round of training as the target neural network model.

[0056] Specifically, the first loss value between the target recognition result and the target output result can be determined; when the first loss value is less than or equal to the preset threshold, the neural network model obtained by the i-th round of training is determined as the target neural network model.

[0057] The first loss value is the loss value between the target recognition result and the target output result ;

[0058] The second loss value is the loss value between the model parameters of the first neural network model and the model parameters of the neural network model obtained by the i-th round of training. ;

[0059] The third loss value is the loss value between the target output result and the annotation information of the target sample image ;

[0060] Obtaining a target loss value through the first loss value, the second loss value and / or the third loss value comprises:

[0061] The weighted sum of the first loss value and the second loss value is determined as the target loss value; for example: .

[0062] Alternatively, a weighted sum of the first loss value and the third loss value is determined as the target loss value; for example: .

[0063] Alternatively, a weighted sum of the first loss value, the second loss value and the third loss is determined as the target loss value, for example:

[0064]

[0065] in, It refers to the training loss of the A model itself. This loss guides A to learn the data distribution of the second sample image set. Refers to A and A T The loss of distilled features, here we can use L2 loss to guide A not to forget the feature information of the original model; , meaning A and A T The loss of the head output layer also guides the features of A not to forget the original information. , , , , , , is the preset weight coefficient, which can be set according to the actual situation, for example, , , Can be set to 0.5, 0.2 and 0.3 respectively.

[0066] When the target loss value is less than or equal to the preset threshold, the neural network model obtained by the i-th round of training is determined as the target neural network model.

[0067] Finally, the trained target neural network model can learn the distribution of new data (the second sample image set) without forgetting the original memory. Figure 4 As shown, the following steps are included:

[0068] Step S401, obtaining a retrained neural network model and a second sample image set, wherein the second sample image set includes: annotation information of the sample images;

[0069] Step S402, based on the model pruning technology, analyzing the distribution of the model parameters of the second neural network model, and separating the distillation model parameters and the frozen model parameters;

[0070] Step S403, copy the retrained model into the second neural network model A and the first neural network model A T , the second neural network model A and the first neural network model A T The model structure and model parameters are exactly the same;

[0071] Step S404, analyzing the structure of model A and freezing the model parameters that need to be frozen;

[0072] Step S405: input the second sample image set into the first neural network model A T The output result is obtained, the reasoning process of the first neural network model does not update any model weights, and the second neural network model A is trained using the second sample image set;

[0073] Step S406, based on the training and the output results of the first neural network model, calculate the target loss value loss, the target loss value includes the first loss value , the second loss value and / or third loss value . Last updated A T Model; after training, output the target neural network model.

[0074] Compared with the prior art, this application utilizes model compression technology through small sample input training. The original intention of compression is to distinguish the importance of model parameters, thereby reducing the number of parameters. This feature is used to distinguish the model parameters of the network. The important ones are divided into frozen model parameters, and the unimportant ones are divided into distilled model parameters.

[0075] Combining the characteristics of knowledge distillation technology, in the process of optimizing the model, it can not only learn the data distribution of small batches of sample images, but also maintain the data distribution of the original model, providing a fast solution system for optimizing the on-site deployment model.

[0076] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0077] In the present embodiment, a device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.

[0078] Figure 5 is a structural block diagram of a device for identifying a target object according to an embodiment of the present invention. Figure 5 As shown, the device comprises:

[0079] An acquisition module 52, configured to acquire a first neural network model and a second neural network model, wherein the first neural network model and the second neural network model are the same neural network model trained using the first sample image set;

[0080] A first recognition module 54 is used to recognize the target object in the second sample image set by using the first neural network to obtain a recognition result, wherein the second sample image set is an image set obtained by photographing the target object in the target area;

[0081] A training module 56, configured to train the second neural network model using the recognition result and the second sample image set to obtain a target neural network model;

[0082] The second recognition module 58 is used to use the target neural network image to recognize the target object in the target area.

[0083] In an exemplary embodiment, the above-mentioned device is also used to determine the freezing parameters and distillation parameters of the second neural network model through the detection module of the second neural network model; during the training of the second neural network model, the distillation parameters are updated and the freezing parameters are not updated.

[0084] In an exemplary embodiment, the apparatus is further configured to keep model parameters of the first neural network model unchanged during the training of the second neural network model.

[0085] In an exemplary embodiment, the number of sample images in the first sample image set is greater than the number of sample images in the second sample image set.

[0086] In an exemplary embodiment, the above-mentioned device is also used to terminate the training to obtain the target neural network model when the neural network model obtained by the i-th round of training of the second neural network model meets the target loss condition, wherein i is an integer greater than or equal to 1; wherein the target loss condition includes: the target loss value is less than or equal to a preset threshold, and the target loss value includes at least one of the following: a first loss value between the output result of the neural network model obtained by the i-th round of training and the recognition result of the first neural network model, a second loss value between the model parameters of the first neural network model and the model parameters of the neural network model obtained by the i-th round of training, and a third loss value between the annotation information of the sample image input into the neural network model obtained by the i-th round of training and the output result.

[0087] In an exemplary embodiment, the above-mentioned device is also used to determine the first loss value between the recognition result and the output result; when the first loss value is less than or equal to the preset threshold, the neural network model obtained by the i-th round of training is determined as the target neural network model.

[0088] In an exemplary embodiment, the above-mentioned device is also used to determine the first loss value between the recognition result and the output result; determine the second loss value between the model parameters of the first neural network model and the model parameters of the neural network model obtained by the i-th round of training; determine the third loss value between the target output result and the annotation information of the target sample image; and obtain the target loss value through the first loss value, the second loss value and / or the third loss value.

[0089] In an exemplary embodiment, the above-mentioned device is also used to determine the weighted sum of the first loss value and the second loss value as the target loss value; or, to determine the weighted sum of the first loss value and the third loss value as the target loss value; or, to determine the weighted sum of the first loss value, the second loss value and the third loss as the target loss value.

[0090] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0091] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0092] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0093] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0094] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0095] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0096] An embodiment of the present invention further provides a computer program product, including a computer program, which implements the steps of the method described in each embodiment of the present application when executed by a processor.

[0097] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0098] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for identifying a target object, characterized in that: include: Acquire a first neural network model and a second neural network model, wherein the first neural network model and the second neural network model are the same neural network model trained using the first sample image set; Recognize the target object in the second sample image set by using the first neural network model to obtain a recognition result, wherein the second sample image set is a set of images obtained by photographing the target object in the target area; The second neural network model is trained using the recognition result and the second sample image set to obtain a target neural network model, including: when the neural network model obtained by performing the i-th round of training on the second neural network model satisfies the target loss condition, the training is terminated to obtain the target neural network model, wherein i is an integer greater than or equal to 1; Wherein, the target loss condition includes: the target loss value is less than or equal to a preset threshold value, and the target loss value includes at least one of the following: a first loss value between the output result of the neural network model obtained by the i-th round of training and the recognition result of the first neural network model, a second loss value between the model parameters of the first neural network model and the model parameters of the neural network model obtained by the i-th round of training, and a third loss value between the annotation information of the sample image input into the neural network model obtained by the i-th round of training and the output result; The target object in the target area is identified using the target neural network image.

2. The method according to claim 1, characterized in that The second neural network model is trained using the recognition result and the second sample image set to obtain a target neural network model, including: Determining freezing parameters and distillation parameters of the second neural network model through the detection module of the second neural network model; During the training of the second neural network model, the distillation parameters are updated, and the freezing parameters are not updated.

3. The method according to claim 1 or 2, characterized in that: The method further comprises: During the training process of the second neural network model, the model parameters of the first neural network model remain unchanged.

4. The method according to claim 1 or 2, characterized in that: The number of sample images in the first sample image set is greater than the number of sample images in the second sample image set.

5. The method according to claim 1, characterized in that: The method further comprises: determining the first loss value between the recognition result and the output result; When the first loss value is less than or equal to the preset threshold, the neural network model obtained by the i-th round of training is determined as the target neural network model.

6. The method according to claim 1, characterized in that The method further comprises: determining the first loss value between the recognition result and the output result; Determine a second loss value between the model parameters of the first neural network model and the model parameters of the neural network model obtained by the i-th round of training; Determine a third loss value between the target output result and the annotation information of the target sample image; The target loss value is obtained by using the first loss value, the second loss value and / or the third loss value.

7. The method according to claim 6, characterized in that Obtaining the target loss value by using the first loss value, the second loss value and / or the third loss value comprises: determining a weighted sum of the first loss value and the second loss value as the target loss value; or, determining a weighted sum of the first loss value and the third loss value as the target loss value; or, A weighted sum of the first loss value, the second loss value and the third loss is determined as the target loss value.

8. A device for identifying a target object, characterized in that: include: An acquisition module, used to acquire a first neural network model and a second neural network model, wherein the first neural network model and the second neural network model are the same neural network model trained using a first sample image set; A first recognition module is used to recognize the target object in the second sample image set by using the first neural network model to obtain a recognition result, wherein the second sample image set is a set of images obtained by photographing the target object in the target area; A training module, used to train the second neural network model using the recognition result and the second sample image set to obtain a target neural network model, comprising: when the neural network model obtained by performing the i-th round of training on the second neural network model satisfies the target loss condition, ending the training to obtain the target neural network model, wherein i is an integer greater than or equal to 1; Wherein, the target loss condition includes: the target loss value is less than or equal to a preset threshold value, and the target loss value includes at least one of the following: a first loss value between the output result of the neural network model obtained by the i-th round of training and the recognition result of the first neural network model, a second loss value between the model parameters of the first neural network model and the model parameters of the neural network model obtained by the i-th round of training, and a third loss value between the annotation information of the sample image input into the neural network model obtained by the i-th round of training and the output result; The second recognition module is used to use the target neural network image to recognize the target object in the target area.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 7 when executed by a processor.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 7.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Image identification method and device

    CN115205603A

  • Image-based target identification and neural network model processing method

    CN116167990A