Small sample learning-based data enhancement and learnable parameter threshold loss optimization method

Through the data enhancement of small sample learning and the threshold loss optimization method of learnable parameters, the problem of small sample learning method's dependence on large data sets and high computational complexity is solved, the robustness and generalization ability of the model are improved, and the It reduces the false detection rate and achieves effective engineering solutions in the context of very few samples.

CN118799681AActive Publication Date: 2024-10-18北京中科通量科技有限公司

Patent Information

Application Number
CN202411013608.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-10-18
Estimated Expiration
2044-07-26

AI Technical Summary

Technical Problem

Existing small-sample learning methods have problems such as high dependence on large pre-training data sets, high computational complexity, and insufficient adaptability to tasks in specific fields. The threshold loss optimization method has problems in small-sample learning support, data enhancement technology application, and false detection rate. Significantly deficient.

Method used

The threshold loss optimization method of data enhancement and learnable parameters based on small sample learning is adopted. Through the two-stage data enhancement technology and the penalty mechanism of learnable parameters, the robustness and generalization ability of the model are improved, and the false detection rate is reduced. Specific steps include establishing an actual background image sample library and a small sample image sample library, performing first- and second-stage data enhancement processing, using a deep learning neural network model for training, and adjusting learnable parameters to optimize the threshold loss.

Benefits of technology

It significantly improves the robustness and generalization ability of small sample field models, improves the prediction accuracy of each category, reduces the occurrence of false detections, reduces the dependence on large amounts of data in specific fields, and simplifies the model training process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118799681A_ABST
    Figure CN118799681A_ABST
Patent Text Reader

Abstract

The invention provides a data enhancement and learnable parameter threshold loss optimization method based on small sample learning, and the method comprises the following steps: carrying out the first-stage actual background image offline enhancement, the first-stage pure-color background image offline enhancement and the second-stage fusion enhancement of a small sample, and forming a training sample set; establishing a deep learning neural network model; the deep learning neural network model has a learnable parameter p; and carrying out model training by adopting a parameter-learnable threshold loss optimization method. According to the data enhancement and learnable parameter threshold loss optimization method based on small sample learning provided by the invention, a practical engineering innovation scheme under the background of extremely few samples is realized by combining a small sample two-stage data enhancement technology and learnable parameter threshold loss optimization; the robustness and generalization ability of the model in the related small sample field are greatly improved, the prediction accuracy of each category is also improved, and false detection is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of sample enhancement, and in particular relates to a method for optimizing the threshold loss of a data enhancement and a learnable parameter based on small sample learning. Background Art

[0002] In today's era of rapid technological development, machine learning and deep learning technologies have become core tools in many fields. In particular, these technologies have made great progress in areas such as pattern recognition, image processing, and natural language processing. However, in some cases, due to the scarcity of data samples or class imbalance, traditional machine learning methods may face challenges, such as in medical diagnosis, financial risk control, and security testing.

[0003] In this context, Few-Shot Learning has become a research direction that has attracted much attention. Few-Shot Learning aims to learn from very limited samples and generalize to new samples to deal with the problem of data scarcity. Research in this field focuses on how to build a robust model using a small number of labeled samples. In the field of Few-Shot Learning, data enhancement and loss function optimization are two key technical points. The following introduces these two aspects respectively:

[0004] 1. Data enhancement

[0005] Commonly used data enhancement methods use small sample learning methods, including transfer learning, meta-learning, etc.

[0006] (1) Transfer Learning

[0007] Transfer learning works by pre-training a model on a large dataset and then fine-tuning it on a target small dataset. This approach leverages the features learned on the large dataset to enable the model to better adapt to new tasks. For example, when using a pre-trained model for small-sample object detection, the model can be fine-tuned to adapt it to a specific small-sample dataset.

[0008] The specific implementation method is: pre-train a deep neural network model (such as ResNet or VGG) on a large-scale image dataset (such as ImageNet), and then apply the pre-trained model to a specific small sample dataset, and fine-tune the parameters of the model to adapt it to new tasks.

[0009] This method has the following problems: it still requires a large pre-training dataset and may encounter overfitting problems during fine-tuning, especially when the distribution of the target small sample dataset is significantly different from that of the pre-training dataset.

[0010] (2) Meta-learning

[0011] Meta-learning, by training a model, enables it to quickly adapt to new tasks. Typical meta-learning methods include MAML (Model-Agnostic Meta-Learning) and ProtoNet (Prototypical Networks). These methods enable the model to better generalize to new small sample tasks by training on multiple small sample tasks.

[0012] The specific implementation methods are as follows: For example, the MAML method learns an initial parameter by training on multiple tasks, and these parameters can quickly adapt to new tasks with only a small amount of updates. ProtoNet classifies by calculating the distance between the sample and the category prototype, which is suitable for small sample scenarios.

[0013] This method has the following problems: Meta-learning methods usually require a large number of datasets of different tasks for training, and have high requirements in terms of computational complexity and training time. In addition, for small sample tasks in a specific field, existing meta-learning methods may not be able to fully utilize the prior knowledge in the specific field.

[0014] It can be seen from this that existing small sample learning methods have problems such as high dependence on large pre-training datasets, high computational complexity, and insufficient adaptability to tasks in specific fields.

[0015] (II) Loss function optimization

[0016] In machine learning and deep learning, threshold loss optimization methods are widely used to improve the accuracy of classification and detection tasks. Traditional threshold loss optimization methods usually set fixed or simple dynamic thresholds and optimize the model by minimizing the loss function during training. Traditional threshold loss optimization methods mainly include the following:

[0017] (1) Fixed threshold method:

[0018] The fixed threshold method uses a fixed threshold to determine the classification or detection results of samples. This method has poor flexibility and is difficult to adapt to changes in different categories or samples.

[0019] (2) Dynamic threshold method:

