A data enhancement method, device and related equipment

CN120747664BActive Publication Date: 2026-11-03SHANGHAI TAIZE SEMICONDUCTOR CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510816493.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-18
Publication Date
2026-11-03
Estimated Expiration
2045-06-18

AI Technical Summary

Technical Problem

Existing technologies struggle to simultaneously satisfy the requirements of balanced sample distribution, high quality, and diversity in training datasets. This leads to models favoring the majority class and neglecting the minority class during recognition, particularly in applications such as medical image recognition and fault prediction. Existing methods, such as oversampling, undersampling, traditional data augmentation, and generative adversarial networks, are insufficient in generating sample quality and diversity.

Method used

By using a generator to perform linear interpolation on the noise vector, combined with the discriminator's discrimination probability threshold filtering and dynamic adjustment of the generator input, high-quality positive image samples are generated, avoiding the checkerboard effect, improving sample diversity, reducing the risk of overfitting, and ensuring the balance and diversity of the training sample group.

Benefits of technology

It significantly improved the model's accuracy in identifying minority class samples, enhanced the variety, quality, and diversity of the dataset, and particularly improved the model's generalization ability in the fields of tumor detection and mechanical fault identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120747664B_ABST
    Figure CN120747664B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of data processing, and provides a data enhancement method, device and related equipment, which comprises the following steps: obtaining a first positive example image sample, the first positive example image sample being generated based on a first noise vector of an input generator, the generator adopting linear interpolation to process the first noise vector; inputting the first positive example image sample into a discriminator to obtain a first discrimination probability; if the first discrimination probability is greater than or equal to a probability threshold value, outputting the first positive example image sample into a training sample group; determining the quantity ratio of a target positive example image sample and a negative example image sample, if the ratio does not reach a first target value, dynamically adjusting the input of the generator based on the first discrimination probability to obtain a new first positive example image sample and a new first discrimination probability, until the ratio reaches the first target value. The application performs an enhancement operation on an initial feature vector through linear interpolation processing, does not need to use a convolution kernel, and can avoid the occurrence of a chessboard effect in the generated image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a data augmentation method, apparatus and related equipment based on generative adversarial networks. Background Technology

[0002] Deep learning can learn deeper features from data to obtain more hidden and effective features. In particular, in some fields, such as medical image recognition, if the samples in the data training set simultaneously meet the conditions of balanced distribution of species, high quality and diversity, it is beneficial to train the recognition model, thereby achieving efficient prediction or classification of the data to be recognized. For example, the recognition model can be used to detect medical images to efficiently and accurately identify the tissue or organ characteristics caused by a certain disease.

[0003] However, in many practical applications, such as image recognition and fault prediction, the samples in the training set often cannot simultaneously meet the conditions of balanced data distribution, high quality and diversity, which makes it impossible for the model to efficiently identify the data to be detected.

[0004] Imbalanced data distribution generally refers to a situation where the number of samples in some categories is far greater than that in others. However, in practical applications, minority class data often represents abnormal or important situations, while majority class data represents normal situations. Therefore, data imbalance can cause trained models to favor the majority class during identification, ignoring the minority class. For example, in tumor identification tasks based on recognition models, positive samples (tumor presence) are usually far fewer than negative samples (healthy tissue). This data imbalance can cause the recognition model to be more biased towards negative samples during training, easily ignoring positive samples and thus leading to misidentification.

[0005] In addition to ensuring a balanced distribution of data types, it is also necessary to simultaneously ensure high data quality and diversity in order to train a recognition model that can efficiently and accurately detect the data to be identified.

[0006] To address the issue that samples in a dataset cannot simultaneously satisfy the requirements of balanced class distribution, high quality, and diversity, the proposed technical solutions mainly include the following:

[0007] (1) Oversampling techniques: By copying minority class samples or generating new minority class samples, the number of minority class samples is increased, making the data types in the dataset more balanced. Common oversampling techniques include SMOTE (Synthetic Minority Over-sampling Technique) and ADASYN (Adaptive Synthetic Sampling Approach). SMOTE generates new minority class samples through interpolation, while ADASYN generates minority class samples adaptively to balance the dataset. Oversampling techniques balance the dataset by generating new minority class samples; however, the new samples generated by this method are usually obtained through interpolation or simple transformation, and are too similar to the original minority class samples. This can easily lead to the model overfitting the minority class samples during training, thus affecting the generalization ability of the prediction model.

[0008] (2) Undersampling techniques: By reducing the number of majority class samples, the dataset is made more balanced. Common undersampling techniques include random undersampling and ensemble undersampling. However, while undersampling techniques can balance the dataset, they may lose important information from the majority class, affecting model performance.

[0009] (3) Data augmentation techniques: These techniques transform the original data to generate new samples, increasing data diversity. Traditional data augmentation methods include rotation, translation, cropping, and flipping. However, while these methods increase data diversity to some extent, the resulting samples have limited variation, making it difficult to significantly improve the data imbalance problem, and their effectiveness is not ideal for certain complex application scenarios.

[0010] (4) Generative Adversarial Networks (GANs): These networks generate high-quality synthetic data by having a generator and a discriminator compete against each other. As an advanced generative model, they excel in generating high-quality synthetic data, but the samples they generate still lack diversity and representativeness. Furthermore, existing models often produce invalid or low-quality samples when generating minority class samples, which not only fails to effectively alleviate the data imbalance problem but may even introduce noise and affect model performance.

[0011] Therefore, while the above methods can alleviate the problems of data imbalance, high quality, or diversity to a certain extent, they cannot simultaneously guarantee the balance of sample types, sample diversity, and sample high quality in the dataset. Summary of the Invention

[0012] The main objective of this application is to provide a data augmentation method, apparatus, and related equipment, which aims to solve the problem that, in the prior art, samples in the data training set do not simultaneously satisfy the requirements of balanced species distribution, high quality, and diversity.

[0013] In a first aspect, embodiments of this application provide a data augmentation method, the method comprising:

[0014] A first positive example image sample is obtained, wherein the first positive example image sample is generated based on a first noise vector input to the generator, and the generator processes the first noise vector using linear interpolation;

[0015] The first positive example image sample is input into the discriminator to obtain the first discrimination probability;

[0016] If the first discrimination probability is greater than or equal to the probability threshold, then the first positive example image sample is output as the target positive example image sample to the training sample group; wherein, the probability threshold is the sum of the mean of the first discrimination probabilities obtained in each round and a preset multiple of the standard deviation of the first discrimination probabilities obtained in each round;

[0017] The ratio of the number of target positive image samples to negative image samples in the training sample group is determined. If the ratio of the number of target positive image samples to negative image samples in the training sample group does not reach the first target value, the input of the generator is dynamically adjusted based on the first discrimination probability to obtain a new first positive image sample and a new first discrimination probability, until the ratio reaches the first target value.

