A sample generation method based on deep learning, a storage medium and an electronic device

By calculating the mean and variance of the samples generated by the generator and adjusting the weights using an exponential function, the generator is optimized to generate more hard-to-obtain samples, thus solving the problem of sample imbalance in image classification and improving generation quality and classification accuracy.

CN116403045BActive Publication Date: 2026-02-17ISA TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310388434.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-12
Publication Date
2026-02-17
Estimated Expiration
2043-04-12

AI Technical Summary

Technical Problem

In the field of image classification, normal image samples are easy to obtain, while blurry, overexposed, color-distorted, and low-brightness samples are difficult to obtain, leading to sample imbalance, which affects the quality of samples generated by the generator and the label accuracy of the classification model.

Method used

By acquiring the weighting information of the initial image samples generated by the generator, the weights are calculated and adjusted. The generator is optimized to generate more difficult-to-obtain samples by utilizing the smoothness of the exponential function and the mean-variance of the samples. The loss function is adjusted to increase the penalty value for difficult samples, thereby improving the generation quality.

Benefits of technology

It enhances the generator's focus on minority class samples, improves the quality of generated samples with orders of magnitude smaller and the label accuracy of the classification model, and solves the problem of imbalanced samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116403045B_ABST
    Figure CN116403045B_ABST
Patent Text Reader

Abstract

The present application relates to the field of sample labeling, in particular to a sample generation method based on deep learning, a storage medium and an electronic device. It comprises the following steps: generating A i The corresponding adjustment weight W i ; according to the adjustment loss value of each initial image sample corresponding to the adjustment loss function, the generator is optimized to generate the target image sample. In the present application, the small number of samples which are difficult to obtain will have a larger adjustment loss value, that is, the loss function has a larger penalty value. In this way, the purpose of increasing the cost of the small number of samples which are difficult to obtain is achieved, and the generator pays more attention to the small number of samples, so as to improve the number of generated small number of samples.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of sample labeling, in particular to a sample generation method based on deep learning, a storage medium and an electronic device. BACKGROUND

[0002] In machine learning, in order to make the model achieve better learning effect, high-quality training samples are selected for training, so that the corresponding ability is obtained. However, at the beginning of a task, the corresponding training samples are usually less, which will affect the training effect of the model. In order to quickly increase the number of training samples, a generation model can be used to generate a large number of training samples. For example, GANs (Generative Adversarial Networks). The generation model is a model that can generate new data samples from the latent space. It is usually composed of two parts: a generator and a discriminator. The generator receives random noise as input and generates new samples similar to the training data; the discriminator attempts to distinguish between the samples generated by the generator and the real training data. The two models are trained together, the generator tries to minimize the error of the discriminator, and the discriminator tries to maximize its accuracy for real data and generated data.

[0003] However, in the field of image classification, normal image samples are more easily obtained in actual scenarios, while blurred, high-exposure, color-distorted and low-brightness image samples are more difficult to obtain in actual scenarios. The amount of different categories of samples in a group of samples is very different, which causes the problem of sample imbalance. In this case, due to the imbalance of sample categories, the features contained in the small amount of samples will be too few, and it is difficult to extract rules from them; and the quality of the small number of samples generated by the generator is low, which reduces the label accuracy of the classification model for the small number of samples. SUMMARY

[0004] To solve the above technical problems, the technical scheme adopted by the present application is as follows:

[0005] According to one aspect of the present application, a sample generation method based on deep learning is provided, the method comprising the following steps:

[0006] obtaining the weighting information A1, A2, …, A of a plurality of initial image samples in the same batch generated by the generator i , …, A z , wherein A i is the weighting information of the i-th initial image sample in the batch, A i =(a i , b i ), a i is used to represent A iInformation vectors of data in each dimension, b i For A i The image category label; z is the total number of initial image samples generated in this batch; i = 1, 2, ..., z;

[0007] According to A1, A2, ..., A i A z Multiple information vectors in the data are used to generate A. i The corresponding adjustment weight W i W i The following conditions must be met:

[0008]

[0009] in, For b i The hyperparameters corresponding to the image categories; the hyperparameters corresponding to each image category are negatively correlated with the number of samples belonging to each image category in the multiple initial image samples of the same batch; μ is the sample mean corresponding to the multiple initial image samples of this batch; δ is the sample variance corresponding to the multiple initial image samples of this batch;