[0020] The dynamic threshold method dynamically adjusts the threshold according to the characteristics of the samples and the confidence of the model during training. Although more flexible than the fixed threshold, the adjustment mechanism of this method is usually simple and cannot fully utilize the diversity and complexity of the training data.

[0021] (3) Existing adaptive threshold optimization methods:

[0022] Some advanced technologies have introduced adaptive threshold adjustment mechanisms to improve the accuracy of classification or detection by optimizing threshold parameters during model training. However, these methods mainly focus on optimizing the performance of a single task and are still insufficient in dealing with multi-task, multi-scale problems and high false positive rates.

[0023] Therefore, the existing threshold loss optimization methods have the following problems:

[0024] (1) Insufficient support for small sample learning: Most existing adaptive threshold optimization methods rely on a large amount of data for threshold adjustment, which lacks support for small sample learning and cannot be effectively generalized when data is scarce. (2) Limitations of threshold optimization: The threshold optimization mechanism of existing methods is relatively simple, usually just adding a simple threshold term, lacking fine-tuning for different samples and tasks. (3) High false positive rate problem: In practical applications, existing methods often face a high false positive rate, especially when dealing with complex scenes and multi-scale target detection. This problem is particularly prominent.

[0025] In summary, the existing threshold loss optimization methods have significant deficiencies in terms of support for small sample learning, application of data augmentation technology, precision of threshold optimization, and false detection rate when dealing with complex scenarios. Summary of the invention

[0026] In view of the defects of the prior art, the present invention provides a data enhancement method based on small sample learning and a threshold loss optimization method of learnable parameters, which can effectively solve the above problems.

[0027] The technical solution adopted by the present invention is as follows:

[0028] The present invention provides a method for optimizing the threshold loss of data enhancement and learnable parameters based on small sample learning, comprising the following steps:

[0029] Step S1, establish an actual background image sample library G and a small sample image sample library S; the actual background image sample library G stores multiple actual background images, each actual background image is represented by G i ; The small sample image sample library S stores multiple small sample images, each small sample image is represented by S j ;

[0030] Step S2, traverse the small sample image sample library S, for each small sample image S traversed j Based on the actual background image in the actual background image sample library G, the small sample image S j Perform offline enhancement of the actual background image in one stage and expand the small sample image S j , we get a sample image F after offline enhancement of the actual background image in one stage, and its label is label(F);

[0031] Step S3, traverse the small sample image sample library S, for each small sample image S traversed j , perform one-stage offline enhancement of the pure color background image, and expand the small sample image S j , we get a sample image I after offline enhancement of a pure color background image, whose label is label(I);

[0032] Step S4, using formula (1) to perform two-stage fusion enhancement on sample graph F and sample graph I, and obtain the fusion-enhanced sample graph Mix, whose label is label (Mix):

[0033] Mix=λ·F+(1-λ)·I (1)

[0034] lable(Mix)=λ·lable(F)+(1-λ)·lable(I)

[0035] Where λ is the mixing coefficient of random sampling in Beta distribution;

[0036] Step S5, through steps S2 to S4, a training sample set consisting of a plurality of sample images F, sample images I and sample images Mix is ​​obtained;

[0037] Step S6, establishing a deep learning neural network model; the deep learning neural network model has a learnable parameter p;

[0038] Step S7, using the training sample set to train the deep learning neural network model to obtain a trained deep learning neural network model, the specific training method is:

[0039] Step S7.1, initialize the learnable parameter p to the unit matrix; the sample graph F, the sample graph I and the sample graph Mix have initial strengths respectively;

[0040] Step S7.2, the initial value of the iteration number t is 1;

[0041] Step S7.3, using the online data enhancement module, according to formula (2), the sample graph F, the sample graph I and the sample graph Mix are processed online to obtain the processed sample graph F, the sample graph I and the sample graph Mix, the method is:

[0042]

[0043] in:

[0044] A t is the online data enhancement intensity of the sample graph in the tth round of training;

[0045] A0 is the initial intensity of the sample image;

[0046] t is the current iteration number;

[0047] T is the total number of iterations;

[0048] η t is the learning rate of the tth round of training;

[0049] η0 is the initial learning rate;

[0050] p t is the learnable parameter value of the tth round of training;

[0051] Step S7.4, inputting the sample graph F, sample graph I and sample graph Mix processed in step S7.3 into the deep learning neural network model for training;

[0052] Step S7.5, let t=t+1, return to step S7.3, and continue iterating the training until the training termination condition is reached.

[0053] Preferably, in step S2, the small sample image S j Perform a stage of offline enhancement of the actual background image, specifically:

[0054] Step S2.1, randomly select an actual background image G from the actual background image sample library G i ;

[0055] Step S2.2: the actual background image G i Convert to RGBA format to get the actual background image G i (1) and read the actual background image G i (1) Size;

[0056] Step S2.3, small sample image S j With label lable(S j ), the small sample graph S j Convert to RGBA format to get a small sample image S j (1) and read the small sample image S j (1) Size;

[0057] Comparison of small sample S j (1) Size and actual background image G i (1) size, so that in the actual background image G i (1), determining the transformable region;

[0058] Step S2.4, convert the small sample image S j (1) Convert it into array form, use image transformation method to change the image scale and enhance the image, and obtain the processed small sample image S in array formj (1);

[0059] Step S2.5, the processed small sample graph S in array form j (1), and then converted into a small sample image in the form of an RGBA image object, called a small sample image S j (2);

[0060] Step S2.6, actual background image G i The channel parameters of the alpha channel of (1) are used as fusion parameters, and the small sample image S j (2) and the actual background image G i (1) is fused to the transformable area, so that the actual background image G i (1) The transformable region is integrated into the small sample map S j (2) Obtain the fused sample graph F and calculate the fused sample graph S according to the small sample graph S. j Label(S j ), update the label of sample graph F, so that label label(F) of sample graph F is label label(S j );

[0061] Step S2.7, return to step S2.1, and randomly select the actual background image, and j Perform offline enhancement processing, repeat this process many times to achieve the small sample image S j Offline enhancement.

