Training data determination method and apparatus, target detection method and apparatus, device, and medium
Feature maps and target detection frames are generated through image generation processing and diffusion models, and training data are automatically determined. This solves the difficulty in obtaining training data caused by the reliance on manual annotation in the existing technology, achieves high-quality and diverse training data, and reduces the cost of training. cost.
Patent Information
- Application Number
- PCT/CN2024/083193
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-22
- Filing Date
- 2024-03-22
- Publication Date
- 2024-09-26
AI Technical Summary
It is difficult to obtain training data for existing target detection models, mainly because manually annotated detection frames consume a lot of resource costs, making it difficult to obtain training data.
By acquiring images, performing image generation processing, and using diffusion models to generate feature maps and target detection frames, training data is automatically determined and dependence on manual annotation is reduced.
It effectively reduces the difficulty of obtaining training data, improves the quality and diversity of training data, reduces manual annotation costs, and improves the detection performance of the target detection model.
Smart Images

Figure CN2024083193_26092024_PF_FP
Abstract
Description
Training data determination method, target detection method, device, equipment, medium
[0001] This application claims priority to Chinese Patent Application No. 202310288309.4 filed on March 22, 2023, and the contents of the above-mentioned Chinese patent application disclosure are hereby incorporated by reference in their entirety as a part of this application. Technical Field
[0002] The present disclosure relates to a training data determination method, a target detection method, an apparatus, a device, and a medium. Background Art
[0003] With the development of image processing technology, object detection models have become increasingly widely used in the field of vision. For example, they can be applied to vision fields such as scene recognition and scene understanding.
[0004] In fact, in order to ensure the detection performance of the target detection model, it is necessary to pre-train the target detection model using high-quality image training data with detection box annotations, so that the trained target detection model has better detection performance.
[0005] However, the detection boxes carried in the above training data are usually obtained by manual annotation, which requires a lot of resource costs (such as labor costs, time costs, etc.), making it difficult to obtain training data.
[0006] Summary of the Invention
[0007] The present disclosure provides a training data determination method, target detection method, apparatus, device, and medium, which can effectively reduce the difficulty of obtaining training data.
[0008] In order to achieve the above objectives, the technical solutions provided by the present disclosure are as follows:
[0009] The present disclosure provides a method for determining training data, the method comprising:
[0010] acquiring a first image;
[0011] performing image generation processing on the first image to obtain at least one feature map and a second image; the second image is determined based on the at least one feature map; the at least one feature map is determined based on the first image;
[0012] determining an object detection frame corresponding to the second image based on the at least one feature map;
[0013] Training data is determined based on the second image and the target detection box corresponding to the second image.
[0014] In one possible implementation, the method further includes:
[0015] Obtaining image generation constraint information corresponding to the first image;
[0016] The performing image generation processing on the first image to obtain at least one feature map and a second image includes:
[0017] Based on the image generation constraint information, image generation processing is performed on the first image to obtain at least one feature map and a second image; the at least one feature map is determined based on the first image and the image generation constraint information.
[0018] In one possible implementation, performing image generation processing on the first image based on the image generation constraint information to obtain at least one feature map and a second image includes:
[0019] The at least one feature map and the second image are determined using a pre-built first diffusion model, the image generation constraint information, and the first image.
[0020] In a possible implementation manner, the image generation constraint information includes conditional prompt text;
[0021] The process of determining the at least one feature map and the second image includes:
[0022] Performing feature extraction on the conditional prompt text to obtain conditional prompt features;
[0023] The conditional prompt feature and the first image are input into the first diffusion model to obtain the at least one feature map and the second image.
[0024] In one possible implementation, the first diffusion model includes a denoising module and a decoding module, the denoising module is configured to perform multiple noise removal processes on input data of the denoising module; the input data of the decoding module includes a result of the last noise removal process;
[0025] The at least one feature map is determined based on the intermediate features generated during the last noise removal process;
[0026] The second image is determined according to output data of the decoding module.
[0027] In a possible implementation manner, the image generation constraint information includes at least one of a random seed, a coding rate, a guidance ratio, and a conditional prompt text.
[0028] In one possible implementation manner, after determining the training data based on the second image and the object detection box corresponding to the second image, the method further includes:
[0029] Adjust some or all of the constraint items in the image generation constraint information, and continue to execute the step of performing image generation processing on the first image based on the image generation constraint information to obtain at least one feature map and a second image until the first end condition is reached.
[0030] In a possible implementation manner, acquiring the first image includes:
[0031] determining the first image from a training dataset;
[0032] The determining of training data according to the second image and the target detection frame corresponding to the second image includes:
[0033] Updating the training dataset using the second image and the target detection box corresponding to the second image;
[0034] The method further comprises:
[0035] After the first end condition is reached, the step of determining the first image from the training data set is continued until the second end condition is reached.
[0036] In one possible implementation, determining the object detection frame corresponding to the second image based on the at least one feature map includes:
[0037] The at least one feature map is processed using a pre-built first detection network to obtain an object detection box corresponding to the second image.
[0038] In one possible implementation manner, the process of constructing the first detection network includes:
[0039] Training a first data processing model using a plurality of third images and detection box labels corresponding to the third images; the first data processing model includes a second diffusion model and a second detection network; and parameters in the second diffusion model are not updated during the training of the first data processing model.
[0040] The first detection network is determined according to the second detection network in the trained first data processing model.
[0041] In a possible implementation manner, the second image is generated using a pre-built first diffusion model;
[0042] The second diffusion model is determined according to the first diffusion model.
[0043] In a possible implementation manner, the second image is generated using a pre-built first diffusion model; the first diffusion model is used to perform a first numerical noise removal process;
[0044] The second diffusion model is used to perform a second-order noise removal process; the second order is smaller than the first order.
[0045] In one possible implementation, the training process of the first data processing model includes:
[0046] determining an image to be used from the plurality of third images;
[0047] Inputting the image to be used into the first data processing model, and obtaining a detection box prediction result corresponding to the image to be used output by the first data processing model;
[0048] According to the detection box prediction result and the detection box label, the second detection network in the first data processing model is updated, and the step of determining the image to be used from the plurality of third images is continued until a preset stopping condition is reached.
[0049] In one possible implementation, the detection box prediction result is determined by the second detection network processing at least one feature map corresponding to the image to be used;
[0050] The at least one feature map corresponding to the image to be used is determined by processing the image to be used by the second diffusion model.
[0051] In one possible implementation, the at least one characteristic map includes a plurality of characteristic maps, and different characteristic maps have different sizes;
[0052] The using the pre-built first detection network to process the at least one feature map to obtain an object detection frame corresponding to the second image includes:
[0053] Using the plurality of feature maps, constructing a pyramid feature;
[0054] The pyramid features are input into the first detection network to obtain an object detection box corresponding to the second image.
[0055] In one possible implementation, the process of determining the second image and the object detection frame corresponding to the second image includes:
[0056] Using a pre-built second data processing model and the first image, the second image and the target detection box corresponding to the second image are determined; the second data processing model includes a first diffusion model and a first detection network; the first diffusion model is used to perform image generation processing on the first image to obtain at least one feature map and a second image; the first detection network is used to determine the target detection box corresponding to the second image based on the at least one feature map.
[0057] The present disclosure provides a target detection method, the method comprising:
[0058] Obtain the image to be detected;
[0059] The image to be detected is input into a pre-constructed target detection model to obtain a target detection result output by the target detection model; the target detection model is constructed based on training data; the training data is determined using the training data determination method provided by the present disclosure.
[0060] The present disclosure provides a training data determination device, comprising:
[0061] A first acquiring unit, configured to acquire a first image;
[0062] an image generation unit, configured to perform image generation processing on the first image to obtain at least one feature map and a second image; the second image is determined based on the at least one feature map; the at least one feature map is determined based on the first image;
[0063] a detection frame determining unit, configured to determine an object detection frame corresponding to the second image based on the at least one feature map;
[0064] A data determination unit is used to determine training data based on the second image and the target detection box corresponding to the second image.
[0065] The present disclosure provides a target detection device, comprising:
[0066] A second acquisition unit, configured to acquire an image to be detected;
[0067] The target detection unit is used to input the image to be detected into a pre-built target detection model to obtain the target detection result output by the target detection model; the target detection model is constructed based on training data; the training data is determined using the training data determination method provided by the present disclosure.
[0068] The present disclosure provides an electronic device, the device comprising: a processor and a memory;
[0069] The memory is used to store instructions or computer programs;
[0070] The processor is used to execute the instructions or computer programs in the memory, so that the electronic device performs the training data determination method or target detection method provided by the present disclosure.
[0071] The present disclosure provides a computer-readable medium having instructions or a computer program stored therein. When the instructions or the computer program are executed on a device, the device executes the training data determination method or the target detection method provided by the present disclosure.
[0072] The present disclosure provides a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the training data determination method or the target detection method provided by the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments recorded in the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0074] FIG1 is a flow chart of a method for determining training data provided by an embodiment of the present disclosure;
[0075] FIG2 is a schematic diagram of a training data augmentation process provided by an embodiment of the present disclosure;
[0076] FIG3 is a flow chart of a target detection method provided by an embodiment of the present disclosure;
[0077] FIG4 is a schematic structural diagram of a training data determination device provided by an embodiment of the present disclosure;
[0078] FIG5 is a schematic structural diagram of a target detection device provided by an embodiment of the present disclosure; and
[0079] FIG6 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0080] In order to enable those skilled in the art to better understand the solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the embodiments described are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0081] To better understand the technical solutions provided by the present disclosure, the following describes the training data determination method provided by the present disclosure in conjunction with some figures. As shown in Figure 1, the training data determination method provided by the embodiment of the present disclosure includes the following steps S101-S104. Figure 1 is a flowchart of a training data determination method provided by an embodiment of the present disclosure.
[0082] S101: Acquire a first image.
[0083] The first image refers to image data required for reference when generating a new image; and the present disclosure does not limit the first image, for example, it can refer to any image data.
[0084] For another example, in some application scenarios (e.g., augmenting training data), the first image may refer to image data (e.g., image 1 shown in FIG2 ) existing in an existing training dataset in a certain application field (e.g., target detection). The training dataset may include at least one image data and label information (e.g., a detection box label and / or a category label, etc.) for each image data. The detection box label is used to indicate the location of one or more targets (e.g., an object, an animal, etc.) in the image data; the category label is used to indicate the category to which one or more targets in the image data belong (e.g., the category label "cow" shown in FIG2 ).
[0085] Furthermore, the present disclosure does not limit the process for acquiring the first image. For example, the first image may be acquired using any existing or future image data acquisition method (e.g., acquisition using an image acquisition device, searching the Internet, etc.). For another example, when the training data determination method provided in the present disclosure is used to augment a training dataset for a specific application domain (e.g., target detection), the first image acquisition process may specifically include randomly selecting an image from an existing training dataset for that domain and determining it as the first image.
[0086] Based on the relevant content of S101 above, it can be known that in some application scenarios, when the training data determination method provided by the present disclosure is used to perform augmentation processing on a training data set in a certain application field (for example, the target detection field, etc.), an image data (for example, image data 1 shown in Figure 2) can be randomly extracted from the training data set as the first image, so that a new image (for example, image 2 shown in Figure 2) can be automatically generated based on the first image. In this way, the new image has a more reasonable layout structure (for example, similar to the layout structure of the first image), which is beneficial to improving the image quality of the new image, and further beneficial to improving the data quality of the training data determined based on the new image.
[0087] S102: Perform image generation processing on the first image to obtain at least one feature map and a second image; the second image is determined based on the at least one feature map; the at least one feature map is determined based on the first image.
[0088] The second image refers to a new image generated based on the first image. For example, when the first image is image 1 shown in FIG2 , the second image may be image 2 shown in FIG2 .
[0089] The "at least one feature map" mentioned above refers to the intermediate features generated during the generation process of the second image, and the "at least one feature map" can represent the image information carried by the second image. For example, the "at least one feature map" may include all feature maps generated during the Mth denoising process shown in Figure 2.
[0090] In addition, the present disclosure does not limit the implementation method of the above "at least one feature map". For example, it may include several feature maps of different sizes (for example, feature maps with 8×8 resolution, 16×16 resolution and 32×32 resolution generated by the continuous upsampling process involved in the denoising module of the diffusion model according to the upsampling step sizes of 8, 16 and 32 respectively), so that pyramid features can be constructed based on these feature maps in the future, so that the pyramid features can better represent the image information carried by the second image.
[0091] In addition, the present disclosure does not limit the implementation of the above S102. For example, it can be implemented by using any existing or future method that can perform image generation processing based on an image.
[0092] In fact, in order to better improve the image generation effect, the present disclosure also provides a possible implementation method of S102 above, which can be specifically: based on the image generation constraint information corresponding to the first image, the first image is processed to obtain at least one feature map and a second image; the second image is determined based on the at least one feature map; the at least one feature map is determined based on the first image and the image generation constraint information.
[0093] The image generation constraint information corresponding to the first image refers to constraint information (or guidance information) required for reference when generating a new image based on the first image. For example, when the first image is Image 1 shown in FIG2 , the image generation constraint information may include at least the image description text "A cow in the grass" shown in FIG2 .
[0094] In addition, the present disclosure does not limit the image generation constraint information. For example, when the present disclosure implements image generation processing with the help of diffusion models (DM), the image generation constraint information may include at least one of a random seed, a coding rate, a guidance ratio, and a conditional prompt text. Among them, the random seed is used to assist in generating random numbers involved in the image generation process of the DM. The coding rate is used to control the intensity of the noise added by the DM to the original image. The stronger the noise added, the greater the difference between the denoised image and the original image. The guidance ratio is used to adjust the degree of control of the conditional prompt text over the generation result. The higher the guidance ratio, the stronger the semantic consistency between the generated image and the conditional prompt text; the lower the guidance ratio, the more diverse the generated image, that is, the more room for DM to play freely. The conditional prompt text is used to guide the generation of semantic information carried by the image.
[0095] It should be noted that diffusion models typically involve two phases: forward diffusion and backward diffusion. In the forward diffusion phase, image data is gradually contaminated by noise until the image becomes completely random. In the backward diffusion phase, a series of Markov chains are used to gradually remove noise at each time step, thereby recovering the data from Gaussian noise. In addition, when diffusion models are applied to image generation, their ability to preserve the semantic structure of the data allows them to generate diverse images without being affected by mode collapse.
[0096] It's also important to note that a random seed is a random number that uses a true random number (seed) as its initial condition. Computer random numbers typically use a true random number (seed) as their initial condition and iterate using a specific algorithm to generate pseudo-random numbers. Furthermore, because some image generation processes (such as those based on diffusion models) are inherently random, different random seeds can be configured to generate different image data, thereby increasing image diversity.
[0097] It should be noted that the present disclosure does not limit the implementation method of the above conditional prompt text. For example, for the first image, if there is an image description text corresponding to the first image (for example, the image description text "A cow in the grass" shown in Figure 2), then the image description text can be determined as the conditional prompt text; if there is no image description text corresponding to the first image, then the conditional prompt text can be implemented using a pre-set general prompt text "A[Domain], with[CLASS-1],[CLASS-2],...in the[Domain]."; wherein, the [Domain] refers to the domain to which the image data belongs; and the [CLASS-i] refers to the name (or category) of the target appearing in the image data. For another example, in some application scenarios, the conditional prompt text can be implemented using text data input by the user.
[0098] In addition, the present disclosure does not limit the acquisition process of the above-mentioned image generation constraint information. For example, the image generation constraint information can be manually input by the user, or automatically generated with the help of a certain pre-set rule. The present disclosure does not make specific limitations on this.
[0099] Based on the above content, it can be seen that in one possible implementation, a first image (for example, image 1 shown in Figure 2) and image generation constraint information corresponding to the first image (for example, the image description text "A cow in the grass" shown in Figure 2) can be first obtained; then, under the guidance of the image generation constraint information, image generation processing is performed on the first image to obtain at least one feature map (for example, the three feature maps generated in the Mth denoising process shown in Figure 2) and a second image (for example, image 2 shown in Figure 2), so that the at least one feature map is determined based on the first image and the image generation constraint information, and the second image is determined based on the at least one feature map. In this way, not only does the second image have a more reasonable layout structure (for example, similar to the layout structure of the first image), but there are also certain differences between the second image and the first image, which is conducive to improving the diversity of image data.
[0100] In practice, to further improve image generation, S102 above can be implemented using a first diffusion model. Based on this, the present disclosure provides a possible implementation of S102 above, which specifically can include determining at least one feature map and a second image using a pre-built first diffusion model, a first image, and image generation constraint information corresponding to the first image.
[0101] Among them, the first diffusion model is used to perform image generation processing on the input data of the first diffusion model; and the embodiment of the present disclosure does not limit the implementation method of the first diffusion model. For example, it can be implemented using any existing or future diffusion model, such as the latent diffusion model (LDM).
[0102] In addition, the present disclosure does not limit the construction process of the first diffusion model mentioned above. For example, it can be implemented by using any existing or future method that can construct a diffusion model with image generation function.
[0103] In addition, the present disclosure does not limit the model structure of the first diffusion model mentioned above. For example, it may include an encoding module, a denoising module, a denoising module, and a decoding module; and the input data of the denoising model includes the output data of the encoding module, the input data of the denoising module includes the output data of the denoising module, and the input data of the decoding module includes the output data of the denoising module (for example, when the denoising module is used to perform several noise removal processes on the input data of the denoising module, the input data of the decoding module includes the processing result of the last noise removal process).
[0104] The encoding module is used to perform encoding processing (for example, the encoding processing shown in the following formula (1)) on the input data of the encoding module (for example, the image 1 shown in Figure 2) to obtain the encoding feature (for example, z0 shown in Figure 2). z0 = ε(x) (1)
[0105] In the formula, z0 represents the encoding feature obtained by encoding the image data x; x represents an image data (for example, the first image); ε(x) represents the encoding process performed on the image data x.
[0106] In addition, the present disclosure does not limit the implementation of the encoding module. For example, it can be implemented using a module with encoding function in any existing or future diffusion model (such as the encoding module shown in FIG. 2 ).
[0107] The noise addition module is used to perform at least one noise addition process (for example, several noise addition processes, or a one-time noise addition process of adding noise of an order of magnitude corresponding to the number of sampling time steps, etc.) on the input data of the noise addition module, so that the noise addition module is used to implement the forward diffusion stage in the first diffusion model above.
[0108] Furthermore, the present disclosure does not limit the operating principle of the noise addition module. For example, the noise addition module may implement forward diffusion by performing multiple noise addition processes. In another example, the noise addition module may implement forward diffusion by performing a single noise addition process that adds noise of an order of magnitude corresponding to the number of sampling time steps. For ease of understanding, the following examples are provided for illustration.
[0109] Example 1: When the noise adding module can realize forward diffusion by performing multiple noise adding processes, the noise adding module may include several noise adding submodules. Among them, one noise adding submodule is used to perform one noise adding process on the input data of the noise adding submodule (for example, the noise adding process shown in the following formula (2)). It should be noted that one noise adding process can also be referred to as one time step noise adding process. It should also be noted that the present disclosure does not limit the connection method between the "several noise adding submodules". For example, it can be implemented by any existing or future method for connecting multiple noise adding submodules (for example, cascade method, etc.). It should also be noted that the present disclosure does not limit the number of the "several noise adding submodules". For example, it can be M as shown in Figure 2, where M is a positive integer. For example, the number of the "several noise adding submodules" = k×50, where k can be obtained by random sampling from the interval [0.3, 1.0].
[0110] Where z t represents the output data of the t-th noise adding submodule; z t-1 represents the input data of the t-th noise adding submodule. If t=1, then z0 refers to the output data of the above encoding module. If t≥2, then z t-1 Refers to the output data of the t-1th noise adding submodule; ∈ represents Gaussian noise, which belongs to the standard Gaussian distribution; α t , σ t Determined by the noise module.
[0111] Example 2: When the noise adding module can realize forward diffusion by adding a noise of an order of magnitude corresponding to the number of sampled time steps at one time, the working principle of the noise adding module is as follows: after obtaining the number of time steps (for example, M shown in FIG2 ), first sample the noise of an order of magnitude corresponding to the number of time steps from the pre-established mapping relationship, so that the noise can indicate what order of magnitude of noise needs to be added when the noise adding process under the number of time steps is completed at one time; then use the noise to perform a noise adding process (for example, the noise adding process shown in the following formula (3)) on the input data of the noise adding module (for example, an image data) to obtain the noised result (for example, z shown in FIG2 ). M ). The mapping relationship is used to record the noise level corresponding to each candidate time step, so that the noise corresponding to the candidate step can indicate the noise level that needs to be added in the forward diffusion with the candidate time step.
[0112] Where z M Represents the output data of the noise module; M represents the number of time steps; ∈ represents Gaussian noise, which belongs to the standard Gaussian distribution; α M and σ M = represents the noise addition module; z0 refers to the output data of the encoding module; and e(M) represents the noise required to complete the M-step noise addition process in one go. It should be noted that this disclosure does not limit the method for obtaining M. For example, M = k × 50, where k can be obtained by random sampling from the interval [0.3, 1.0].
[0113] In addition, the present disclosure does not limit the implementation of the noise adding module. For example, it can be implemented by using a module with a noise adding function in any existing or future diffusion model.
[0114] The denoising module is used to perform at least one noise removal process (eg, several noise removal processes or the noise removal processes shown in formulas (4)-(5) below) on the input data of the denoising module, so that the denoising module is used to implement the reverse diffusion stage in the first diffusion model above. c p =T θ (P) (5)
[0115] Where, Represents the output result of the denoising module; z Mrepresents the input data of the denoising module, that is, the output data of the noise adding module above, that is, the data obtained after M time steps of noise addition processing; M represents the number of time steps, that is, the number of noise removal times; P represents the conditional prompt text above; T θ (P) represents feature extraction processing for P, and the present disclosure does not limit the implementation method of the feature extraction processing. For example, it can be implemented using a Contrastive Language-Image Pre-training (CLIP) model based on contrastive text-image pairs; c p Represents the embedding features of P (for example, the text embedding features obtained based on the CLIP model); ∈ θ (z M ,M,c p ) indicates that the c p As a guide, the input data z of the denoising module M Perform M noise removal processes. It should be noted that the present disclosure does not limit the method for obtaining M involved in the denoising module. For example, the method can be implemented by outputting the embedded features of M from the above-mentioned denoising module to the denoising module. For example, other methods can also be used to obtain M, which are not specifically limited by the present disclosure.
[0116] In addition, the present disclosure does not limit the denoising module. For example, it can be implemented using any existing or future network structure (such as U-Net) that can achieve several noise removal processes. For example, in some application scenarios, the denoising module may include several denoising sub-modules. Among them, a denoising sub-module is used to perform a noise removal process on the input data of the denoising sub-module. It should be noted that the present disclosure does not limit the connection method between the "several denoising sub-modules". For example, it can be implemented using any existing or future method for connecting multiple denoising sub-modules (such as a cascade method, etc.). It should also be noted that the present disclosure does not limit the number of the "several denoising sub-modules". For example, the number of sub-modules of the "several denoising sub-modules" is equal to the "number of time steps" above.
[0117] In addition, the present disclosure does not limit the implementation of the denoising module. For example, it can be implemented using a module with noise removal function in any existing or future diffusion model (for example, a denoising module based on U-Net).
[0118] Based on the above description of the first diffusion model, it can be seen that in some application scenarios, the first diffusion model can implement the image generation process through a forward diffusion + backward diffusion method (for example, a method of multiple noise addition processes + multiple noise removal processes). Based on this, the present disclosure also provides an implementation of the above S102. When the above "image generation constraint information corresponding to the first image" includes at least conditional prompt text (for example, the image description text "A cow in the grass" shown in Figure 2), S102 can specifically include the following steps 11 and 12.
[0119] Step 11: Extract features of the conditional prompt text to obtain conditional prompt features.
[0120] The conditional prompt feature is used to characterize the semantic information carried by the above conditional prompt text; and the present disclosure does not limit the acquisition process of the conditional prompt feature. For example, it can be implemented using the above formula (5).
[0121] Step 12: Input the conditional prompt feature and the first image into the first diffusion model to obtain at least one feature map and a second image.
[0122] In the present disclosure, after obtaining a first image and the conditional prompt features corresponding to the first image, these two data sets can be input into a pre-built first diffusion model. This model can then process the first image using the conditional prompt features as guidance information to obtain at least one feature map and a second image. For ease of understanding, this is explained below with examples.
[0123] As an example, when the first diffusion model includes an encoding module, a noise adding module, a noise removing module, and a decoding module, the step 12 may specifically include the following steps 121 to 124.
[0124] Step 121: Utilize an encoding module to encode the first image to obtain encoding features of the first image.
[0125] The coding feature of the first image is used to represent the image information carried by the first image.
[0126] Based on the relevant content of step 121 above, it can be known that for the first diffusion model above, after the first image (for example, image 1 shown in Figure 2) is input into the first diffusion model, the encoding module in the first diffusion model (for example, the encoding module shown in Figure 2) can perform encoding processing on the first image (for example, the encoding processing shown in formula (1) above) to obtain the encoding feature of the first image (for example, z0 shown in Figure 2), so that the encoding feature can represent the image information carried by the first image.
[0127] Step 122: Use a noise adding module to perform noise adding processing on the coding features of the first image to obtain a noise added result.
[0128] The noise-added result refers to data obtained by performing forward diffusion processing on the first image using the first diffusion model described above.
[0129] In addition, the present disclosure does not limit the implementation of step 122. For example, when the noise adding module implements forward diffusion by adding a noise adding process of a magnitude corresponding to the number of sampling time steps at one time, step 122 may specifically be as follows: after obtaining the coding feature z0 of the first image and the number of sampling time steps M, first determine the noise of a magnitude corresponding to the M; then, perform a noise adding process (for example, the noise adding process shown in formula (3) above) on the coding feature z0 according to the noise, so as to obtain the noise added result z M , which can effectively improve the noise addition efficiency, thereby helping to improve the data generation efficiency.
[0130] Based on the relevant content of step 122 above, it can be seen that for the first diffusion model above, after the encoding module in the first diffusion model outputs the encoding feature of the first image (for example, z0 shown in Figure 2), the noise addition module in the first diffusion model performs noise addition processing on the encoding feature for several time steps to obtain a noised result (for example, z0 shown in Figure 2). M ), so that the noise-added result can represent data obtained by the first diffusion model performing forward diffusion processing on the first image.
[0131] Step 123: Use a denoising module to perform noise removal on the above noise-added result to obtain a denoised result and the above at least one feature map.
[0132] The denoising result refers to data obtained by performing forward diffusion processing and backward diffusion processing on the first image using the first diffusion model.
[0133] In addition, the present disclosure does not limit the implementation of step 123. For example, as shown in FIG2 , when the above denoising module includes M denoising submodules, step 123 may specifically be: after obtaining the above denoising result z M Afterwards, the first denoising submodule refers to the above condition prompt features and calculates the noise result z M Perform the first noise removal process to obtain the denoised data output by the first denoising submodule The second denoising submodule then refers to the conditional prompt feature to "denoise the data output by the first denoising submodule" "Perform the second noise removal process to obtain the denoised data output by the second denoising submodule The third denoising submodule then refers to the conditional prompt feature to "denoise the data output by the second denoising submodule" "Perform the third noise removal process to obtain the denoised data output by the third denoising submodule ...(and so on); then the Mth denoising submodule refers to the conditional prompt feature and performs the denoising on the denoised data output by the M-1th denoising submodule Perform the Mth noise removal process to obtain the denoised data output by the Mth denoising submodule As the denoising result above; at the same time, the various feature maps generated when the M-th denoising submodule performs the M-th denoising process can also be obtained (for example, when the M-th denoising submodule is implemented using U-net, feature maps with 8×8 resolution, 16×16 resolution, and 32×32 resolution can be extracted from the three stages of the U-Net decoder). Wherein, M is a positive integer. It can be seen that under one possible implementation, the above "at least one feature map" can be determined based on the intermediate features generated in the last denoising process (for example, the M-th denoising process shown in Figure 2).
[0134] It should be noted that the first time involved in the present disclosure may also be referred to as the first time step; the second time may also be referred to as the second time step; ... (and so on).
[0135] Based on the relevant content of step 123 above, it can be known that for the first diffusion model above, when the noise adding module in the first diffusion model outputs the noise added result (for example, the z shown in FIG. 2 M ), the denoising module in the first diffusion model performs several noise removal processes on the noise-added result (for example, M noise removal processes as shown in FIG2 ) to obtain a denoised result (for example, ) and at least one feature map (e.g., the three feature maps extracted in the Mth denoising process shown in FIG2 ), so that the second image and its corresponding object detection frame can be subsequently determined based on these two pieces of data. For details about the object detection frame, please refer to the following.
[0136] Step 124: Decoding the denoised image using a decoding module to obtain the second image.
[0137] In the present disclosure, for the first diffusion model mentioned above, when the denoising module in the first diffusion model outputs the denoised result (for example, the one shown in FIG. 2 ), ), the denoised result can be decoded by a decoding module in the first diffusion model (e.g., the decoding module shown in FIG2 ) to obtain and output the second image (e.g., Image 2 shown in FIG2 ). Thus, in one possible implementation, the second image can be determined based on the output data of the decoding module (e.g., Image 2 shown in FIG2 ).
[0138] Based on the relevant content of steps 121 to 124 above, it can be known that after obtaining the first image and the image generation constraint information corresponding to the first image, the first diffusion model above can be used to perform image generation processing on the first image under the guidance of the image generation constraint information (for example, the image generation processing shown in Figure 2), and the first diffusion model outputs the second image and at least one corresponding feature map.
[0139] Based on the relevant contents of steps 11 to 12 above, it can be seen that for some application scenarios, after obtaining a first image (e.g., image 1 shown in FIG2 ) and image generation constraint information corresponding to the first image, if the image generation constraint information includes at least conditional prompt text (e.g., the image description text “A cow in the grass” shown in FIG2 ), the first image and the conditional prompt features extracted from the conditional prompt text can be input into a pre-constructed first diffusion model, so that the first diffusion model can perform image generation processing (e.g., the image generation processing shown in FIG2 ) on the first image under the guidance of the conditional prompt features, to obtain and output at least one feature map (e.g., the three feature maps extracted in the Mth denoising process shown in FIG2 ) and a second image (e.g., image 2 shown in FIG2 ), so that the at least one feature map can represent the image information carried by the second image (e.g., implicit semantics and position knowledge based on which the first diffusion model generates the second image), and the second image can be different from the first image to a certain extent while ensuring a relatively reasonable layout structure. Among them, because these feature maps have different sizes, these feature maps can represent the structure of the second image at multiple resolutions, so that these feature maps can better represent the information carried by the second image, so that the detection frame subsequently determined based on these feature maps can more accurately represent the position of the object in the second image.
[0140] Based on the relevant content of S102 above, it can be known that in one possible implementation, after obtaining the first image and the image generation constraint information corresponding to the first image, the first image can be processed (for example, encoding processing, noise addition processing, noise removal processing, etc.) according to the image generation constraint information to obtain at least one feature map, so that these feature maps can represent the image information of the new image to be generated; and then some processing is performed on these feature maps to obtain the new image as the second image, so that not only the second image has a more reasonable layout structure (for example, similar to the layout structure of the first image), but also there are certain differences between the second image and the first image, which is conducive to improving the diversity of image data.
[0141] S103: Determine an object detection frame corresponding to the second image based on at least one feature map.
[0142] The object detection frame corresponding to the second image is used to indicate the location of at least one object (e.g., a cow) in the second image. For example, when the second image is image 2 shown in FIG2 , the object detection frame corresponding to the second image may include the detection frame of image 2 shown in FIG2 .
[0143] In addition, the present disclosure does not limit the implementation method of S103 above. For example, it can be implemented using any existing or future method that can perform detection processing based on multiple feature maps (for example, detection frame detection processing, or detection frame detection processing + category detection processing, etc.).
[0144] In fact, in order to better improve the detection effect of the detection frame, the present disclosure also provides a possible implementation method of S103 above, which can be specifically: using a pre-built first detection network to process at least one feature map above to obtain a target detection frame corresponding to the second image.
[0145] Among them, the first detection network is used to perform detection processing (for example, detection frame detection processing, or detection frame detection processing + category detection processing, etc.) on the input data of the first detection network; and the present disclosure does not limit the implementation method of the first detection network. For example, it can be implemented using any existing or future network structure with a detection function (for example, a detection frame detection function, or a detection frame detection function + category determination function, etc.). It can be seen that under one possible implementation method, the first detection network can be used only to perform detection frame detection processing on the input data of the first detection network. Under another possible implementation method, the first detection network can be used to perform detection frame detection processing and category detection processing on the input data of the first detection network, so that the detection result determined by the first detection network for the input data can include a target detection frame and a target category. Among them, the target category is used to describe the category to which at least one target appearing in the input data belongs (for example, the "cow" category shown in Figure 2).
[0146] In addition, the present disclosure does not limit the working principle of the above-mentioned first detection network. For example, it can be specifically: directly inputting at least one feature map above into the first detection network to obtain the target detection frame (or, the target detection frame and the target category) corresponding to the second image output by the first detection network.
[0147] In fact, in order to better improve the detection effect of the detection frame, the present disclosure also provides another possible implementation of the working principle of the first detection network above. In this implementation, when the at least one feature map above includes several feature maps, and the sizes of any two feature maps in the several feature maps are different, the working principle of the first detection network may include the following steps 21-22.
[0148] Step 21: Use the above feature maps to construct pyramid features.
[0149] The pyramid feature refers to a result obtained by arranging the above-mentioned feature maps in order from large to small (or from small to large) in size, so that the pyramid feature includes multiple feature maps arranged in a pyramid form.
[0150] Step 22: Input the above pyramid features into the first detection network to obtain the target detection box (or the target detection box and the target category) corresponding to the second image.
[0151] In the present disclosure, after obtaining the above-mentioned pyramid features, the pyramid features are input into a pre-constructed first detection network so that the network layers corresponding to different sizes in the first detection network can be used to perform corresponding processing on the feature maps of corresponding sizes, so that the first detection network can perform detection processing on the pyramid features, obtain and output the target detection frame (or, the target detection frame and the target category) corresponding to the above-mentioned second image, so that the detection frame can represent the position of at least one target in the second image in the second image (and the target category can represent the category to which at least one target in the second image belongs). Among them, because feature maps of different sizes can represent information of different scales of the second image, the pyramid features determined based on these feature maps can represent information of different scales of the second image, which is conducive to improving the target detection performance (for example, detection accuracy, etc.) for the second image.
[0152] Based on the relevant content of steps 21 to 22 above, it can be seen that in one possible implementation, after obtaining multiple feature maps corresponding to the second image above, these feature maps are first arranged according to their sizes to obtain pyramid features; then the pyramid features are input into the first detection network, so that the first detection network performs detection processing on the pyramid features, obtains and outputs the target detection frame corresponding to the second image above, so that the detection frame can represent the position of at least one target in the second image in the second image.
[0153] In addition, the present disclosure does not limit the implementation method of the above-mentioned first detection network. For example, it can be implemented using any existing or future network structure (for example, a certain detection head) that has at least a detection frame detection function.
[0154] Based on the relevant content of the first detection network above, it can be known that for the first detection network provided by the present disclosure, the first detection network (for example, a certain detection head) is used to directly perform detection processing on the feature map, rather than directly performing detection processing on the image data, so that the first detection network does not need to perform the process of feature extraction on the image data, which is conducive to improving the detection efficiency of the first detection network. Among them, because the above feature map carries implicit semantics and position information involved in an image data, the first detection network can perform detection processing based on the implicit semantics and position information, which is conducive to improving the detection accuracy of the first detection network.
[0155] Furthermore, the present disclosure does not limit the construction process of the first detection network. For example, it may be implemented by using any existing or future method capable of constructing the first detection network.
[0156] In fact, in order to better improve the detection performance of the first detection network mentioned above, the present disclosure also provides a possible implementation method of the construction process of the first detection network mentioned above, which may specifically include the following steps 31 and 32.
[0157] Step 31: Train a first data processing model using a plurality of third images and detection frame labels corresponding to each third image; the first data processing model includes a second diffusion model and a second detection network; the parameters in the second diffusion model are not updated during the training process of the first data processing model.
[0158] The third image refers to image data required for use in constructing the first detection network. For example, the third image may be image 1 shown in FIG2 .
[0159] In addition, the present disclosure does not limit the implementation method of the above-mentioned "several third images". For example, it can be implemented using any existing or future image data in a training data set that includes image data and detection box labels corresponding to the image binary.
[0160] Furthermore, the present disclosure does not limit the relationship between the "several third images" and the first image. For example, the "several third images" may or may not include the first image. Therefore, when the first image is derived from a training dataset that requires augmentation, the image dataset used to construct the first detection network may be derived from the training dataset that requires augmentation or from elsewhere, and the present disclosure does not impose any specific limitations on this.
[0161] The detection frame label corresponding to the third image is used to describe the actual location of the target (e.g., an object, an animal, etc.) in the third image. For example, when the third image is image 1 shown in Figure 2, the detection frame label corresponding to the third image can be the detection frame label of image 1 shown in Figure 2.
[0162] In addition, the present disclosure does not limit the method for obtaining the above-mentioned "detection frame label corresponding to the third image", for example, it can be implemented by manual labeling.
[0163] The first data processing model is used to perform detection processing (e.g., detection box detection processing, or detection box detection processing + category detection processing, etc.) on the input data of the first data processing model. For example, the first data processing model can achieve the detection purpose by means of one noise addition process and one noise removal process. It can be seen that in one possible implementation, the first data processing model can refer to the diffusion engine including one denoising submodule as shown in Figure 2.
[0164] In practice, the first data processing model may include a second diffusion model and a second detection network, and the input data of the second detection network includes intermediate features generated by the second diffusion model during image generation (e.g., all feature maps generated during noise removal). For ease of understanding, the second diffusion model and the second detection network are described below.
[0165] The second diffusion model is used to perform image generation processing on the input data of the second diffusion model. Moreover, the present disclosure does not limit the implementation of the second diffusion model. For example, it can be implemented using any existing or future diffusion model (such as LDM).
[0166] In addition, the present disclosure does not limit the association relationship between the second diffusion model and the first diffusion model. For example, there is no association relationship between the second diffusion model and the first diffusion model.
[0167] For another example, the number of noise removal operations involved in the second diffusion model described above is less than the number of noise removal operations involved in the first diffusion model. Thus, in one possible implementation, if the first diffusion model is used to perform noise addition processing for a first number of time steps (e.g., M as shown in FIG2 ) and noise removal processing for a first number of time steps (i.e., the first time step), then the second diffusion model is used to perform noise addition processing for a second number of time steps (e.g., 1 as shown in FIG2 ) and noise removal processing for a second number of time steps (i.e., the second time step), and the second number of time steps is less than the first number.
[0168] In fact, in order to better improve the detection effect of the feature map generated by the first detection network above for the first diffusion model above, the present disclosure also provides a possible implementation of the second diffusion model above. The second diffusion model can be determined based on the first diffusion model so that the second diffusion model is partially or completely the same as the first diffusion model.
[0169] In addition, the present disclosure does not limit the determination process of the second diffusion model shown in the previous paragraph. For example, it can be specifically as follows: if the first diffusion model includes a plurality of denoising submodules, then the second diffusion model can include a preset number of denoising submodules, and the preset number is less than the number of submodules in the plurality of denoising submodules. In other words, the number of denoising submodules in the second diffusion model is less than the number of denoising submodules in the first diffusion model, so as to ensure that the intermediate features generated when the second diffusion model performs image generation processing (that is, the feature map generated by the last denoising submodule) can still relatively accurately describe the image information carried by the third image above. This can effectively avoid the impact caused by excessive noise addition, thereby facilitating the improvement of the construction effect of the first detection network below.
[0170] The preset number can be set in advance, and the preset number is equal to the second number mentioned above. For example, when the input data of the second detection network mentioned above includes the feature map generated by the last noise removal process in the second diffusion model mentioned above, in order to ensure as much as possible that the input data of the second detection network mentioned above (for example, multiple feature maps) can still more accurately describe the image information carried by the third image mentioned above, the preset number can be 1. That is, in one possible implementation, the second diffusion model mentioned above can include at least one denoising submodule.
[0171] Based on the above two paragraphs, it can be seen that in one possible implementation, if the pre-constructed first diffusion model includes several denoising submodules, the above second diffusion model can include at least one denoising submodule, so that the second diffusion model can achieve image generation processing through one backdiffusion. In particular, because the second diffusion model only performs noise addition processing on the third image for one time step, the output data of the denoising module in the second diffusion model can still relatively accurately represent the image information carried by the third image. As a result, the feature map generated when the denoising submodule in the second diffusion model performs noise removal processing on the output data for one time step can also relatively accurately represent the image information carried by the third image, so that the detection box subsequently determined by the above second detection network based on the feature map can represent the predicted locations of some targets in the third image.
[0172] The second detection network is used to perform prediction processing (e.g., detection frame detection processing, or detection frame detection processing + category detection processing, etc.) on the input data of the second detection network (e.g., the three feature maps shown in Figure 2); and the present disclosure is not limited to the second detection network. For example, it can be implemented using any existing or future network structure for realizing the detection function (e.g., detection frame detection function, or detection frame detection function + category detection function, etc.).
[0173] In addition, the present disclosure does not limit the input data of the second detection network above. For example, when the second diffusion model above includes one denoising submodule, the input data of the second detection network may include the feature map generated when the denoising submodule performs noise removal processing. For another example, when the second diffusion model above includes a preset number of denoising submodules, the input data of the second detection network may include the feature map generated when the last denoising submodule performs noise removal processing (that is, the feature map generated when the noise removal processing of the last time step is performed). For another example, when the second diffusion model above includes several denoising submodules, the input data of the second detection network may include the feature map generated when the Q-th denoising submodule performs noise removal processing (that is, the feature map generated when the noise removal processing of the Q-th time step is performed). Wherein, Q is a positive integer, and Q is less than the number of denoising submodules in the "several denoising submodules", for example, Q=1.
[0174] Based on the content of the above paragraph, it can be seen that in some application scenarios, if the above second detection network can be used to perform noise removal processing for a relatively small number of times (that is, a relatively small number of time steps), the intermediate features generated by the last noise removal processing in the second detection network can be directly used as the input data of the above second detection network. For another example, if the above second detection network can be used to perform noise removal processing for a relatively large number of times (that is, a relatively large number of time steps), the intermediate features generated by a certain noise removal processing in the second detection network can be used as the input data of the above second detection network. It can be seen that under one possible implementation method, the input data of the second detection network may include the intermediate features generated by the Q-th noise removal processing in the second detection network, and Q is less than or equal to the actual number of executions of the noise removal processing in the second detection network (for example, the total number of denoising submodules in the second detection network).
[0175] In fact, in some application scenarios, in order to better improve the detection performance, the first data processing model above may include a second diffusion model in a frozen state and a second detection network that needs to be learned and trained, so that the purpose of the training process for the first data processing model is mainly: the second detection network learns to align the implicit semantics and position knowledge in the second diffusion model with the detection perception signal to predict the detection box (or target category).
[0176] Based on the above content, it can be seen that in one possible implementation, the training process of the first data processing model above (that is, the implementation of step 31 above) can specifically include the following steps 311 to 314.
[0177] Step 311: Determine an image to be used from a plurality of third images.
[0178] The image to be used refers to the image data required to be used in the current round of training for the first data processing model described above. For example, the image to be used may be image 1 shown in FIG2 .
[0179] In addition, the present disclosure does not limit the implementation method of the above step 311. For example, it can be specifically: randomly selecting one or more images from all the images that have not been traversed in the above several third images, and determining them as images to be used, so that the images to be used can be used for model training processing in the current round of training.
[0180] Step 312: Input the image to be used into the first data processing model, and obtain the detection box prediction result corresponding to the image to be used output by the first data processing model.
[0181] Among them, the detection box prediction result corresponding to the image to be used is used to describe the target prediction position in the image to be used; and the present disclosure does not limit the determination process of the "detection box prediction result corresponding to the image to be used". For example, when the above first data processing model includes a second diffusion model and a second detection network, and the second diffusion model includes at least a coding module, a noise addition module and a denoising module, the determination process of the "detection box prediction result corresponding to the image to be used" can specifically include the following steps 3121-step 3124.
[0182] Step 3121: Use the encoding module in the second diffusion model above to encode the image to be used (for example, image 1 shown in Figure 2) to obtain the encoding features of the image to be used (for example, z0 shown in Figure 2), so that the encoding features can represent the image information carried by the image to be used.
[0183] It should be noted that the relevant content of step 3121 is similar to the relevant content of step 121 above. For the sake of brevity, it will not be repeated here.
[0184] Step 3122: Use the noise addition module in the second diffusion model to add noise to the coding features of the image to be used, and obtain a noise addition result (for example, z1 shown in Figure 2), so that the noise addition result can still express the image information carried by the image to be used.
[0185] It should be noted that the relevant content of step 3122 is similar to the relevant content of the noise adding module involved in the above step 122, and for the sake of brevity, it is not repeated here.
[0186] It should also be noted that the above-mentioned single-noise addition result refers to data obtained by performing a noise addition process for one time step on the coding features of the above-mentioned image to be used.
[0187] Step 3123: Use the denoising module in the second diffusion model to perform noise removal on the noise addition result, and determine at least one feature map corresponding to the image to be used from the intermediate features generated by the denoising module, so that these feature maps can represent the image information carried by the image to be used.
[0188] It should be noted that the relevant content of step 3123 is similar to the relevant content of the feature map involved in step 123 above. For the sake of brevity, it will not be repeated here.
[0189] It should also be noted that, in order to ensure that the at least one feature map corresponding to the image to be used can better represent the image information carried by the image to be used, the denoising module in the second diffusion model does not need to refer to any guidance information (e.g., the conditional prompt text) when performing noise removal. Based on this, it can be seen that in one possible implementation, the denoising module in the second diffusion model can perform noise removal under the premise of an unconditional signal (as shown in Formula (6) below).
[0190] Where, represents the output result of the denoising module in the second diffusion model above; z1 represents the output result of the denoising module in the second diffusion model above; Represents an unconditional signal (ie, without reference to any guidance information).
[0191] Step 3124: Use the second detection network to perform detection processing on at least one feature map corresponding to the image to be used to obtain a detection box prediction result corresponding to the image to be used.
[0192] It should be noted that the relevant content of step 3124 is similar to the relevant content of performing detection processing with the help of the first detection network involved in S103 above, and for the sake of brevity, it will not be repeated here.
[0193] Based on the relevant content of steps 3121 to 3124 above, it can be known that for the first data processing model including the second diffusion model and the second detection network, after the image to be used is input into the first data processing model, the second diffusion model in the first data processing model first processes the image to be used (for example, encoding processing, one noise addition processing and one noise removal processing, etc.) to obtain at least one feature map corresponding to the image to be used, so that these feature maps can represent the image information carried by the image to be used; and then the second detection network in the first data processing model processes at least one feature map corresponding to the image to be used (for example, detection frame detection processing) to obtain a detection frame prediction result corresponding to the image to be used, so that the detection frame prediction result can represent the predicted position of the object in the image to be used, so that the detection frame detection performance of the second detection network can be measured based on the detection frame prediction result.
[0194] Based on the relevant content of step 312 above, it can be known that for the current round of training process, after obtaining the image to be used, the first data processing model can be used to process the image to be used (for example, encoding processing, one noise addition processing, one noise removal processing and detection frame detection processing, etc.) to obtain the detection frame prediction result corresponding to the image to be used, so that the detection frame detection performance of the second detection network can be measured based on the detection frame prediction result.
[0195] Step 313: Determine whether a preset stop condition is met. If so, end the training process for the first data processing model; if not, execute the following step 314.
[0196] Among them, the preset stopping condition refers to the condition that needs to be achieved when the training process for the first data processing model ends; and the present disclosure does not limit the preset stopping condition. For example, the preset stopping condition can specifically be: the detection loss of the first data processing model is lower than a preset first threshold. For another example, the preset stopping condition can also be: the rate of change of the detection loss of the first data processing model is lower than a preset second threshold (that is, the detection performance of the first data processing model reaches convergence). For another example, the preset stopping condition can also be: the number of updates of the first data processing model reaches a preset third threshold.
[0197] The detection loss of the first data processing model is used to characterize the detection performance of the first data processing model (for example, detection box detection performance, or detection box detection performance and category detection performance); and the present disclosure does not limit the process of determining the detection loss. For example, it may specifically include: determining the detection box detection loss of the first data processing model based on the detection box prediction result corresponding to the image to be used and the detection box label corresponding to the image to be used; and determining the detection loss of the first data processing model based on the detection box detection loss.
[0198] In addition, the present disclosure does not limit the determination process of the "detection frame detection loss of the first data processing model" in the above paragraph. For example, it can be implemented using the following formula (7).
[0199] Where, represents the detection box loss of the first data processing model; y represents the detection box label corresponding to the image to be used above; Indicates the detection box prediction result corresponding to the image to be used above; Indicates the difference between the detection frame prediction result corresponding to the image to be used and the detection frame label corresponding to the image to be used, and this disclosure does not limit the The implementation method can be set according to the specific application scenario (for example, the detection framework used by the second detection network above), and this disclosure does not make specific limitations on this.
[0200] Based on the relevant content of step 313 above, it can be known that for the first data processing model involved in the current round of training process, it can be determined whether the first data processing model reaches the pre-set preset stop condition. If so, it can be determined that the first data processing model has good detection frame detection performance, and thus it can be determined that the second detection network in the first data processing model has good detection frame detection performance for the feature map provided by the second diffusion model, so the training process for the first data processing model can be ended and the following step 32 can be executed; however, if the preset stop condition is not reached, it can be determined that the detection frame detection performance of the first data processing model still needs to be improved, so the following step 314 can be executed.
[0201] Step 314: If the preset stopping condition is not met, the second detection network in the first data processing model is updated according to the detection box prediction result corresponding to the image to be used and the detection box label corresponding to the image to be used, and the process returns to continue executing step 311 and subsequent steps.
[0202] In the present disclosure, for the first data processing model involved in the current round of training process, if it is determined that the first data processing model has not reached the preset stop condition, it can be determined that the detection frame detection performance of the first data processing model still needs to be improved. Therefore, the second detection network in the first data processing model can be directly updated based on the difference between the detection frame prediction result corresponding to the image to be used and the detection frame label corresponding to the image to be used, so that the updated second detection network has better detection frame detection performance for the feature map provided by the above second diffusion model, and based on the first data processing model including the updated second detection network, continue to execute the above step 311 and its subsequent steps to realize a new round of training process for the first data processing model. The iterative cycle is repeated until the preset stop condition is reached to end the training process for the first data processing model.
[0203] It should be noted that in some application scenarios, if the second diffusion model in the above first data processing model is determined based on the already constructed first diffusion model, then because the first diffusion model has a better image generation function, the second diffusion model also has a relatively good image generation function. Therefore, in order to better improve the performance of the second detection network in the first data processing model, only the parameters in the above second detection network can be updated during the update process of the first data processing model, without the need to update the parameters of the second diffusion model, so that the second detection network can learn with the help of the training process of the first data processing model: how to better align the implicit semantics and position knowledge in the first diffusion model with the detection perception signal to predict the detection frame, so that the finally learned second detection network has better detection frame detection performance for the feature map provided by the first diffusion model.
[0204] Based on the relevant contents of steps 311 to 314 above, it can be seen that for the training process of the first data processing model above, it can be implemented by means of a one-step denoising and denoising method, so that the training process has the three advantages shown below ①-③.
[0205] ① Because the first data processing model only performs noise addition and noise removal processing for a small number of time steps (for example, 1 time step of noise addition and 1 time step of noise removal), the influence of the conditional signal (for example, the conditional prompt text mentioned above) on the feature map generated by the second diffusion model in the first data processing model can be ignored, so that the conditional signal has little effect on the training process of the first data processing model. It can be determined that whether the conditional prompt text aligned with the image data is used in the training process has little effect on the training process. Therefore, in order to reduce the difficulty of training, only the image data and the detection annotation corresponding to the image data (that is, the detection box label mentioned above) can be used to train the first data processing model. In this way, a data set without image description text (for example, the image description text "A cow in the grass" shown in Figure 2) is allowed to be used in the training process of the first data processing model, thereby effectively reducing the difficulty of obtaining training data used in the training process.
[0206] ② Because the first data processing model only performs noise addition and noise removal processing for a small number of time steps (for example, 1 time step of noise addition and 1 time step of noise removal), the layout and composition of the input data (that is, the original image) of the first data processing model are well preserved, thereby ensuring the credibility of the original annotation of the input data (that is, the detection box label corresponding to the original image).
[0207] ③ Because the training process of the first data processing model only needs to be implemented based on the image data and the detection annotations corresponding to the image data, any existing or future annotated detection data set can be directly used in the training process of the first data processing model without the need for additional data collection and labeling work, which can effectively reduce the construction cost of the first data processing model.
[0208] It should be noted that for step 31 above, in some application scenarios (e.g., target detection scenarios), in order to better improve the detection performance of the trained first data processing model, the present disclosure also provides a possible implementation of step 31 above, which can be: using a number of third images, a detection box label corresponding to each third image, and a category label corresponding to each third image, the first data processing model is trained so that the trained first data processing model has not only good detection box detection performance, but also good category detection performance. The category label is used to indicate the actual category to which the target in the third image belongs.
[0209] It should also be noted that the present disclosure does not limit the implementation method of the step in the previous paragraph "using a number of third images, the detection frame labels corresponding to each third image, and the category labels corresponding to each third image to train the first data processing model". For example, it is similar to the implementation method provided for step 31 above. For the sake of brevity, it will not be repeated here.
[0210] Step 32: Determine the first detection network based on the second detection network in the trained first data processing model.
[0211] It should be noted that the present disclosure does not limit the implementation method of step 32. For example, it can specifically be: the second detection network in the trained first data processing model (for example, detection network 2 shown in Figure 2) is directly determined as the first detection network (for example, detection network 1 shown in Figure 2).
[0212] Based on the relevant content of steps 31 to 32 above, it can be seen that in one possible implementation, the first detection network can be constructed with the help of a training process for the first data processing model including the second diffusion model and the second detection network, so that the constructed first detection network can learn in the training process of the first data processing model: how to better align the implicit semantics and position knowledge in the first diffusion model with the detection perception signal to predict the detection box (and target category), so that the constructed first detection network has better detection box detection performance (and category detection performance) for the feature map provided by the first diffusion model above, so that the first detection network can subsequently be used to process at least one feature map corresponding to a certain image binary to obtain the target detection box (and target category) corresponding to the image data.
[0213] In some application scenarios (e.g., object detection scenarios), S103 above may specifically include determining an object detection frame corresponding to the second image and an object category corresponding to the second image based on the at least one feature map above. The object category indicates the category to which at least one object in the second image belongs.
[0214] It should be noted that the implementation method of the step "determining the target detection frame corresponding to the second image and the target category corresponding to the second image based on at least one feature map above" in the above paragraph is similar to the implementation method of S103 shown above. For the sake of brevity, it will not be repeated here.
[0215] Based on the relevant content of S103 above, it can be known that in one possible implementation, after obtaining at least one feature map corresponding to the second image above, these feature maps can be detected and processed using a pre-constructed first detection network to obtain and output a target detection frame and a target category corresponding to the second image, so that the detection frame can indicate the position of at least one target (for example, a cow, etc.) in the second image, and the target category can indicate the category to which at least one target in the second image belongs (for example, the "cow" category shown in Figure 2). Among them, since the second image and the target detection frame and target category corresponding to the second image are all determined based on these feature maps, the image feature information referred to in the determination process of the second image (for example, the implicit semantics and position knowledge involved in the first diffusion model, etc.) is consistent with the image feature information referred to in the determination process of the target detection frame and target category corresponding to the second image, so that the detection frame can more accurately represent the position of at least one target in the second image in the second image, and the target category can more accurately represent the category to which at least one target in the second image belongs. In this way, the data quality of the tuple <second image, target detection frame corresponding to the second image> can be effectively improved, thereby improving the data quality of the training data determined based on the tuple.
[0216] S104: Determine training data based on the second image and the target detection frame corresponding to the second image.
[0217] In the present disclosure, in one possible implementation, after obtaining the second image and the target detection frame corresponding to the second image, the two-tuple <second image, target detection frame corresponding to the second image> can be used to determine training data so that the training data includes the two-tuple <second image, target detection frame corresponding to the second image>.
[0218] In addition, the present disclosure does not limit the implementation of the above S104. For example, it can be specifically as follows: the two-tuple <second image, target detection frame corresponding to the second image> is determined as a training data. For another example, in some application scenarios (such as scenarios of augmenting training data), if the above training data set includes the two-tuple <first image, target detection frame annotation corresponding to the first image>, then S104 can be specifically as follows: using the second image and the target detection frame corresponding to the second image, update the training data set so that the updated training data set includes not only the training data <first image, target detection frame annotation corresponding to the first image>, but also the training data <second image, target detection frame corresponding to the second image>. In this case, because there are differences between the first image and the second image, the updated training data has more diverse image data, which is conducive to improving the diversity of the training data.
[0219] In fact, in order to better improve the data quality of the training data, the present disclosure also provides a possible implementation of the above S104, which may specifically include the following steps 41 and 42.
[0220] Step 41: After determining at least one detection frame corresponding to the second image and the prediction confidence of each detection frame based on at least one feature map corresponding to the second image, determine a detection frame that meets a preset confidence condition from the at least one detection frame based on the prediction confidence of each detection frame.
[0221] Among them, the prediction confidence of a detection frame is used to indicate the accuracy of the detection frame; and the present disclosure does not limit the method for obtaining the prediction confidence of the detection frame. For example, it can be specifically: using a pre-constructed first detection network to process at least one feature map corresponding to the second image above to obtain at least one detection frame corresponding to the second image and the prediction confidence of each detection frame.
[0222] The preset confidence condition refers to the condition required to be used when screening multiple detection boxes obtained from the prediction of an image binary; and the present disclosure does not limit the preset confidence condition. For example, it can specifically be: the prediction confidence is greater than a preset threshold (for example, 0.3).
[0223] Based on the relevant content of step 41 above, it can be known that after obtaining at least one detection frame corresponding to the second image and the prediction confidence of each detection frame, based on these prediction confidences, detection frames with higher prediction confidences are screened out from these detection frames, so that a binary group including the second image can be generated based on these detection frames with higher prediction confidences. This is conducive to improving the data quality of the binary group.
[0224] Step 42: Determine training data based on the second image and the detection boxes that meet the preset confidence conditions.
[0225] In the present disclosure, after obtaining the second image and the above detection frame that meets the preset confidence conditions, the two-tuple <second image, the detection frame that meets the preset confidence conditions> can be used to determine the training data, so that the training data is the second image and the detection frame that meets the preset confidence conditions (for example, the training data is the two-tuple <second image, the detection frame that meets the preset confidence conditions>), which is conducive to improving the data quality of the training data.
[0226] Based on the relevant content of steps 41 to 42 above, it can be seen that after obtaining at least one detection frame corresponding to the second image and the prediction confidence of each detection frame, it is possible to first screen out detection frames with higher prediction confidence from these detection frames based on these prediction confidences, and then determine training data based on the second image and these detection frames with higher prediction confidences, so that the detection frames in the training data are more accurate, which is conducive to improving the data quality of the training data.
[0227] In fact, in some application scenarios (for example, when using S103 above to determine the target detection frame corresponding to the second image and the target category corresponding to the second image), S104 above can be specifically: determining the training data based on the second image, the target detection frame corresponding to the second image, and the target category corresponding to the second image, so that the training data includes the second image, the target detection frame corresponding to the second image, and the target category corresponding to the second image.
[0228] It should be noted that the implementation method of the step "determining the training data based on the second image, the target detection frame corresponding to the second image, and the target category corresponding to the second image" in the previous paragraph is similar to the implementation method of S104 shown above. For the sake of brevity, it will not be repeated here.
[0229] Based on the relevant contents of S101 to S104 above, it can be seen that for the training data determination method provided by the embodiment of the present disclosure, a first image is first obtained (for example, an image data already existing in the training data); then, image generation processing is performed on the first image to obtain at least one feature map (for example, multiple feature maps of different sizes) and a second image, where the second image is determined based on the at least one feature map, and the at least one feature map is determined based on the first image; then, a target detection frame corresponding to the second image is determined based on the at least one feature map, so that the target detection frame can represent the position of at least one target (for example, an object, an animal, etc.) in the second image; finally, based on the second image and the target detection frame corresponding to the second image, training data is determined (for example, the tuple <second image, target detection frame corresponding to the second image> is determined as a training data, etc.). In this way, the purpose of automatically generating new training data with the help of some existing images can be achieved, thereby effectively avoiding the increase in annotation costs caused by manually annotating detection frames, and thus reducing the difficulty of obtaining the training data while ensuring the data quality of the training data.
[0230] In addition, since the second image and the target detection frame corresponding to the second image are both determined based on at least one feature map above, the image feature information referenced in the determination process of the second image (for example, the implicit semantics and position knowledge involved in the first diffusion model, etc.) is consistent with the image feature information referenced in the determination process of the target detection frame corresponding to the second image, so that the target detection frame can more accurately represent the position of at least one target in the second image in the second image, thereby effectively improving the data quality of the tuple <second image, target detection frame corresponding to the second image>, which is beneficial to improving the data quality of the training data determined based on the tuple, thereby improving the data quality of the training data.
[0231] In addition, in some possible implementations, because the second image is generated based on the image generation constraint information corresponding to the first image above (for example, image description text such as "A cow in the grass", etc.), there is a certain degree of difference between the second image and the first image above. In this way, the diversity of image data can be improved while ensuring the generation of reasonable images, thereby improving the richness of training data while ensuring the data quality of training data, and further improving the detection performance of the target detection model trained based on the training data.
[0232] In addition, the present disclosure does not limit the execution subject of the above training data determination method. For example, the training data determination method provided in the embodiments of the present disclosure can be applied to devices with data processing functions such as terminal devices or servers. For another example, the training data determination method provided in the embodiments of the present disclosure can also be implemented with the help of a data communication process between different devices (for example, a terminal device and a server, two terminal devices, or two servers). Among them, the terminal device can be a smart phone, a computer, a personal digital assistant (PDA) or a tablet computer. The server can be a standalone server, a cluster server or a cloud server.
[0233] In fact, in order to better improve the quality of training data, the present disclosure also provides a possible implementation of the above training data determination method, which may specifically include the following steps 51 to 53.
[0234] Step 51: Acquire a first image.
[0235] It should be noted that, for the relevant content of step 51, please refer to the relevant content of S101 above, and for the sake of brevity, it will not be repeated here.
[0236] Step 52: Using a pre-constructed second data processing model and a first image, determine a second image and a target detection frame corresponding to the second image; the second data processing model includes a first diffusion model and a first detection network; the first diffusion model is used to perform image generation processing on the first image to obtain at least one feature map and a second image; the first detection network is used to determine the target detection frame corresponding to the second image (or, the target detection frame corresponding to the second image and the target category corresponding to the second image) based on the at least one feature map.
[0237] The second data processing model is used to perform data generation processing on the input data of the second data processing model. For example, the second data processing model can be the diffusion engine including M denoising submodules shown in FIG2 .
[0238] In addition, the second data processing model may include a first diffusion model and a first detection network, and the input data of the first detection network includes a feature map generated by the last noise removal process in the first diffusion model. The first diffusion model and the first detection network are described above.
[0239] In addition, the present disclosure does not limit the construction process of the second data processing model mentioned above. For example, it may specifically include the following steps 61 to 63.
[0240] Step 61: constructing a first diffusion model so that the constructed first diffusion model has a better image generation function.
[0241] It should be noted that the present disclosure does not limit the implementation of step 61. For example, it can be implemented by using any existing or future method that can construct a diffusion model with image generation function.
[0242] Step 62: Based on the constructed first diffusion model, construct the first data processing model mentioned above (for example, the diffusion engine including one denoising submodule shown in FIG2 ), so that the first data processing model includes a second diffusion model and a second detection network; the parameters in the second diffusion model are not updated during the training process of the first data processing model.
[0243] In the present disclosure, in one possible implementation, after obtaining the constructed first diffusion model, a second diffusion model is first constructed based on the constructed first diffusion model, so that the second diffusion model includes all or part of the first diffusion model; then the second diffusion model is combined with a second detection network that needs to be learned and trained to obtain a first data processing model that needs to be trained.
[0244] Step 63: Train the first data processing model using a number of third images and the detection frame labels corresponding to each third image (or, using a number of third images, the detection frame labels corresponding to each third image, and the category labels corresponding to each third image).
[0245] It should be noted that, for the relevant content of step 63, please refer to the relevant content of step 31 above, and for the sake of brevity, it will not be repeated here.
[0246] Step 64: Using the constructed first diffusion model, update the trained first data processing model to obtain a second data processing model, so that the second data processing model includes the constructed first diffusion model and the first detection network determined based on the trained second detection network.
[0247] In the present disclosure, after obtaining the trained first data processing model, the noise addition module and the denoising module in the first diffusion model constructed above can be used to replace the module for implementing the noise addition function and the module for implementing the noise addition function in the first data processing model, respectively, to obtain a second data processing model, so that the second data processing model not only includes the noise addition module and the denoising module in the first diffusion model, but also includes other modules in the first data processing model except the module for implementing the noise addition function and the module for implementing the noise addition function, which is conducive to improving the data generation function of the second data processing model.
[0248] Based on the relevant content of steps 61 to 64 above, it can be seen that in some application scenarios, the construction process of the second data processing model can be completed with the help of a two-stage training method, so that all modules in the second data processing model have better coordination, thereby enabling the second data processing model to have better data generation capabilities.
[0249] In addition, the present disclosure does not limit the working principle of the second data processing model mentioned above. For example, when the second data processing model is the diffusion engine including M denoising sub-modules as shown in Figure 2, the working principle of the second data processing model can be referred to the image 2 shown in Figure 2 and the generation process of the detection frame of the image 2.
[0250] Based on the relevant contents of steps 51 to 52 above, it can be known that for some application scenarios, after obtaining the first image and the image generation constraint information corresponding to the first image, a model that has been constructed (that is, a second data processing model) can be used to process these two pieces of information to obtain the second image and the target detection frame (and target category) corresponding to the second image. In particular, because the different modules in the model have relatively good coordination, the second image output by the model and the target detection frame corresponding to the second image have better matching, which is conducive to improving the data quality of the two-tuple <second image, target detection frame corresponding to the second image> (or, <second image, target detection frame corresponding to the second image, target category corresponding to the second image>), thereby helping to improve the data quality of the training data including the two-tuple.
[0251] After research, it was found that for the first diffusion model mentioned above, the first diffusion model can generate a large amount of image data with different degrees of difference from the reference image (for example, image 1 shown in Figure 2) by adjusting constraint information such as random seed, coding rate, guidance ratio and conditional prompt text. Therefore, in order to better improve the richness of training data, the present disclosure also provides a possible implementation method of the above training data determination method, which may specifically include the following steps 71 to 77.
[0252] Step 71: Determine a first image from a training data set, and obtain image generation constraint information corresponding to the first image.
[0253] The training data refers to a data set that needs to be augmented; and the present disclosure is not limited to the training data set. For example, the training data set may at least include the image 1 shown in FIG. 2 and the target detection frame label corresponding to the image 1.
[0254] In addition, for the relevant contents of the first image and the image generation constraint information corresponding to the first image, please refer to the relevant contents of S101-S102 above, and for the sake of brevity, they will not be repeated here.
[0255] In addition, the present disclosure does not limit the method for obtaining the first image. For example, it may specifically be: randomly selecting an image data from all original images that have not been traversed in the training data as the first image.
[0256] Step 72: Based on the image generation constraint information corresponding to the first image, perform image generation processing on the first image to obtain at least one feature map and a second image; the second image is determined based on the at least one feature map; the at least one feature map is determined based on the first image and the image generation constraint information.
[0257] It should be noted that for the relevant content of step 72, please refer to the relevant content of S102 above. For the sake of brevity, it will not be repeated here.
[0258] Step 73: Determine the object detection frame (and object category) corresponding to the second image based on the at least one feature map.
[0259] It should be noted that, for the relevant content of step 73, please refer to the relevant content of S103 above, and for the sake of brevity, it will not be repeated here.
[0260] Step 74: Update the training dataset based on the second image and the target detection frame (and target category) corresponding to the second image, so that the updated training dataset includes the second image and the target detection frame (and target category) corresponding to the second image.
[0261] In the present disclosure, after obtaining the second image and the target detection frame corresponding to the second image, the two-tuple <second image, target detection frame corresponding to the second image> (or, the three-tuple <second image, target detection frame corresponding to the second image, target category corresponding to the second image>) can be used as a new training data to update the above training data set so that the updated training data set also includes the two-tuple <second image, target detection frame corresponding to the second image> (or, the three-tuple <second image, target detection frame corresponding to the second image, target category corresponding to the second image>).
[0262] Step 75: Determine whether the first end condition is met. If so, execute the following step 77; if not, execute the following step 76.
[0263] Among them, the first end condition refers to the condition required to end the multiple image generation processes based on the first image; and the present disclosure does not limit the first end condition. For example, the first end condition can specifically be: reaching a pre-set number of image generation iterations for the first image.
[0264] Based on the relevant content of step 75 above, it can be seen that for the current round of image generation process, if it is determined that the first end condition is met, it can be determined that a sufficient number of new images and their corresponding target detection frames (and target categories) have been generated using the first image, so the following step 77 can be directly executed; if it is determined that the first end condition is not met, it can be determined that it is still necessary to continue to use the first image to generate new images and their corresponding target detection frames (and target categories), so the following step 76 can be directly executed.
[0265] Step 76: If the first end condition is not met, some or all constraint items in the image generation constraint information corresponding to the first image are adjusted, and the process returns to continue executing step 72 and subsequent steps.
[0266] The constraint item refers to an item of information in the image generation constraint information corresponding to the first image that has a constraint function on the image generation process. For example, the constraint item can be the random seed, encoding rate, guidance ratio, or conditional prompt text mentioned above.
[0267] Based on the relevant content of step 76 above, it can be known that for the current round of image generation process, if it is determined that the first end condition has not been met, it can be determined that it is still necessary to continue to use the first image to generate a new image and its corresponding target detection frame (and target category), so some or all of the constraints in the image generation constraint information corresponding to the first image can be adjusted (for example, adjusting the random seed, coding rate, guidance ratio and at least one of the conditional prompt texts, etc.) so that the image generation constraint information after the constraint items are adjusted is different from the image generation constraint information used in the historical image generation process based on the first image, so that the above step 72 and its subsequent steps can be continued based on the "image generation constraint information after the constraint items are adjusted". In this way, a new round of image generation process for the first image can be realized, and the iterative loop can be performed until the first end condition is met and the following step 77 can be executed.
[0268] Step 77: If the first end condition is met, determine whether the second end condition is met. If so, end the amplification process for the training data; if not, return to continue executing the above step 71 and subsequent steps.
[0269] Among them, the second end condition refers to the condition required to end the amplification processing process for the above training data; and the present disclosure does not limit the second end condition. For example, the second end condition can specifically be: all original images in the training data are traversed.
[0270] Based on the relevant content of step 77 above, it can be known that for the current round of image generation process, if it is determined that the first end condition is met, it can be determined that enough new images and their corresponding target detection frames (and target categories) have been generated using the first image, so it can be further judged whether the second end condition is met. If the second end condition is met, it can be determined that multiple image generation processes for all original images in the training data have been completed, so the amplification processing process for the training data can be directly ended. If the second end condition is not met, it can be determined that there are still untraversed original images in the training data, so the above step 71 and its subsequent steps can be continued to be executed, and the iterative cycle can be repeated until the second constraint condition is met to end the amplification processing process for the training data.
[0271] Based on the relevant content of steps 71 to 77 above, it can be seen that for the augmentation processing scenario of training data, it is possible to generate a large amount of image data and its detection frames (and target categories) that are different from the original images in the training data by adjusting the constraint information such as random seed, encoding rate, guidance ratio and conditional prompt text multiple times. This can effectively improve the richness of the training data, thereby helping to improve the augmentation effect of the training data.
[0272] Based on the above-mentioned content regarding the training data determination method, the present disclosure further provides a target detection method. For ease of understanding, this method is described below in conjunction with FIG3 . As shown in FIG3 , the target detection method provided by an embodiment of the present disclosure includes the following steps S301-S302 . FIG3 is a flow chart of a target detection method provided by an embodiment of the present disclosure.
[0273] S301: Acquire an image to be detected.
[0274] The image to be detected refers to image data that needs to be processed for target detection; and the present disclosure is not limited to the image to be detected.
[0275] S302: Input the image to be detected into a pre-built target detection model to obtain the target detection result output by the target detection model; the target detection model is constructed based on training data; the training data is determined by any implementation of the training data determination method provided in the embodiments of the present disclosure.
[0276] Among them, the target detection model is used to perform target detection processing on the input data of the target detection model; and the present disclosure does not limit the implementation method of the target detection model. For example, it can be implemented using any existing or future model with target detection function (such as a target detection model, etc.).
[0277] In addition, the target detection model is constructed based on the above training data, and the training data is determined using any implementation of the training data determination method provided in the present disclosure, so that the training data at least includes the above second image and the target detection frame (and target category) corresponding to the second image.
[0278] The target detection result is used to indicate what type of target exists in the image to be detected and the location of the target in the image to be detected.
[0279] Based on the relevant contents of S301 to S302 above, it can be seen that after obtaining the amplified training data in a certain application field, the training data is first used to train the target detection model in the field to obtain a trained target detection model so that the target detection model has good target detection performance. After the image to be detected is input into the pre-built target detection model, the target detection model performs target detection processing on the image to be detected, obtains and outputs the target detection result corresponding to the image to be detected, so that the target detection result can indicate what type of target exists in the image to be detected and the location of the target in the image to be detected. Among them, because the training data has a high richness and data quality, the target detection model trained based on the training data also has good target detection performance, so that the target detection result determined by the target detection model can also more accurately indicate what type of target exists in the image to be detected and the location of the target in the image to be detected, which is conducive to improving the target detection effect in the field.
[0280] In addition, the present disclosure does not limit the execution subject of the above target detection method. For example, the target detection method provided in the embodiments of the present disclosure can be applied to a device with data processing capabilities, such as a terminal device or a server. For another example, the target detection method provided in the embodiments of the present disclosure can also be implemented through a data communication process between different devices (e.g., a terminal device and a server, two terminal devices, or two servers).
[0281] Based on the training data determination method provided in the embodiments of the present disclosure, the embodiments of the present disclosure also provide a training data determination device, which will be explained and illustrated below in conjunction with Figure 4. Figure 4 is a schematic diagram of the structure of a training data determination device provided in the embodiments of the present disclosure. It should be noted that for the technical details of the training data determination device provided in the embodiments of the present disclosure, please refer to the relevant content of the training data determination method above.
[0282] As shown in FIG4 , the training data determination apparatus 400 provided in an embodiment of the present disclosure includes:
[0283] A first acquiring unit 401 is configured to acquire a first image;
[0284] An image generation unit 402 is configured to perform image generation processing on the first image to obtain at least one feature map and a second image; the second image is determined based on the at least one feature map; and the at least one feature map is determined based on the first image.
[0285] a detection frame determining unit 403, configured to determine an object detection frame corresponding to the second image based on the at least one feature map;
[0286] The data determining unit 404 is configured to determine training data based on the second image and the target detection box corresponding to the second image.
[0287] In a possible implementation manner, the first acquiring unit 401 is specifically configured to: acquire image generation constraint information corresponding to the first image;
[0288] The image generation unit 402 is specifically used to: perform image generation processing on the first image according to the image generation constraint information to obtain at least one feature map and a second image; the at least one feature map is determined based on the first image and the image generation constraint information.
[0289] In a possible implementation manner, the image generation unit 402 is specifically configured to determine the at least one feature map and the second image by using a pre-built first diffusion model, the image generation constraint information, and the first image.
[0290] In a possible implementation manner, the image generation constraint information includes conditional prompt text;
[0291] The image generation unit 402 is specifically configured to: perform feature extraction on the conditional prompt text to obtain conditional prompt features; and input the conditional prompt features and the first image into the first diffusion model to obtain the at least one feature map and the second image.
[0292] In one possible implementation, the first diffusion model includes a denoising module and a decoding module, the denoising module is used to perform several noise removal processes on the input data of the denoising module; the input data of the decoding module includes the processing result of the last noise removal process; the at least one feature map is determined based on the intermediate features generated during the last noise removal process; and the second image is determined based on the output data of the decoding module.
[0293] In a possible implementation manner, the image generation constraint information includes at least one of a random seed, a coding rate, a guidance ratio, and a conditional prompt text.
[0294] In a possible implementation manner, the training data determination device 400 further includes:
[0295] A constraint adjustment unit is used to adjust some or all of the constraint items in the image generation constraint information after determining the training data based on the second image and the target detection box corresponding to the second image, and continue to execute the step of performing image generation processing on the first image based on the image generation constraint information to obtain at least one feature map and a second image until the first end condition is reached.
[0296] In a possible implementation manner, the first acquisition unit 401 is specifically configured to: determine the first image from a training data set;
[0297] The data determination unit 404 is specifically configured to update the training dataset using the second image and the target detection frame corresponding to the second image;
[0298] The training data determination device 400 further includes:
[0299] The iterative unit is configured to, after a first end condition is reached, return to the first acquisition unit 401 to continue executing the step of determining the first image from the training data set until a second end condition is reached.
[0300] In a possible implementation, the detection frame determining unit 403 is specifically configured to process the at least one feature map using a pre-built first detection network to obtain a target detection frame corresponding to the second image.
[0301] In one possible implementation manner, the process of constructing the first detection network includes:
[0302] A first data processing model is trained using a plurality of third images and detection frame labels corresponding to each of the third images; the first data processing model includes a second diffusion model and a second detection network; the parameters in the second diffusion model are not updated during the training process of the first data processing model; and the first detection network is determined based on the second detection network in the trained first data processing model.
[0303] In a possible implementation manner, the second image is generated using a pre-built first diffusion model; and the second diffusion model is determined based on the first diffusion model.
[0304] In one possible implementation, the second image is generated using a pre-built first diffusion model; the first diffusion model is used to perform a first order noise addition process and a first order noise removal process; the second diffusion model is used to perform a second order noise addition process and a second order noise removal process; the second order is less than the first order.
[0305] In one possible implementation, the training process of the first data processing model includes: determining an image to be used from the plurality of third images; inputting the image to be used into the first data processing model to obtain a detection box prediction result corresponding to the image to be used output by the first data processing model; updating the second detection network in the first data processing model based on the detection box prediction result and the detection box label, and continuing to execute the step of determining the image to be used from the plurality of third images until a preset stop condition is reached.
[0306] In one possible implementation, the detection box prediction result is determined by the second detection network processing at least one feature map corresponding to the image to be used; and the at least one feature map corresponding to the image to be used is determined by the second diffusion model processing the image to be used.
[0307] In one possible implementation, the at least one characteristic map includes a plurality of characteristic maps, and different characteristic maps have different sizes;
[0308] The detection frame determination unit 403 is specifically configured to: construct a pyramid feature using the plurality of feature maps; and input the pyramid feature into the first detection network to obtain a target detection frame corresponding to the second image.
[0309] In a possible implementation manner, the training data determination device 400 includes a data generation unit, and the data generation unit includes the detection frame determination unit 403 and the data determination unit 404;
[0310] The data generation unit is used to determine the second image and the target detection box corresponding to the second image using a pre-built second data processing model and the first image; the second data processing model includes a first diffusion model and a first detection network; the first diffusion model is used to perform image generation processing on the first image to obtain at least one feature map and a second image; the first detection network is used to determine the target detection box corresponding to the second image based on the at least one feature map.
[0311] Based on the relevant content of the above-mentioned training data determination device 400, it can be seen that for the training data determination device 400 provided in the embodiment of the present disclosure, a first image is first acquired (for example, an image data already existing in the training data); then, image generation processing is performed on the first image to obtain at least one feature map (for example, multiple feature maps of different sizes) and a second image, where the second image is determined based on the at least one feature map, and the at least one feature map is determined based on the first image; then, a target detection frame corresponding to the second image is determined based on the at least one feature map, so that the target detection frame can represent the position of at least one target (for example, an object, an animal, etc.) in the second image; finally, training data is determined based on the second image and the target detection frame corresponding to the second image (for example, the two-tuple <second image, target detection frame corresponding to the second image> is determined as a training data, etc.). In this way, the purpose of automatically generating new training data with the help of some existing images can be achieved, thereby effectively avoiding the increase in annotation costs caused by manually annotating detection frames, and further reducing the difficulty of obtaining the training data while ensuring the data quality of the training data.
[0312] In addition, since the second image and the target detection frame corresponding to the second image are both determined based on at least one feature map above, the image feature information referenced in the determination process of the second image (for example, the implicit semantics and position knowledge involved in the first diffusion model, etc.) is consistent with the image feature information referenced in the determination process of the target detection frame corresponding to the second image, so that the target detection frame can more accurately represent the position of at least one target in the second image in the second image, thereby effectively improving the data quality of the tuple <second image, target detection frame corresponding to the second image>, which is beneficial to improving the data quality of the training data determined based on the tuple, thereby improving the data quality of the training data.
[0313] Based on the target detection method provided in the embodiments of the present disclosure, the embodiments of the present disclosure also provide a target detection device, which will be explained and illustrated below in conjunction with Figure 5. Figure 5 is a schematic diagram of the structure of a target detection device provided in the embodiments of the present disclosure. It should be noted that for the technical details of the target detection device provided in the embodiments of the present disclosure, please refer to the relevant content of the target detection method above.
[0314] As shown in FIG5 , the target detection device 500 provided by the embodiment of the present disclosure includes:
[0315] The second acquisition unit 501 is used to acquire the image to be detected;
[0316] The target detection unit 502 is used to input the image to be detected into a pre-constructed target detection model to obtain the target detection result output by the target detection model; the target detection model is constructed based on training data; the training data is determined by any implementation of the training data determination method provided in the embodiments of the present disclosure.
[0317] Based on the relevant contents of the above-mentioned target detection device 500, it can be known that for the target detection device 500 provided by the embodiment of the present disclosure, after obtaining the amplified training data in a certain application field, the training data is first used to train the target detection model in the field to obtain a trained target detection model so that the target detection model has better target detection performance, so that after the image to be detected is input into the pre-built target detection model, the target detection model performs target detection processing on the image to be detected, obtains and outputs the target detection result corresponding to the image to be detected, so that the target detection result can indicate what type of target exists in the image to be detected and the location of the target in the image to be detected. Among them, because the training data has a high richness and data quality, the target detection model trained based on the training data also has good target detection performance, so that the target detection result determined by the target detection model can also more accurately indicate what type of target exists in the image to be detected and the location of the target in the image to be detected, which is conducive to improving the target detection effect in this field.
[0318] In addition, an embodiment of the present disclosure also provides an electronic device, which includes a processor and a memory: the memory is used to store instructions or computer programs; the processor is used to execute the instructions or computer programs in the memory, so that the electronic device executes any implementation of the training data determination method provided by the embodiment of the present disclosure, or executes any implementation of the target detection method provided by the embodiment of the present disclosure.
[0319] Referring to FIG6 , a schematic diagram of the structure of an electronic device 600 suitable for implementing embodiments of the present disclosure is shown. Terminal devices in embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device shown in FIG6 is merely an example and should not limit the functionality or scope of use of embodiments of the present disclosure.
[0320] As shown in Figure 6, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the electronic device 600 are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0321] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although FIG. 6 shows the electronic device 600 with various devices, it should be understood that not all of the devices shown are required to be implemented or present. More or fewer devices may alternatively be implemented or present.
[0322] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0323] The electronic device provided by the embodiment of the present disclosure and the method provided by the above embodiment belong to the same inventive concept. For technical details not fully described in this embodiment, please refer to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0324] The embodiments of the present disclosure also provide a computer-readable medium, which stores instructions or computer programs. When the instructions or computer programs are executed on a device, the device executes any implementation of the training data determination method provided by the embodiments of the present disclosure, or executes any implementation of the target detection method provided by the embodiments of the present disclosure.
[0325] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0326] In some embodiments, the client and server can communicate using any currently known or later developed network protocol, such as HTTP (Hypertext Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or later developed network.
[0327] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0328] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device can perform the method.
[0329] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0330] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0331] The units involved in the embodiments described in this disclosure may be implemented in software or hardware, wherein the name of a unit / module does not, in some cases, limit the unit itself.
[0332] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0333] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0334] It should be noted that the various embodiments of this disclosure are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the descriptions of the systems or devices disclosed in the embodiments for similarities and differences between them. Since the systems or devices disclosed in the embodiments correspond to the methods disclosed in the embodiments, their descriptions are relatively simple, and reference can be made to the descriptions of the methods for any related details.
[0335] It should be understood that in the present disclosure, "at least one (item)" refers to one or more, and "plurality" refers to two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can represent: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0336] It should also be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0337] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0338] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present disclosure. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not limited to the embodiments shown herein, but is intended to be construed in the widest manner consistent with the principles and novel features disclosed herein.
Claims
1. A method for determining training data, comprising: acquiring a first image; Performing image generation processing on the first image to obtain at least one feature map and a second image; The second image is determined based on the at least one feature map; The at least one feature map is determined based on the first image; Determining an object detection frame corresponding to the second image according to the at least one feature map; Training data is determined according to the second image and the target detection box corresponding to the second image.
2. The method according to claim 1, further comprising: Obtaining image generation constraint information corresponding to the first image; The performing image generation processing on the first image to obtain at least one feature map and a second image includes: Performing image generation processing on the first image according to the image generation constraint information to obtain at least one feature map and a second image; The at least one feature map is determined based on the first image and the image generation constraint information.
3. The method according to claim 2, wherein: The step of performing image generation processing on the first image according to the image generation constraint information to obtain at least one feature map and a second image includes: The at least one feature map and the second image are determined by using a pre-constructed first diffusion model, the image generation constraint information, and the first image.
4. The method according to claim 3, wherein: The image generation constraint information includes conditional prompt text; The determining of the at least one feature map and the second image comprises: Extracting features from the conditional prompt text to obtain conditional prompt features; The conditional prompt feature and the first image are input into the first diffusion model to obtain the at least one feature map and the second image.
5. The method according to claim 1, wherein: The first diffusion model includes a denoising module and a decoding module, wherein the denoising module is used to perform several noise removal processes on the input data of the denoising module; the input data of the decoding module includes the processing result of the last noise removal process; The at least one feature map is obtained according to the noise removal process in the last noise removal process. Determined by the generated intermediate features; The second image is determined according to output data of the decoding module.
6. The method according to claim 2, wherein: The image generation constraint information includes at least one of a random seed, a coding rate, a guidance ratio, and a conditional prompt text.
7. The method according to claim 2, wherein: After determining the training data according to the second image and the target detection frame corresponding to the second image, the method further includes: Adjust some or all of the constraint items in the image generation constraint information, and continue to execute the step of performing image generation processing on the first image based on the image generation constraint information to obtain at least one feature map and a second image until the first end condition is reached.
8. The method according to claim 7, wherein: The acquiring of the first image comprises: determining the first image from a training data set; The determining of training data according to the second image and the target detection frame corresponding to the second image includes: Updating the training data set using the second image and the target detection box corresponding to the second image; The method further comprises: After the first end condition is reached, the step of determining the first image from the training data set is continued until the second end condition is reached.
9. The method according to claim 1, wherein: The determining, based on the at least one feature map, a target detection frame corresponding to the second image includes: The at least one feature map is processed using a pre-constructed first detection network to obtain an object detection box corresponding to the second image.
10. The method according to claim 9, wherein: The construction process of the first detection network includes: Using a plurality of third images and detection frame labels corresponding to the third images, a first data processing model is trained; the first data processing model includes a second diffusion model and a second detection network; parameters in the second diffusion model are not updated during the training process of the first data processing model; The first detection network is determined according to the second detection network in the trained first data processing model.
11. The method according to claim 10, wherein: The second image is generated using a pre-constructed first diffusion model; The second diffusion model is determined according to the first diffusion model.
12. The method according to claim 10, wherein: The second image is generated by using a pre-built first diffusion model; the first diffusion model is used to perform a first number noise removal process; The second diffusion model is used to perform a second numerical noise removal process; The second number is smaller than the first number.
13. The method according to claim 10, wherein: The training process of the first data processing model includes: Determining an image to be used from the plurality of third images; Inputting the image to be used into the first data processing model, and obtaining a detection box prediction result corresponding to the image to be used output by the first data processing model; According to the detection box prediction result and the detection box label, the second detection network in the first data processing model is updated, and the step of determining the image to be used from the plurality of third images is continued until a preset stop condition is reached.
14. The method according to claim 13, wherein: The detection frame prediction result is determined by the second detection network processing at least one feature map corresponding to the image to be used; The at least one feature map corresponding to the image to be used is determined by processing the image to be used by the second diffusion model.
15. The method according to claim 9, wherein: The at least one feature map comprises a plurality of feature maps, and different feature maps have different sizes; The using the pre-built first detection network to process the at least one feature map to obtain the target detection frame corresponding to the second image includes: Using the several feature maps, constructing pyramid features; The pyramid features are input into the first detection network to obtain an object detection box corresponding to the second image.
16. The method according to claim 1, wherein: The process of determining the second image and the target detection frame corresponding to the second image includes: Determine the second image by using a pre-built second data processing model and the first image The first detection network is used to determine the target detection box corresponding to the second image based on the at least one feature map.
17. A target detection method, comprising: Acquire the image to be detected; Inputting the image to be detected into a pre-built target detection model to obtain a target detection result output by the target detection model; The target detection model is constructed based on training data; the training data is determined using the training data determination method described in any one of claims 1-16.
18. A training data determination device, comprising: A first acquisition unit, configured to acquire a first image; an image generating unit, configured to perform image generating processing on the first image to obtain at least one feature map and a second image; the second image is determined based on the at least one feature map; The at least one feature map is determined based on the first image; a detection frame determining unit, configured to determine a target detection frame corresponding to the second image according to the at least one feature map; The data determination unit is configured to determine training data according to the second image and the target detection box corresponding to the second image.
19. A target detection device, comprising: A second acquisition unit is configured to acquire an image to be detected; A target detection unit is configured to input the image to be detected into a pre-built target detection model to obtain a target detection result output by the target detection model; The target detection model is constructed based on training data; the training data is determined using the training data determination method described in any one of claims 1-16.
20. An electronic device comprising a processor and a memory, wherein: The memory is configured to store instructions or computer programs; The processor is configured to execute the instructions or the computer program in the memory so that the electronic device performs the method according to any one of claims 1 to 17.
21. A computer readable medium, wherein: The computer-readable medium stores instructions or a computer program, and when the instructions or the computer program are executed on a device, the device executes the method according to any one of claims 1 to 17.
Citation Information
Patent Citations
Detection model training method and device, target detection method and device and electronic system
CN113239982A
Handwritten image generation method, model training method, device and equipment
CN113516136A
Image processing model training method and device
CN115424088A
Image Enhancement via Iterative Refinement based on Machine Learning Models
US20230067841A1
Target detection method and apparatus, and electronic device, storage medium, computer program product and computer program
WO2022151755A1
Cited By
Multi-feature fusion driven high-quality drainage pipeline defect sample automatic labeling method, system and equipment and medium
CN120526252A
A multi-feature fusion driven high-quality sewer defect sample automatic labeling method, system, device and medium
CN120526252B
Video target detection method and system based on multi-scale perception diffusion
CN121190746A