[0010] Based on the adjusted weights corresponding to each initial image sample, determine the adjusted loos value of the loss function for each initial image sample; L i The following conditions must be met:

[0011] L i =W i *l i Among them, L i The adjusted loos value of the loss function corresponding to the i-th initial image sample in this batch; i Let be the initial loos value of the loss function corresponding to the i-th initial image sample in this batch;

[0012] The generator is optimized by adjusting the loos value corresponding to each initial image sample to generate the target image sample.

[0013] According to a second aspect of the present invention, a non-transitory computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the aforementioned deep learning-based sample generation method.

[0014] According to a third aspect of the present invention, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the aforementioned deep learning-based sample generation method.

[0015] The present invention has at least the following beneficial effects:

[0016] In the present application, the sample mean and sample variance of the initial image sample generated by each batch of the generator are obtained to determine the adjustment weight corresponding to each initial image sample. According to the adjustment weight generation formula of the present application, when the condition of the initial image sample is greatly different from the average condition, that is, |a i Since the sample quantity of the small order of magnitude is small, the final determined μ is necessarily closer to the normal sample. Thus, the small order of magnitude sample is difficult to obtain, and has a larger adjustment weight. Meanwhile, the adjustment loos value corresponding to each initial image sample is proportional to the corresponding adjustment weight. Thus, the small order of magnitude sample difficult to obtain has a larger adjustment loos value, that is, the loss function has a larger penalty value. In this way, the purpose of increasing the cost of the small order of magnitude sample difficult to obtain is achieved, and the generator pays more attention to the minority class sample to generate more small order of magnitude samples difficult to obtain, so as to improve the quantity of the generated small order of magnitude sample, and further solve the sample imbalance problem.

[0017] Moreover, the algorithm of the adjustment weight in the present application is the exponential function of e, which has better smoothness and slow growth in the initial stage and rapid growth in the later stage. Thus, in the normal sample, even if there is a certain difference in the deviation degree of different normal samples from μ, the overall deviation degree is small, and is in the initial stage of the exponential function of e, so that the finally calculated adjustment weight is almost the same. However, the deviation degree of the small order of magnitude sample difficult to obtain from μ is large, and is in the later stage of the exponential function of e, so that the increase range of the calculated adjustment weight is large. This feature is more in line with the distribution form of the adjustment weight in the present application, and can more accurately adjust the generator to generate small order of magnitude samples with higher quality, and further improve the label accuracy of the classification model for the small order of magnitude sample. BRIEF DESCRIPTION OF DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0019] Figure 1 A flowchart of a sample generation method based on deep learning provided by the embodiments of the present application. DETAILED DESCRIPTION

[0020] With reference to the drawings of the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.

[0021] According to an aspect of the present application, as shown in Figure 1 , a deep learning-based sample generation method is provided, which comprises the following steps:

[0022] S100: Obtain the weighting information A1, A2, …, A i of the plurality of initial image samples of the same batch generated by the generator. z , …, A i , wherein A i is the weighting information of the i-th initial image sample in the batch, A i = (a i , b i ), a i is an information vector for representing data in each dimension of A i , and b i is the image category label of A i . z is the total number of initial image samples generated in the batch. i = 1, 2, …, z.

[0023] The generator is a network for generating pictures, which can adopt multilayer perceptron, convolutional network, autoencoder, etc. It receives a random noise and generates a picture through the noise. In the present embodiment, a i may be data generated by Generator in GANs according to the noise, combined with the corresponding Training set data. That is, the input of Discriminator in GANs. The data is a high-dimensional feature data, which can be a 1024-dimensional feature vector. b i Specifically, in the present embodiment, it includes blur, high exposure, normal, color distortion, and low brightness, etc., five image category labels. The four image types of blur, high exposure, color distortion, and low brightness can be determined according to existing determination standards.

[0024] S200: Generate the corresponding adjustment weight W z of A i according to the plurality of information vectors in A1, A2, …, A i . W i satisfies the following conditions:

[0025]

[0026] in, For b i The hyperparameters for each image category. The hyperparameters for each image category are negatively correlated with the number of samples belonging to each category in the multiple initial image samples within the same batch. μ is the sample mean of the multiple initial image samples in this batch. δ is the sample variance of the multiple initial image samples in this batch.