[0062] Preferably, step S2.4, using an image transformation method to perform image scale change and image enhancement processing is specifically as follows:

[0063] Use a random function to randomly determine the image scaling; for a small sample image S in array form j (1) Perform scale transformation and then perform random enhancement processing, including flipping, row and column swapping, grid distortion, elastic transformation, rotation, random gamma, image mean filtering, random brightness, and adding Gaussian noise processing.

[0064] Preferably, in step S3, the small sample image S j , perform a stage of offline enhancement of the pure color background image, specifically:

[0065] Step S3.1, randomly select an actual background image G from the actual background image sample library G i , read the actual background image G i (1) Size;

[0066] Step S3.2, based on the actual background image G i (1) size, initialize and generate a solid color background canvas of the same size;

[0067] Step S3.3, predefine multiple pure color background colors, including mainstream pure color background colors and random pure color background colors; randomly select a pure color background color and fill it into the pure color background canvas to generate a pure color background image B0 in RGBA format;

[0068] Step S3.4, small sample image S j With label lable(S j ), the small sample graph S j Convert to RGBA format to get a small sample image S j (1) and read the small sample image S j (1) Size;

[0069] Step S3.5, compare small sample graph S j (1) and the size of the solid color background image B0, thereby determining the transformable area in the solid color background image B0;

[0070] Step S3.6, convert the small sample image S j (1) Convert it into array form, use image transformation method to change the image scale and enhance the image, and obtain the processed small sample image S in array form j (1);

[0071] Step S3.7, the processed small sample graph S in array form j (1), and then converted into a small sample image in the form of an RGBA image object, called a small sample image S j (2);

[0072] Step S3.8, the channel parameter of the alpha channel of the pure color background image B0 is used as the fusion parameter, and the small sample image S j (2) The transformable area of ​​the pure color background image B0 is merged, so that the small sample image S is integrated into the transformable area of ​​the pure color background image B0. j (2) Obtain the fused sample graph I and calculate the fused sample graph S according to the small sample graph S. j Label(S j ), update the label of sample graph I, so that label label(I) of sample graph I is label label(S j );

[0073] Step S3.9, return to step S3.1, and repeat this process many times to achieve the goal of j Offline enhancement.

[0074] Preferably, in step S3.6, the image scale change and image enhancement processing using the image transformation method is specifically as follows:

[0075] Use a random function to randomly determine the image scaling; for a small sample image S in array form j (1) Perform scale transformation and then perform random enhancement processing. The specific method is as follows:

[0076] If the small sample graph S in array form j (1) For contour-sensitive samples, the color data is perturbed and the channels are shuffled;

[0077] If the small sample graph S in array form j (1) For color-sensitive samples, basic brightness contrast enhancement is performed, and rectangular area occlusion, center cropping, high-intensity grid distortion and elastic transformation processing are introduced.

[0078] Preferably, in step S7.4, the method for training the deep learning neural network model is:

[0079] Step S7.4.1, in each iteration, the training sample is input into the deep learning neural network model, and the deep learning neural network model outputs the model prediction result ModelOutput;

[0080] Step S7.4.2, calculate the confidence simulation value C of each training sample based on the model prediction result ModelOutput i ;

[0081] Step S7.4.3, calculating the proportion n0 of the number of training samples n0 whose confidence simulation value is greater than the set value k in the total number of training samples n, that is, (TH>k) / (TH>=0);

[0082] Step S7.4.4, calculate the initial penalty ratio PEN=1-n0 / n;

[0083] Step S7.4.5, calculate the final penalty value PEN loss =σ(obj_k·PEN·e p )

[0084] Where: obj_k is a constant coefficient of the scaling order of magnitude; p is a learnable parameter; σ represents the activation function;

[0085] Step S7.4.6, use the following formula to obtain the corrected confidence loss value OBJ loss :

[0086] OBJ loss =obj loss +PEN loss

[0087] Where: obj loss is the original confidence loss value; obtained by the target existence score;

[0088] Step S7.4.7, according to the corrected confidence loss value OBJ loss , adjust the parameters of the deep learning neural network model, including the learnable parameter p, so that the learnable parameter p is updated with the gradient, so that the deep learning neural network model is optimized towards the set expected threshold.

[0089] The data enhancement and learnable parameter threshold loss optimization method based on small sample learning provided by the present invention has the following advantages:

[0090] The present invention provides a method for data enhancement based on small sample learning and threshold loss optimization of learnable parameters. By combining the small sample two-stage data enhancement technology and the threshold loss optimization of learnable parameters, the present invention realizes a practical engineering innovation solution in the context of very few samples, greatly improves the model robustness and generalization ability in the relevant small sample field, and also improves the prediction accuracy of various categories and reduces the occurrence of false detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0091] Figure 1 A flowchart of a method for optimizing the threshold loss of data enhancement and learnable parameters based on small sample learning provided by the present invention. DETAILED DESCRIPTION

[0092] In order to make the technical problems, technical solutions and beneficial effects solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0093] In the field of small sample learning, data enhancement and loss function optimization are two key technical points, which are crucial to improving the performance of the model on a limited data set. The present invention provides a method for data enhancement and threshold loss optimization of learnable parameters based on small sample learning, which solves the shortcomings of the existing technology, such as strong data dependence, insufficient generalization ability, high false detection rate, single data enhancement means and high model training complexity:

[0094] Compared with traditional methods, the present invention has the following characteristics in terms of data enhancement for small sample learning and threshold loss optimization of learnable parameters:

[0095] 1. Data enhancement for small sample learning

[0096] (1) Data Dependency

[0097] Existing transfer learning methods strongly rely on the quality of pre-trained models and the diversity of source datasets. If the feature expression ability of the pre-trained model is insufficient or the data distribution of the source dataset is significantly different from that of the target task, the effect of transfer learning will be greatly reduced. The present invention introduces data enhancement technology to increase the diversity of training data and reduce the dependence on the source dataset.

