CN-116310714-B - Small sample image recognition method based on double-gradient reinforced contrast learning
Abstract
The invention discloses a small sample image recognition method based on dual-gradient reinforcement contrast learning, which comprises the steps of obtaining an image to be recognized, performing data enhancement processing to obtain a dual-view sample and a mixed sample, inputting the dual-view sample and the mixed sample into a deep neural network model for gradient training to construct a minimized global contrast loss function, performing gradient return correction processing on a full-connection layer of the deep neural network model based on the global contrast loss function to construct a corrected deep neural network model, and performing image recognition processing based on the corrected deep neural network model to obtain an image recognition result. By using the method and the device, the identification precision of the deep neural network model to the image can be improved while the manual labeling cost of the data sample is reduced. The small sample image recognition method based on double-gradient reinforcement contrast learning can be widely applied to the technical field of image recognition based on a neural network.
Inventors
- LI HONGXI
- ZHU WENBO
- LI AIYUAN
- ZHU ZHEN
- CHEN JIANWEN
- WANG XIUCAI
Assignees
- 佛山科学技术学院
Dates
- Publication Date
- 20260512
- Application Date
- 20230222
Claims (6)
- 1. The small sample image recognition method based on double-gradient reinforcement contrast learning is characterized by comprising the following steps of: Acquiring an image to be identified and performing data enhancement processing to obtain a double-view sample and a mixed sample; The double-view sample is obtained by linearly combining a positive sample pair sample formed after two times of random data enhancement according to different mixing proportion coefficients based on the double-view sample; ; ; In the above-mentioned method, the step of, A hybrid sample is represented and the sample is mixed, A two-view sample is represented and, Representing the similarity between the mixed sample and the original sample, 、 Representing the half-partitioned data; Inputting the dual-view sample and the mixed sample into a deep neural network model, wherein the deep neural network model comprises a feature extractor, a projector and a full-connection layer, and the feature extractor comprises a convolution layer, a batch normalization layer, an activation function, a maximum pooling layer, a first residual block, a second residual block, a third residual block, a fourth residual block and an average pooling layer; the residual block comprises a downsampled residual structure and a skip residual structure; The downsampling residual structure comprises a convolution layer, a batch normalization layer, an equalization layer and an activation function; The method comprises the steps of performing feature dimension processing on image information of a processed double-view sample and a processed mixed sample based on a convolution layer and a batch normalization layer to obtain a corresponding multi-channel feature map; dividing, superposing and convoluting the multi-channel feature map based on the equidifferentiation layer to obtain a transformed dividing map; performing convolution fusion processing on the transformed segmentation graph to obtain a downsampled image result; performing feature extraction processing on the double-view sample and the mixed sample based on a feature extractor to obtain a double-view sample feature coding vector and a mixed sample feature coding vector; based on a projector, performing global contrast loss calculation processing on the double-view sample feature coding vector and the mixed sample feature coding vector to obtain linear similarity of the double-view sample and the mixed sample; Based on the full connection layer, the global contrast loss function is optimized by combining the linear similarity of the double-view sample and the mixed sample, and the minimized global contrast loss function is constructed; the expression of the minimized global contrast loss function is specifically as follows: ; In the above-mentioned method, the step of, Representing the calculation of a similarity loss function between the dual views, Representing the calculation of a similarity loss function of the blended sample with the original image and the blended sample with the dual view, Representing the sum of the two and providing the model as an objective function as a training constraint; performing gradient feedback correction processing on the full-connection layer of the deep neural network model based on the global contrast loss function, and constructing a corrected deep neural network model; And carrying out image recognition processing based on the corrected deep neural network model to obtain an image recognition result.
- 2. The method for identifying a small sample image based on dual gradient reinforcement contrast learning according to claim 1, wherein the step of obtaining the image to be identified and performing data enhancement processing to obtain a dual view sample and a mixed sample specifically comprises: Shooting an object to be identified through a camera to obtain an image to be identified; Reading the image to be identified through an OpenCV library function imread to obtain a read image; performing central clipping processing on the read image to obtain a clipped image; Carrying out random noise level, rotation, random clipping, color distortion and Gaussian blur processing on the clipped image to obtain a double-view sample; and selecting and processing the double-view samples and reconstructing data to construct a mixed sample.
- 3. The method for identifying a small sample image based on dual gradient reinforcement contrast learning according to claim 2, wherein the step of extracting features from the dual-view sample and the mixed sample by the feature extractor to obtain a feature encoding vector of the dual-view sample and a feature encoding vector of the mixed sample specifically comprises: Inputting the double-view samples and the mixed samples to a feature extractor, wherein the feature extractor comprises a convolution layer, a batch normalization layer, an activation function, a maximum pooling layer, a first residual block, a second residual block, a third residual block, a fourth residual block and an average pooling layer; Carrying out convolution treatment and pooling treatment on the double-view sample and the mixed sample based on the convolution layer, the batch normalization layer, the activation function and the maximum pooling layer respectively to obtain a treated double-view sample and a treated mixed sample; Performing identity mapping processing on the processed double-view sample and the processed mixed sample based on a residual block network to obtain a feature vector of the double-view sample and a feature vector of the mixed sample; The residual block network comprises a first residual block, a second residual block, a third residual block and a fourth residual block; and carrying out conversion treatment on the feature vector of the double-view sample and the feature vector of the mixed sample based on the average pooling layer to obtain a double-view sample feature coding vector and a mixed sample feature coding vector.
- 4. The method for identifying a small sample image based on dual gradient reinforcement contrast learning according to claim 3, wherein the step of performing identity mapping processing on the processed dual-view sample and the processed mixed sample based on the residual block network to obtain a feature vector of the dual-view sample and a feature vector of the mixed sample specifically comprises the following steps: The method comprises the steps that a processed double-view sample and a processed mixed sample are sequentially input into a first residual block, a second residual block, a third residual block and a fourth residual block in a residual block network, wherein the first residual block comprises a one-layer downsampling residual structure and two-layer jumping residual structures, the second residual block comprises a one-layer downsampling residual structure and three-layer jumping residual structures, the third residual block comprises a one-layer downsampling residual structure and five-layer jumping residual structures, and the fourth residual block comprises a one-layer downsampling residual structure and two-layer jumping residual structures.
- 5. The method for identifying a small sample image based on dual gradient reinforcement contrast learning according to claim 4, wherein the step of obtaining a transformed segmentation map by performing segmentation processing on the multi-channel feature map based on the equidifferentiation layer specifically comprises the following steps: Dividing the multi-channel feature map based on the equal differentiation layer to obtain a first division map, a second division map, a third division map and a fourth division map; performing non-transformation characteristic processing on the first segmentation map to obtain a transformed first segmentation map; performing convolution conversion processing on the second segmentation graph to obtain a transformed second segmentation graph; Superposing and convoluting the transformed second segmentation map and the third segmentation map to obtain a transformed third segmentation map; And performing superposition and convolution transformation processing on the transformed third segmentation map and the fourth segmentation map to obtain a transformed segmentation map.
- 6. The method for identifying a small sample image based on dual gradient reinforcement contrast learning according to claim 5, wherein the expression for minimizing the global contrast loss function is specifically as follows: ; ; In the above-mentioned method, the step of, Representing the similarity of the two-view samples, Representing the similarity of the mixed samples, The number of mixed samples is indicated and the number of samples is indicated, The representation is based on the characterization of the samples after scaling factor mixing of a batch of samples after data enhancement after encoder, when the feature vector A1+C1 is taken as In the time-course of which the first and second contact surfaces, Indicated is the fact that A1, Indicated is the fact that C1, Representing the temperature coefficient, facilitating the learning of the model to obtain a softer representation, The representation is based on the representation of the samples after the scaling factor mixing of a batch of samples after data enhancement, but with the scaling factor and The coefficient of (c) is added to 1, Representing the calculation of a similarity loss function between the dual views, Representing the calculation of the similarity sum between the blended sample and the original graph And (3) with The degree of similarity between the two, The sum of the two is represented and provided as an objective function to the model as a training constraint.
Description
Small sample image recognition method based on double-gradient reinforced contrast learning Technical Field The invention relates to the technical field of image recognition based on a neural network, in particular to a small sample image recognition method based on double-gradient reinforcement contrast learning. Background Because the external texture ambiguity of coal and gangue is extremely high, vision-based resolution is difficult, the normal gangue sorting industrial site still takes the manual knocking and vision as the main principle, and the prior art mainly comprises machine learning based on digital images, manual detection and deep learning technology; the method mainly comprises the steps of carrying out model training by setting the similarity degree between positive and negative samples under the condition of no label, enabling the internal characteristics of the model excavated samples to be coded into high-order characteristics which are enough to distinguish different objects, distinguishing similar images from different images under the condition of no label, aiming at the problems that the sample of the industrial site is difficult to acquire and has label errors, the contrast learning can avoid the problems, but the gradient dissipation model cannot obtain better fitting capacity, and the gradient learning method is unfavorable for optimizing the model after the gradient learning is lost. Disclosure of Invention In order to solve the technical problems, the invention aims to provide a small sample image recognition method based on double-gradient reinforcement contrast learning, which can reduce the cost of manually marking a data sample and improve the recognition accuracy of a deep neural network model on an image. The first technical scheme adopted by the invention is that the small sample image recognition method based on double-gradient reinforcement contrast learning comprises the following steps: Acquiring an image to be identified and performing data enhancement processing to obtain a double-view sample and a mixed sample; Inputting the double-view sample and the mixed sample into a deep neural network model for gradient training, and constructing a minimized global contrast loss function; performing gradient feedback correction processing on the full-connection layer of the deep neural network model based on the global contrast loss function, and constructing a corrected deep neural network model; And carrying out image recognition processing based on the corrected deep neural network model to obtain an image recognition result. Further, the step of obtaining the image to be identified and performing data enhancement processing to obtain a dual-view sample and a mixed sample specifically includes: Shooting an object to be identified through a camera to obtain an image to be identified; Reading the image to be identified through an OpenCV library function imread to obtain a read image; performing central clipping processing on the read image to obtain a clipped image; Carrying out random noise level, rotation, random clipping, color distortion and Gaussian blur processing on the clipped image to obtain a double-view sample; and selecting and processing the double-view samples and reconstructing data to construct a mixed sample. Further, the step of inputting the dual-view sample and the mixed sample into the deep neural network model for gradient training and constructing the minimized global contrast loss function specifically comprises the following steps: inputting the dual-view sample and the mixed sample into a deep neural network model, wherein the deep neural network model comprises a feature extractor, a projector and a full connection layer; performing feature extraction processing on the double-view sample and the mixed sample based on a feature extractor to obtain a double-view sample feature coding vector and a mixed sample feature coding vector; based on a projector, performing global contrast loss calculation processing on the double-view sample feature coding vector and the mixed sample feature coding vector to obtain linear similarity of the double-view sample and the mixed sample; Based on the full connection layer, the global contrast loss function is optimized by combining the linear similarity of the double-view sample and the mixed sample, and the minimized global contrast loss function is constructed. Further, the step of performing feature extraction processing on the dual-view sample and the mixed sample based on the feature extractor to obtain a dual-view sample feature code vector and a mixed sample feature code vector specifically includes: Inputting the double-view samples and the mixed samples to a feature extractor, wherein the feature extractor comprises a convolution layer, a batch normalization layer, an activation function, a maximum pooling layer, a first residual block, a second residual block, a third residual block, a fourth residual block