Semi-supervised image classification method based on causal reasoning
Background masks are generated through causal reasoning and class activation mapping to reduce the influence of background information, solve the problem of deep learning image classification methods relying on labeled data, and improve the accuracy and performance of semi-supervised image classification.
Patent Information
- Application Number
- CN202210896650.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-28
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-07-28
AI Technical Summary
Existing image classification methods based on deep learning rely on labeled data during the model training process and blindly learn the statistical correlation between image visual features and category labels, resulting in poor semi-supervised image classification performance of the network model and the influence of background information. Classification accuracy.
By constructing a structural causal model for causal reasoning, we analyze the causal relationship between target information and classification results in image classification tasks, use class activation mapping (CAM) to generate background masks, perform causal intervention, and reduce the impact of background information on classification results. and train deep neural networks via causal consistency criteria.
It improves the classification accuracy of the image classification network, reduces the dependence on labeled data, and enhances the classification performance under a small number of labeled samples.
Smart Images

Figure CN115131618B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing and pattern recognition, and further relates to an image classification method, specifically a semi-supervised image classification method based on causal reasoning, which can be used in the fields of target detection and target classification. Background Art
[0002] Image classification is a very important research direction in the field of computer vision. It is the basis for solving problems such as target tracking and target segmentation. It has a wide range of applications in daily life and military fields. The task of image classification is to classify different categories of targets by learning the statistical correlation between the visual features and labels of different targets based on the visual features in the image. In recent years, with the development of deep learning theory and the improvement of hardware level, image classification methods based on deep learning have achieved high classification accuracy on many challenging data sets and have also shown excellent results in practical applications. Image classification methods based on deep learning generally rely on supervised learning driven by data and rely heavily on labeled data. When the number of labeled samples is insufficient, the classification network is prone to overfitting, which seriously affects the classification accuracy. However, in our practical applications, the collection and labeling of a large number of samples often requires a lot of manpower and material resources, which has become a major obstacle to the development of image classification algorithms based on deep learning. In order to alleviate this problem, semi-supervised learning methods have received widespread attention from researchers. Semi-supervised image classification methods use limited labeled samples and a large number of unlabeled samples to train models, and have been proven to achieve good classification performance. When labeled data is limited, semi-supervised learning can reduce the dependence on labeled data and enrich the application scenarios of image classification algorithms.
[0003] In recent years, researchers at home and abroad have proposed many semi-supervised image classification algorithms based on deep learning. The consistency principle is an important theoretical basis for semi-supervised classification algorithms, that is, the prediction results of the network after different perturbations of the same sample should be consistent. Tarvainen et al. used the consistency criterion between the prediction results of the same sample after different perturbations based on two independent networks with the same structure but different network parameter update methods in the paper "Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results" (Advances in neural information processing systems, 2017, 30.). Ke et al. trained two different deep networks based on the consistency principle in the paper "Dual student: Breaking the limits of the teacher in semi-supervised learning" (International Conference on Computer Vision, 2019, 6728-6736.), and jointly constrained the two networks through the consistency of the prediction results of the two networks on the "stable sample". The model achieved high classification accuracy and is a typical algorithm based on consistency constraints. Although the current semi-supervised classification algorithms have effectively alleviated the problem of dependence on labeled samples, they have not improved the blind learning method of deep learning that relies on large amounts of data to learn the statistical correlation between image deep features and labels; in image classification tasks, background information, as a disturbance factor that affects classification accuracy, has not been paid attention to or solved in existing semi-supervised image classification algorithms. Summary of the invention
[0004] The purpose of the present invention is to address the deficiencies of the above-mentioned prior art and propose a semi-supervised image classification method based on causal reasoning, which mainly solves the problem that the existing image classification method based on deep learning relies on labeled data during the model training process, blindly learns the statistical correlation between the image visual features and the category labels, resulting in poor semi-supervised image classification performance of the network model. The present invention reduces the influence of background information on the classification results, guides the model training process to pay attention to the target information of the image and the causal relationship between the learning target information and the classification results, and improves the classification accuracy of the classification network while alleviating the dependence on labeled data.
[0005] In order to achieve the above object, the technical solution adopted by the present invention comprises the following steps:
[0006] (1) An image classification task consisting of target information O, background information C, and classification result L is constructed. Based on causal reasoning, a structural causal model is established to analyze the relationship between the disturbance factor in the image classification task and the causal relationship that should be learned during the training process. The model analysis shows that in the image classification task, the causal relationship that the network model should learn is the relationship between the target information O and the classification result L, and the disturbance factor that needs causal intervention is the background information C.
[0007] (2) Obtain a sample set of semi-supervised image classification:
[0008] (2a) Determine the number of categories to be K, each category contains pictures, normalize them and divide the normalized sample set into a training sample set containing N pictures and a test sample set containing SN pictures, where 2≤K≤20, S≥60000,
[0009] (2b) Divide the training sample set into a training set of l labeled sample images, where By adjusting the ratio of labeled samples to total training samples, we can obtain a semi-supervised training sample set T with different numbers of labeled samples. i , i∈{1,2,...,n}, n≥3 represents the total number of semi-supervised training sample sets obtained;
[0010] (3) Using two deep neural networks with the same structure but independently updated parameters, a classification network model with feature extraction and classification functions is constructed, and the initial training parameters of the network model are set;
[0011] (4) Use n semi-supervised training sample sets to iteratively train the constructed classification network model in turn:
[0012] (4a) Using the semi-supervised training sample set T i Train the two deep neural networks in the network model and calculate the total consistency loss for all samples in them At the same time, the supervision loss is calculated for the labeled samples
[0013] (4b) Using the feature maps extracted by the neural network during the training process and the predicted classification results of the network model, a background mask is generated for all training samples based on the class activation map CAM, and n new semi-supervised training sample sets T are obtained based on the background mask and the original image. i ';
[0014] (4c) Using the new semi-supervised training sample set T i'Retrain the two deep neural networks in the network model and calculate the causal consistency loss for all samples in them Get the total loss function of the classification network model Finally, n trained classification network models are obtained;
[0015] (5) Use the test set to test the i-th trained classification network model and obtain the network model in the semi-supervised training sample set T i The image classification accuracy obtained by training, taking i=1,2,...,n, obtains the image classification accuracy corresponding to the classification network model when the labeled samples account for various different proportions of the total training samples.
[0016] Compared with the prior art, the present invention has the following advantages:
[0017] First, the present invention analyzes the causal relationship between the various components in the classification task through causal reasoning, points out that background information is an important disturbance factor that affects the final classification accuracy, and the causal relationship between the target information and the label in the image is a relationship that the image classification model should pay attention to and learn, which has important guiding significance for avoiding the network model from blindly learning the statistical correlation between the overall features of the image and the label;
[0018] Second, the background mask proposed by the present invention based on CAM is a good method for classifying image targets and background areas, and causal intervention on background information is achieved through the background mask; in order to better apply causal intervention to semi-supervised image classification, the present invention uses the causal consistency criterion, which can achieve better classification accuracy even in the absence of sufficient labeled training samples, thereby reducing the dependence on labeled training samples. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is the overall flow chart of the implementation of the present invention;
[0020] Figure 2 It is a structural causal model constructed for image classification based on causal reasoning in the present invention;
[0021] Figure 3 is a schematic diagram of a background mask generation module in the present invention;
[0022] Figure 4 It is a schematic diagram of the training process in the deep neural network model of the present invention. DETAILED DESCRIPTION
[0023] The implementation of the present invention is further described in detail below in conjunction with the accompanying drawings.
[0024] Example 1: Reference Figure 1The present invention proposes a semi-supervised image classification method based on causal reasoning, comprising the following steps:
[0025] Step 1: Construct an image classification task consisting of target information O, background information C, and classification result L. Based on causal reasoning, establish a structural causal model for analyzing the perturbation factor in the image classification task and the causal relationship to be learned during the training process, and use the model analysis to conclude that in the image classification task, the causal relationship that the network model should learn is the relationship between the target information O and the classification result L, and the perturbation factor that needs causal intervention is the background information C. Here, the perturbation factor C needs to be causally intervened by backdoor adjustment, and the formula is as follows:
[0026]
[0027] Among them, O is the target information, c is the known background information in the background information C, and L is the predicted classification result of the model.
[0028] Step 2: Obtain a sample set of semi-supervised image classification:
[0029] (2a) Determine the number of categories to be K, each category contains pictures, normalize them and divide the normalized sample set into a training sample set containing N pictures and a test sample set containing SN pictures, where 2≤K≤20, S≥60000,
[0030] (2b) Divide the training sample set into a training set of l labeled sample images, where By adjusting the ratio of labeled samples to total training samples, we can obtain a semi-supervised training sample set T with different numbers of labeled samples. i , i∈{1,2,...,n}, n≥3 represents the total number of semi-supervised training sample sets obtained;
[0031] Step three: Use two deep neural networks with the same structure but independently updated parameters to construct a classification network model with feature extraction and classification functions, and set the initial training parameters of the network model; the classification network model constructed in this embodiment uses CNN13 as a deep neural network, and its structure includes: 3 convolution blocks and 1 fully connected layer; the number of input channels of the fully connected layer is 128, and the number of output channels is 10, and the three convolution blocks are composed of 3 convolution layers, 3 batch normalization layers, 1 maximum pooling layer and 1 fully connected layer; the first convolution block of the three convolution blocks has 3 input channels and 128 output channels; the second convolution block has 128 input channels and 256 output channels; the third convolution block has 256 input channels and 12 output channels; the output of the third convolution block is used as the feature map of the input image, and the prediction result of the network model is obtained through the fully connected layer.
[0032] Step 4: Use n semi-supervised training sample sets to iteratively train the constructed classification network model in turn:
[0033] (4a) Using the semi-supervised training sample set T i Train the two deep neural networks in the network model and calculate the total consistency loss for all samples in them At the same time, the supervision loss is calculated for the labeled samples This embodiment uses the semi-supervised training sample set T i The two deep neural networks in the training network model are respectively recorded as the first deep neural network model model 1 and the second deep neural network model 2 , specifically follow the steps below:
[0034] 4a.1) Calculate the consistency loss between models based on the consistency criterion The mean square error loss is used, and the formula is as follows:
[0035]
[0036] Among them, P 1 (y|x),P 2 (y|x) represent model 1 and model 2 The predicted classification results for the perturbed sample x;
[0037] Calculate the consistency loss within the model based on the consistency criterion The mean square error loss is used, and the formula is as follows:
[0038]
[0039] Among them, Pj (y|x),P j (y|x′) represents the model j ,j∈{1,2} is the predicted classification results for samples x and x′ after different perturbations;
[0040] 4a.2) According to and Get the total consistency loss
[0041]
[0042] 4a.3) Additional supervision loss calculation for labeled samples The cross entropy loss function is used, and its formula is as follows:
[0043]
[0044] Among them, P j (y|x) represents model j ,j∈{1,2} is the predicted classification result for sample x, y n is the label given in the training set.
[0045] (4b) Using the feature maps extracted by the neural network during the training process and the predicted classification results of the network model, a background mask is generated for all training samples based on the class activation map CAM, and n new semi-supervised training sample sets T are obtained based on the background mask and the original image. i ', in this embodiment, a new semi-supervised training sample set is obtained according to the background mask and the original image. Specifically, the background mask and the original image are bitwise multiplied to obtain a new data set with the background area blocked, that is, a new semi-supervised training sample set.
[0046] The generation of background masks for all training samples based on the class activation map CAM specifically refers to the separation of the target area and the background area in the image using the feature map extracted by the network and the model classification prediction result based on the class activation map CAM, and then generating the background mask by threshold selection. The specific implementation process is as follows:
[0047] 4b.1) Back-propagate the probability of the model classification prediction result to obtain the contribution weight ω of different feature maps to the classification result i , and obtain the classification contribution distribution map M c (x,y):
[0048]
[0049] in, Represents the feature map f kThe contribution weight of the network model prediction result c is obtained by calculating the contribution weighted sum to obtain the classification contribution distribution map M c (x, y), calculate the mean of the classification contribution distribution map as the contribution threshold t for distinguishing the image target and background, retain the area with a contribution greater than the threshold and occlude the area with a contribution less than the threshold;
[0050] 4b.2) The formula for generating the background mask context mask by threshold selection is as follows:
[0051]
[0052] (4c) Using the new semi-supervised training sample set T i 'Retrain the two deep neural networks in the network model and calculate the causal consistency loss for all samples in them Get the total loss function of the classification network model Where α is a weight parameter, and finally n trained classification network models are obtained; this embodiment calculates the causal consistency loss The formula for the mean square error loss function is as follows:
[0053]
[0054] Among them, P 1 (y|d o ), P 2 (y|d o ) represent model 1 and model 2 For the newly generated samples d after different perturbations o The predicted classification results.
[0055] Step 5: Use the test set to test the i-th trained classification network model and obtain the network model in the semi-supervised training sample set T i The image classification accuracy obtained by training, taking i=1,2,...,n, obtains the image classification accuracy corresponding to the classification network model when the labeled samples account for various different proportions of the total training samples.
[0056] Example 2: Reference Figure 2-4 The overall steps of the classification method in this embodiment are the same as those in the first embodiment. Now, in conjunction with the accompanying drawings and with specific category numbers, the implementation process of the present invention is further described in detail:
[0057] Step 1: Establish a structured causal model.
[0058] Reference Figure 2 , where O represents the target information, C represents the background information, and L represents the classification result. This step is implemented as follows:
[0059] 1.1) Image classification tasks are composed of three parts: target information, background information, and classification results. The target and background information is provided by the input image, and the classification result is obtained by the trained network model based on the extracted image features. Obviously, in the image classification task, the network model predicts the type of target in the image. In actual operation, the impact of background information on the classification results cannot be ignored. On the one hand, the image collection of a certain category of targets in the data set collection process is likely to have statistical correlation with a certain background; on the other hand, due to the lack of a clear boundary between the target and the background, the visual feature extraction of the target is inevitably affected by the visual features of the background area. Figure 2 As shown in (a) in the figure, the present invention establishes a structured causal model for image classification tasks. From the above analysis, it can be seen that the background is a disturbance factor in the image classification task, and the relationship between the target and the classification result is the causal relationship that the network model should learn.
[0060] 1.2) In order to reduce the impact of background as a disturbance factor on the classification accuracy of the model, we introduce causal intervention into the target classification task and generate a structured causal graph after causal intervention, such as Figure 2 As shown in (b) in the figure. On the one hand, through the backdoor adjustment commonly used in causal intervention, we can cut off C→O, thereby eliminating the statistical correlation between the target and the background during the dataset acquisition process. On the other hand, by introducing the background mask, we can reduce the influence of the visual features of the background area on the target visual feature extraction process.
[0061] Step 2: Obtain a semi-supervised training sample set.
[0062] The present invention uses the widely used public data sets Cifar-10 and Fashion-MNIST to verify the performance of the present invention on different types of semi-supervised image classification tasks. In practice, other data sets can also be used, or data sets for special purposes can be constructed by oneself. The Cifar-10 data set has a total of 60,000 samples, of which 50,000 are training set samples and 10,000 are test set samples. The sample categories total 10 types: airplanes, cars, birds, cats, deer, dogs, frogs, horses, ships, and trucks. The images of all samples are color images with a size of 32 pixels × 32 pixels. Fashion-MNIST has a total of 70,000 samples, of which 60,000 are training set samples and 10,000 are test set samples. The sample categories total 10 types: T-shirts, jeans, pullovers, skirts, coats, sandals, shirts, sneakers, bags, and boots. The images of all samples are grayscale images with a size of 28 pixels × 28 pixels.
[0063] In order to obtain a semi-supervised training sample set, the normalized training set D samples need to be divided to obtain a semi-supervised training sample set T, where l samples are selected to construct a labeled data set X, and the remaining images are used to construct an unlabeled data set U. In order to test the performance of the present invention in the unsupervised image classification task, we construct semi-supervised training sample sets with 1000, 2000 and 4000 labeled data per category for the Cifar-10 sample set, and semi-supervised training sample sets with 250, 500 and 1000 labeled data per category for the Fashion-MNIST sample set. For each semi-supervised training sample set T, labeled samples and unlabeled samples of each category are uniformly sampled.
[0064] Step 3: Build a deep neural network model.
[0065] The present invention uses CNN13 as a deep neural network model, and its specific structure and parameters are: CovBlock1: (3×3 convolution + BN layer)×3+max pooling layer+Dropout layer (input channel: 3, output channel: 128), CovBlock2: (3×3 convolution + BN layer)×3+max pooling layer+Dropout layer (input channel: 128, output channel: 256), CovBlock3: (3×3 convolution + BN layer)×3+average pooling layer (input channel: 256, output channel: 128), fully connected layer (input channel: 128, output channel: 10). We use the output of CovBlock3 as the feature map of the input image and obtain the final prediction result of the network model through the fully connected layer.
[0066] Step 4: Iteratively train the network model.
[0067] Reference Figure 3 We show the training process of the network model of the present invention, where CNN1 and CNN2 represent two independent classification networks in our network model, ζ i represents random perturbation, D represents the semi-supervised training sample set consisting of a labeled dataset X and an unlabeled dataset U, D o The new sample set that represents the introduction of the background mask is also composed of the labeled dataset X o And the unlabeled dataset U o composition, represents the loss based on the consistency criterion for all training data, represents the classification loss of labeled data, Represents the causal consistency loss for new samples with the background mask introduced.
[0068] 4.1) For a sample in the semi-supervised training set, after passing through CNN1 and CNN2, the two models obtain the classification probabilities of different categories for the sample, among which the category with the largest classification probability is the final prediction of the model for the sample.
[0069] 4.2) The present invention uses the feature map extracted by the network and the model classification prediction results based on CAM to separate the target area and the background area in the image, and then generates a background mask by threshold selection. Figure 4 , where Input represents the input image, Output represents the output prediction result, and f k represents the feature map extracted by the network model, GAP represents the global average pooling layer, U k Represents f k The feature representation after GAP, ω i Indicates U K For the contribution weight of the classification result, M c (x, y) represents the visualized classification contribution distribution map. The brighter the color, the greater the contribution value. t represents the target background distinction threshold.
[0070] For the input sample image Input, the feature map f is obtained after passing through the feature extraction module of the network model k , and then after the global average pooling layer to U k As the input of the fully connected layer, the network model obtains the probability distribution of the category to which the Input belongs, and the category with the largest classification probability is used as the model's predicted classification result output; the probability of the classification prediction result is back-propagated to obtain the contribution weight ω of different feature maps to the classification result i , and obtain the classification contribution distribution map M c The formula for (x,y) is as follows:
[0071]
[0072] in, Represents the feature map f k The contribution weight of the network model prediction result c is obtained by calculating the contribution weighted sum to obtain the classification contribution distribution map M c (x, y). The present invention calculates the mean of the classification contribution distribution map as the contribution threshold t for distinguishing the image target from the background, retains the area with a contribution greater than the threshold and blocks the area with a contribution less than the threshold, and generates the background mask context mask as follows:
[0073]
[0074] 4.3) The background mask and the original image are bitwise multiplied to obtain a new data set with the background area blocked. The present invention proposes a causal consistency criterion that the prediction results of different networks for target areas that have undergone different disturbances should have consistent results.
[0075] 4.4) The total loss function of the network model proposed in this invention is Where α is a weight parameter. In order to improve the training efficiency, the present invention combines the generation of background mask with the calculation of causal consistency loss. Specifically, for the first step of the first iteration, the input image is modeled and predicted. For the other steps of the first iteration, the input of the model consists of the input image of the current step and the background mask image of the previous step. In each step except the first step, we calculate the classification loss of the step Consistency loss And the causal consistency loss of the previous step
[0076] The effect of the present invention can be further illustrated by the following simulation results:
[0077] 1. Simulation experiment conditions
[0078] The hardware platform used in the present invention is: the CPU uses an Intel Core i7-9700k with eight cores and eight threads, with a main frequency of 3.6GHz and a memory of 64GB; the GPU uses two Nvidia RTX 3090s with a video memory of 24GB. The software platform used is: the operating system uses Ubuntu16.04LTS, the deep learning computing framework uses PyTorch 1.4, and the programming language uses Python3.6.
[0079] This simulation experiment uses the average classification accuracy as the evaluation indicator, which refers to the accuracy of the category with the first probability value in the classification probability distribution predicted by the network model and the actual result.
[0080] 2. Simulation content and result analysis
[0081] The present invention and the two existing methods Mean Teacher and Dual Student are tested on the data sets Cifar-10 and Fashion-MNIST under the above simulation conditions, and the tracking results are evaluated using the above evaluation indicators. The results are shown in Tables 1 and 2.
[0082] Table 1 Comparison of classification effects between the prior art and the present invention on Cifar-10
[0083] Method name\Number of label samples 1000 2000 4000 Mean Teacher 79.8 85.8 90.0 Dual Student 82.3 87.5 90.3 Method of the present invention 85.4 88.8 90.4
[0084] Table 2 Comparison of classification effects between the prior art and the present invention on Fashion-MNIST
[0085] Method name\Number of label samples 250 500 1000 Mean Teacher 83.01 84.62 89.26 Dual Student 79.50 83.88 87.79 Method of the present invention 84.85 87.75 89.64
[0086] It can be seen from Table 1 and Table 2 that the classification accuracy of the present invention in different types of sample sets and different numbers of labeled samples is higher than that of the two existing methods, indicating that the image classification effect and semi-supervised learning ability of the present invention are better than the two existing methods. This is because the present invention introduces causal reasoning into the target classification task, analyzes that background information is a disturbance factor, and uses a background mask to generate a new data set to train the network model to achieve causal intervention, thereby guiding the model to pay more attention to the causal relationship between the target information and the classification results during the training process, and achieves better classification accuracy on a data set with a small number of labeled samples.
[0087] The above simulation analysis proves the correctness and effectiveness of the method proposed in the present invention.
[0088] Parts of the present invention that are not described in detail belong to common knowledge among those skilled in the art.
[0089] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Obviously, for professionals in this field, after understanding the content and principles of the present invention, they may make various modifications and changes in form and details without departing from the principles and structures of the present invention. However, these modifications and changes based on the ideas of the present invention are still within the scope of protection of the claims of the present invention.
Claims
1. A semi-supervised image classification method based on causal reasoning, It is characterized in that The steps include: (1) An image classification task consisting of target information O, background information C, and classification result L is constructed. Based on causal reasoning, a structural causal model is established to analyze the relationship between the disturbance factor in the image classification task and the causal relationship that should be learned during the training process. The model analysis shows that in the image classification task, the causal relationship that the network model should learn is the relationship between the target information O and the classification result L, and the disturbance factor that needs causal intervention is the background information C. (2) Obtain a sample set of semi-supervised image classification: (2a) Determine the number of categories to be K, each category contains pictures, normalize them and divide the normalized sample set into a training sample set containing N pictures and a test sample set containing SN pictures, where 2≤K≤20, S≥60000, (2b) Divide the training sample set into a training set of l labeled sample images, where By adjusting the ratio of labeled samples to total training samples, we can obtain a semi-supervised training sample set T with different numbers of labeled samples. i , i∈{1,2,...,n}, n≥3 represents the total number of semi-supervised training sample sets obtained; (3) Using two deep neural networks with the same structure but independently updated parameters, a classification network model with feature extraction and classification functions is constructed, and the initial training parameters of the network model are set; (4) Use n semi-supervised training sample sets to iteratively train the constructed classification network model in turn: (4a) Using the semi-supervised training sample set T i Train the two deep neural networks in the network model and calculate the total consistency loss for all samples in them At the same time, the supervision loss is calculated for the labeled samples (4b) Using the feature maps extracted by the neural network during the training process and the predicted classification results of the network model, a background mask is generated for all training samples based on the class activation map CAM, and n new semi-supervised training sample sets T are obtained based on the background mask and the original image. i '; (4c) Using the new semi-supervised training sample set T i 'Retrain the two deep neural networks in the network model and calculate the causal consistency loss for all samples in them Get the total loss function of the classification network model Finally, n trained classification network models are obtained; (5) Use the test set to test the i-th trained classification network model and obtain the network model in the semi-supervised training sample set T i The image classification accuracy obtained by training, taking i=1,2,...,n, obtains the image classification accuracy corresponding to the classification network model when the labeled samples account for various different proportions of the total training samples.
2. The method according to claim 1, Features: The causal interference in step (1) refers to the causal intervention of the disturbance factor C by backdoor adjustment, and the formula is as follows: P(L|to(O))=∑ c P(L|O,c)P(c)=P(L|O) Among them, O is the target information, c is the known background information in the background information C, and L is the predicted classification result of the model.
3. The method according to claim 1, Features: The classification network model described in step (3) uses CNN13 as a deep neural network, and its structure includes: 3 convolution blocks and 1 fully connected layer; the number of input channels of the fully connected layer is 128, and the number of output channels is 10, and the three convolution blocks are composed of 3 convolution layers, 3 batch normalization layers, 1 maximum pooling layer and 1 fully connected layer; among the three convolution blocks, the first convolution block has 3 input channels and 128 output channels; the second convolution block has 128 input channels and 256 output channels; the third convolution block has 256 input channels and 12 output channels; the output of the third convolution block is used as the feature map of the input image, and the prediction result of the network model is obtained through the fully connected layer.
4. The method according to claim 1, Features: In step (4a), the semi-supervised training sample set T is used i The two deep neural networks in the training network model are respectively recorded as the first deep neural network model model 1 and the second deep neural network model 2 , implemented as follows: 4a.1) Calculate the consistency loss between models based on the consistency criterion The mean square error loss is used, and the formula is as follows: Among them, P 1 (y|x),P 2 (y|x) represent model 1 and model 2 The predicted classification results for the perturbed sample x; Calculate the consistency loss within the model based on the consistency criterion The mean square error loss is used, and the formula is as follows: Among them, P j (y|x),P j (y|x′) represents the model j ,j∈{1,2} is the predicted classification results for samples x and x′ after different perturbations; 4a.2) According to and Get the total consistency loss 4a.3) Additional supervision loss calculation for labeled samples The cross entropy loss function is used, and its formula is as follows: Among them, P j (y|x) represents model j ,j∈{1,2} is the predicted classification result for sample x, y n is the label given in the training set.
5. The method according to claim 1, Features: In step 4b), a background mask is generated for all training samples based on the class activation map CAM. Specifically, the class activation map CAM uses the feature map extracted by the network and the model classification prediction result to separate the target area and the background area in the image, and then generates the background mask by threshold selection. The specific implementation process is as follows: 4b.1) Back-propagate the probability of the model classification prediction result to obtain the contribution weight ω of different feature maps to the classification result i , and obtain the classification contribution distribution map M c (x,y): in, Represents the feature map f k The contribution weight of the network model prediction result c is obtained by calculating the contribution weighted sum to obtain the classification contribution distribution map M c (x, y), calculate the mean of the classification contribution distribution map as the contribution threshold t for distinguishing the image target and background, retain the area with a contribution greater than the threshold and occlude the area with a contribution less than the threshold; 4b.2) The formula for generating the background mask context mask by threshold selection is as follows: wheret=mean[M c (x,y)]。 6. The method according to claim 5, Features: In step 4b), a new semi-supervised training sample set is obtained according to the background mask and the original image. Specifically, the background mask and the original image are bitwise multiplied to obtain a new data set with the background area blocked, that is, a new semi-supervised training sample set.
7. The method according to claim 4, Features: Step 4c) Calculate the causal consistency loss Using the mean square error loss function, the formula is as follows: Among them, P 1 (y|d o ), P 2 (y|d o ) represent model 1 and model 2 For the newly generated samples d after different perturbations o The predicted classification results.
8. The method according to claim 1, Features: The total loss function of the network model in step 4) is Where α is the weight parameter.