[0098] The prior art relies on a large amount of labeled data. The prior art usually requires a large-scale labeled data set. In special fields such as medical diagnosis, safety testing and other testing fields, data collection becomes difficult, and samples may have various differences and are particularly widely distributed. The present invention aims to greatly reduce the demand for labeled data and better utilize very little labeled data through special data enhancement methods to reduce the dependence of special fields on large amounts of labeled data.

[0099] (2) Generalization ability

[0100] Traditional small sample learning methods often perform poorly when generalizing to new tasks. Although fine-tuning can improve the performance of the model to a certain extent, the generalization ability of the model is still limited when the distribution of the target dataset is significantly different from that of the training dataset. The present invention uses a threshold loss optimization method for learnable parameters to enable the model to better adapt to different data distributions during training, thereby improving generalization ability.

[0101] (3) False positive rate

[0102] The existing technology often faces the problem of high false positive rate when dealing with small sample target detection. This is because when data is scarce, it is difficult for the model to fully learn the features that distinguish the target from the background. The present invention introduces a threshold loss optimization method with learnable parameters and specially designs a new threshold loss function, which effectively reduces the false positive rate through the threshold penalty mechanism.

[0103] (4) Data enhancement methods

[0104] Traditional data enhancement methods are relatively limited, usually limited to geometric transformations of images, such as rotation, cropping, scaling, etc., and cannot fully capture the diversity of data. This paper designs a more effective two-stage data enhancement method, which more comprehensively expands the diversity of training data and enhances the robustness of the model.

[0105] (5) Model training complexity

[0106] The existing technology often requires a complex model fine-tuning process when performing small sample learning, which consumes a lot of time and computing resources. The present invention introduces a new threshold loss function and data enhancement method to improve model performance while simplifying the model training process and complexity.

[0107] In summary, the existing technology has the disadvantages of strong data dependence, insufficient generalization ability, high false positive rate, single data enhancement means and high model training complexity. The present invention provides an effective solution to these shortcomings by proposing a data enhancement method based on small sample learning and a threshold loss optimization method for learnable parameters, which reduces the dependence on a large amount of data in a specific field, enhances the generalization ability of the model and reduces the false positive rate, significantly improving the performance and robustness of the model, thereby making it more practical and competitive in engineering in special fields.

[0108] (II) Threshold loss optimization of learnable parameters

[0109] (1) Support for small sample learning:

[0110] Existing adaptive threshold optimization methods usually rely on a large amount of data for threshold adjustment and model training. When data is scarce, these methods are difficult to fully exert their effectiveness, resulting in poor generalization ability of the model. The present invention effectively expands the diversity of training data by combining the data enhancement method of small sample learning, and significantly improves the learning effect under small sample conditions.

[0111] (2) Data enhancement methods:

[0112] Traditional adaptive threshold optimization methods have limited means of data enhancement, mainly relying on simple image transformations (such as rotation, cropping, scaling, etc.), and cannot fully utilize data enhancement techniques to increase the diversity and quantity of training data. The present invention designs a dedicated data enhancement technique to make the generated data more diverse and rich, thereby further improving the robustness of the model.

[0113] (3) The precision of threshold optimization:

[0114] The threshold optimization mechanism of the prior art is relatively simple, usually simply adding a threshold item, lacking fine-tuning for different samples and tasks. This method has limited effect when processing complex and diverse data. The present invention introduces a threshold loss optimization method with learnable parameters to make threshold adjustment more flexible and accurate, and can better adapt to the characteristics of different samples. The model layer of the present invention adds a non-zero parameter, which participates in both loss function adjustment and model training, allowing the model to learn the data distribution under the new threshold loss.

[0115] (4) False positive rate:

[0116] Existing technologies often face high false positive rate problems when dealing with target detection tasks, especially in multi-scale scenes and complex backgrounds. This is because traditional methods lack a targeted penalty mechanism when optimizing thresholds, making it difficult to effectively distinguish between targets and non-targets. The present invention significantly reduces the false positive rate and improves the accuracy of detection by designing a new threshold loss function and introducing a threshold penalty mechanism.

[0117] (5) Model training complexity

[0118] Adaptive threshold optimization methods usually involve complex calculation processes and require a lot of computing resources and time for parameter optimization, which may become a bottleneck in practical applications. The present invention fully considers the efficiency of training in its design. By combining the optimization algorithm and data enhancement technology, only one learnable parameter is added to the final output of the model to dynamically adjust the threshold loss function and the weight distribution of the model. There is no additional complex calculation, and the impact on the speed and efficiency of training and reasoning is almost negligible.

[0119] In summary, the prior art has significant deficiencies in terms of support for small sample learning, data enhancement methods, precision of threshold optimization, false positive rate, and training complexity. The present invention effectively overcomes these shortcomings by proposing a method for optimizing the threshold loss of learnable parameters combined with data enhancement for small sample learning, thereby improving the performance and practicality of the model. The present invention can effectively reduce the dependence on a large amount of data in a specific field, enhance the generalization ability of the model, and reduce the false positive rate, thereby making it more practical and competitive in engineering in special fields.

[0120] The key technical solutions of the present invention include small sample data enhancement technology and threshold loss optimization method of learnable parameters. These technical solutions will cooperate with each other in the multi-scale object detection framework to achieve better performance and generalization ability.

[0121] See also Figure 1 The data enhancement method based on small sample learning and the threshold loss optimization method of learnable parameters provided by the present invention include the following steps:

[0122] Step S1, establish an actual background image sample library G and a small sample image sample library S; the actual background image sample library G stores multiple actual background images, each actual background image is represented by G i ; The small sample image sample library S stores multiple small sample images, each small sample image is represented by S j ; Among them, the number of small sample images stored in the small sample image sample library S is much less than the number of actual background images stored in the actual background image sample library G.

