Target integrity detection model training method and device, equipment and medium
By analyzing and processing the target objects in the image and training the model, the problem of low accuracy of target objects in the prior art is solved, and a target integrity detection model for accurately detecting the target objects is realized.
Patent Information
- Application Number
- CN202411358888.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-02-14
AI Technical Summary
The prior art has low accuracy when detecting the completeness of the target object in an image, especially when there is a self-occlusion situation in the target object, which can easily lead to errors.
By acquiring the initial image, the analysis process is used to determine the image to be trained and the initial integrity score, the target integrity detection model is trained based on these data, the target loss function value is determined, and the model is determined when the preset model optimization conditions are met.
It realizes more accurate completeness detection of the target object in the image. The generated model can output the target completeness score of the target object, supporting continuous and accurate completeness detection.
Smart Images

Figure CN119445195A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a training method for a target integrity detection model, a target integrity detection method, a device, equipment and a medium. Background Art
[0002] In the field of image processing technology, it is usually necessary to perform integrity detection on the target object in the image. For example, when re-identifying pedestrians in an image, the target object is the pedestrian in the image. If the human body image integrity of the pedestrian in the image is low, it will lead to poor analysis and processing results. Therefore, before re-identifying the pedestrian in the image, it is necessary to detect the human body image integrity of the pedestrian in the image, so as to select images with higher human body image integrity for pedestrian re-identification, so as to reduce false detection and improve the accuracy of re-identification.
[0003] In the prior art, a binary classification model is usually used to detect the integrity of the target object in the image, or the integrity of the target object in the image is detected by detecting and identifying key points of the target object. However, for the binary classification model, only 0 and 1 can be output to determine whether the target object in the image is complete, and a coarse-grained integrity detection can be performed, but the integrity of the target object cannot be detected more accurately through continuous scores. For key point detection and recognition, if the target object in the image is self-occluded (for example, if the target object is a human body, there is self-occlusion when the hand is placed behind the body), even if the entire target object exists in the image, the target object will be judged as incomplete, which will cause errors in the integrity detection result corresponding to the target object. The above-mentioned method for detecting the integrity of the target object has poor integrity detection accuracy. Therefore, how to perform a more accurate integrity detection on the target object in the image is a technical problem that needs to be solved urgently. Summary of the invention
[0004] The embodiments of the present invention provide a training method for a target integrity detection model, a target integrity detection method, an apparatus, a device and a medium to solve the problem of how to perform more accurate integrity detection on a target object in an image.
[0005] A training method for an object integrity detection model, comprising: Acquire at least one initial image, wherein the initial image includes a target object; Analyze and process the target object in each of the initial images to determine the to-be-trained image corresponding to each of the target objects and the initial completeness score corresponding to each of the to-be-trained images; Based on the to-be-trained images and the initial completeness scores corresponding to each of the to-be-trained images, an initial completeness detection model is trained to determine a target loss function value corresponding to the initial completeness detection model; If the target loss function value satisfies the preset model optimization condition, the initial integrity detection model is determined as the target integrity detection model corresponding to the target object.
[0006] Preferably, the analyzing and processing the target object in each of the initial images to determine the to-be-trained image corresponding to each target object and the initial completeness score corresponding to each of the to-be-trained images includes: Processing the target object in each of the initial images to obtain a complete target image corresponding to each of the target objects; Using a random detection frame to perform sample cropping processing on the target object in each of the initial images to obtain an image to be trained corresponding to each of the initial images; Completeness analysis is performed on the to-be-trained image and the target complete image corresponding to the same initial image to obtain an initial completeness score corresponding to each to-be-trained image.
[0007] Preferably, the performing integrity analysis on the image to be trained and the target complete image corresponding to the same initial image to obtain an initial integrity score corresponding to each image to be trained includes: Acquire first position area data of each of the to-be-trained images and second position area data of each of the target complete images; The overlap processing is performed on each of the first position area data and the second position area data corresponding to the same initial image to determine the initial completeness score corresponding to each of the to-be-trained images.
[0008] Preferably, the training of the initial integrity detection model based on the to-be-trained images and the initial integrity scores corresponding to each of the to-be-trained images, and determining the target loss function value corresponding to the initial integrity detection model include: Inputting the to-be-trained images into the initial completeness detection model, and outputting an initial detection score corresponding to each of the to-be-trained images; Based on the initial detection score corresponding to each of the to-be-trained images and the initial completeness score corresponding to each of the to-be-trained images, a target loss function value corresponding to the initial completeness detection model is determined.
[0009] Preferably, determining the target loss function value corresponding to the initial integrity detection model based on the initial detection score corresponding to each of the to-be-trained images and the initial integrity score corresponding to each of the to-be-trained images includes: Determining a first loss function value corresponding to the initial integrity detection model based on an initial detection score corresponding to each of the to-be-trained images and an initial integrity score corresponding to each of the to-be-trained images; Based on the initial completeness scores corresponding to any two of the images to be trained, a target completeness difference is determined; if the target completeness difference meets a preset completeness difference standard, the any two images to be trained are determined as a target image pair; based on the images to be trained, all target image pairs are subjected to loss calculation to determine a second loss function value corresponding to the initial completeness detection model; Using a first correction coefficient to correct the first loss function value to obtain a first corrected function value, and using a second correction coefficient to correct the second loss function value to obtain a second corrected function value; Based on the first correction function value and the second correction function value, a target loss function value corresponding to the initial integrity detection model is determined.
[0010] Preferably, the target image pair comprises a first image and a second image; The step of performing loss calculation on all target images in the image to be trained to determine a second loss function value corresponding to the initial integrity detection model includes: Determining a first classification probability and a second classification probability based on an initial detection score corresponding to the first image and an initial detection score corresponding to the second image; Determine a first cross entropy based on the first classification probability, and determine a second cross entropy based on the second classification probability; Determining a first classification coefficient and a second classification coefficient based on a magnitude relationship between an initial completeness score corresponding to the first image and an initial completeness score corresponding to the second image; The first cross entropy is corrected based on the first classification coefficient, the second cross entropy is corrected based on the second classification coefficient, and a second loss function value corresponding to the initial integrity detection model is determined.
[0011] A target integrity detection method, comprising: Acquire the target image to be detected; Inputting the target image to be detected into a target integrity detection model, and outputting a target integrity score corresponding to the target image to be detected; Among them, the target integrity detection model is a model trained by the above-mentioned target integrity detection model training method.
[0012] A training device for a target integrity detection model, comprising: An initial image acquisition module, used to acquire at least one initial image, wherein the initial image includes a target object; An initial completeness score determination module is used to analyze and process the target object in each of the initial images to determine the to-be-trained image corresponding to each of the target objects and the initial completeness score corresponding to each of the to-be-trained images; A model training module, based on the to-be-trained images and the initial completeness scores corresponding to each of the to-be-trained images, trains an initial completeness detection model, and determines a target loss function value corresponding to the initial completeness detection model; A model generation module is used to determine the initial integrity detection model as the target integrity detection model corresponding to the target object if the target loss function value meets the preset model optimization condition.
[0013] A target integrity detection device, comprising: The target image acquisition module to be detected is used to acquire the target image to be detected; The target integrity score output module is used to input the target image to be detected into the target integrity detection model and output the target integrity score corresponding to the target image to be detected.
[0014] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned training method of the target integrity detection model when executing the computer program, or implements the above-mentioned target integrity detection method when executing the computer program.
[0015] A computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the above-mentioned training method of the target integrity detection model, or the computer program, when executed by a processor, implements the above-mentioned target integrity detection method.
[0016] The training method, target integrity detection method, device, equipment and medium of the target integrity detection model can analyze and process the target object in each initial image, and can obtain a relatively rich set of images to be trained and a relatively accurate initial integrity score corresponding to each image to be trained. Based on the relatively rich set of images to be trained, the initial integrity detection model can be trained more accurately, and the initial integrity detection model that meets the preset model optimization conditions is determined as the target integrity detection model for integrity detection of the target object, which can achieve the purpose of relatively accurate integrity detection of the target object in the image. The target integrity detection model generated by the method can relatively accurately output the target integrity score of the target object in the image, so as to perform continuous and accurate integrity detection on the target object in the image. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0018] Figure 1 is a flow chart of a method for training a target integrity detection model in one embodiment of the present invention; Figure 2 is another flow chart of a method for training a target integrity detection model in one embodiment of the present invention; Figure 3 is another flow chart of a method for training a target integrity detection model in one embodiment of the present invention; Figure 4 is another flow chart of a method for training a target integrity detection model in one embodiment of the present invention; Figure 5 is another flow chart of a method for training a target integrity detection model in one embodiment of the present invention; Figure 6 is another flow chart of a method for training a target integrity detection model in one embodiment of the present invention; Figure 7 is a flow chart of a target integrity detection method in one embodiment of the present invention; Figure 8 is a schematic diagram of a training device for a target integrity detection model in one embodiment of the present invention; Fig. 9 is a schematic diagram of a computer device in one embodiment of the present invention; Fig.10 is a schematic diagram of an initial image in an embodiment of the present invention; Fig.11 is a schematic diagram of a complete image of a target in one embodiment of the present invention; Fig.12 is a schematic diagram of two to-be-trained images corresponding to target objects in one embodiment of the present invention. DETAILED DESCRIPTION
[0019] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0020] The training method of the target integrity detection model provided in an embodiment of the present invention is used to achieve the purpose of more accurate integrity detection of the target object in the image.
[0021] In one embodiment, if Figure 1 As shown in FIG. 1 , a training method for a target integrity detection model is provided, and the method is applied in Fig. 9 The computer device in the example is used as an example to illustrate, including the following steps: S101: Acquire at least one initial image, where the initial image includes a target object; S102: Analyze and process the target object in each initial image to determine the to-be-trained image corresponding to each target object and the initial completeness score corresponding to each to-be-trained image; S103: Based on the to-be-trained image and the initial completeness score corresponding to each to-be-trained image, train an initial completeness detection model, and determine a target loss function value corresponding to the initial completeness detection model; S104: If the target loss function value satisfies the preset model optimization condition, the initial integrity detection model is determined as the target integrity detection model corresponding to the target object.
[0022] The initial image refers to an image including a complete target object. The target object refers to an object that needs to be checked for integrity, for example, a movable object such as a person in an image.
[0023] As an example, in step S101, the computer device obtains a batch of images collected in an actual scene, preprocesses the batch of images, and obtains an initial image including a complete target object. For example, a batch of images including the target object is obtained, and the batch of images is manually screened and cropped to obtain at least one initial image including a complete target object. For another example, a batch of images including the target object is obtained, and the target object in the batch of images is detected and cropped using a preset detection model corresponding to the target object, to obtain at least one initial image including the complete target object. For example, in a scenario where the integrity of a pedestrian in an image is detected, the target object is a human body image, and the computer device screens the acquired batch of images and determines the image including the complete human body image as the initial image.
[0024] The training image refers to the image used for model training. The initial completeness score refers to the score corresponding to the completeness of the target object in the training image relative to the complete target object in the initial image corresponding to the training image. It can be understood that if an initial image is a, the target object in the initial image a is analyzed and processed to obtain the training image and , get Relative to the completeness of the target object in the initial image a, the image to be trained is obtained The corresponding initial completeness score is obtained Relative to the completeness of the target object in the initial image a, the image to be trained is obtained The corresponding initial completeness score.
[0025] As an example, in step S102, the computer device analyzes and processes the target object in each initial image, generates at least two images to be trained corresponding to the target object in each initial image for model training, and determines the initial completeness score corresponding to the target object in each image to be trained. In this example, the computer device randomly crops each initial image to obtain images to be trained with different completeness corresponding to each initial image, analyzes and processes the target object in the initial image and the target object in each image to be trained corresponding to the initial image, and determines the initial completeness score corresponding to each image to be trained. For example, the computer device determines the overlap between the target object in the initial image and the target object in each image to be trained corresponding to the initial image, and determines the overlap corresponding to each image to be trained as the initial completeness score corresponding to each image to be trained.
[0026] For example, for an initial image a, the computer device randomly crops the initial image a to obtain the image to be trained and , the target object in the initial image a is respectively matched with the training image corresponding to the initial image a and Analyze and process the target object in the image to be trained Corresponding initial completeness scores and images to be trained The corresponding initial completeness score. The range of the initial completeness score is [0, 1]. It can be understood that if the target object in the image to be detected obtained after cropping the initial image is a complete target image, the initial completeness score is 1. If the target object does not exist in the image to be detected after cropping the initial image, the initial completeness score is 0. According to the completeness of the target object in the image to be detected, the initial completeness score is determined to be between 0 and 1. In this example, by analyzing and processing the target object in each initial image, a relatively rich set of images to be trained and the initial completeness score corresponding to each image to be trained can be obtained, so that model training can be performed based on the rich images to be trained to obtain a more accurate target completeness detection model.
[0027] The initial integrity detection model refers to the integrity detection model used for training. It can be understood that the integrity detection model is used to detect the integrity of the target object in the input image. If the integrity detection model is not trained, the accuracy of the integrity evaluation of the target object in the current scene is low. Therefore, model training is required, and the integrity detection model used for training is used as the initial integrity detection model. The target loss function value refers to the loss function value generated during the model training process.
[0028] As an example, in step S103, the computer device inputs at least two images to be trained into a preset initial completeness detection model, outputs the detection score of the target object in each image to be trained during the training process, calculates the loss function according to the detection score of the target object in each image to be trained and the initial completeness score corresponding to the same image to be trained, determines the loss function value when training the image to be trained, and determines the loss function value as the target loss function value corresponding to the initial completeness detection model. The detection score is used to characterize the completeness of the target object in the image to be trained output by the model, and the range of the detection score is [0, 1]. If the image includes the complete target object, the detection score is 1, if the image does not contain the target object, the detection score is 0, and if the image includes half of the target object, the detection score is 0.5.
[0029] For example, if the target object is a human image, and the images to be trained include human images of different completeness, the computer device outputs the training completeness detection score between [0, 1] corresponding to the human image in each image to be trained evaluated by the initial completeness detection model during the training process, and the loss function value when training at least two images to be trained is obtained according to the detection score of the human image in each image to be trained and the initial completeness score corresponding to the same image to be trained, and the loss function value is determined as the target loss function value corresponding to the initial completeness detection model. In this example, the initial completeness detection model includes but is not limited to a pre-set neural network model and a convolutional neural network model. For example, the initial completeness detection model includes a backbone network and an output layer, the backbone network can adopt a Mobilenet structure, and the output layer can adopt a fully connected layer. In this example, training on a relatively rich set of images to be trained can train the initial completeness detection model more accurately.
[0030] The preset model optimization condition refers to the preset condition for completing model training. The target integrity detection model refers to the integrity detection model that has completed training.
[0031] As an example, in step S104, the computer device compares the target loss function value generated by each training of the initial integrity detection model with the preset model optimization conditions to determine whether the target loss function value meets the preset model optimization conditions. When it is determined that the target loss function value meets the preset model optimization conditions, the initial integrity detection model is determined as the target integrity detection model corresponding to the target object.
[0032] For example, if the target object is a human image, when the computer device determines that the target loss function value corresponding to the human image satisfies the preset model optimization condition, the computer device determines the initial integrity detection model corresponding to the target loss function value as the target integrity detection model for performing integrity detection on the human image in the image. The preset model optimization condition includes but is not limited to the target loss function value of two adjacent trainings being less than a preset difference, the target loss function value being less than a preset loss value, and / or the number of calculations of the target loss function reaching a preset number of times.
[0033] In this example, the initial integrity detection model that meets the preset model optimization conditions is determined as the target integrity detection model for performing integrity detection on the target object, which can achieve the purpose of more accurate integrity detection of the target object in the image. The target integrity detection model can detect the integrity of the target object in the input image and output a more accurate target integrity score corresponding to the target object in the image. The target integrity detection model performs integrity detection on the target object in the output image and outputs the target integrity score of the target object in [0, 1]. Therefore, the target integrity detection model can perform continuous score detection in the range of [0, 1].
[0034] In this embodiment, by analyzing and processing the target object in each initial image, a relatively abundant number of images to be trained and a relatively accurate initial integrity score corresponding to each image to be trained can be obtained. Based on the relatively abundant images to be trained, the initial integrity detection model can be trained relatively accurately, and the initial integrity detection model that meets the preset model optimization conditions is determined as the target integrity detection model for integrity detection of the target object, which can achieve the purpose of relatively accurate integrity detection of the target object in the image. The target integrity detection model generated by this method can relatively accurately output the target integrity score of the target object in the image, so as to perform continuous and accurate integrity detection of the target object in the image.
[0035] In one embodiment, if Figure 2 As shown, step S102, i.e., analyzing and processing the target object in each initial image to determine the to-be-trained image corresponding to each target object and the initial completeness score corresponding to each to-be-trained image, includes: S201: Processing the target object in each initial image to obtain a complete target image corresponding to each target object; S202: using a random detection frame to perform sample cropping processing on the target object in each initial image to obtain a training image corresponding to each initial image; S203: Performing completeness analysis on the to-be-trained image and the target complete image corresponding to the same initial image to obtain an initial completeness score corresponding to each to-be-trained image.
[0036] The target complete image refers to an image including a complete target object.
[0037] As an example, in step S201, the computer device processes the target object in each initial image to obtain at least one to-be-trained image corresponding to each initial image. For example, a labeling box corresponding to each target object is set, and the computer device crops the labeling box in each initial image, and determines each cropped labeling box as a target complete image corresponding to each initial image. It is understandable that the target complete image is composed of the complete target object. For another example, the computer device uses a preset model to detect and crop the target object in each initial image to obtain a target complete image corresponding to the target object in each initial image. Fig.10 As shown in FIG. 1 , an initial image is collected in an actual scene. The target object in the initial image is a human body image. The complete human body image is processed to obtain the following Fig.11 The target complete image shown includes a complete human body image.
[0038] The random detection frame refers to a randomly generated detection frame used to crop the initial image.
[0039] As an example, in step S202, the computer device pregenerates a batch of random detection frames, and uses the random detection frames to randomly crop samples of the initial image corresponding to the target complete image, to obtain at least two cropped images to be trained corresponding to each initial image. Fig.12 As shown in the figure, when the target object is a human image, a random detection frame is used. Fig.10 In this example, the initial image is cropped with a random detection frame to obtain a relatively rich set of training images, so that a relatively accurate model training can be performed based on the relatively rich set of training images.
[0040] The integrity analysis process refers to the process of analyzing the training image to determine the integrity of the target object in the training image.
[0041] As an example, in step S203, the computer device performs completeness analysis on the target complete image corresponding to the initial image and each to-be-trained image corresponding to the same initial image, and obtains the initial completeness score corresponding to each to-be-trained image. For example, for the initial image b, its corresponding target complete image is , the corresponding training image is and , computer equipment and Perform completeness analysis and processing to obtain the image to be trained The corresponding initial completeness score, computer equipment and Perform completeness analysis and processing to obtain the image to be trained In this example, the target complete image corresponding to the initial image is used to perform completeness analysis on the to-be-trained image corresponding to the same initial image, so as to obtain the initial completeness score corresponding to each to-be-trained image more accurately.
[0042] In this embodiment, a random detection frame is used to perform sample cropping on the initial image, so that a richer set of images to be trained can be obtained, so that more accurate model training can be performed based on the richer set of images to be trained. The target complete image corresponding to the initial image is used to perform completeness analysis on the images to be trained corresponding to the same initial image, so that the initial completeness score corresponding to each image to be trained can be obtained more accurately, so that model training can be performed more accurately based on the initial completeness score corresponding to each image to be trained.
[0043] In one embodiment, if Figure 3 As shown, step S203, i.e., performing integrity analysis on the image to be trained and the target complete image corresponding to the same initial image to obtain the initial integrity score corresponding to each image to be trained, includes: S301: Acquire first position area data of each to-be-trained image and second position area data of each target complete image; S302: Performing overlap processing on each first position region data and second position region data corresponding to the same initial image to determine an initial completeness score corresponding to each image to be trained.
[0044] The first position area data refers to data used to characterize the area size of the image to be trained. The second position area data refers to data used to characterize the area size of the target complete image. For example, the first position area data includes the position area coordinates of the image to be trained, and the second position area data includes the position area coordinates of the target complete image.
[0045] As an example, in step S301, the computer device identifies the position area coordinates of each image to be trained in the initial image, and determines the identified position area coordinates of each image to be trained as the first position area data corresponding to each image to be trained. The computer device identifies the position area coordinates of each target complete image in the initial image, and determines the identified position area coordinates of each target complete image as the second position area data corresponding to each target complete image.
[0046] The coincidence processing refers to the process of determining the coincidence between the target complete image and the image to be trained corresponding to the same initial image.
[0047] As an example, in step S302, the computer device performs overlap processing on each first position area data corresponding to the same initial image and the second position area data corresponding to the same initial image, respectively, to obtain the overlap between each first position area data corresponding to the same initial image and the second position area data corresponding to the same initial image, and determines the overlap as the initial completeness score of the image to be trained corresponding to the first position area data.
[0048] For example, when the target object is a human image, Fig.10 The initial image b in corresponds to Fig.12 In (12a), the training image is and the training image shown in (12b) ,as well as Fig.11 The target complete image in , in the initial image b, identify The coordinates of the upper left corner are ( ), The width is The height is , that is, the image to be trained is obtained The corresponding first position area data is ( , , ), identification The coordinates of the upper left corner are ( ), The width is The height is , that is, the image to be trained is obtained The corresponding first position area data is ( , , ), identification The coordinates of the upper left corner are ( ), Width is The height is , that is, the complete target image is obtained The corresponding second location area data is ( , , ). Computer equipment according to The corresponding first position area data is ( , , )and The corresponding second location area data is ( , , ), perform overlap processing and determine and The overlap degree is determined as the image to be trained. The initial completeness score of the computer equipment is The corresponding first position area data is ( , , )and The corresponding second location area data is ( , , ), perform overlap processing and determine and The overlap degree is determined as the image to be trained. In this example, the overlap between the training image and the target complete image corresponding to the same initial image can be processed by performing an intersection-and-union comparison on the first position area data and the second position area data, and the intersection-and-union comparison result is determined as the initial completeness score of the training image. The corresponding first position area data is ( , , )and The corresponding second location area data is ( , , ), the intersection-over-union ratio IOU is: IOU= The IOU is determined as the image to be trained. The initial completeness score of .
[0049] In this embodiment, the initial completeness score corresponding to each image to be trained is determined based on the degree of overlap between each first position area data and the second position area data corresponding to the same initial image. This can more intuitively and accurately reflect the completeness of the target object in the image to be trained, and facilitates training to obtain a more accurate target integrity detection model based on the image to be trained and the initial completeness score corresponding to each image to be trained.
[0050] In one embodiment, if Figure 4 As shown, step S103, i.e., training an initial integrity detection model based on the image to be trained and the initial integrity score corresponding to each image to be trained, and determining a target loss function value corresponding to the initial integrity detection model, includes: S401: Input the image to be trained into the initial integrity detection model, and output the initial detection score corresponding to each image to be trained; S402: Determine a target loss function value corresponding to the initial integrity detection model based on an initial detection score corresponding to each to-be-trained image and an initial integrity score corresponding to each to-be-trained image.
[0051] The initial detection score refers to the score of the integrity detection of the target object output by the initial integrity detection model during the model training process.
[0052] As an example, in step S401, the computer device inputs the obtained at least two images to be trained into the initial completeness detection model, and outputs an initial detection score generated by the initial completeness detection model performing completeness detection on each image to be trained.
[0053] As an example, in step S402, the computer device performs loss function processing on the initial detection score corresponding to each image to be trained and the initial completeness score corresponding to the same image to be trained to obtain a target loss function value corresponding to the initial completeness detection model. The target loss function value can more accurately reflect the training degree of the model, facilitate the training of the initial completeness detection model, and obtain a more accurate target completeness detection model.
[0054] In this embodiment, the initial completeness score corresponding to the image to be trained is used as the model training label, and the initial detection score corresponding to the image to be trained is used as the model training value. According to the initial completeness score corresponding to the image to be trained and the initial detection score corresponding to the same image to be trained, the difference between the training label and the model training value is determined, and the target loss function value corresponding to the initial completeness detection model is determined. The target loss function value can more accurately reflect the model loss, which facilitates training to obtain a more accurate target completeness detection model.
[0055] In one embodiment, if Figure 5As shown, step S402, based on the initial detection score corresponding to each to-be-trained image and the initial completeness score corresponding to each to-be-trained image, determines the target loss function value corresponding to the initial completeness detection model, including: S501: Determine a first loss function value corresponding to an initial integrity detection model based on an initial detection score corresponding to each to-be-trained image and a completeness score corresponding to each to-be-trained image; S502: Based on the initial completeness scores corresponding to any two images to be trained, determine the target completeness difference. If the target completeness difference meets the preset completeness difference standard, determine the any two images to be trained as a target image pair, perform loss calculation on all target image pairs in the images to be trained, and determine the second loss function value corresponding to the initial completeness detection model. S503: Correcting the first loss function value using the first correction coefficient to obtain a first correction function value, and correcting the second loss function value using the second correction coefficient to obtain a second correction function value; S504: Determine a target loss function value corresponding to the initial integrity detection model based on the first correction function value and the second correction function value.
[0056] The first loss function value refers to a loss function value obtained according to an initial detection score and an initial completeness score of the image to be trained.
[0057] As an example, in step S501, the computer device performs loss function processing on the initial detection score corresponding to each image to be trained and the initial completeness score corresponding to the same image to be trained, and obtains a first loss function value corresponding to the initial completeness detection model. , the initial completeness score corresponding to each image to be trained is , the initial detection score corresponding to each image to be trained is ,in, is the i-th image to be trained, is the initial completeness score corresponding to the i-th image to be trained, is the initial detection score corresponding to the i-th image to be trained. and , and , and and and Calculate the label loss function, that is, the initial completeness score is As training labels, the initial detection scores are As the model training value, the first loss function value of the initial integrity detection model in the model training process is obtained by determining the difference between the training label corresponding to the same training image and the model training value. In this example, the first loss function value is for: .
[0058] The target integrity difference refers to the difference in initial integrity scores between any two of the images to be trained. The second loss function value refers to the loss function value obtained based on the first image and the second image. The preset integrity difference standard refers to a preset standard value for judging the size of the target integrity difference.
[0059] As an example, in step S502, the computer device determines the difference in initial completeness scores corresponding to any two images to be trained, determines the difference as the target completeness difference corresponding to any two images to be trained, compares and analyzes the target completeness difference with the preset completeness difference standard, determines whether the target completeness difference meets the preset completeness difference standard, and determines any two images to be trained whose target completeness difference meets the preset completeness difference standard as a target image pair. The above method is used to obtain all the target image pairs that meet the preset completeness difference standard in the images to be trained. The computer device calculates the loss function value according to the initial completeness scores and initial detection scores corresponding to all target image pairs, and obtains the second loss function value corresponding to the initial completeness detection model. .
[0060] For example, the computer device determines the difference between the initial completeness scores corresponding to any two images to be trained, determines the difference between the initial completeness scores corresponding to any two images to be trained as the target completeness difference, determines the preset difference as the preset completeness difference standard, determines any two images to be trained whose initial completeness score difference is greater than the preset difference as images to be trained that meet the preset completeness difference standard, and determines the images to be trained that meet the preset completeness difference standard as the first image and the second image. It can be understood that the greater the difference in the initial completeness scores corresponding to any two images to be trained (target completeness difference), the greater the difference in the completeness of the target objects in the two images to be trained. If the second loss function value between the two images to be trained with large differences can converge, it indicates that the training of the initial completeness detection model is relatively accurate, that is, the loss function value calculation based on the images to be trained with large completeness differences can more accurately reflect the degree of model training. Therefore, a preset difference value (preset completeness difference standard) is set. When the difference in the initial completeness scores is greater than the preset difference value, it indicates that the completeness difference of the target objects in any two images to be trained corresponding to the preset difference value is relatively large, and can be used to calculate the loss function value, and the two images to be trained are determined as the target image pair. For example, for the images to be trained and ,like and If the difference between the initial completeness scores of and There is a big difference between and The difference between the initial completeness scores of and Determine the target image pairs. The computer device determines all the target image pairs in the image to be trained in the above manner, calculates the loss function according to the completeness scores and initial detection scores corresponding to all the target image pairs, and obtains the second loss function value of the initial completeness detection model in the model training process. .
[0061] The first correction coefficient and the second correction coefficient refer to preset coefficients for correction.
[0062] As an example, in step S503, the computer device uses a preset first correction coefficient For the first loss function value Make corrections and get the first correction function value The computer device uses the preset first correction coefficient For the second loss function value Make corrections and get the second correction function value In this example, 0≤ ≤1,0≤ ≤1, + =1, the correction coefficient is used to correct the loss function value to obtain a more accurate loss function value.
[0063] As an example, in step S504, the computer device performs a summation process on the first correction function value and the second correction function value to obtain a target loss function value LOSS corresponding to the initial integrity detection model. In this example, LOSS= + .
[0064] In this embodiment, according to the initial detection score and initial integrity score corresponding to each image to be trained, and the target image pair that meets the preset integrity difference standard, the first loss function value and the second loss function value generated by the initial integrity detection model during the training process can be determined more comprehensively and accurately. The first loss function value is corrected by the first correction coefficient to obtain a more accurate first correction function value, and the second loss function value is corrected by the second correction coefficient to obtain a more accurate second correction function value. Based on the more accurate first correction function value and the second correction function value, a target loss function value with higher accuracy can be obtained, so that the initial integrity detection model can be trained more accurately according to the target loss function value to obtain a target integrity detection model with higher accuracy. The target integrity detection model is used to perform more accurate integrity detection on the target object in the image, output the target integrity score corresponding to the target object, and realize more accurate integrity detection on the target object, which has higher application value.
[0065] In one embodiment, the target image pair includes a first image and a second image.
[0066] The first image and the second image refer to the images to be trained included in the target image pair. It can be understood that the target image pair includes two images to be trained for determining the target integrity difference when the target integrity difference meets the preset integrity difference standard.
[0067] In one embodiment, if Figure 6 As shown, step S502, i.e., based on the image to be trained, all target images are subjected to loss calculation to determine the second loss function value corresponding to the initial integrity detection model, includes: S601: Determine a first classification probability and a second classification probability based on an initial detection score corresponding to the first image and an initial detection score corresponding to the second image; S602: Determine a first cross entropy based on the first classification probability, and determine a second cross entropy based on the second classification probability; S603: Determine a first classification coefficient and a second classification coefficient based on a magnitude relationship between an initial completeness score corresponding to the first image and an initial completeness score corresponding to the second image; S604: Correct the first cross entropy based on the first classification coefficient, correct the second cross entropy based on the second classification coefficient, and determine a second loss function value corresponding to the initial integrity detection model.
[0068] The first classification probability refers to the probability that the initial detection score corresponding to the first image is greater than the initial detection score corresponding to the second image. The second classification probability refers to the probability that the initial detection score corresponding to the first image is not greater than the initial detection score corresponding to the second image.
[0069] As an example, in step S601, the computer device processes the initial detection score corresponding to the first image and the initial detection score corresponding to the second image, determines a first classification probability that the initial detection score corresponding to the first image is greater than the initial detection score corresponding to the second image, and determines a second classification probability that the initial detection score corresponding to the first image is not greater than the initial detection score corresponding to the second image based on the first classification probability. In this example, for the first image and the second image , the first classification probability for: Since the second classification probability represents the probability that the initial detection score corresponding to the first image is not greater than the initial detection score corresponding to the second image, the second classification probability for ,Right now: .
[0070] In this example, the first classification probability and the second classification probability are obtained to facilitate more accurate determination of the first cross entropy and the second cross entropy.
[0071] Among them, the first cross entropy refers to the entropy when the initial integrity detection model evaluates that the initial detection score corresponding to the first image is greater than the initial detection score corresponding to the second image. The second cross entropy refers to the entropy when the initial integrity detection model evaluates that the initial detection score corresponding to the first image is not greater than the initial detection score corresponding to the second image. It can be understood that when the initial integrity detection model evaluates the integrity corresponding to the first image and the second image, when generating the initial detection score corresponding to the first image and the initial detection score corresponding to the second image, there is a certain uncertainty. The uncertainty is obtained and determined as the cross entropy, so as to determine the loss function value of the model training according to the cross entropy, so as to train the initial integrity detection model more accurately.
[0072] As an example, in step S602, the computer device calculates the first classification probability Perform logarithmic processing to obtain the first cross entropy: -log[ ], for the second classification probability Perform logarithmic processing to obtain the second cross entropy: -log[ ].
[0073] In this example, , , the probability of the first classification by the computer device Perform logarithmic processing to obtain the first cross entropy: , for the second classification probability Perform logarithmic processing to obtain the second cross entropy: .
[0074] The first classification coefficient refers to a coefficient used to correct the first cross entropy, and the second classification coefficient refers to a coefficient used to correct the second cross entropy.
[0075] As an example, in step S603, the computer device compares the initial completeness score corresponding to the first image with the initial completeness score corresponding to the second image, and determines the first classification coefficient and the second classification coefficient according to the comparison result. and the second image , first image The corresponding initial completeness score is , the second image The corresponding initial completeness score is ,Will and For size comparison, if > , then the first classification coefficient Determined to be 1, the second classification coefficient Determine to 0, if < , then the first classification coefficient Determined to be 0, the second classification coefficient Determined to be 1. Among them, 0≤ ≤1,0≤ ≤1, + =1.
[0076] As an example, in step S604, the computer device uses the first classification coefficient corresponding to all the first images and the second images in the training images to correct the corresponding first cross entropy, uses the second classification coefficient corresponding to all the first images and the second images in the training images to correct the corresponding second cross entropy, and sums each result obtained by correcting the first cross entropy with the first classification coefficient and each result obtained by correcting the second cross entropy with the second classification coefficient to obtain the second loss function value corresponding to the initial integrity detection model. In this example, if there are m pairs of first images and second images in n images to be trained, then the m pairs of first images and second images are processed to obtain the second loss function value : In this embodiment, the initial detection score corresponding to the first image and the initial detection score corresponding to the second image are processed to obtain the first cross entropy and the second cross entropy, and the first classification coefficient and the second classification coefficient are determined according to the size relationship between the initial completeness score corresponding to the first image and the initial completeness score corresponding to the second image. The initial detection score of the initial completeness detection model and the initial completeness scores of the first image and the second image are taken into consideration, so as to obtain a more accurate second loss function value corresponding to the initial completeness detection model.
[0077] In another embodiment, if Figure 7 As shown, a target integrity detection method is provided, and the method is applied in Fig. 9 The computer device in the example is used as an example to illustrate, including the following steps: S701: Acquire the target image to be detected; S702: Inputting the target image to be detected into the target integrity detection model, and outputting the target integrity score corresponding to the target image to be detected; Among them, the target integrity detection model is a model trained by the above-mentioned target integrity detection model training method.
[0078] The target image to be detected refers to an image that needs to be tested for the integrity of the target object. It can be understood that the target image to be detected contains a target object with a certain degree of integrity, and the integrity of the target object contained in the target image to be detected needs to be scored and evaluated.
[0079] As an example, in step S701, the computer device obtains a target image to be detected collected in a scene where the integrity of the target object needs to be detected, and is used to perform a score detection on the integrity of the target object in the target image to be detected. In this example, the target image to be detected is at least one, which can be a batch of images. For example, in a scene where pedestrians need to be re-identified, in order to improve the accuracy of re-identification, before re-identifying the pedestrians in the image, it is necessary to perform a score detection on the integrity of the image corresponding to the pedestrian in the image to determine whether the pedestrian in the image can be re-identified. Therefore, it is necessary to determine the image as the target image to be detected, and perform a score evaluation on the integrity of the image corresponding to the pedestrian. In practical applications, there are a large number of target images to be detected. If the score evaluation of the target image to be detected is performed manually, it will not only result in low evaluation accuracy, but also be time-consuming and labor-intensive, and low efficiency. In this embodiment, a target integrity detection method is provided to accurately and efficiently detect the integrity of the target object in the target image to be detected. In this example, the computer device obtains the original image to be detected in the scene to be detected, pre-processes the original image to be detected, and obtains the target image to be detected including the target object. Among them, the preprocessing method includes but is not limited to identifying the target object in the original image to be detected and cropping it to obtain the target image to be detected through a preset recognition model of the target object, or manually marking and cropping the target object in the original image to be detected to obtain the target image to be detected. It can be understood that the original image to be detected is an image obtained in the scene to be detected, which may include the target object and other objects except the target object. Therefore, it is necessary to preprocess the original image to be detected to obtain the target image to be detected that only includes the target object, so as to facilitate the subsequent detection of the target integrity score corresponding to the target object based on the target image to be detected more accurately.
[0080] The target completeness score refers to the completeness score corresponding to the target object in the target image to be detected.
[0081] As an example, in step S702, the computer device inputs the acquired target image to be detected into the target integrity detection model trained by the training method of the above-mentioned target integrity detection model, and the integrity of the target object in the target image to be detected is scored by the target integrity detection model to obtain a target integrity score between [0, 1] corresponding to the target object in the target image to be detected. It can be understood that if the target image to be detected does not include the target object, the target integrity score is 0, if the target image to be detected includes a complete target object, the target integrity score is 1, and if the target image to be detected includes half of the target object, the target integrity score is 0. For example, when performing integrity detection on a pedestrian in the target image to be detected, the computer device inputs the target image to be detected into the target integrity detection model for evaluating the integrity of a human body image, and outputs the target integrity score corresponding to the pedestrian in the target image to be detected.
[0082] In this embodiment, a target integrity detection model corresponding to the target object is used to evaluate the integrity score of the target object in the target image to be detected. No human intervention is required, and the target integrity score corresponding to the target object in the target image to be detected can be obtained more efficiently and accurately.
[0083] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0084] In one embodiment, a training device for a target integrity detection model is provided, and the training device for the target integrity detection model corresponds one-to-one to the training method for the target integrity detection model in the above embodiment. Figure 8 As shown, the training device of the target integrity detection model includes an initial image acquisition module 801, an initial integrity score determination module 802, a model training module 803 and a model generation module 804. The detailed description of each functional module is as follows: An initial image acquisition module 801 is used to acquire at least one initial image, where the initial image includes a target object; An initial completeness score determination module 802 is used to analyze and process the target object in each initial image, determine the to-be-trained image corresponding to each target object and the initial completeness score corresponding to each to-be-trained image; The model training module 803 trains an initial integrity detection model based on the to-be-trained images and the initial integrity scores corresponding to each to-be-trained image, and determines a target loss function value corresponding to the initial integrity detection model; The model generation module 804 is used to determine the initial integrity detection model as the target integrity detection model corresponding to the target object if the target loss function value meets the preset model optimization condition.
[0085] In one embodiment, the initial completeness score determination module 802 includes: A target complete image acquisition submodule is used to process the target object in each initial image to obtain a target complete image corresponding to each target object; The training image acquisition submodule is used to perform sample cropping processing on the target object in each initial image using a random detection frame to obtain a training image corresponding to each initial image; The initial completeness score acquisition submodule is used to perform completeness analysis on the to-be-trained image and the target complete image corresponding to the same initial image, and obtain the initial completeness score corresponding to each to-be-trained image.
[0086] In one embodiment, the initial completeness score acquisition submodule includes: A position area data acquisition unit, used to acquire first position area data of each to-be-trained image and second position area data of each target complete image; The initial completeness score determination unit is used to perform overlap processing on each first position area data and second position area data corresponding to the same initial image to determine the initial completeness score corresponding to each image to be trained.
[0087] In one embodiment, the model training module 803 includes: The initial detection score acquisition submodule is used to input the image to be trained into the initial integrity detection model and output the initial detection score corresponding to each image to be trained; The target loss function value determination submodule determines the target loss function value corresponding to the initial integrity detection model based on the initial detection score corresponding to each image to be trained and the initial integrity score corresponding to each image to be trained.
[0088] In one embodiment, the target loss function value determination submodule includes: A first loss function value determining unit, which determines a first loss function value corresponding to the initial integrity detection model based on an initial detection score corresponding to each to-be-trained image and an initial integrity score corresponding to each to-be-trained image; A second loss function value determination unit is configured to determine a target integrity difference based on initial integrity scores corresponding to any two images to be trained. If the target integrity difference meets a preset integrity difference standard, any two images to be trained are determined as a target image pair. Loss calculation is performed on all target image pairs in the images to be trained to determine a second loss function value corresponding to the initial integrity detection model. A second correction function value determining unit, configured to correct the first loss function value by using a first correction coefficient to obtain a first correction function value, and correct the second loss function value by using a second correction coefficient to obtain a second correction function value; The target loss function value determining unit determines the target loss function value corresponding to the initial integrity detection model based on the first correction function value and the second correction function value.
[0089] In one embodiment, the second loss function value determining unit includes: A classification probability determination subunit, which determines a first classification probability and a second classification probability based on an initial detection score corresponding to the first image and an initial detection score corresponding to the second image; A cross entropy determination subunit, which determines a first cross entropy based on the first classification probability and determines a second cross entropy based on the second classification probability; A classification coefficient determination subunit determines a first classification coefficient and a second classification coefficient based on a magnitude relationship between an initial completeness score corresponding to the first image and an initial completeness score corresponding to the second image; The second loss function value determination subunit amends the first cross entropy based on the first classification coefficient, amends the second cross entropy based on the second classification coefficient, and determines the second loss function value corresponding to the initial integrity detection model.
[0090] In another embodiment, a target integrity detection device is provided, which corresponds to the target integrity detection method in the above embodiment. The target integrity detection device includes a target image acquisition module to be detected and a target integrity score output module. The functional modules are described in detail as follows: The target image acquisition module to be detected is used to acquire the target image to be detected; The target integrity score output module is used to input the target image to be detected into the target integrity detection model and output the target integrity score corresponding to the target image to be detected.
[0091] For the specific definition of the training device of the target integrity detection model, please refer to the definition of the training method of the target integrity detection model in the above text, which will not be repeated here. For the specific definition of the target integrity detection device, please refer to the definition of the target integrity detection method in the above text, which will not be repeated here. The training device of the target integrity detection model and each module in the target integrity detection device can be fully or partially implemented by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0092] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig. 9 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data used or generated during the training method of executing the target integrity detection model. Alternatively, the database of the computer device is used to store data used or generated during the execution of the target integrity detection method. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a training method for a target integrity detection model is implemented. Alternatively, when the computer program is executed by the processor, a target integrity detection method is implemented.
[0093] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the training method of the target integrity detection model in the above embodiment is implemented, for example Figure 1 S101-S104 as shown, or Figures 2 to 6 As shown in , or, when the processor executes the computer program, the target integrity detection method in the above embodiment is implemented, for example Figure 7 S701-S702 are shown, and will not be described here to avoid repetition. Alternatively, when the processor executes the computer program, the functions of each module / unit in the training device of the target integrity detection model are realized, for example Figure 8 The functions of the initial image acquisition module 801, the initial integrity score determination module 802, the model training module 803 and the model generation module 804 shown, or the functions of each module / unit in this embodiment of the target integrity detection device implemented when the processor executes the computer program, such as the target image acquisition module to be detected and the target integrity score output module, will not be repeated here to avoid repetition.
[0094] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the training method of the target integrity detection model in the above embodiment is implemented, for example Figure 1 S101-S104 as shown, or Figures 2 to 6 As shown in, or, when the computer program is executed by a processor, the target integrity detection method in the above embodiment is implemented, for example Figure 7 S701-S702 are shown, and will not be described here to avoid repetition. Alternatively, when the computer program is executed by the processor, the functions of each module / unit in the embodiment of the training device for the target integrity detection model are realized, for example Figure 8 The functions of the initial image acquisition module 801, the initial integrity score determination module 802, the model training module 803 and the model generation module 804 shown, or the functions of each module / unit in the embodiment of the target integrity detection device are realized when the computer program is executed by the processor, such as the functions of the target image acquisition module to be detected and the target integrity score output module, which are not described here to avoid repetition. The computer-readable storage medium can be non-volatile or volatile.
[0095] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0096] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0097] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A training method for a target integrity detection model, characterized in that: include: Acquire at least one initial image, wherein the initial image includes a target object; Analyze and process the target object in each of the initial images to determine the to-be-trained image corresponding to each of the target objects and the initial completeness score corresponding to each of the to-be-trained images; Based on the to-be-trained images and the initial completeness scores corresponding to each of the to-be-trained images, an initial completeness detection model is trained to determine a target loss function value corresponding to the initial completeness detection model; If the target loss function value satisfies the preset model optimization condition, the initial integrity detection model is determined as the target integrity detection model corresponding to the target object.
2. The training method of the target integrity detection model according to claim 1, characterized in that: The analyzing and processing the target object in each of the initial images to determine the to-be-trained image corresponding to each of the target objects and the initial completeness score corresponding to each of the to-be-trained images includes: Processing the target object in each of the initial images to obtain a complete target image corresponding to each of the target objects; Using a random detection frame to perform sample cropping processing on the target object in each of the initial images to obtain an image to be trained corresponding to each of the initial images; Completeness analysis is performed on the to-be-trained image and the target complete image corresponding to the same initial image to obtain an initial completeness score corresponding to each to-be-trained image.
3. The training method of the target integrity detection model according to claim 2, characterized in that: The performing integrity analysis on the image to be trained and the target complete image corresponding to the same initial image to obtain an initial integrity score corresponding to each image to be trained includes: Acquire first position area data of each of the to-be-trained images and second position area data of each of the target complete images; The overlap processing is performed on each of the first position area data and the second position area data corresponding to the same initial image to determine the initial completeness score corresponding to each of the to-be-trained images.
4. The training method of the target integrity detection model according to claim 1, characterized in that: The step of training an initial integrity detection model based on the to-be-trained images and the initial integrity scores corresponding to each of the to-be-trained images, and determining a target loss function value corresponding to the initial integrity detection model, comprises: Inputting the to-be-trained images into the initial completeness detection model, and outputting an initial detection score corresponding to each of the to-be-trained images; Based on the initial detection score corresponding to each of the to-be-trained images and the initial completeness score corresponding to each of the to-be-trained images, a target loss function value corresponding to the initial completeness detection model is determined.
5. The training method of the target integrity detection model according to claim 4, characterized in that: The determining, based on the initial detection score corresponding to each of the to-be-trained images and the initial completeness score corresponding to each of the to-be-trained images, a target loss function value corresponding to the initial completeness detection model comprises: Determining a first loss function value corresponding to the initial integrity detection model based on an initial detection score corresponding to each of the to-be-trained images and an initial integrity score corresponding to each of the to-be-trained images; Based on the initial completeness scores corresponding to any two of the images to be trained, a target completeness difference is determined; if the target completeness difference meets a preset completeness difference standard, the any two images to be trained are determined as a target image pair; based on the images to be trained, all target image pairs are subjected to loss calculation to determine a second loss function value corresponding to the initial completeness detection model; Using a first correction coefficient to correct the first loss function value to obtain a first corrected function value, and using a second correction coefficient to correct the second loss function value to obtain a second corrected function value; Based on the first correction function value and the second correction function value, a target loss function value corresponding to the initial integrity detection model is determined.
6. The training method of the target integrity detection model according to claim 5, characterized in that: The target image pair includes a first image and a second image; The step of performing loss calculation on all target images in the image to be trained to determine a second loss function value corresponding to the initial integrity detection model includes: Determining a first classification probability and a second classification probability based on an initial detection score corresponding to the first image and an initial detection score corresponding to the second image; Determine a first cross entropy based on the first classification probability, and determine a second cross entropy based on the second classification probability; Determining a first classification coefficient and a second classification coefficient based on a magnitude relationship between an initial completeness score corresponding to the first image and an initial completeness score corresponding to the second image; The first cross entropy is corrected based on the first classification coefficient, the second cross entropy is corrected based on the second classification coefficient, and a second loss function value corresponding to the initial integrity detection model is determined.
7. A target integrity detection method, characterized in that: include: Acquire the target image to be detected; Inputting the target image to be detected into the target integrity detection model, and outputting the target integrity score corresponding to the target image to be detected; Among them, the target integrity detection model is a model trained by the training method of the target integrity detection model described in any one of claims 1-6.
8. A training device for a target integrity detection model, characterized in that: include: An initial image acquisition module, used to acquire at least one initial image, wherein the initial image includes a target object; An initial completeness score determination module is used to analyze and process the target object in each of the initial images to determine the to-be-trained image corresponding to each of the target objects and the initial completeness score corresponding to each of the to-be-trained images; A model training module, based on the to-be-trained images and the initial completeness scores corresponding to each of the to-be-trained images, trains an initial completeness detection model, and determines a target loss function value corresponding to the initial completeness detection model; A model generation module is used to determine the initial integrity detection model as the target integrity detection model corresponding to the target object if the target loss function value meets the preset model optimization condition.
9. A target integrity detection device, characterized in that: include: The target image acquisition module to be detected is used to acquire the target image to be detected; The target integrity score output module is used to input the target image to be detected into the target integrity detection model and output the target integrity score corresponding to the target image to be detected.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements the training method of the target integrity detection model as described in any one of claims 1 to 6, or, when the processor executes the computer program, it implements the target integrity detection method as described in claim 7.
11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the training method of the target integrity detection model as described in any one of claims 1 to 6, or, when the computer program is executed by a processor, it implements the target integrity detection method as described in claim 7.