[0027] Specifically, based on the information vector in the weighting information of the initial image samples, μ and δ for the same batch can be calculated. Then, according to the aforementioned algorithm for generating adjusted weights, the adjusted weights corresponding to each initial image sample are calculated. In this way, the adjusted weights of each sample are taken into account during the training process, thereby finer-tuning the parameters of the generative model to generate more samples that are difficult to obtain, thus further solving the problem of imbalanced samples.

[0028] Preferably, when b i When the corresponding image category is the normal image category, When b i When the corresponding image category is the low-brightness image category, When b i When the corresponding image category is the blurred image category, When b i When the corresponding image category is the color distortion image category, When b i When the corresponding image category is the high-exposure image category,

[0029] Typically, the hyperparameters corresponding to each image category are negatively correlated with the ease of obtaining that image category. Since the ease of obtaining an image category is positively correlated with the number of initial image samples corresponding to each image category in the same batch, the hyperparameters corresponding to each image category are negatively correlated with the number of samples belonging to each image category among the multiple initial image samples in the same batch.

[0030] The algorithm for adjusting the weight in the application is an exponential function of e, which has better smoothness and slow growth in the initial stage and faster growth in the later stage. Therefore, in normal samples, even if there is a certain difference in the deviation degree of different normal samples from mu, the overall deviation degree is small, in the initial stage of the exponential function of e, so the final calculated adjustment weight is almost the same. However, the deviation degree of the difficult-to-obtain sample from mu is large, in the later stage of the exponential function of e, so the increase range of the calculated adjustment weight will be large. This feature is also more in line with the distribution form of the adjustment weight in the application, and the generator can be adjusted more accurately to make the quality of the sample with a small order of magnitude generated by the generator higher, thereby improving the label accuracy of the classification model for the sample with a small order of magnitude.

[0031] Further, in generating A i The corresponding adjustment weight W i Then, the method further comprises:

[0032] The adjustment weight corresponding to each initial image sample in the same batch is normalized to generate a target adjustment weight corresponding to each initial image sample. Wherein, Satisfy the following conditions:

[0033]

[0034] The target adjustment weight corresponding to the i-th initial image sample in the batch.

[0035] By normalization, the adjustment weight in the same batch has a unified measurement standard, thereby having higher accuracy.

[0036] S300: According to the adjustment weight corresponding to each initial image sample, determine the adjustment loos value of the loss function corresponding to each initial image sample. i Satisfy the following conditions:

[0037] L i = W i * l i . Wherein, L i The adjustment loos value of the loss function corresponding to the i-th initial image sample in the batch. i The initial loos value of the loss function corresponding to the i-th initial image sample in the batch.

[0038] The loss function in the embodiment can be any existing loss function, such as cross-entropy loss function, i The initial loos value corresponding to the cross-entropy loss function can be calculated.

[0039] S400: According to the adjustment loos value corresponding to each initial image sample, the generator is optimized to generate a target image sample.

[0040] In the present application, the sample mean and sample variance of the initial image sample generated by each batch of the generator are obtained to determine the adjustment weight corresponding to each initial image sample. In the data generation stage, the adaptive adjustment weight loss is used to give high weight to the samples that are difficult to collect in reality, so that the generation model can better generate such samples, and avoid the problem of imbalance between sample categories.

[0041] According to the adjustment weight generation formula of the present application, when the situation of the initial image sample is greatly different from the average situation, that is, |a i Since the number of small order samples is small and difficult to obtain, the final determined mu is necessarily closer to the normal sample. Therefore, the small order sample that is difficult to obtain will have a larger adjustment weight. At the same time, the adjustment loos value corresponding to each initial image sample is also proportional to the corresponding adjustment weight. Therefore, the small order sample that is difficult to obtain will have a larger adjustment loos value, that is, the loss function has a larger penalty value. In this way, the purpose of increasing the cost of dividing the small order sample that is difficult to obtain is achieved, and the generator pays more attention to the minority class sample, so as to improve the number of small order samples generated.

[0042] As another possible embodiment of the present application, after generating the target image sample, the method further comprises:

[0043] S500: Using the target image sample to perform model optimization processing to improve the annotation accuracy of the target classification model.

[0044] The model optimization processing includes:

[0045] S501: Using the target image sample to train at least one classification model to generate a classification accuracy corresponding to each classification model.

[0046] The target image sample can be generated by the above-mentioned adjusted generator, and has a higher quality image formation. Therefore, in the case of less initial training sample, a large number of initial training samples can be quickly and more cost-effectively obtained. And on this basis, the classification model is trained, and the target classification model is obtained. Therefore, the speed of the first iteration of the classification model can be accelerated.