[0018] Optionally, obtaining the first positive example image sample includes:

[0019] The generator's fully connected layer extracts initial features from the first noise vector to obtain an initial feature vector, wherein the first noise vector is sampled from a standard normal distribution.

[0020] The initial feature vector is linearly interpolated through the hidden layer of the generator to generate an enhanced initial feature vector;

[0021] The enhanced initial feature vector is convolved by a standard convolutional layer following the hidden layer of the generator to obtain initial feature data; wherein, the hidden layer includes at least two convolutional layers, each convolutional layer including the linear interpolation process and the convolution process; and

[0022] The enhanced initial feature data is nonlinearly transformed and normalized using the first activation function of the generator to generate the first positive example image sample.

[0023] Optionally, the step of inputting the first positive example image sample into the discriminator to obtain the first discrimination probability includes: inputting the first positive example image sample into the discriminator; performing continuous multi-layer convolution processing on the first positive example image sample to obtain the first positive example image sample features; classifying the first positive example image sample features through the fully connected layer of the discriminator to obtain the first classification data; and processing the first classification data through the second activation function of the discriminator to obtain the first discrimination probability.

[0024] Optionally, the generator is pre-trained in the following manner: a second noise vector is randomly sampled from the standard normal distribution according to preset sampling parameters; the second noise vector is input into an initial generator to generate a second positive image sample; the second positive image sample is input into a discriminator to generate a second discrimination probability; a first discrimination loss value is obtained based on the second discrimination probability; if the first discrimination loss value does not meet the first preset condition, the training parameters of the generator are updated with a preset step size, and a new second noise vector is obtained to obtain a new positive image sample, until a new first discrimination loss value obtained based on the new positive image sample meets the first preset condition; wherein, the preset step size is different in different training stages, wherein the training step size in the late training stage is smaller than the training step size in the middle training stage, and the training step size in the middle training stage is smaller than the training step size in the early training stage; the first preset condition includes the first discrimination loss value reaching a first preset value.

[0025] Optionally, the discriminator is pre-trained in the following manner: acquiring a sample image to be identified, which is a real image sample or an image sample generated by a generator; inputting the sample image to be identified into an initial discriminator to obtain a third discrimination probability; obtaining a second discrimination loss value based on the third discrimination probability and the correct discrimination result of the sample image to be identified; if the second discrimination loss value does not meet a second preset condition, updating the training parameters of the discriminator with a preset step size, and acquiring a new sample image to be identified to obtain a new third discrimination probability, until a new second discrimination loss value obtained based on the new third discrimination probability meets the second preset condition; the second preset condition includes the second discrimination loss value reaching a second preset value.

[0026] Optionally, the image sample to be identified is obtained from a candidate training sample group, which includes a first positive image sample generated during generator training with a discrimination probability greater than or equal to the probability threshold; during the discriminator training process, the discrimination difficulty of the discriminator is increased by increasing the number of negative image samples.

[0027] Optionally, the probability threshold in σ is the mean of the first discrimination probabilities of each round. p Let k be the standard deviation of the first discrimination probability for each round, and k takes a value between 1 and 2.

[0028] Optionally, the first target value is taken from 1:1 to 1:10.

[0029] Secondly, embodiments of this application provide a data augmentation apparatus having functions corresponding to the data augmentation method provided in the first aspect above. These functions can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the aforementioned functions, and these modules can be software and / or hardware.

[0030] In one embodiment, the data augmentation device includes: an acquisition module configured to acquire a first positive image sample; a generation module configured to input the first positive image sample into a discriminator to obtain a first discrimination probability; a first discrimination module configured to output the first positive image sample as a target positive image sample into a training sample group if the first discrimination probability is greater than or equal to a probability threshold; and a second discrimination module configured to dynamically adjust the input of the generator based on the first discrimination probability if the ratio of the number of target positive image samples to negative image samples in the training sample group does not reach a first target value.

[0031] Thirdly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a computer, cause the computer to perform the multimodal data processing method based on a unified representation model as described in the first aspect.

[0032] Fourthly, embodiments of this application provide a computing device, 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 data augmentation method described in the first aspect.

[0033] In the embodiments of this application, the initial feature vector is enhanced by linear interpolation. Since no convolution kernel is needed, there is no overlap between convolution kernels, and therefore no skipping or overlapping areas, which avoids the checkerboard effect in the generated image samples. In addition, the generator input is dynamically adjusted based on the first discrimination probability, which can update the discrimination probability in real time, thereby effectively enhancing the diversity of generated samples and significantly reducing the risk of overfitting. Furthermore, the screening mechanism based on probability threshold can obtain higher quality target positive image samples. Attached Figure Description

[0034] The objectives, features, and advantages of the embodiments of this application will become readily understood by referring to the accompanying drawings and the detailed description of the embodiments. Wherein:

[0035] The objectives, features, and advantages of the embodiments of this application will become readily understood by referring to the accompanying drawings and the detailed description of the embodiments. Wherein:

[0036] Figure 1 This is a schematic flowchart of a data augmentation method according to an embodiment of this application;

[0037] Figure 2 This is a schematic diagram of the generator structure according to an embodiment of this application;

[0038] Figure 3 This is a schematic diagram of the discriminator structure according to an embodiment of this application;

[0039] Figure 4 This is a schematic diagram of the structure of a data enhancement device according to an embodiment of this application;

[0040] Figure 5 This is a schematic diagram of the structure of the medium in one embodiment of this application;

[0041] Figure 6 This is a schematic diagram of the structure of a computing device according to an embodiment of this application.

[0042] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation

[0043] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0044] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.

[0045] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0046] This application provides a data augmentation method, apparatus, device, and medium. The data augmentation method can be applied to a terminal device, which may be an electronic device such as a tablet computer, laptop computer, desktop computer, personal digital assistant, or wearable device. In other embodiments, the data augmentation method can also be deployed on a server or server cluster.

[0047] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0048] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating a data augmentation method provided in an embodiment of this application.

[0049] like Figure 1 As shown in the embodiments of this application, the data augmentation method includes the following steps S101 to S104:

[0050] Step S101: Obtain the first positive example image sample.

[0051] In this embodiment, positive examples refer to minority class samples in the training dataset, and negative examples refer to majority class samples in the training dataset. In some application areas, the number of positive example images is usually far less than the number of negative example images. For example, in tumor recognition tasks, positive example images are images of lesions containing tumors, and negative example images are images of healthy tissue; the number of positive example images containing tumors is usually far less than the number of negative example images of healthy tissue.