[0123] Step S2, traverse the small sample image sample library S, for each small sample image S traversed jBased on the actual background image in the actual background image sample library G, the small sample image S j Perform offline enhancement of the actual background image in one stage and expand the small sample image S j , we get a sample image F after offline enhancement of the actual background image in one stage, and its label is label(F);

[0124] In step S2, the small sample image S j Perform a stage of offline enhancement of the actual background image, specifically:

[0125] Step S2.1, randomly select an actual background image G from the actual background image sample library G i ;

[0126] Step S2.2: the actual background image G i Convert to RGBA format to get the actual background image G i (1) and read the actual background image G i (1) Size;

[0127] Step S2.3, small sample image S j With label lable(S j ), the small sample graph S j Convert to RGBA format to get a small sample image S j (1) and read the small sample image S j (1) Size;

[0128] Comparison of small sample S j (1) Size and actual background image G i (1) size, so that in the actual background image G i (1), determining the transformable region;

[0129] Step S2.4, convert the small sample image S j (1) Convert it into array form, use image transformation method to change the image scale and enhance the image, and obtain the processed small sample image S in array form j (1);

[0130] Step S2.4, using the image transformation method to perform image scale change and image enhancement processing is specifically as follows:

[0131] Use a random function to randomly determine the image scaling; for a small sample image S in array form j (1) Perform scale transformation and then perform random enhancement processing, including flipping, row and column swapping, grid distortion, elastic transformation, rotation, random gamma, image mean filtering, random brightness, and adding Gaussian noise processing.

[0132] Step S2.5, the processed small sample graph S in array form j (1), and then converted into a small sample image in the form of an RGBA image object, called a small sample image S j (2);

[0133] Step S2.6, actual background image G i The channel parameters of the alpha channel of (1) are used as fusion parameters, and the small sample image S j (2) and the actual background image G i (1) is fused to the transformable area, so that the actual background image G i (1) The transformable region is integrated into the small sample map S j (2) Obtain the fused sample graph F and calculate the fused sample graph S according to the small sample graph S. j Label(S j ), update the label of sample graph F, so that label label(F) of sample graph F is label label(S j ), the label can include information such as scale, location, category, etc.

[0134] Step S2.7, return to step S2.1, and randomly select the actual background image, and j Perform offline enhancement processing, repeat this process many times to achieve the small sample image S j Offline enhancement.

[0135] Therefore, since the number of actual background images is much larger than the number of small sample images, each small sample image will be enhanced and fused multiple times.

[0136] Step S3, traverse the small sample image sample library S, for each small sample image S traversed j , perform one-stage offline enhancement of the pure color background image, and expand the small sample image S j , we get a sample image I after offline enhancement of a pure color background image, whose label is label(I);

[0137] In step S3, the small sample image S j , perform a stage of offline enhancement of the pure color background image, specifically:

[0138] Step S3.1, randomly select an actual background image G from the actual background image sample library G i , read the actual background image G i (1) Size;

[0139] Step S3.2, based on the actual background image G i (1) size, initialize and generate a solid color background canvas of the same size;

[0140] Step S3.3, predefine multiple pure color background colors, including mainstream pure color background colors and random pure color background colors; randomly select a pure color background color and fill it into the pure color background canvas to generate a pure color background image B0 in RGBA format;

[0141] Step S3.4, small sample image S j With label lable(S j ), the small sample graph S j Convert to RGBA format to get a small sample image S j (1) and read the small sample image S j (1) Size;

[0142] Step S3.5, compare small sample graph S j (1) and the size of the solid color background image B0, thereby determining the transformable area in the solid color background image B0;

[0143] Step S3.6, convert the small sample image S j (1) Convert it into array form, use image transformation method to change the image scale and enhance the image, and obtain the processed small sample image S in array form j (1);

[0144] Step S3.6, using the image transformation method to perform image scale change and image enhancement processing is specifically as follows:

[0145] Use a random function to randomly determine the image scaling; for a small sample image S in array form j (1) Perform scale transformation and then perform random enhancement processing. The specific method is as follows:

[0146] If the small sample graph S in array form j (1) For contour-sensitive samples, the color data is subjected to color perturbation and channel shuffling processing; for contour-sensitive samples, the one-stage actual background image offline enhancement method in step S2 of the present invention can be added at the same time to perform one-stage actual background image offline enhancement. Channel shuffling processing is to perform fusion between channels.

[0147] If the small sample graph S in array form j (1) For color-sensitive samples, basic brightness contrast enhancement is performed, and rectangular area occlusion, center cropping, high-intensity grid distortion and elastic transformation processing are introduced.

[0148] Therefore, in the present invention, different methods of data enhancement processing are performed on the contour-sensitive small sample image and the color-sensitive small sample image.

[0149] Step S3.7, the processed small sample graph S in array form j(1), and then converted into a small sample image in the form of an RGBA image object, called a small sample image S j (2);

[0150] Step S3.8, the channel parameter of the alpha channel of the pure color background image B0 is used as the fusion parameter, and the small sample image S j (2) The transformable area of ​​the pure color background image B0 is merged, so that the small sample image S is integrated into the transformable area of ​​the pure color background image B0. j (2) Obtain the fused sample graph I and calculate the fused sample graph S according to the small sample graph S. j Label(S j ), update the label of sample graph I, so that label label(I) of sample graph I is label label(S j );

[0151] Step S3.9, return to step S3.1, and repeat this process many times to achieve the goal of j Offline enhancement.

[0152] Through step S3, the pure color background replaces the actual background, so the fused sample image has sample features different from those of the actual background image offline enhanced in the first stage.

[0153] Step S4, the sample images F and I are randomly enhanced in two stages with a probability of 0.5. Specifically, formula (1) is used to perform two-stage fusion enhancement to obtain the fusion-enhanced sample image Mix, whose label is label (Mix):

[0154] Mix=λ·F+(1-λ)·I (1)