[0047] The classification model can be selected from existing machine learning models for image classification. The classification model will finally generate a classification label and a corresponding confidence for each input image. For example, the classification label and the corresponding confidence of the target image sample can be a fuzzy image category label and 0.98.

[0048] S502: The classification model with the highest classification accuracy is taken as the target classification model.

[0049] S503: The plurality of image data to be classified is input into the target classification model, and the initial classification label and confidence of each image data to be classified is generated.

[0050] When the training sample data of sufficient size is generated using the generation model, a plurality of classification models are trained based on the training sample data, the classification model with the highest accuracy is selected for on-site deployment, the on-site video is accessed, the video image frame is intercepted and input into the target classification model, and the video image frame and the model output information (category and confidence) are saved. The image data to be classified is the intercepted video image frame.

[0051] S504: Each image data to be classified with a confidence greater than a first threshold is input into a plurality of classification models respectively, and classification information B1, B2, …, B of each image data to be classified is generated. j , …, B y . Wherein, B j is the classification information of the jth image data to be classified. B j = (B j 1 , B j 2 , …, B j k , …, B j x ). B j k is the classification label of the jth image data to be classified by the kth classification model. x is the total number of classification models. k = 1, 2, …, x. y is the total number of image data to be classified. j = 1, 2, …, y.

[0052] S505: When all classification labels in B j are the same, the initial classification label is taken as the target classification label of the jth image data to be classified.

[0053] In this embodiment, in order to further improve the accuracy of automatic labeling, a parallel classification mode of a plurality of classification models is used to label the same sample using different models. Further, the complementary information between different models can be effectively utilized for further verification to further improve the accuracy of automatic labeling.

[0054] Further, after S504, the model optimization process further includes:

[0055] S506: When B jWhen all the classification labels in the first classification label set and the second classification label set are different, the jth image data to be classified is re-classified and labeled to generate a target classification label of the jth image data to be classified. The re-classification and labeling accuracy is greater than the labeling accuracy of the target classification model.

[0056] Further, after S503, the model optimization processing further includes:

[0057] S507: Each image data to be classified with a confidence less than or equal to the first threshold is re-classified and labeled to generate a target classification label of each image data to be classified.

[0058] The re-classification and labeling can be performed in an artificial manner, so as to ensure the labeling accuracy. The first threshold in the embodiment can be 0.9.

[0059] In the embodiment, a small amount of artificial verification is performed. The efficiency can be ensured, and the sample quality and the accuracy of the automatic label deep learning model can be continuously improved.

[0060] As another possible embodiment of the present application, after the target classification labels of the plurality of image data to be classified are generated, the method further includes:

[0061] S508: The image data to be classified with the target classification label is used as an iterative target image sample.

[0062] S509: The model optimization processing is performed using the iterative target image sample.

[0063] Further, after the model optimization processing is performed using the iterative target image sample, the method further includes:

[0064] S600: The labeled data set generated by the iterative target classification model is verified to improve the labeling accuracy of the iterative target classification model.

[0065] Specifically, the embodiment is a process of iterative optimization of the model. The specific iterative process is as follows: after the first time through S501 to S507, a large amount of image data to be classified with more accurate labels will be generated. Therefore, the part of data is used as a new training sample, that is, an iterative target image sample, and the process of S501 to S507 is performed again. In order to generate training data with higher quality for the next iteration optimization. Thus, the classification accuracy of the classification model can be gradually improved.

[0066] Meanwhile, when the number of iterations reaches a second threshold, the generated labeled data set needs to be manually verified, and the model is further optimized according to the verification result. Through the feedback mechanism and the continuous optimization of the algorithm parameters, the accuracy of automatic labeling can be continuously improved. Through the closed loop of automatic label training and manual verification, the quality of automatic label and the accuracy of the final model can be continuously improved.

[0067] The embodiment of the application further provides a non-transitory computer readable storage medium, which can be arranged in an electronic device to store at least one instruction or at least one program related to a method in the method embodiment, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the method provided in the above embodiment.

[0068] The embodiment of the application further provides an electronic device, comprising a processor and the aforementioned non-transitory computer readable storage medium.

[0069] The embodiment of the application further provides a computer program product, which comprises program code, and when the program product is run on an electronic device, the program code is used to make the electronic device execute the steps in the method according to various exemplary embodiments of the application described in the specification.