[0052] In this embodiment, the data augmentation method can be applied to data augmentation of minority class samples in some fields, such as medical image recognition and mechanical fault recognition. Taking tumor image recognition in the field of medical image recognition as an example, positive example image samples are images of lesions containing tumors, and negative example image samples are images of healthy tissue. Therefore, obtaining the first positive example image sample means obtaining the image of a lesion containing a tumor.

[0053] In this embodiment of the application, in order to obtain the first positive example image sample, the following steps S1011 to S1013 can be used:

[0054] S1011: Initial feature vector is obtained by extracting initial features from the first noise vector through the fully connected layer of the generator.

[0055] In this embodiment of the application, the generator can be obtained by defining a function, for example, such as Figure 2 As shown, Figure 2This is a schematic diagram of a generator structure according to an embodiment of this application. The generator may include an input layer, a fully connected layer, multiple hidden layers, and an output layer. Furthermore, each hidden layer is followed by a standard convolutional layer, a batch normalization layer, and a ReLU activation function. The output layer may use the tanh function. The specific number of hidden layers can be determined based on actual needs; this embodiment does not limit the specific number of hidden layers.

[0056] In this embodiment, the first noise vector can be obtained by sampling from a standard normal distribution. The first noise vector is not generated arbitrarily, but is sampled strictly following the principles of a standard normal distribution, ensuring the randomness and diversity of the first noise vector. The dimension of this first noise vector can be set according to the actual task, commonly 128 or 256 dimensions. In this embodiment, by using the first noise vector obtained from the standard normal distribution, the generator can generate various possible tumor images based on the first noise vector, thereby providing a reliable foundation for subsequent image recognition.

[0057] Suppose the first noise vector is an array with dimensions (1, 100), that is, an array containing 1 row and 100 columns. The first noise vector can be input into the input layer of the generator by calling a function, and the initial feature vector of the first noise vector can be obtained by extracting the initial features of the first noise vector through a fully connected layer.

[0058] S1012: The initial feature vector is linearly interpolated through the generator's hidden layer to generate an enhanced initial feature vector.

[0059] Traditional generative adversarial networks (GANs) use transposed convolutional layers for upsampling. Since transposed convolutions can cause overlap or gaps between convolutional kernels, they may produce a checkerboard effect, resulting in noticeable artifacts in the generated images and thus producing unnatural images.

[0060] In this embodiment, each hidden layer employs bilinear interpolation for upsampling to enhance the initial feature vector. Bilinear interpolation maps features based on the deterministic nature of pixel positions, such as calculating new interpolated pixels based on the four nearest pixel values. Since no convolution kernel is needed, there is no overlap between convolution kernels, thus avoiding skipping steps or overlapping regions. In other words, the upsampling operation of each fully connected hidden layer in this embodiment does not produce overlap problems compared to transposed convolution in existing technologies, thereby preventing the checkerboard effect from appearing in the subsequently generated first positive sample.

[0061] In addition, each hidden layer in the generator in this embodiment is followed by a standard convolutional layer. After upsampling in the hidden layer, the standard convolutional layer can extract detailed features based on the enhanced initial feature vector and adjust the dimension of the output channel. This not only improves the resolution of the subsequently generated first positive example image, but also ensures that the subsequently generated first positive example image samples are smoother and more natural.

[0062] S1013: The enhanced initial feature vector is convolved through the standard convolutional layer after the hidden layer of the generator to obtain the initial feature data.

[0063] In this embodiment, a batch normalization layer is set after the standard convolutional layer of each hidden layer, which can balance the feature distribution in each mini-batch of samples, ensure more stable model training, and avoid gradient explosion or vanishing problems.

[0064] S1014: The initial feature data is nonlinearly transformed by the generator's first activation function to generate the first positive example image sample.

[0065] In the embodiments of this application, the first activation function is the ReLU function after each hidden layer. Each hidden layer performs a linear transformation on the initial feature vector, and then performs a non-linear transformation through the ReLU function. This can improve the generator's ability to express curves, edges, textures, and other parts. The ReLU activation function after each hidden layer can ensure that the output of each hidden layer is non-linear. Thus, after stacking, a deep non-linear network is formed, which ensures that the subsequently generated image is closer to the real image and improves the quality of the generated image.

[0066] In this embodiment, the generator's hidden layers are multi-layered structures used for upsampling based on linear interpolation. Each hidden layer is based on linear interpolation and a standard convolutional layer, which can gradually enlarge low-resolution feature maps to higher resolutions. Each hidden layer is followed by a normalization layer and a ReLU activation function. The batch normalization layer helps to accelerate the training process and improve the model's convergence, while the ReLU activation function enables the generator to learn complex mapping relationships. The output layer outputs the first positive image sample based on the deep nonlinear network formed by stacking the hidden layers through the tanh activation function.

[0067] In this embodiment, the generator output is an image, such as a first positive example image. In medical image analysis, this means generating an image similar to a positive example image for tumor detection. These images generated by the generator can be used to supplement minority class samples in the training sample group, increasing the diversity and balance of the data. The first positive example image output by the generator is typically the same size as a real medical image, such as a 128x128 or 256x256 pixel CT or MRI image.

[0068] Step S102: Input the first positive example image sample into the discriminator to obtain the first discrimination probability.

[0069] In this embodiment, the generator typically needs to be used in conjunction with a discriminator, therefore adversarial training is required to continuously improve the quality of the images generated by the generator. Specifically, the first positive example image sample is input into the discriminator to obtain a first discrimination probability, which can be determined based on the following steps S1021-S1024:

[0070] S1021: Input the first positive example image sample into the discriminator.

[0071] In this embodiment, the discriminator is used to determine the probability that the input image to be discriminated is a real image. The image to be discriminated can be a real image or an image generated by the generator that is similar to a real image. Taking a tumor recognition task as an example, the input to the discriminator can be a first positive example image sample generated by the generator, which is similar to a real CT or MRI image containing a tumor lesion, or it can be a real CT or MRI image containing a tumor lesion. After receiving the image to be discriminated, the discriminator can determine the probability that it is a real image. For example, after inputting the first positive example image generated by the generator into the discriminator, the discriminator can determine the probability that the first positive example image sample is a real positive example image sample. If the probability that the first positive example image sample is a real positive example image is high, it indicates that the first positive example image sample generated by the generator has a high similarity to the real positive example image. If the probability that the first positive example image sample is a real positive example image is low, it is necessary to continue training the generator's parameters to improve the similarity between the first positive example image sample it generates and the real positive example image sample.

[0072] like Figure 3 As shown in the embodiments of this application, the discriminator includes an input layer, multiple convolutional layers, a fully connected layer, and an output layer. The input layer is used to receive the image to be discriminated, such as receiving a first positive image sample generated by the generator.