[0155] lable(Mix)=λ·lable(F)+(1-λ)·lable(I)

[0156] Here, λ is the mixing coefficient of random sampling in Beta distribution, for example, λ may be 0.2.

[0157] Step S5, through steps S2 to S4, a training sample set formed by multiple sample images F, sample images I and sample images Mix is ​​obtained; as a specific application, sample images F and sample images I account for 50% of the total number of samples, and sample images Mix accounts for 50% of the total number of samples.

[0158] Step S6, establishing a deep learning neural network model; the deep learning neural network model has a learnable parameter p;

[0159] As a specific application, the deep learning neural network model constructed by the present invention is expressed as:

[0160] F(x)=M0·Mout ·e p

[0161] Among them: M0 is the main structure of the model; M out is the output layer of the model; p is a learnable parameter; in the present invention, e is used p The form of can prevent the learnable parameter p from becoming negative during automatic update, which will lead to abnormal penalty value of the additional loss function.

[0162] Step S7, using the training sample set to train the deep learning neural network model to obtain a trained deep learning neural network model, the specific training method is:

[0163] Step S7.1, initialize the learnable parameter p to the unit matrix; the sample graph F, the sample graph I and the sample graph Mix have initial strengths respectively;

[0164] Step S7.2, the initial value of the iteration number t is 1;

[0165] Step S7.3, using the online data enhancement module, according to formula (2), the sample graph F, the sample graph I and the sample graph Mix are processed online to obtain the processed sample graph F, the sample graph I and the sample graph Mix, the method is:

[0166]

[0167] in:

[0168] A t is the online data enhancement intensity of the sample graph in the tth round of training;

[0169] A0 is the initial intensity of the sample image;

[0170] t is the current iteration number;

[0171] T is the total number of iterations;

[0172] η t is the learning rate of the tth round of training;

[0173] η0 is the initial learning rate;

[0174] p y is the learnable parameter value of the tth round of training;

[0175] It can be seen that the present invention provides an online data enhancement method. During the model training process, online data enhancement attenuation is introduced, and sample image F, sample image I and sample image Mix enter the same online data enhancement module, and the intensity of data enhancement changes with the iteration of the model and the change of related parameters.

[0176] Step S7.4, inputting the sample graph F, sample graph I and sample graph Mix processed in step S7.3 into the deep learning neural network model for training;

[0177] Step S7.4, the method for training the deep learning neural network model is:

[0178] Step S7.4.1, in each iteration, the training sample is input into the deep learning neural network model, and the deep learning neural network model outputs the model prediction result ModelOutput;

[0179] Step S7.4.2, calculate the confidence simulation value C of each training sample based on the model prediction result ModelOutput i , the specific calculation method is:

[0180] Define the sigmoid function:

[0181]

[0182] Therefore, the confidence simulation value Among them, c i is the original confidence value of each training sample;

[0183] Step S7.4.3, calculating the proportion n0 of the number of training samples n0 whose confidence simulation value is greater than the set value k in the total number of training samples n, that is, (TH>k) / (TH>=0);

[0184] Step S7.4.4, calculate the initial penalty ratio PEN=1-n0 / n;

[0185] Specifically,

[0186] t mask =C i >k

[0187] F mask =C i

[0188]

[0189] Where: T mask is the mask whose confidence simulation value of the sample is greater than the set value k, F mask is the mask of all samples, T count It is T mask The number of masks, F count Yes F mask Finally, the initial penalty ratio PEN is obtained.

[0190] Step S7.4.5, calculate the final penalty value PEN loss=σ(obj_k·PEN·e p )

[0191] Where: obj_k is a constant coefficient of the scaling order of magnitude; p is a learnable parameter; σ represents the activation function;

[0192] In this step, due to the PEN·e p Compared with the original confidence loss value, it is still too large, which is not conducive to the rapid and stable convergence of the model. Therefore, the present invention multiplies a scaling factor obj_k to scale this auxiliary confidence penalty loss value to the same order of magnitude as the original confidence loss value.

[0193] Step S7.4.6, use the following formula to obtain the corrected confidence loss value OBJ loss :

[0194] OBJ loss =obj loss +PEN loss

[0195] Where: obj loss is the original confidence loss value; obtained by the target existence score;

[0196] Therefore, through this step, the original confidence loss value obj loss Add to penalty value PEN loss , get the corrected confidence loss value OBJ loss , through the corrected confidence loss value OBJ loss Adjust the parameters of the deep learning neural network model. Since the learnable parameter p will be updated with the gradient, the model will be optimized towards the set expected threshold, and finally a new model with extremely low false positive rate under the limited threshold will be obtained.

[0197] Step S7.4.7, according to the corrected confidence loss value OBJ loss , adjust the parameters of the deep learning neural network model, including the learnable parameter p, so that the learnable parameter p is updated with the gradient, so that the deep learning neural network model is optimized towards the set expected threshold.

[0198] Step S7.5, let t=t+1, return to step S7.3, and continue iterating the training until the training termination condition is reached.

[0199] In the present invention, during model training, the learnable parameter p is updated, thereby affecting the output of the model and automatically generalizing the model to the desired range. In the training optimizer, the learnable parameter p is added to the gradient update so that the model automatically updates this parameter during the training process.

[0200] The present invention provides a data enhancement method based on small sample learning and a threshold loss optimization method for learnable parameters, which has the following innovations:

[0201] 1. Small sample data enhancement technology:

[0202] Through the two-stage data enhancement method, the diversity of limited sample data is expanded, including the enhancement of small sample data itself and the enhancement after background fusion, which significantly reduces the dependence on large amounts of data and improves the generalization ability of the model.

[0203] 2. Threshold loss optimization method for learnable parameters:

[0204] The learnable penalty_factor parameter is introduced and automatically adjusted during the model training process. By penalizing the confidence loss of the model output, the performance of the model under the set threshold is optimized and false detection is reduced. At the same time, this parameter can also act on the actual output of the model to dynamically adjust the output representation of the model, further improving the reliability, practicality and engineering value of the model.