[0070] In addition, although the various steps of the method in the present disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired result. In addition or alternatively, some steps can be omitted, a plurality of steps can be combined into one step, and / or one step can be divided into a plurality of steps, etc.

[0071] Through the above description of the embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a U disk, a mobile hard disk, etc.) or a network, and includes a plurality of instructions to make a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) execute the method according to the embodiments of the present disclosure.

[0072] In the exemplary embodiments of the present disclosure, an electronic device capable of implementing the above method is also provided.

[0073] Those skilled in the art can understand that each aspect of the present application can be implemented as a system, a method or a program product. Therefore, each aspect of the present application can be embodied in a form of entirely hardware, entirely software (including firmware, microcode, etc.), or a combination of hardware and software, which can be collectively referred to as "circuitry", "module" or "system".

[0074] The electronic device according to this embodiment of the present application. The electronic device is merely an example and should not bring any limitation to the function and use range of the embodiments of the present application.

[0075] The electronic device is in the form of a general computing device. The components of the electronic device can include, but are not limited to, the at least one processor described above, the at least one memory described above, and a bus connecting different system components, including the memory and the processor.

[0076] The memory stores program codes which can be executed by the processor, so that the processor executes the steps according to various exemplary embodiments of the present application described in the "Exemplary Method" section of the present specification.

[0077] The memory can include a readable medium in the form of a volatile memory, such as a random access memory (RAM) and / or a cache memory, and can further include a read-only memory (ROM).

[0078] The memory can further include programs / utilities with a set of (at least one) program modules, such as an operating system, one or more application programs, other program modules, and program data, each of which or some combination of which can include the implementation of a network environment.

[0079] The bus can be one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor or a local bus using any of a variety of bus structures.

[0080] The electronic device can also communicate with one or more external devices such as a keyboard or a pointing device, a Bluetooth device, or a device for enabling

[0081] Those skilled in the art will readily understand that the example embodiments described herein can be implemented by software and / or by hardware combined with software essential for the software, with the foregoing embodiments being implemented by one or more computer components or modules. Accordingly, the technical solutions of the embodiments of the present disclosure can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (e.g., a CD-ROM, a USB flash drive, a mobile hard disk, or the like) or on a network, and includes a number of instructions for causing one or more computing devices (e.g., a personal computer, a server, a terminal device, or a network device) to perform the methods described above according to the embodiments of the present disclosure.

[0082] In the example embodiments of the present disclosure, a computer-readable storage medium is also provided, which stores a program product capable of implementing the methods described above. In some possible embodiments, various aspects of the present disclosure can also be implemented in the form of a program product, which includes program codes for causing a terminal device to perform the steps described in the “Example Method” section above according to various example embodiments of the present disclosure when the program product is run on the terminal device.

[0083] The program product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium may, for example, be but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any combination thereof. More specific examples (a non-exhaustive list) of the readable storage medium include an electrical connection having one or more wires, a portable disc, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or a flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0084] Computer readable signal media can include a propagated data signal with instructions embodied in data signals. Such propagated signal can take a wide variety of forms, including but not limited to electro-magnetic signals, optical signals, and so forth. A computer readable medium of the present application can also be any medium that can be read by a computer. Such mediums can include, but are not limited to optical storage devices (e.g., CD-ROMs, optical disks, etc.), semi-conductor memory devices (e.g., RAM, ROM, etc.), and further can include any medium that can be used to store the desired information dynamically accessible by a computer.

[0085] The code can be transmitted in any form including radio frequency, optical, electrical, or the like, or any suitable combination thereof. A code can be implemented in any of a variety of programming languages including, for example, C++.

[0086] The program code may

[0087] Further, the above-described diagrams are merely schematic representations of the processes encompassed by the methods according to exemplary embodiments of the present application and are not intended to limit the present application. It is readily understood that the processes shown in the above-described diagrams do not indicate or limit the chronological order of these processes. Further, it is readily understood that these processes can be executed, for example, synchronously or asynchronously in a plurality of modules.

[0088] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, such a division is not mandatory. Indeed, according to an embodiment of the present disclosure, the features and functionalities of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functionalities of one module or unit described above can be further divided into a plurality of modules or units.