[0073] S1022: Perform continuous multi-layer convolution processing on the first positive example image sample to obtain the features of the first positive example image sample.

[0074] In this embodiment, multiple convolutional layers of the discriminator progressively extract features from the input first positive example image sample through stride convolution. During feature extraction, each convolutional layer scans different regions of the first positive example image sample using a sliding window, extracting image features at different scales and locations. Furthermore, each convolutional layer progressively reduces the spatial size (width and height) of the extracted feature map according to a preset stride, while simultaneously increasing the number of channels to extract more abstract, high-level features. By stacking multiple convolutional layers to progressively extract features from the first positive example image sample, features are extracted from low-level edges and textures to high-level object parts and overall structures. Additionally, the number of convolutional layers can be set according to actual needs and task complexity; this embodiment does not limit the specific number of convolutional layers.

[0075] In addition, in the embodiments of this application, each layer of convolution is followed by a Leaky ReLU activation function, which enables the discriminator to effectively deal with the sparse features of negative samples, while capturing nonlinear relationships in the image.

[0076] In addition, in this embodiment, a batch normalization layer is provided after each convolution. By setting the batch normalization layer, the training process is stabilized, the stability of the feature distribution of the image to be judged is maintained, and gradient explosion or vanishing of the discriminator is avoided.

[0077] Specifically, taking the implementation in Python as an example, the first positive example image sample is first loaded, and then the first positive example image sample is preprocessed, such as resizing. The preprocessed first positive example image sample is passed through multiple convolutional layers. Each convolutional layer extracts the sample features of the first positive example image through stride convolution. The sample features are a one-dimensional feature vector.

[0078] S1023: Classify the features of the first positive image sample through the fully connected layer of the discriminator to obtain the first classification data.

[0079] In the field of deep learning, especially in generative adversarial networks (GANs), the main task of the discriminator is to distinguish whether the input data comes from real datasets or fake data generated by the generator. However, the structure of the discriminator is not limited to its use in GANs; it can also be used as a classifier to classify input data.

[0080] In this embodiment, the features of positive image samples are classified by the fully connected layer of the discriminator. The discriminator is a pre-trained model that includes multiple convolutional layers for feature extraction and fully connected layers for the final classification decision.

[0081] The extracted features can be transformed, such as flattened or reshaped, to match the input requirements of the fully connected layer. The transformed features are then fed into the fully connected layer, which maps them to a classification space, producing the first classification data. This first classification data is the output of the discriminator's fully connected layer, representing the classification result for the input image (the first positive image sample). This output is a discrete label (such as "real" or "generated"). The purpose of the fully connected layer is to perform linear transformations and non-linear activations on the input vector, ultimately outputting the classification result. The output vector typically represents the probability distribution for each class.

[0082] S1024. The first classification data is processed by the second activation function of the discriminator to obtain the first discrimination probability.

[0083] In this embodiment, the second activation function of the discriminator can be the sigmoid activation function in the output layer. The sigmoid function maps the first classification data to a value in the interval (0,1), which can be interpreted as the probability of belonging to the target positive sample image. In tumor detection, this value is the probability of belonging to the real tumor image.

[0084] Step S103: If the first discrimination probability is greater than or equal to the probability threshold, then the first positive example image sample is output as the target positive example image sample to the training sample group.

[0085] In this embodiment of the application, a probability threshold can be set to determine whether the first positive example image should be classified as a positive sample (or target category).

[0086] Specifically, after the discriminator determines the first positive image sample and obtains the first discrimination probability, the first discrimination probability corresponding to the first positive image sample is compared with the probability threshold. If the first discrimination probability is greater than or equal to the probability threshold, the first positive image sample is output as the target positive image sample to the training sample group. Otherwise, it is classified as a negative image sample.

[0087] In this embodiment of the application, the probability threshold is the sum of the mean of the first discrimination probabilities obtained in each round and a preset multiple of the standard deviation of the first discrimination probabilities obtained in each round.

[0088] In this embodiment of the application, the probability threshold can be determined based on the following formula:

[0089]

[0090] in, Let σ be the mean of the first discrimination probability in each round. p denoted as the standard deviation of the first discrimination probability for each round, and k is a preset multiple, taking a value between 1 and 2.

[0091] A probability threshold is used to determine whether the discrimination probability of an image sample is high enough to be considered a valid positive image sample. The probability threshold is typically adjusted based on the specific application scenario and model performance; for example, the value of the probability threshold can be adjusted by changing the value of k. If the first discrimination probability corresponding to a first positive image sample is greater than or equal to this probability threshold, then the first positive image sample is considered a sufficiently reliable target positive image sample and is added to the training sample group for subsequent model training. By setting a probability threshold and selecting first positive image samples with a first discrimination probability greater than or equal to the threshold as positive image training samples, the quality and representativeness of the positive image training samples can be ensured, thereby improving the training effect and performance of the model. If the first discrimination probability corresponding to a first positive image sample is lower than the probability threshold, then the corresponding first positive image sample is considered a negative image sample or an uncertain sample. In this embodiment, by setting a probability threshold, high-quality positive image samples can be selected from the first positive image samples and added to the training sample group. The next round of training can then be performed based on the updated training sample group, improving the balance and diversity of the training sample group.

[0092] Step S104: Determine the ratio of the number of target positive image samples to negative image samples in the training sample group. If the ratio of the number of target positive image samples to negative image samples does not reach the first target value, dynamically adjust the input of the generator based on the first discrimination probability to obtain a new first positive image sample and a new first discrimination probability, until the ratio of the number of target positive image samples to negative image samples in the training sample group reaches the first target value.

[0093] In deep learning, the problem of imbalanced sample size refers to an imbalance between the number of positive and negative samples in the training sample group. Severe imbalance can cause the recognition model to heavily rely on the larger class of samples and focus on that class while ignoring the smaller minority class, resulting in weak recognition ability. Therefore, this embodiment of the application sets a first target value to ensure a balance between positive and negative image samples in the training sample group.

[0094] In this embodiment of the application, the first target value is the ratio of the number of target positive image samples to the number of negative image samples. The first target value can be a range, such as between 1:1 and 1:10. When the ratio of the number of positive image samples to the number of negative image samples is between 1:1 and 1:10, the acquisition of new first positive image samples is stopped.

[0095] In this embodiment of the application, in order to obtain high-quality positive example image samples, it is necessary to train the generator and the discriminator.

[0096] In this embodiment of the application, the generator can be pre-trained in the following manner:

[0097] First, based on preset sampling parameters, a second noise vector is obtained by randomly sampling from a standard normal distribution.

[0098] Next, the second noise vector is input into the initial generator to generate the second positive image sample.