[0205] The present invention provides a method for data enhancement based on small sample learning and threshold loss optimization of learnable parameters. By combining the small sample two-stage data enhancement technology and the threshold loss optimization of learnable parameters, the present invention realizes a practical engineering innovation solution in the context of very few samples, greatly improving the model robustness and generalization ability in the relevant small sample field, while also improving the prediction accuracy of various categories and reducing the occurrence of false positives. Compared with traditional methods, the present invention not only achieves significant improvement in model performance, but also achieves outstanding results in reducing the false positive rate, bringing important technical innovation and practical application prospects to the field of small sample data processing.

[0206] The technical solution of the present invention brings about many beneficial effects, solves the problem of relying on a large amount of data in a specific field, enhances the generalization ability of the model and reduces the false detection rate, and brings important technical innovation and practical application prospects to the field of small sample data processing. The following is a detailed description of the beneficial effects brought about by the present invention:

[0207] 1. Reduce data dependency:

[0208] Traditional methods are highly dependent on large amounts of data, but the small sample data enhancement technology used in this invention significantly reduces the need for large amounts of data by expanding the diversity of limited sample data. This enables effective models to be built even when data is scarce, reducing the cost of data collection and annotation.

[0209] 2. Reduce false detection rate:

[0210] By adopting the threshold loss optimization method of learnable parameters, the present invention enables the model to be optimized according to the set expected threshold during the training process, limiting the occurrence of false positives. By penalizing the confidence loss of the model output, false positives in real scenarios are effectively reduced, and the reliability and practicality of the model are improved.

[0211] 3. Reduce the difficulty of model training:

[0212] The technical solution of the present invention has brought significant results in reducing the difficulty of model training. In traditional methods, training for small sample data usually requires a more complex model architecture or more training resources to obtain satisfactory performance. The small sample data enhancement technology and threshold loss optimization method of learnable parameters adopted in the present invention greatly simplify the model training process and provide a more convenient and efficient solution for engineering practice.

[0213] 4. Improve model robustness:

[0214] The technical solution of the present invention is not only applicable to small sample data processing, but also enhances the model's adaptability to various complex situations and scenarios. This enhanced robustness enables the model to better cope with data noise, interference and changes, and maintain stable performance.

[0215] 5. Improve forecast accuracy:

[0216] By effectively enhancing small sample data and optimizing model parameters, the present invention significantly improves the prediction accuracy of the model, which is crucial for engineering deployment of tasks such as target detection and image classification, and can provide more reliable results for practical applications.

[0217] In summary, the technical solution of the present invention not only plays a significant role in solving technical problems in specific fields, but also brings important engineering use value in improving model performance, reducing costs, and improving reliability.

[0218] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be considered as the scope of protection of the present invention.

Claims

1. A method for data enhancement based on small sample learning and threshold loss optimization of learnable parameters, characterized in that: The following steps are involved: Step S1, establish an actual background image sample library G and a small sample image sample library S; the actual background image sample library G stores multiple actual background images, each actual background image is represented by G i The small sample image sample library S stores multiple small sample images, each of which is represented by S j ; Step S2, traverse the small sample image sample library S, for each small sample image S traversed j Based on the actual background image in the actual background image sample library G, the small sample image S j Perform offline enhancement of the actual background image in one stage and expand the small sample image S j , we get a sample image F after offline enhancement of the actual background image in one stage, and its label is label(F); Step S3, traverse the small sample image sample library S, for each small sample image S traversed j , perform one-stage offline enhancement of pure color background image, and expand small sample image S j , we get a sample image I after offline enhancement of a pure color background image, whose label is label(I); Step S4, using formula (1) to perform two-stage fusion enhancement on sample graph F and sample graph I, and obtain the fusion-enhanced sample graph Mix, whose label is label (Mix): Mix=λ·F+(1-λ)·I (1) lable(Mix)=λ·lable(F)+(1-λ)·lable(I) Where λ is the mixing coefficient of random sampling in Beta distribution; Step S5, through steps S2 to S4, a training sample set consisting of a plurality of sample images F, sample images I and sample images Mix is ​​obtained; Step S6, establishing a deep learning neural network model; the deep learning neural network model has a learnable parameter p; Step S7, using the training sample set to train the deep learning neural network model to obtain a trained deep learning neural network model, the specific training method is: Step S7.1, initialize the learnable parameter p to the unit matrix; the sample graph F, the sample graph I and the sample graph Mix have initial strengths respectively; Step S7.2, the initial value of the iteration number t is 1; Step S7.3, using the online data enhancement module, according to formula (2), the sample graph F, the sample graph I and the sample graph Mix are processed online to obtain the processed sample graph F, the sample graph I and the sample graph Mix, the method is: in: A t is the online data enhancement intensity of the sample graph in the tth round of training; A0 is the initial intensity of the sample image; t is the current iteration number; T is the total number of iterations; η t is the learning rate of the tth round of training; η0 is the initial learning rate; p y is the learnable parameter value of the tth round of training; Step S7.4, inputting the sample graph F, sample graph I and sample graph Mix processed in step S7.3 into the deep learning neural network model for training; Step S7.5, let t=t+1, return to step S7.3, and continue iterating the training until the training termination condition is reached.