[0089] The above merely illustrates the specific embodiments of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of the changes or replacements within the technical range disclosed by the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A deep learning-based sample generation method, characterized by, The method comprises the following steps: obtain the tuning information A1, A2, …, A of the plurality of initial image samples of the same batch generated by the generator i , …, A z , wherein A i is the tuning information of the i-th initial image sample in the batch, A i = (a i , b i ), a i is an information vector for representing data in each dimension of A i , and b i is the image category label of A i ; z is the total number of initial image samples generated in the batch; i = 1, 2, …, z; According to multiple information vectors in A1, A2, …, A i , …, A z , generate A i corresponding adjustment weight W i ; W i satisfies the following conditions: ; wherein, b i corresponding to the image category; the hyperparameter corresponding to each image category is negatively correlated with the number of samples belonging to each image category in the plurality of initial image samples in the same batch; μ is a sample mean corresponding to the plurality of initial image samples in the batch; and δ is a sample variance corresponding to the plurality of initial image samples in the batch. According to the adjustment weight corresponding to each initial image sample, an adjustment loss value of a loss function corresponding to each initial image sample is determined; L i satisfies the following conditions: L i =W i *l i ; among which, L i The adjusted loos value of the loss function corresponding to the i-th initial image sample in this batch; i Let be the initial loos value of the loss function corresponding to the i-th initial image sample in this batch; According to the adjustment loos value corresponding to each initial image sample, the generator is optimized to generate target image samples.

2. The method of claim 1, wherein, In generating A i The corresponding adjustment weight W i Afterwards, the method further comprises: The adjustment weight corresponding to each of the initial image samples in the same batch is normalized to generate a target adjustment weight corresponding to each of the initial image samples; wherein The following conditions are met: ; is the target adjustment weight corresponding to the i-th initial image sample in the batch.

3. The method of claim 1, wherein, After generating target image samples, the method further comprises: Using target image samples for model optimization processing; to improve the annotation accuracy of the target classification model; The model optimization processing comprises: Using target image samples to train at least one classification model to generate the classification accuracy corresponding to each classification model; The classification model with the highest classification accuracy is used as the target classification model; Input multiple image data to be classified into the target classification model to generate the initial classification label and confidence of each image data to be classified; input each image data to be classified with a confidence greater than a first threshold into a plurality of classification models respectively, to generate classification information B1, B2, …, B j , …, B y of each image data to be classified; wherein B j is the classification information of the jth image data to be classified; B j = (B j 1 , B j 2 , …, B j k , …, B j x ); B j k is the classification label of the jth image data to be classified by the kth classification model; x is the total number of classification models; k = 1, 2, …, x; y is the total number of image data to be classified; j = 1, 2, …, y. When all of the classification tags in B j are the same, the initial classification tag is taken as the target classification tag of the jth image data to be classified.

4. The method of claim 3, wherein, After generating the classification information of each image data to be classified, the model optimization processing further comprises: When all classification labels in B j differences exist, the jth image data to be classified is reclassified and labeled to generate a target classification label of the jth image data to be classified; the accuracy of the reclassification and labeling is greater than the labeling accuracy of the target classification model.

5. The method of claim 3, wherein, After generating the initial classification label and confidence of each image data to be classified, the model optimization processing further comprises: Each image data to be classified with a confidence less than or equal to a first threshold is reclassified and labeled to generate a target classification label for each image data to be classified.

6. The method of claim 3, wherein, After generating the target classification labels of multiple image data to be classified, the method further comprises: Image data to be classified with a target classification label is used as an iterative target image sample; Using the iterative target image sample for model optimization processing.

7. The method of claim 6, wherein, After using the iterative target image sample for model optimization processing, the method further comprises: The annotation data set generated by the iterative target classification model is verified to improve the annotation accuracy of the iterative target classification model.

8. The method of claim 1, wherein: When b i When the corresponding image category is a normal image category, ; When b i When the corresponding image category is a low-brightness image category, ; When b i When the corresponding image category is a blur image category, ; When b i When the corresponding image category is a color distortion image category, ; When b i When the corresponding image category is a high-exposure image category, . 9.A non-transitory computer-readable storage medium storing a computer program, the computer program comprising instructions configured to cause a processor to perform the method according to any one of claims 1 to 8. The computer program is executed by the processor to implement a sample generation method based on deep learning according to any one of claims 1-8.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement a sample generation method based on deep learning according to any one of claims 1-8.

Citation Information

Patent Citations

  • Multi-sample adversarial disturbance generation method and device, storage medium and computing equipment

    CN111738374A

  • Model training method and device based on image processing, equipment and medium

    CN112132172A