[0099] Then, the second positive image sample is input into the discriminator to generate a second discrimination probability; a first discrimination loss value is obtained based on the second discrimination probability; if the first discrimination loss value does not meet the first preset condition, the training parameters of the generator are updated with a preset step size, and a new second noise vector is obtained to obtain a new positive image sample, until the new first discrimination loss value obtained based on the new positive image sample meets the first preset condition; wherein, the preset step size is different in different training stages, wherein the training step size in the late training stage is smaller than the training step size in the middle training stage, and the training step size in the middle training stage is smaller than the training step size in the early training stage.

[0100] In this embodiment of the application, the first preset condition includes the first discrimination loss value reaching a first preset value, wherein the first preset value is the minimum value, that is, the first discrimination loss reaches the minimum.

[0101] Adaptive data augmentation methods can dynamically adjust the generator's input and training parameters to increase the diversity of generated positive image samples, thereby reducing the risk of overfitting.

[0102] In the embodiments of this application, the sampling parameters can be the number of samples (i.e. how many noise vectors to generate), the dimension of the noise vector (i.e. how many elements each noise vector has), etc.

[0103] In the embodiments of this application, the first discrimination loss value can be calculated by comparing the output of the discriminator (i.e., the second discrimination probability) with the output value of the real image. The real image is the target positive example image sample, and the first loss value reflects the current performance of the discriminator; the smaller the first loss value, the higher the current performance of the discriminator.

[0104] In the embodiments of this application, the preset step size refers to the learning rate during the parameter update process.

[0105] In the embodiments of this application, the preset step size can be different in different training stages, that is, the learning rate (or step size) can be dynamically changed throughout the training process. For example, in the early stage of training, since the model parameters are far from the optimal solution, a larger learning rate can be used to accelerate training; as training progresses, the model gradually approaches the optimal solution, at which point the learning rate needs to be reduced to avoid excessive oscillation or jumping out of the optimal solution. Therefore, the learning rate in the late stage of training is smaller than that in the middle stage of training, and the learning rate in the middle stage of training is smaller than that in the early stage of training.

[0106] In this embodiment of the application, the discriminator is pre-trained in the following manner:

[0107] First, obtain the image sample to be identified, which can be a real image sample or an image sample generated by the generator.

[0108] Secondly, the image sample to be identified is input into the initial discriminator to obtain the third discrimination probability.

[0109] Then, based on the third discrimination probability and the correct discrimination result of the image sample to be identified, a second discrimination loss value is obtained; if the second discrimination loss value does not meet the second preset condition, the training parameters of the discriminator are updated with a preset step size, and a new image sample to be identified is obtained to obtain a new third discrimination probability, until the new second discrimination loss value obtained based on the new third discrimination probability meets the second preset condition; the second preset condition includes the second discrimination loss value reaching the second preset value.

[0110] In the embodiments of this application, the image sample to be identified can be a real image sample, such as a real tumor image, or it can be an image sample generated by a generator, such as an image generated by a generator that is similar to a real tumor image, that is, a positive example image sample generated by a generator.

[0111] The initial discriminator is used to determine whether the input image is real or generated. When the image sample to be identified is input into the discriminator, it generates a third discrimination probability, which represents the probability that the input image is a real image or a generated image. The second discrimination loss value is calculated by comparing the output of the discriminator (i.e. the third discrimination probability) with the correct discrimination result of the image sample to be identified. The smaller the second discrimination loss value, the higher the accuracy of the discriminator.

[0112] In this embodiment, the second preset condition is a standard or threshold for the discriminant loss value. Typically, we want the discriminator to accurately distinguish between real and generated images, and the second discriminant loss value reflects the discriminator's accuracy in distinguishing between real and generated images. In each iteration, the second discriminant loss value of the current discriminator is first calculated and compared with the preset second condition. If the second discriminant loss value does not meet the second preset condition (e.g., if the second discriminant loss value is large, it indicates that the discriminator's performance is not good enough), then the discriminator needs to continue training.

[0113] When the second discriminant loss value does not meet the second preset condition, a preset step size (learning rate) can be used to update the discriminator's training parameters. In this embodiment, the discriminator's training parameters may include weights and biases in the discriminator network. By updating the discriminator's training parameters, the discriminator can more accurately distinguish between real and generated images in the next iteration.

[0114] After updating the training parameters of the discriminator, new image samples to be identified are needed for the next iteration. The new image samples can be images that have not been used before, or images randomly selected from the training sample group.

[0115] The new image sample to be identified is input into the updated discriminator to obtain a new third discrimination probability. Then, a new second discrimination loss value is calculated based on the new third discrimination probability, and it is checked again whether it meets the second preset condition. If it does not meet the condition, the training parameters of the discriminator are updated, and new image samples are acquired for the next iteration until the new second discrimination loss value obtained based on the new third discrimination probability meets the second preset condition. At this point, it can be considered that the discriminator can accurately distinguish between real image samples and image samples generated by the generator.

[0116] In this embodiment of the application, the image sample to be identified is obtained from the candidate training sample group, which includes generated image samples whose discrimination probability is greater than or equal to the probability threshold generated during the generator training process.

[0117] In this embodiment of the application, during the discriminator training process, the discrimination difficulty of the discriminator is increased by increasing the number of negative image samples.

[0118] In the embodiments of this application, the initial feature vector is enhanced by linear interpolation. Since no convolution kernel is needed, there is no overlap between convolution kernels, and therefore no skipping or overlapping areas, which avoids the checkerboard effect in the generated image samples. In addition, the generator input is dynamically adjusted based on the first discrimination probability, which can update the discrimination probability in real time, thereby effectively enhancing the diversity of generated samples and significantly reducing the risk of overfitting. Furthermore, the screening mechanism based on probability threshold can obtain higher quality target positive image samples.

[0119] In tumor detection applications, the data augmentation method in this application embodiment can ensure that the data in the dataset reaches an ideal state in terms of type, quality and diversity, thereby significantly improving the accuracy of tumor identification by the identification model.

[0120] Furthermore, the data augmentation method in this application is applicable to various imbalanced datasets, especially those in the fields of healthcare, finance, and security, and has broad application prospects.

[0121] Exemplary device

[0122] This exemplary embodiment proposes a data enhancement device, such as... Figure 4 As shown in this embodiment, the data enhancement device 100 includes:

[0123] The acquisition module 110 is used to acquire a first positive example image sample, wherein the first positive example image sample is generated based on a first noise vector input to the generator, and the generator processes the first noise vector using linear interpolation;

[0124] Processing module 120 is used to input the first positive example image sample into the discriminator to obtain the first discrimination probability;

