A fine-grained image classification method based on deep semi-supervised model
Through deep semi-supervised models and super-pixel segmentation technology, fine-grained features of image areas are extracted, combined with semi-supervised neural networks and Beta distribution regularization terms, to solve the problems of poor interpretability of deep models and dependence on labeled data, and achieve fine-grained classification of images. Accuracy improvements and data utilization efficiency.
Patent Information
- Application Number
- CN202210787416.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-05
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-07-05
AI Technical Summary
Existing deep models have difficulty interpreting their prediction results in image classification and rely on a large amount of labeled data. Especially in fine-grained image classification, uneven distances between categories make classification decisions difficult, and unlabeled data cannot be effectively utilized.
A deep semi-supervised model is used to extract regional fine-grained features through super-pixel segmentation, combined with a semi-supervised neural network and Beta distribution regularization term, a small amount of labeled data is used to train the model, and the model is optimized through the alignment probability distribution method and loss function to achieve image Fine-grained classification.
It achieves accurate fine-grained classification of images, improves classification accuracy, effectively utilizes unlabeled data, reduces dependence on a large amount of labeled data, and enhances the generalization ability of the model.
Smart Images

Figure CN115035302B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image analysis, and in particular relates to a fine-grained image classification method based on a deep semi-supervised model. Background Art
[0002] Deep models have been very successful in vision, but their results are often difficult to interpret. While there are many ways to interpret a model, one approach is to segment meaningful local regions of an object to explain the model's predictions (for example, the eyes, mouth, cheeks, forehead, and neck of a human face) and further identify the contribution of these local regions to the decision (for example, the mouth region is more important in distinguishing whether a face is smiling). How can we design an interpretable deep model that learns to discover local regions of an object and estimate their importance for visual recognition? A simple prior assumption can be made: human faces appear in most face recognition images, but are unlikely to appear in most bird images. This prior assumption can be characterized by the local regions following a Beta distribution. This distribution can explain the importance of different local regions to the model's predictions and provide information about regions that are consistent with the predictions. Therefore, incorporating this prior assumption into the model training process as a regularization term can effectively improve model classification performance.
[0003] In addition, during the model training process, scholars have attempted to use both labeled and unlabeled data to optimize the model, and proposed a classification model training method for semi-supervised learning. Today, accurate image deep learning classification models rely heavily on a large number of labeled training samples, but in practical applications, a large number of accurately labeled multi-classification labeled training samples are often the bottleneck of such problems. Moreover, for fine-grained image classification, many image analysis applications often face the serious problem of larger distances between large categories and smaller distances between small categories. In short, the more similar the image categories, the smaller the differences between them, making accurate multi-classification decisions more difficult. Under the above unavoidable conditions, using fine-grained semi-supervised neural networks to improve the performance of classification models is a new research direction.
[0004] In short, for image intelligent analysis research, classification is an important foothold of intelligent analysis. Therefore, the present invention proposes a method for accurately and effectively using unlabeled data to perform semi-supervised fine-grained classification of image data. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a fine-grained image classification method based on a deep semi-supervised model, which adopts a deep semi-supervised neural network trained with a small amount of labeled data sets as a base classifier, and uses a method of extracting regional fine-grained features from superpixel segmentation to expand the effective feature set of image data, thereby achieving accurate fine-grained classification of images.
[0006] To solve the above technical problems, an embodiment of the present invention provides a fine-grained image classification method based on a deep semi-supervised model, comprising the following steps:
[0007] S1. Get the original image and extract the image feature X of the original image 1:N ={X n}, forming the global feature matrix X;
[0008] S2, perform superpixel segmentation on the original image obtained in step S1, and divide the image into k parts d k , calculate the feature allocation map Q;
[0009] S3, performing nonlinear feature encoding on the global feature matrix X obtained in step 1 and the feature allocation map Q obtained in step S2 to obtain the superpixel local area feature Z;
[0010] S4. Given Q, detect each part d k The occurrence probability of the superpixel region is obtained by using the alignment probability distribution method;
[0011] S5. Create a semi-supervised neural network f θ (x), train the semi-supervised neural network f according to the superpixel region occurrence probability regularization term and damage function θ (x);
[0012] S6, use the semi-supervised neural network f trained in step S5 θ (x) Perform fine-grained image classification.
[0013] Wherein, the step S1 includes the following steps:
[0014] S1.1. Extracting image autoencoding features X′ using deep autoencoders 1:i ;
[0015] S1.2. Use convolution kernel to extract convolution feature X′ (i+1):N ;
[0016] S1.3. Use deep autoencoders and pooling layers to extract image features and form a feature matrix X 1:N .
[0017] Wherein, the step S2 includes the following steps:
[0018] S2.1, split the original image into k parts by superpixel;
[0019] S2.2. Calculate the eigenvector x ij Assigned to the kth part d k Probability
[0020] S2.3, the probability Combined to get the partial allocation vector q ij ∈R K , consisting of all allocation vectors forming a map Q∈R K×H×W .
[0021] Wherein, the step S3 includes the following steps:
[0022] S3.1, calculate using the nonlinear feature encoding formula, substituting Q into the formula to obtain the regional feature map and z' k , all regional features constitute the map
[0023] Among them, the nonlinear feature encoding formula is:
[0024]
[0025]
[0026] Among them, z' k Indicates part d k Superpixel region features;
[0027] S3.2. Input the mapping Z' into the sub-network f with the residual module z The characteristic representation of Z' is f z (Z'), where f z Contains four residual modules, each of which contains three convolutions with batch norm and ReLU activation function;
[0028] S3.3, f z (Z') is input to the softmax layer to obtain the importance probability of each region softmax (f z (Z' T ));
[0029] S3.4. Place the attention template f on the mapping Z', calculate the importance of each region, and represent the regional importance as the attention vector a, where the template f is a neural network and the input of f is z' k , the output is weight a k ;
[0030] S3.5, use the attention vector to adjust the softmax(f z (Z' T )), the calculation formula is Z=asoftmax(f z (Z' T )).
[0031] Wherein, the step S4 includes the following steps:
[0032] S4.1. Define the detector as
[0033] in, is a 2D Gaussian kernel, * operation is a convolution operator, Q k From the allocation vector map Q,t in step S2 k The range is (0, 1);
[0034] S4.2. Combine the outputs of all k part detectors into a co-occurrence vector τ = [t1, t2, ..., t K ] T ∈(0, 1) K , represents the probability of occurrence of all superpixels;
[0035] S4.3, all co-occurrence vectors τ n , n=1,2,...,N are merged into a matrix T=[τ1,τ2,...τ N ]∈(0,1) K×N , we estimate the empirical distribution p(d k |X 1:N );
[0036] S4.4. Set a prior distribution For a U-shaped Beta distribution, use Earth Mover distance to align p(d k |X 1:N ) and prior The aligned co-occurrence vector is used as the regularization term, and the alignment formula is:
[0037]
[0038] Wherein, the step S5 includes the following steps:
[0039] S5.1. Establish a neural network f with random initialization parameters θ θ (x), input the regional features Z and feature matrix X into the neural network for training;
[0040] S5.2. Calculate the neural network f θ The supervised data and unsupervised data loss terms of (x) are calculated, where the formula for calculating the supervised loss term of labeled data is:
[0041]
[0042] The formula for calculating the unsupervised loss term for unlabeled data is:
[0043]
[0044] S5.5. Obtain the total loss using the formula:
[0045] Loss=loss1+loss2+Reg_prior;
[0046] S5.6. Use the ADAM algorithm to update the neural network parameters θ.
[0047] The beneficial effects of the above technical solution of the present invention are as follows:
[0048] The present invention adopts a deep semi-supervised neural network trained with a small amount of labeled data sets as the base classifier, and expands the effective feature set of image data with the help of a method of extracting regional fine-grained features after superpixel segmentation. It combines the regional fine-grained features with the deep semi-supervised neural network model to accurately classify digital images and cell images, thereby achieving accurate fine-grained classification of images. It has the advantages of both deep semi-supervised neural network models and fine-grained image feature extraction, and can effectively utilize unlabeled image data, thereby improving the accuracy of fine-grained classification of images. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION
[0050] In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0051] like Figure 1 As shown, an embodiment of the present invention provides a fine-grained image classification method based on a deep semi-supervised model, comprising the following steps:
[0052] S1. Get the original image and extract the image feature X of the original image 1:N ={X n}, forming the global feature matrix X;
[0053] S2, perform superpixel segmentation on the original image obtained in step S1, and divide the image into k parts d k , calculate the feature allocation map Q;
[0054] S3, performing nonlinear feature encoding on the global feature matrix X obtained in step 1 and the feature allocation map Q obtained in step S2 to obtain the superpixel local area feature Z;
[0055] S4. Given Q, detect each part d k The occurrence probability of the superpixel region is obtained by using the alignment probability distribution method;
[0056] S5. Create a semi-supervised neural network f θ (x), train the semi-supervised neural network f according to the superpixel region occurrence probability regularization term and damage function θ (x);
[0057] S6, use the semi-supervised neural network f trained in step S5 θ (x) Perform fine-grained image classification.
[0058] In this embodiment, step S1 includes the following steps:
[0059] S1.1. Extracting image autoencoding features X′ using deep autoencoders 1:i ;
[0060] S1.2. Use convolution kernel to extract convolution feature X′ (i+1):N ;
[0061] S1.3. Use deep autoencoders and pooling layers to extract image features and form a feature matrix X 1:N .
[0062] The step S2 comprises the following steps:
[0063] S2.1, split the original image into k parts by superpixel;
[0064] S2.2. Calculate the eigenvector x ij Assigned to the kth part d k Probability
[0065] S2.3, the probability Combined to get the partial allocation vector q ij ∈R K , consisting of all allocation vectors forming a map Q∈R K×H×W .
[0066] The step S3 comprises the following steps:
[0067] S3.1, calculate using the nonlinear feature encoding formula, substituting Q into the formula to obtain the regional feature map and z' k , all regional features constitute the map
[0068] Among them, the nonlinear feature encoding formula is:
[0069]
[0070]
[0071] Among them, z' k Indicates part dk Superpixel region features;
[0072] S3.2. Input the mapping Z' into the sub-network f with the residual module z The characteristic representation of Z' is f z (Z'), where f z Contains four residual modules, each of which contains three convolutions with batch norm and ReLU activation function;
[0073] S3.3, f z (Z') is input to the softmax layer to obtain the importance probability softmax (f z (Z' T ));
[0074] S3.4. Place the attention template f on the mapping Z', calculate the importance of each region, and represent the regional importance as the attention vector a, where the template f is a neural network and the input of f is z' k , the output is weight a k ;
[0075] S3.5, use the attention vector to adjust the softmax(f z (Z' T )), the calculation formula is Z=asoftmax(f z (Z' T )).
[0076] The step S4 comprises the following steps:
[0077] S4.1. Define the detector as
[0078] in, is a 2D Gaussian kernel, * operation is a convolution operator, Q k From the allocation vector map Q,t in step S2 k The range is (0, 1);
[0079] S4.2. Combine the outputs of all k part detectors into a co-occurrence vector τ = [t1, t2, ..., t K ] T ∈(0, 1) K , represents the probability of occurrence of all superpixels;
[0080] S4.3, all co-occurrence vectors τ n , n=1,2,...,N are merged into a matrix T=[τ1,τ2,...τ N ]∈(0,1) K×N , we estimate the empirical distribution p(dk |X 1:N );
[0081] S4.4. Set a prior distribution For a U-shaped Beta distribution, use Earth Mover distance to align p(d k |X 1:N ) and prior The aligned co-occurrence vector is used as the regularization term, and the alignment formula is:
[0082]
[0083] The step S5 comprises the following steps:
[0084] S5.1. Establish a neural network f with random initialization parameters θ θ (x), input the regional features Z and feature matrix X into the neural network for training;
[0085] S5.2. Calculate the neural network f θ The supervised data and unsupervised data loss terms of (x) are calculated, where the formula for calculating the supervised loss term of labeled data is:
[0086]
[0087] The formula for calculating the unsupervised loss term for unlabeled data is:
[0088]
[0089] S5.5. Obtain the total loss using the formula:
[0090] Loss=loss1+loss2+Reg_prior;
[0091] S5.6. Use the ADAM algorithm to update the neural network parameters θ.
[0092] The two key points of modeling and solving the fine-grained image classification method based on the deep semi-supervised model provided by the present invention are:
[0093] (1) How to design an effective fine-grained feature extraction method. Learning to classify the components of an object sample without explicit regional supervision is a challenging problem in itself. The proposed method differs in that it uses the regional local features of the object sample as the input to the final classification network. First, the target object is segmented using superpixels; then, a nonlinear encoding method is used to extract the attention weights of each region of the target object. Achieving local feature extraction is one of the characteristics of this method.
[0094] (2) How to use unlabeled samples for semi-supervised model training. Compared with other semi-supervised models, the proposed method adopts the method of adding regional prior knowledge and unlabeled samples to the loss function to fully utilize important regional information and a large number of unlabeled samples to improve the classification model effect. Therefore, only a small amount of labeled data is needed for guidance, while a large amount of unlabeled data is fully utilized to improve the performance of the model. Ultimately, the waste of unlabeled data resources is avoided, the generalization ability of small-sample labeled supervised learning models is improved, and the inaccuracy problem of pure unlabeled data learning methods is alleviated.
[0095] The above is 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 principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A fine-grained image classification method based on a deep semi-supervised model, characterized in that: The following steps are involved: S1. Get the original image and extract the image feature X of the original image 1:N ={X n }, forming the global feature matrix X: S2: Perform superpixel segmentation on the original image obtained in step S1, and divide the image into k parts d k , calculate the feature allocation map Q; S3, performing nonlinear feature encoding on the global feature matrix X obtained in step 1 and the feature allocation map Q obtained in step S2 to obtain a superpixel local area feature Z; S4. Given Q, detect each part d k The occurrence probability of the superpixel region is obtained by using the alignment probability distribution method; S5. Create a semi-supervised neural network f θ (x), train the semi-supervised neural network f according to the superpixel region occurrence probability regularization term and damage function θ (x); S6, use the semi-supervised neural network f trained in step S5 θ (x) Perform fine-grained image classification; The step S4 comprises the following steps: S4.
1. Define the detector as in, is a 2D Gaussian kernel, the * operation is a convolution operator, Q k From the allocation vector map Q in step S2, t k The range is (0, 1); S4.
2. Combine the outputs of all k detectors into a co-occurrence vector τ = [t1, t2, ..., t K ] T ∈(0,1) K , represents the probability of occurrence of all superpixels; S4.
3. All co-occurrence vectors τ n ,n=1,2,…,N are merged into a matrix T=[τ1,τ2,…τ N ]∈(0,1) K×N , we estimate the empirical distribution p(d k |X 1:N ); S4.
4. Set a prior distribution For a U-shaped Beta distribution, use the Earth Mover distance to align p(d k |X 1:N ) and prior The aligned co-occurrence vector is used as the regularization term, and the alignment formula is: The step S5 comprises the following steps: S5.
1. Establish a neural network f with random initialization parameters θ θ (x), input the regional features Z and feature matrix X into the neural network for training; S5.
2. Calculate the neural network f θ The supervised data and unsupervised data loss terms of (x), where the formula for calculating the supervised loss term for labeled data is: The formula for calculating the unsupervised loss term for unlabeled data is: S5.5, get the total loss, the formula is: Loss=loss1+loss2+Reg_prior; S5.
6. Use the ADAM algorithm to update the neural network parameters θ.
2. The image fine-grained classification method based on a deep semi-supervised model according to claim 1 is characterized in that: The step S1 comprises the following steps: S1.
1. Extract image autoencoding features X' using deep autoencoders 1:i ; S1.
2. Use convolution kernel to extract convolution feature X' i+1:N ; S1.
3. Use deep autoencoders and pooling layers to extract image features and form feature matrix X 1:N .
3. The image fine-grained classification method based on a deep semi-supervised model according to claim 1 is characterized in that: The step S2 comprises the following steps: S2.1, segment the original image into k parts by superpixel; S2.
2. Calculate the eigenvector x ij Assign to the kth part d k Probability S2.
3. Probability Combined to get the partial allocation vector q ij ∈R K , consisting of all allocation vectors forming a map Q∈R K ×H×W .
4. The image fine-grained classification method based on a deep semi-supervised model according to claim 1, characterized in that: The step S3 comprises the following steps: S3.1, use the nonlinear feature encoding formula to calculate, put Q into the formula to get the regional feature map and z' k , all regional features constitute the map Among them, the nonlinear feature encoding formula is: Among them, z' k Indicates part d k Superpixel region features; S3.
2. Input the mapping Z' into the sub-network f with residual module z Let Z' be represented by f z (Z'), where f z Contains four residual modules, each of which contains three convolutions with batch norm and ReLU activation functions; S3.3, f z (Z′) is input to the softmax layer to obtain the importance probability of each region, softmax(f z (Z′ T )); S3.
4. Place the attention template f on the mapping Z′, calculate the importance of each region, and represent the regional importance as the attention vector a, where the template f is a neural network and the input of f is z′ k , the output is weight a k ; S3.5, use the attention vector to adjust the softmax (f z (Z′ T )), the calculation formula is Z = softmax(f z (Z′ T ))a.
