CN-121982443-A - Image recognition model training method, image recognition method, device, equipment and medium
Abstract
The invention discloses an image recognition model training method, an image recognition device, image recognition equipment and a medium. The method comprises the steps of obtaining a training image and a first event soft label corresponding to the training image, carrying out model training based on the training image and the first event soft label to determine a reference image recognition model, adopting the reference image recognition model to recognize the training image to determine a reference label corresponding to the training image, adjusting the first event soft label corresponding to the training image based on the reference label to determine a second event soft label corresponding to the training image, and carrying out model training based on the training image and the second event soft label to determine a target image recognition model. According to the method, the reliability of the label can be improved, a target image recognition model capable of accurately and reliably recognizing the target event in the image is obtained according to the training image and the second event soft label, and the aim of accurately recognizing the target event in the image through the target image recognition model is fulfilled.
Inventors
- LU HAICHENG
- LIN DAJUN
- WEI XINMING
- YU XIAOTIAN
Assignees
- 深圳云天励飞技术股份有限公司
- 青岛云天励飞科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20251212
Claims (10)
- 1. An image recognition model training method, comprising the steps of: acquiring a training image and a first event soft label corresponding to the training image; Model training is carried out based on the training image and a first event soft label corresponding to the training image, and a reference image recognition model is determined; identifying the training image by adopting the reference image identification model, and determining a reference label corresponding to the training image; Adjusting a first event soft label corresponding to the training image based on a reference label corresponding to the training image, and determining a second event soft label corresponding to the training image; and performing model training based on the training image and a second event soft label corresponding to the training image, and determining a target image recognition model.
- 2. The method for training an image recognition model according to claim 1, wherein the acquiring a training image and a first event soft tag corresponding to the training image comprises: Acquiring a training image and an event hard tag corresponding to the training image; and softening the event hard tag corresponding to the training image to determine a first event soft tag corresponding to the training image.
- 3. The method for training an image recognition model according to claim 2, wherein the softening the event hard tag corresponding to the training image to determine the first event soft tag corresponding to the training image comprises: identifying event hard tags corresponding to the training images by adopting a quality evaluation algorithm, and determining quality indexes corresponding to the training images; and softening the first event hard index corresponding to the training image based on the quality index corresponding to the training image, and determining the first event soft label corresponding to the training image.
- 4. The method for training an image recognition model according to claim 3, wherein the first event soft label corresponding to the training image comprises an event soft label corresponding to a target event and an event soft label corresponding to a non-target event; The softening process is performed on the first event hard index corresponding to the training image based on the quality index corresponding to the training image, and the determination of the first event soft label corresponding to the training image comprises the following steps: If the quality index corresponding to the training image is greater than a first quality threshold, determining that the event soft tag corresponding to the target event is adjusted to be in the first event soft tag The event soft tag corresponding to the non-target event is adjusted to (1- )/n; If the quality index corresponding to the training image is greater than the second quality threshold and not greater than the first quality threshold, adjusting the event soft label corresponding to the target event to be The event soft tag corresponding to the non-target event is adjusted to (1- )/n; If the quality index corresponding to the training image is not greater than a second quality threshold, adjusting the event soft label corresponding to the target event to be The event soft tag corresponding to the non-target event is adjusted to (1- )/n; Wherein, 0 is less than or equal to < < And not more than 1, wherein n is the number of non-target events, and n is not less than 1.
- 5. The method of claim 3, wherein the adjusting the first event soft label corresponding to the training image based on the reference label corresponding to the training image, and determining the second event soft label corresponding to the training image, comprises: when the quality index corresponding to the training image and the reference label corresponding to the training image meet a first adjustment condition, determining that the event soft label corresponding to the target event in the second event soft label is adjusted to be The event soft tag corresponding to the non-target event is adjusted to (1- )/n; When the quality index corresponding to the training image and the reference label corresponding to the training image meet a second adjustment condition, determining that the event soft label corresponding to the target event in the second event soft label is adjusted to be The event soft tag corresponding to the non-target event is adjusted to (1- )/n; When the quality index corresponding to the training image and the reference label corresponding to the training image meet a third adjustment condition, determining that the event soft label corresponding to the target event in the second event soft label is adjusted to be The event soft tag corresponding to the non-target event is adjusted to (1- )/n; When the quality index corresponding to the training image and the reference label corresponding to the training image meet a fourth adjustment condition, determining that a target event of the training image is an unknown event, and determining that a soft label corresponding to the unknown event is set as The event soft label corresponding to the non-target event is (1- )/n; Wherein, 0 is less than or equal to < < ≤1,0≤ And not more than 1, wherein n is the number of non-target events, and n is not less than 1.
- 6. The method of claim 5, wherein the first adjustment condition includes that a quality index corresponding to the training image is greater than a first quality threshold and a reference label corresponding to the training image is greater than a first label threshold, or the first adjustment condition includes that the quality index corresponding to the training image is between the first quality threshold and a second quality threshold and the reference label corresponding to the training image is greater than a third label threshold; The second adjustment condition comprises that the quality index corresponding to the training image is larger than a first quality threshold value and the reference label corresponding to the training image is between a first label threshold value and a second label threshold value, the second adjustment condition comprises that the quality index corresponding to the training image is between the first quality threshold value and the second quality threshold value and the reference label corresponding to the training image is between a third label threshold value and a fourth label threshold value, or the second adjustment condition comprises that the quality index corresponding to the training image is smaller than the second quality threshold value and the reference label corresponding to the training image is larger than a fifth label threshold value; The third adjustment condition comprises that the quality index corresponding to the training image is larger than a first quality threshold and the reference label corresponding to the training image is smaller than a second label threshold, the third adjustment condition comprises that the quality index corresponding to the training image is between the first quality threshold and the second quality threshold and the reference label corresponding to the training image is smaller than a fourth label threshold, or the third adjustment condition comprises that the quality index corresponding to the training image is smaller than the second quality threshold and the reference label corresponding to the training image is between a fifth label threshold and a sixth label threshold; the fourth adjustment condition includes that a quality index corresponding to the training image is smaller than a second quality threshold, and a reference label corresponding to the training image is smaller than a sixth label threshold.
- 7. An image recognition method, comprising: acquiring an image to be identified; inputting the image to be identified into a target image identification model, and outputting a target event corresponding to the image to be identified; The target image recognition model is a model trained by the image recognition model training method according to any one of claims 1 to 6.
- 8. An image recognition model training device, comprising: the image and label acquisition module is used for acquiring a training image and a first event soft label corresponding to the training image; The reference image recognition model determining module is used for performing model training based on the training image and a first event soft label corresponding to the training image to determine a reference image recognition model; the reference label determining module is used for identifying the training image by adopting the reference image identification model and determining a reference label corresponding to the training image; the label adjustment module is used for adjusting the first event soft label corresponding to the training image based on the reference label corresponding to the training image and determining the second event soft label corresponding to the training image; and the target image recognition model determining module is used for performing model training based on the training image and the second event soft label corresponding to the training image to determine a target image recognition model.
- 9. A computer 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 image recognition model training method according to any one of claims 1 to 6 when executing the computer program or the image recognition method according to claim 7 when the processor executes the computer program.
- 10. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the image recognition model training method according to any one of claims 1 to 6 or the computer program when executed by a processor implements the image recognition method according to claim 7.
Description
Image recognition model training method, image recognition method, device, equipment and medium Technical Field The present invention relates to the field of image recognition technologies, and in particular, to an image recognition model training method, an image recognition device, an image recognition apparatus, and a medium. Background Because of the complexity of the monitoring environment, the acquired image usually has an unclear problem, so that the accuracy of identifying the event occurring in the image is reduced, and the situation of false identification occurs. For example, in a factory workshop environment, dust accumulation leads to degradation of imaging quality of a camera, the situation that an acquired image is unclear exists, and then the recognition accuracy of whether a worker wears a helmet in the image is reduced, the situation of false recognition occurs, and the reliability of monitoring of the factory workshop is seriously affected. Therefore, how to accurately identify the event in the image is a technical problem to be solved currently. Disclosure of Invention The embodiment of the invention provides an image recognition model training method, an image recognition device, equipment and a medium, which are used for solving the technical problem of accurately recognizing events in images. An image recognition model training method, comprising: acquiring a training image and a first event soft label corresponding to the training image; Model training is carried out based on the training image and a first event soft label corresponding to the training image, and a reference image recognition model is determined; identifying the training image by adopting the reference image identification model, and determining a reference label corresponding to the training image; Adjusting a first event soft label corresponding to the training image based on a reference label corresponding to the training image, and determining a second event soft label corresponding to the training image; and performing model training based on the training image and a second event soft label corresponding to the training image, and determining a target image recognition model. An image recognition method, comprising: acquiring an image to be identified; inputting the image to be identified into a target image identification model, and outputting a target event corresponding to the image to be identified; the target image recognition model is a model trained by the image recognition model training method. An image recognition model training apparatus comprising: the image and label acquisition module is used for acquiring a training image and a first event soft label corresponding to the training image; The reference image recognition model determining module is used for performing model training based on the training image and a first event soft label corresponding to the training image to determine a reference image recognition model; the reference label determining module is used for identifying the training image by adopting the reference image identification model and determining a reference label corresponding to the training image; the label adjustment module is used for adjusting the first event soft label corresponding to the training image based on the reference label corresponding to the training image and determining the second event soft label corresponding to the training image; and the target image recognition model determining module is used for performing model training based on the training image and the second event soft label corresponding to the training image to determine a target image recognition model. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the image recognition model training method described above when executing the computer program or the image recognition method described above when executing the computer program. A computer readable storage medium storing a computer program which when executed by a processor implements the image recognition model training method described above, or which when executed by a processor implements the image recognition method described above. According to the image recognition model training method, the image recognition device, the image recognition equipment and the medium, the model training is carried out through the first event soft tag corresponding to the training image, the reference image recognition model capable of carrying out primary recognition on the image is obtained, the reference recognition model is adopted to carry out recognition on the training image, the reference tag corresponding to the training image is determined, the tag softening is carried out according to the reference tag, the first event soft tag is reasonably softened into the second event soft tag, the reliability of the tag is improved, the more accurate a