[0125] If the first discrimination probability is greater than or equal to the probability threshold, then the first positive example image sample is output as the target positive example image sample to the training sample group; wherein, the probability threshold is the sum of the mean of the first discrimination probabilities obtained in each round and a preset multiple of the standard deviation of the first discrimination probabilities obtained in each round;

[0126] The ratio of the number of target positive image samples to negative image samples in the training sample group is determined. If the ratio of the number of target positive image samples to negative image samples in the training sample group does not reach the first target value, the input of the generator is dynamically adjusted based on the first discrimination probability to obtain a new first positive image sample and a new first discrimination probability, until the ratio reaches the first target value.

[0127] In this embodiment of the application, the acquisition module is further configured to:

[0128] The generator's fully connected layer extracts initial features from the first noise vector to obtain an initial feature vector, wherein the first noise vector is sampled from a standard normal distribution.

[0129] The initial feature vector is linearly interpolated through the hidden layer of the generator to generate an enhanced initial feature vector;

[0130] The enhanced initial feature vector is convolved through a standard convolutional layer following the hidden layer of the generator to obtain initial feature data.

[0131] The generator performs a nonlinear transformation on the initial feature data using its first activation function to generate the first positive example image sample.

[0132] In this embodiment of the application, the processing module is further configured to:

[0133] The first positive example image sample is input into the discriminator;

[0134] The first positive example image sample is subjected to continuous multi-layer convolution processing to obtain the features of the first positive example image sample;

[0135] The first positive example image sample features are classified using the fully connected layer of the discriminator to obtain first classification data; and

[0136] The first classification data is processed by the second activation function of the discriminator to obtain the first discrimination probability.

[0137] In this application's embodiment set, the generator is pre-trained in the following manner:

[0138] According to preset sampling parameters, a second noise vector is randomly sampled from the standard normal distribution to obtain the second noise vector;

[0139] The second noise vector is input into the initial generator to generate a second positive example image sample;

[0140] The second positive example image sample is input into the discriminator to generate a second discrimination probability;

[0141] The first discrimination loss value is obtained based on the second discrimination probability;

[0142] If the first discriminant loss value does not meet the first preset condition, the training parameters of the generator are updated with a preset step size, and a new second noise vector is obtained to obtain a new positive image sample, until the new first discriminant loss value obtained based on the new positive image sample meets the first preset condition.

[0143] The preset step size has different values ​​in different training stages, with the training step size in the late training stage being smaller than that in the middle training stage, and the training step size in the middle training stage being smaller than that in the early training stage.

[0144] The first preset condition includes the first discrimination loss value reaching a first preset value.

[0145] In this embodiment of the application, the discriminator is pre-trained in the following manner:

[0146] Obtain an image sample to be identified, wherein the image sample to be identified is a real image sample or an image sample generated by a generator;

[0147] The image sample to be identified is input into the initial discriminator to obtain the third discrimination probability;

[0148] Based on the third discrimination probability and the correct discrimination result of the image sample to be identified, a second discrimination loss value is obtained;

[0149] If the second discrimination loss value does not meet the second preset condition, the training parameters of the discriminator are updated with a preset step size, and new image samples to be identified are obtained to obtain a new third discrimination probability, until the new second discrimination loss value obtained based on the new third discrimination probability meets the second preset condition.

[0150] The second preset condition includes the second discrimination loss value reaching a second preset value.

[0151] In this embodiment of the application, the image sample to be identified is obtained from a candidate training sample group, which includes a first positive example image sample generated during the generator training process with a discrimination probability greater than or equal to the probability threshold.

[0152] During the training process of the discriminator, the discrimination difficulty of the discriminator is increased by increasing the number of negative image samples.

[0153] In this embodiment of the application, the probability threshold in σ is the mean of the first discrimination probabilities of each round. p Let k be the standard deviation of the first discrimination probability for each round, and k takes a value between 1 and 2.

[0154] In this embodiment of the application, the first target value is taken from 1:1 to 1:10.

[0155] For specific implementation methods of each module of the data enhancement device in the embodiments of this application, please refer to the various embodiments of the data enhancement method, which will not be described in detail here.

[0156] The data augmentation device in the embodiments of this application enhances the initial feature vector by performing linear interpolation. Since no convolution kernel is used, there is no overlap between convolution kernels, and therefore no skipping or overlapping areas, which can avoid the chessboard effect in the generated image samples. In addition, the generator input is dynamically adjusted based on the first discrimination probability, which can update the discrimination probability in real time, thereby effectively enhancing the diversity of generated samples and significantly reducing the risk of overfitting. Furthermore, the screening mechanism based on probability threshold can obtain higher quality target positive image samples.

[0157] Exemplary media

[0158] After introducing the methods, media, and systems of exemplary embodiments of this application, the following references are made. Figure 5 The computer-readable storage medium of exemplary embodiments of this application will be described, please refer to... Figure 5 The computer-readable storage medium shown is an optical disc 70, on which a computer program (i.e., a program product) is stored. When the computer program is run by a processor, it implements the steps described in the above method embodiments. For example, it acquires a first positive example image sample, wherein the first positive example image sample is generated based on a first noise vector input to a generator, and the generator processes the first noise vector using linear interpolation; it inputs the first positive example image sample to a discriminator to obtain a first discrimination probability; if the first discrimination probability is greater than or equal to a probability threshold, then the first positive example image sample is taken as the target. Positive image samples are output to the training sample group; wherein, the probability threshold is the sum of a preset multiple of the mean of the first discrimination probabilities obtained in each round and the standard deviation of the first discrimination probabilities obtained in each round; the ratio of the number of target positive image samples to negative image samples in the training sample group is determined. If the ratio of the number of target positive image samples to negative image samples in the training sample group does not reach a first target value, the input of the generator is dynamically adjusted based on the first discrimination probability to obtain new first positive image samples and new first discrimination probabilities, until the ratio reaches the first target value. The specific implementation of each step will not be repeated here. It should be noted that examples of computer-readable storage media may also include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical and magnetic storage media, which will not be elaborated here.

[0159] Exemplary computing device

[0160] After introducing the methods, systems, and media of exemplary embodiments of this application, the following references are made. Figure 6 Computing devices according to exemplary embodiments of this application.

[0161] Figure 6 A block diagram is shown of an exemplary computing device 80 suitable for implementing embodiments of the present application. The computing device 80 may be a computer system or a server. Figure 6 The computing device 80 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0162] like Figure 6 As shown, the components of the computing device 80 may include, but are not limited to: one or more processors or processing units 801, system memory 802, and bus 803 connecting different system components (including system memory 802 and processing unit 801).

[0163] The computing device 80 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computing device 80, including volatile and non-volatile media, removable and non-removable media.