2. According to claim 1, a method for data enhancement based on small sample learning and threshold loss optimization of learnable parameters is characterized in that: In step S2, the small sample image S j Perform a stage of offline enhancement of the actual background image, specifically: Step S2.1, randomly select an actual background image G from the actual background image sample library G i ; Step S2.2: the actual background image G i Convert to RGBA format to get the actual background image G i (1) and read the actual background image G i (1) Size; Step S2.3, small sample image S j With label lable(S j ), the small sample graph S j Convert to RGBA format to get a small sample image S j (1) and read the small sample image S j (1) Size; Comparison of small sample S j (1) Size and actual background image G i (1) size, so that in the actual background image G i (1), determining the transformable region; Step S2.4, convert the small sample image S j (1) Convert it into array form, use image transformation method to change the image scale and enhance the image, and obtain the processed small sample image S in array form j (1); Step S2.5, the processed small sample graph S in array form j (1), and then converted into a small sample image in the form of an RGBA image object, called a small sample image S j (2); Step S2.6, actual background image G i The channel parameters of the alpha channel of (1) are used as fusion parameters, and the small sample image S j (2) and the actual background image G i (1) is fused to the transformable area, so that the actual background image G i (1) The transformable region is integrated into the small sample map S j (2) Obtain the fused sample graph F and calculate the fused sample graph S according to the small sample graph S. j Label(S j ), update the label of sample graph F, so that label label(F) of sample graph F is label label(S j ); Step S2.7, return to step S2.1, and randomly select the actual background image, and j Perform offline enhancement processing, repeat this process many times to achieve the small sample image S j Offline enhancement.

3. The method for optimizing the threshold loss of learnable parameters based on data enhancement and learning with small sample size according to claim 2, characterized in that: Step S2.4, using the image transformation method to perform image scale change and image enhancement processing is specifically as follows: Use a random function to randomly determine the image scaling; for a small sample image S in array form j (1) Perform scale transformation and then perform random enhancement processing, including flipping, row and column swapping, grid distortion, elastic transformation, rotation, random gamma, image mean filtering, random brightness, and adding Gaussian noise processing.

4. The method of data enhancement based on small sample learning and threshold loss optimization of learnable parameters according to claim 1, characterized in that: In step S3, the small sample image S j , perform a stage of offline enhancement of the pure color background image, specifically: Step S3.1, randomly select an actual background image G from the actual background image sample library G i , read the actual background image G i (1) Size; Step S3.2, based on the actual background image G i (1) size, initialize and generate a solid color background canvas of the same size; Step S3.3, predefine multiple pure color background colors, including mainstream pure color background colors and random pure color background colors; randomly select a pure color background color and fill it into the pure color background canvas to generate a pure color background image B0 in RGBA format; Step S3.4, small sample image S j With label lable(S j ), the small sample graph S j Convert to RGBA format to get a small sample image S j (1) and read the small sample image S j (1) Size; Step S3.5, compare small sample graph S j (1) and the size of the solid color background image B0, thereby determining the transformable area in the solid color background image B0; Step S3.6, convert the small sample image S j (1) Convert it into array form, use image transformation method to change the image scale and enhance the image, and obtain the processed small sample image S in array form j (1); Step S3.7, the processed small sample graph S in array form j (1), and then converted into a small sample image in the form of an RGBA image object, called a small sample image S j (2); Step S3.8, the channel parameter of the alpha channel of the pure color background image B0 is used as the fusion parameter, and the small sample image S j (2) The transformable area of ​​the pure color background image B0 is merged, so that the small sample image S is integrated into the transformable area of ​​the pure color background image B0. j (2) Obtain the fused sample graph I and calculate the fused sample graph S according to the small sample graph S. j Label(S j ), update the label of sample graph I, so that label label(I) of sample graph I is label label(S j ); Step S3.9, return to step S3.1, and repeat this process many times to achieve the goal of j Offline enhancement.

5. According to claim 4, a method for optimizing the threshold loss of data enhancement and learnable parameters based on small sample learning, characterized in that: Step S3.6, using the image transformation method to perform image scale change and image enhancement processing is specifically as follows: Use a random function to randomly determine the image scaling; for a small sample image S in array form j (1) Perform scale transformation and then perform random enhancement processing. The specific method is as follows: If the small sample graph S in array form j (1) For contour-sensitive samples, the color data is perturbed and the channels are shuffled; If the small sample graph S in array form j (1) For color-sensitive samples, basic brightness contrast enhancement is performed, and rectangular area occlusion, center cropping, high-intensity grid distortion and elastic transformation processing are introduced.

6. The method of data enhancement based on small sample learning and threshold loss optimization of learnable parameters according to claim 1, characterized in that: Step S7.4, the method for training the deep learning neural network model is: Step S7.4.1, in each iteration, the training sample is input into the deep learning neural network model, and the deep learning neural network model outputs the model prediction result ModelOutput; Step S7.4.2, calculate the confidence simulation value C of each training sample based on the model prediction result ModelOutput i ; Step S7.4.3, calculating the proportion n0 of the number of training samples n0 whose confidence simulation value is greater than the set value k in the total number of training samples n, that is, (TH>k) / (TH>=0); Step S7.4.4, calculate the initial penalty ratio PEN=1-n0 / n; Step S7.4.5, calculate the final penalty value PEN loss =σ(obj_k·PEN·e p ) Where: obj_k is a constant coefficient of the scaling order of magnitude; p is a learnable parameter; σ represents the activation function; Step S7.4.6, use the following formula to obtain the corrected confidence loss value OBJ loss : OBJ loss obj loss +PEN loss Where: obj loss is the original confidence loss value; obtained by the target existence score; Step S7.4.7, according to the corrected confidence loss value OBJ loss , adjust the parameters of the deep learning neural network model, including the learnable parameter p, so that the learnable parameter p is updated with the gradient, so that the deep learning neural network model is optimized towards the set expected threshold.

Citation Information

Patent Citations

  • Incremental learning method and system based on small number of labeled samples

    CN112132179A

  • Remote sensing image small sample scene classification method based on multi-task dynamic contrast learning

    CN114913379A

  • Medical image classification method based on small sample meta learning

    CN116503668A

  • Small sample image classification optimization method based on supervised comparative learning and multi-task setting

    CN116524242A

  • Remote sensing image cross-domain small sample classification method based on confidence coefficient dynamic learning

    CN117152606A

Cited By

  • Ancient book paper fiber image classification method based on deep learning and electronic equipment

    CN119360145A