[0164] System memory 802 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 8021 and / or cache memory 8022. Computing device 80 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, ROM 8023 may be used to read and write non-removable, non-volatile magnetic media (…). Figure 6 Not shown in the image (usually referred to as a "hard drive"). Although not shown in Figure 6 The diagram illustrates that a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) can be provided. In these cases, each drive can be connected to bus 803 via one or more data media interfaces. System storage 802 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this application.

[0165] A program / utility 8025 having a set (at least one) of program modules 8024 may be stored, for example, in system storage 802, and such program modules 8024 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment. Program modules 8024 typically perform the functions and / or methods described in the embodiments of this application.

[0166] The computing device 80 can also communicate with one or more external devices 804 (such as a keyboard, pointing device, display, etc.). This communication can be performed through the I / O interface 805. Furthermore, the computing device 80 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 806. Figure 6 As shown, network adapter 806 communicates with other modules of computing device 80 (such as processing unit 801) via bus 803. It should be understood that, although... Figure 6 As not shown, it can be used in conjunction with computing device 80 with other hardware and / or software modules.

[0167] The processing unit 801 executes various functional applications and data processing by running programs stored in the system memory 802. For example, it acquires a first positive image sample, which is generated based on a first noise vector input to a generator, and the generator processes the first noise vector using linear interpolation. It inputs the first positive image sample to a discriminator to obtain a first discrimination probability. If the first discrimination probability is greater than or equal to a probability threshold, it outputs the first positive image sample as a target positive image sample to the training sample group. The probability threshold is the sum of a preset multiple of the mean of the first discrimination probabilities obtained in each round and the standard deviation of the first discrimination probabilities obtained in each round. It determines the ratio of the number of target positive image samples to negative image samples in the training sample group. If the ratio of the number of target positive image samples to negative image samples in the training sample group does not reach a first target value, it dynamically adjusts the input of the generator based on the first discrimination probability to acquire new first positive image samples and obtain new first discrimination probabilities, until the ratio reaches the first target value. The specific implementation methods of each step will not be repeated here. It should be noted that although several units / modules or sub-units / sub-modules of the computing device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided and embodied by multiple units / modules.

[0168] In the description of this application, it should be noted that the terms "first", "second", and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0169] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, units, and processes described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0170] In the several embodiments provided in this application, it should be understood that the disclosed systems, methods, and approaches can be implemented in other ways. The system embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between systems or units may be electrical, mechanical, or other forms.

[0171] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0172] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0173] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computing device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0174] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the technical scope disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.

[0175] Furthermore, although the operations of the method of this application are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0176] Based on the above description, the embodiments of this application provide at least the following technical solutions, but are not limited thereto:

[0177] 1. A data augmentation method, the method comprising:

[0178] A first positive example image sample is obtained, wherein the first positive example image sample is generated based on a first noise vector input to the generator, and the generator processes the first noise vector using linear interpolation;

[0179] The first positive example image sample is input into the discriminator to obtain the first discrimination probability;

[0180] If the first discrimination probability is greater than or equal to the probability threshold, then the first positive example image sample is output as the target positive example image sample to the training sample group; wherein, the probability threshold is the sum of the mean of the first discrimination probabilities obtained in each round and a preset multiple of the standard deviation of the first discrimination probabilities obtained in each round;

[0181] The ratio of the number of target positive image samples to negative image samples in the training sample group is determined. If the ratio of the number of target positive image samples to negative image samples in the training sample group does not reach the first target value, the input of the generator is dynamically adjusted based on the first discrimination probability to obtain a new first positive image sample and a new first discrimination probability, until the ratio reaches the first target value.

[0182] 2. The method described in technical solution 1, wherein obtaining the first positive example image sample includes:

[0183] The generator's fully connected layer extracts initial features from the first noise vector to obtain an initial feature vector, wherein the first noise vector is sampled from a standard normal distribution.

[0184] The initial feature vector is linearly interpolated through the hidden layer of the generator to generate an enhanced initial feature vector;

[0185] The enhanced initial feature vector is convolved through a standard convolutional layer following the hidden layer of the generator to obtain initial feature data.

[0186] The generator performs a nonlinear transformation on the initial feature data using its first activation function to generate the first positive example image sample.

[0187] 3. The method as described in technical solution 1 or 2, wherein inputting the first positive example image sample to the discriminator to obtain the first discrimination probability includes:

[0188] The first positive example image sample is input into the discriminator;

[0189] The first positive example image sample is subjected to continuous multi-layer convolution processing to obtain the features of the first positive example image sample;

[0190] The first positive example image sample features are classified using the fully connected layer of the discriminator to obtain first classification data; and

[0191] The first classification data is processed by the second activation function of the discriminator to obtain the first discrimination probability.

[0192] 4. As described in any one of technical solutions 1-3, the generator is pre-trained in the following manner:

[0193] According to preset sampling parameters, a second noise vector is randomly sampled from the standard normal distribution to obtain the second noise vector;

[0194] The second noise vector is input into the initial generator to generate a second positive example image sample;

[0195] The second positive example image sample is input into the discriminator to generate a second discrimination probability;

[0196] The first discrimination loss value is obtained based on the second discrimination probability;

[0197] If the first discriminant loss value does not meet the first preset condition, the training parameters of the generator are updated with a preset step size, and a new second noise vector is obtained to obtain a new positive image sample, until the new first discriminant loss value obtained based on the new positive image sample meets the first preset condition.

[0198] The preset step size has different values ​​in different training stages, with the training step size in the late training stage being smaller than that in the middle training stage, and the training step size in the middle training stage being smaller than that in the early training stage.

[0199] The first preset condition includes the first discrimination loss value reaching a first preset value.

[0200] 5. The method as described in any one of technical solutions 1-4, wherein the discriminator is pre-trained in the following manner:

[0201] Obtain an image sample to be identified, wherein the image sample to be identified is a real image sample or an image sample generated by a generator;

[0202] The image sample to be identified is input into the initial discriminator to obtain the third discrimination probability;

[0203] Based on the third discrimination probability and the correct discrimination result of the image sample to be identified, a second discrimination loss value is obtained;

[0204] If the second discrimination loss value does not meet the second preset condition, the training parameters of the discriminator are updated with a preset step size, and new image samples to be identified are obtained to obtain a new third discrimination probability, until the new second discrimination loss value obtained based on the new third discrimination probability meets the second preset condition.

[0205] The second preset condition includes the second discrimination loss value reaching a second preset value.

[0206] 6. The method according to any one of technical solutions 1-5, wherein the image sample to be identified is obtained from a candidate training sample group, and the candidate training sample group includes a first positive example image sample generated during the generator training process with a discrimination probability greater than or equal to the probability threshold;

[0207] During the training process of the discriminator, the discrimination difficulty of the discriminator is increased by increasing the number of negative image samples.

[0208] 7. The method as described in any one of technical solutions 1-6, wherein the probability threshold... in σ is the mean of the first discrimination probabilities of each round. p Let k be the standard deviation of the first discrimination probability for each round, and k takes a value between 1 and 2.

[0209] 8. The method described in any one of technical solutions 1-7, wherein the first target value is taken from 1:1 to 1:10.

[0210] 9. A data augmentation apparatus for acquiring positive samples, comprising:

[0211] An acquisition module is used to acquire a first positive example image sample, wherein the first positive example image sample is generated based on a first noise vector input to the generator, and the generator processes the first noise vector using linear interpolation;

[0212] The processing module is used to input the first positive example image sample into the discriminator to obtain the first discrimination probability;

[0213] If the first discrimination probability is greater than or equal to the probability threshold, then the first positive example image sample is output as the target positive example image sample to the training sample group; wherein, the probability threshold is the sum of the mean of the first discrimination probabilities obtained in each round and a preset multiple of the standard deviation of the first discrimination probabilities obtained in each round;

[0214] The ratio of the number of target positive image samples to negative image samples in the training sample group is determined. If the ratio of the number of target positive image samples to negative image samples in the training sample group does not reach the first target value, the input of the generator is dynamically adjusted based on the first discrimination probability to obtain a new first positive image sample and a new first discrimination probability, until the ratio reaches the first target value.

[0215] 10. A computing device comprising 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 method as described in any one of claims 1-8.

[0216] 11. A computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1-8.

Claims

1. A data augmentation method, characterized in that, The method includes: A first positive example image sample is obtained, wherein the first positive example image sample is generated based on a first noise vector input to the generator, and the generator processes the first noise vector using linear interpolation; The first positive example image sample is input into the discriminator to obtain the first discrimination probability; If the first discrimination probability is greater than or equal to the probability threshold, then the first positive example image sample is output as the target positive example image sample to the training sample group; wherein, the probability threshold is the sum of the mean of the first discrimination probabilities obtained in each round and a preset multiple of the standard deviation of the first discrimination probabilities obtained in each round; The ratio of the number of target positive image samples to negative image samples in the training sample group is determined. If the ratio of the number of target positive image samples to negative image samples in the training sample group does not reach the first target value, the input of the generator is dynamically adjusted based on the first discrimination probability to obtain a new first positive image sample and a new first discrimination probability, until the ratio reaches the first target value.

2. The method as described in claim 1, characterized in that, The step of obtaining the first positive example image sample includes: The generator's fully connected layer extracts initial features from the first noise vector to obtain an initial feature vector, wherein the first noise vector is sampled from a standard normal distribution. The initial feature vector is linearly interpolated through the hidden layer of the generator to generate an enhanced initial feature vector; The enhanced initial feature vector is convolved through a standard convolutional layer following the hidden layer of the generator to obtain initial feature data. The generator performs a nonlinear transformation on the initial feature data using its first activation function to generate the first positive example image sample.

3. The method as described in claim 1, wherein, The step of inputting the first positive example image sample into the discriminator to obtain the first discrimination probability includes: The first positive example image sample is input into the discriminator; The first positive example image sample is subjected to continuous multi-layer convolution processing to obtain the features of the first positive example image sample; The first positive example image sample features are classified using the fully connected layer of the discriminator to obtain first classification data; and The first classification data is processed by the second activation function of the discriminator to obtain the first discrimination probability.

4. The method as described in claim 1, characterized in that, The generator is pre-trained in the following manner: The second noise vector is obtained by randomly sampling from a standard normal distribution according to the preset sampling parameters; The second noise vector is input into the initial generator to generate a second positive example image sample; The second positive example image sample is input into the discriminator to generate a second discrimination probability; The first discrimination loss value is obtained based on the second discrimination probability; If the first discriminant loss value does not meet the first preset condition, the training parameters of the generator are updated with a preset step size, and a new second noise vector is obtained to obtain a new positive image sample, until the new first discriminant loss value obtained based on the new positive image sample meets the first preset condition. The preset step size has different values ​​in different training stages, with the training step size in the late training stage being smaller than that in the middle training stage, and the training step size in the middle training stage being smaller than that in the early training stage. The first preset condition includes the first discrimination loss value reaching a first preset value.

5. The method of claim 4, wherein, The discriminator is pre-trained in the following manner: Obtain an image sample to be identified, wherein the image sample to be identified is a real image sample or an image sample generated by a generator; The image sample to be identified is input into the initial discriminator to obtain the third discrimination probability; Based on the third discrimination probability and the correct discrimination result of the image sample to be identified, a second discrimination loss value is obtained; If the second discrimination loss value does not meet the second preset condition, the training parameters of the discriminator are updated with a preset step size, and new image samples to be identified are obtained to obtain a new third discrimination probability, until the new second discrimination loss value obtained based on the new third discrimination probability meets the second preset condition. The second preset condition includes the second discrimination loss value reaching a second preset value.

6. The method of claim 5, wherein, The image sample to be identified is obtained from a candidate training sample group, which includes a first positive example image sample generated during generator training with a discrimination probability greater than or equal to the probability threshold. During the training process of the discriminator, the discrimination difficulty of the discriminator is increased by increasing the number of negative image samples.

7. The method of claim 1, wherein, The probability threshold in σ is the mean of the first discrimination probabilities of each round. p Let k be the standard deviation of the first discrimination probability for each round, and k takes a value between 1 and 2.

8. A data augmentation apparatus for acquiring positive samples, comprising: An acquisition module is used to acquire a first positive example image sample, wherein the first positive example image sample is generated based on a first noise vector input to the generator, and the generator processes the first noise vector using linear interpolation; The processing module is used to input the first positive example image sample into the discriminator to obtain the first discrimination probability; If the first discrimination probability is greater than or equal to the probability threshold, then the first positive example image sample is output as the target positive example image sample to the training sample group; wherein, the probability threshold is the sum of the mean of the first discrimination probabilities obtained in each round and a preset multiple of the standard deviation of the first discrimination probabilities obtained in each round; The ratio of the number of target positive image samples to negative image samples in the training sample group is determined. If the ratio of the number of target positive image samples to negative image samples in the training sample group does not reach the first target value, the input of the generator is dynamically adjusted based on the first discrimination probability to obtain a new first positive image sample and a new first discrimination probability, until the ratio reaches the first target value.

9. A computing device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein, When the processor executes the computer program, it implements the method as described in any one of claims 1-7.

10. A computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Malicious code data imbalance processing method based on swarm intelligence algorithm and cGAN

    CN112800426A

  • Fuzzy space-time image data set amplification method, device and system and storage medium

    CN117437502A