A combined zero-shot image classification method based on progressive mutual guidance
Through the combination of iterative mutual guidance of the progressive mutual guidance network and the dual-attention combination generation module, the problem of the interaction between primitives and combined visual features in combined zero-shot image classification is solved, and higher image classification accuracy and model generalization are achieved. transformation.
Patent Information
- Application Number
- CN202410804377.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-06-21
AI Technical Summary
Existing combined zero-shot image classification methods are deficient in balancing contextuality and generalization, especially in the classification of images that have never been combined before, with low accuracy and inability to effectively decouple and reorganize primitive visual features and combined visual features. interactions between.
Using a method based on progressive mutual guidance, through the mutual guidance process of iterative primitives and combinations, the dual-attention combination generation module (DACG) is used to unify feature fusion in multi-scale disentanglement-entanglement representation, combined with relaxed cross-entropy loss and balance Loss function to optimize Progressive Mutual Guidance Network (PMGNet) to improve image classification accuracy.
Significantly improves the accuracy of combined image classification, especially in image classification where combinations have not been seen, improves the generalization and contextuality of the model, and achieves performance comparable to state-of-the-art methods, including visible and unseen combinations The accuracy, area under the curve and harmonic mean indicators.
Smart Images

Figure CN118379562B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision image classification, and in particular to a combined zero-shot image classification method based on progressive mutual guidance. Background Art
[0002] Zero-shot image classification is a method to obtain the label of the target object in the image based on the different features reflected in the image information in the absence of data annotation. As one of the core tasks in computer vision systems, it is widely used in many fields such as style transfer transformation, image generation, image annotation, and target detection. In the image classification process, especially for the prediction of unseen combinations, it is a huge challenge to perform fine image classification when the attributes and visual features of the objects in the combination are highly entangled.
[0003] Due to the mutual influence between attributes and objects, the visual features of the two are highly entangled. Even if the attributes and objects in the combination are seen in advance, it is difficult for computers to decouple primitive visual features from the combination and recombine them like humans. To overcome this difficulty, many studies are devoted to decoupling combined visual features and then recombining them using unilateral guidance methods. For example, the earliest method for decoupling combined visual features, DeCa (M. Yang, C. Xu, A. Wu and C. Deng. A Decomposable Causal View of Compositional Zero-Shot Learning. In IEEE Transactions on Multimedia, TMM, pages 5892–5902, 2022), proposes a model based on a decomposable causal view and introduces three independent embedding spaces (attributes, objects, and combinations), but it cannot extract the association between attributes and objects. In addition, OADis (N. Saini, K. Pham and A. Shrivastava. Disentangling Visual Embeddings for Attributes and Objects. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR, pages 13648-13657, 2022) focuses on how to use semi-negative samples to extract more accurate primitive visual features. ADE (Shaozhe Hao, Kai Han, Kwan-Yee K. Wong. Learning Attention as Disentangler for Compositional Zero-shot Learning. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR, pages 15315–15324, 2023) uses cross attention as a combined disentangler to learn disentangled primitive embeddings. However, these methods only consider the disentanglement of primitive visual features or the disentanglement of combined visual features through unilateral guidance, ignoring the mutual influence between primitive visual features and combined visual features. Summary of the invention
[0004] In order to overcome the shortcomings of existing combined zero-shot image classification tasks in balancing contextuality and generalization, the present invention provides a combined zero-shot image classification method based on progressive mutual guidance, which can make full use of the mutual guidance between entanglement and disentanglement, allow primitive visual features and combined visual features to learn from each other, and unify multi-scale disentanglement-entanglement representations in a progressive framework to simultaneously maintain the contextuality and generalization of the model, thereby improving the image classification accuracy of the combination, especially the image classification accuracy of unseen combinations.
[0005] The technical solution of the present invention is as follows:
[0006] A combined zero-shot image classification method based on progressive mutual guidance comprises the following steps:
[0007] Step 100, training, training images Input to the pre-trained visual feature extractor (ResNet18);
[0008] Step 101, primitive visual feature extraction (including attribute visual features and object visual features), using different convolutional layers to extract the intermediate layer features of the trained feature extractor (ResNet18) to obtain multi-scale original attribute visual features and the original visual features of the object ;
[0009] Step 200, iterate the mutual guidance process between primitives and combinations, the number of iterations i∈[1,N] ;
[0010] Step 201, attribute guided combination, the attribute visual features after fusion at the current scale are input from the decoupled attribute branch to the coupled combination branch;
[0011] Step 202, object-guided combination, the fused object visual features at the current scale are input from the decoupled object branch to the coupled combination branch;
[0012] Step 203, coupling, for the fused attribute visual features at the same scale And the fused object visual features The dual attention combination generation module (DACG) is used to perform feature fusion in the coupled combination branch to obtain the combined visual features at the current scale.
[0013] Step 204, combining guiding attributes, focusing on the combined visual features of the attributes Returning from the coupled combination branch to the decoupled attribute branch guides the fusion of attribute visual features;
[0014] Step 205, combining guidance objects, focusing on the combined visual features of the objects Returning from the coupled combination branch to the decoupled object branch guides the fusion of object visual features;
[0015] Step 206, decoupling, combining the guidance primitive visual features from three parts: the features at the current scale , the fused primitive visual features retained at the previous scale , and the combined visual features used for guidance , repeat steps 201 to 206;
[0016] Step 300: Extract text features and label the image attributes and object tags Convert word embedding (word2vector or word2vector+fasttext) into feature vector to get the corresponding attribute text features and object literal features ;
[0017] Step 301: text feature fusion, attribute text features and object literal features Spliced together and input into the multi-layer perceptron (MLP) to obtain the combined text features ;
[0018] Step 400, training loss, the final visual features and the corresponding text features are calculated in the same embedding space Relaxed Cross Entropy Loss (RCE loss);
[0019] Step 401, balancing the loss, balancing the loss of the primitive branch and the loss of the combination branch, and optimizing the progressive mutual guidance network (PMGNet);
[0020] Step 500, using the optimized progressive mutual guidance network (PMGNet) to test the image;
[0021] Step 501, combined label prediction, the combined label consists of an attribute plus an object. The image is input into the progressive mutual guidance network (PMGNet), and the predicted attribute score, object score and combined score are obtained through three branches (decoupled attribute branch, decoupled object branch and coupled combination branch). A comprehensive score is obtained by balancing these three scores, and the label with the largest comprehensive score is selected as the combined label for image prediction.
[0022] Preferably, in step 101, multi-scale attribute visual features and object visual features are extracted for progressive fusion, and the method is as follows:
[0023] For the extraction of attribute visual features, the feature maps of multiple residual blocks of the pre-trained visual feature extractor (ResNet18) are selected respectively. convolution, Convolution and global pooling obtain the final multi-scale attribute visual features. The extraction of object visual features adopts the same operation and is calculated by the following formula:
[0024]
[0025] in Represents the visual feature extractor Blocks, and Respectively represent Convolution and convolution, Represents global pooling, where parameters are not shared between convolutions, and attributes and objects are distinguished by aligning with subsequent text features.
[0026] Preferably, the progressive mutual guidance network (PMGNet) includes two parts: extraction of multi-scale visual features and mutual guidance of primitive visual features and combined visual features. For the extraction of multi-scale visual features, the pre-trained visual feature extractor (ResNet18) in step 100 is selected. For the mutual guidance of primitive visual features and combined visual features, it mainly consists of three interdependent branches: decoupled attribute branch, decoupled object branch and coupled combination branch.
[0027] Preferably, in step 201, the decoupled attribute branch is a branch in the progressive mutual guidance network (PMGNet) responsible for classifying attributes. It receives feature maps from multiple residual blocks of a pre-trained visual feature extractor (ResNet18), attribute visual features at multiple scales obtained by 1×1 convolution, 3×3 convolution and global pooling as input, and outputs attribute features that fuse attribute visual features at different scales under the guidance of the combined visual features. This branch is connected with the corresponding attribute text feature Calculating the loss function To optimize the attribute visual features; the formula is as follows:
[0028]
[0029] in, Represents the attribute text label predicted for the target image, Indicates other attribute text labels within the attribute prediction range, Represents the set of all attribute prediction text labels, is a scalar used to control the peak value of the Softmax activation function distribution. Control the degree of relaxation, ranging from 0 to 1. For the fusion of attribute visual features at different scales, under the guidance of the combined visual features, the attribute features at the current scale are selected, and the attribute features at the previous scale are learnably weighted summed at the current scale. The formula is as follows:
[0030]
[0031] in, , , They represent the fused attribute visual features from the previous scale in the decoupled attribute branch. The weight and original attribute visual features at the current scale The weight and combination of guiding attribute branches The weights of these weights are initialized to 1 and gradually adjusted as the model is trained.
[0032] Preferably, in step 202, the decoupled object branch is a branch in the progressive mutual guidance network (PMGNet) responsible for classifying objects. It receives feature maps from multiple residual blocks of a pre-trained visual feature extractor (ResNet18), attribute visual features at multiple scales obtained by 1×1 convolution, 3×3 convolution and global pooling as input, and outputs object features that fuse object visual features at different scales under the guidance of combined visual features. This branch is connected with the corresponding object text features Calculating the loss function To optimize the visual features of the object. The formula is as follows:
[0033]
[0034] in, represents the object text label predicted by the target image, Represents the text labels of other objects within the object prediction range, Represents the set of predicted text labels for all objects, is a scalar used to control the peak value of the Softmax activation function distribution. Control the degree of relaxation, ranging from 0 to 1. For the fusion of visual features of objects at different scales, under the guidance of combined visual features, the object features at the current scale are selected, and the object features at the previous scale are learnably weighted summed at the current scale. The formula is as follows:
[0035]
[0036] in, , , They represent the fused object visual features from the previous scale in the decoupled object branch. The weight of the original object at the current scale The weight and combined guidance object branch The weights of these weights are initialized to 1 and gradually adjusted as the model is trained.
[0037] Preferably, in step 203, the coupled combination branch is a branch in the progressive mutual guidance network (PMGNet) responsible for classifying the combination. It receives attribute visual features and object visual features at multiple scales as input, and obtains the combined visual features by fusing them using a dual attention combination generation module (DACG). , this branch is combined with the corresponding text features Calculating the loss function To optimize the combined visual features. The formula is as follows:
[0038]
[0039] in, represents the combined text label predicted for the target image, Represents other combined text labels within the combined prediction range. represents the set of all combined predicted text labels, is a scalar used to control the peak value of the Softmax activation function distribution. Controls the degree of relaxation, ranging from 0 to 1. Specifically, the method of fusing primitive visual features to obtain combined visual features is as follows:
[0040] In order to preserve the context of the combination, it is necessary to entangle the independent attribute visual features and the object visual features, preserve the correlation between them, and guide the generation of the combined visual features. For this purpose, a new attention mechanism is adopted, instead of simply adding or splicing together. This attention mechanism has been proven to be generally used to focus on important information and ignore other unnecessary information (see Ashish Vaswani, Noam Shazeer, Niki Parmar, JakobUszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Neural Information Processing Systems, NeurIPS, pages 5998–6008, 2017). Unlike previous methods that only learn a single primitive visual feature, the dual attention combination generation module (DACG) is adopted to encourage the generation of two different combined visual features. Specifically, the first Attribute visual features after fusion at different scales And the fused object visual features As input, first calculate their Hadamard product, then use the Softmax activation function to get the combined attention score, perform the Hadamard product of the obtained attention score with the primitive visual feature to be focused on, and then add it element-wise with another primitive visual feature. Through full-connected learning, the combined visual feature with attention can be obtained, considering the relationship between attributes and objects. The operation of DACG can be expressed as:
[0041]
[0042] in, Indicates the combined visual features that focus on attributes, Indicates the focus on the combined visual features of the object, represents the attribute visual features after the combination guidance fusion, represents the visual features of the object after the combination guidance fusion, represents the Hadamard product, represents element-wise addition, represents the Softmax activation function, and FC represents the fully connected layer.
[0043] Preferably, in step 206, the combination guides the primitive visual feature decoupling, and the design method is as follows:
[0044] Disentangling the attributes and objects is beneficial to the generalization of the combination, but it will hurt the contextuality of the combination. To this end, the generated combined visual features can be used and To guide the disentanglement of the decoupled attribute branch and the decoupled object branch respectively, while preserving the context of the combination. Because when the features of the combination are known a priori, the recognition of primitive visual features is easier, and the combination is beneficial to the classification of attributes in the decoupled attribute branch and objects in the decoupled object branch. Specifically, by combining the visual features Original attribute visual features added to the decoupled attribute branch The fused attribute visual features from the previous scale By performing weighted summation in , we can obtain more semantically rich primitive visual features (including both fine-grained features and entanglement with another primitive visual feature). The same operation is also performed in the decoupled object branch. So this operation can be formulated as:
[0045]
[0046] in, , , They represent the fused attribute visual features from the previous scale in the decoupled attribute branch. The weight and original attribute visual features at the current scale The weight and combination of guiding attribute branches The weight it occupies. , , They represent the fused object visual features from the previous scale in the decoupled object branch. The weight of the original object at the current scale The weight and combined guidance object branch The weights they occupy. Their values are initialized to 1 and can be learned along with the model.
[0047] Preferably, step 400 and step 401 specifically include:
[0048] For the combinatorial zero-shot learning image classification task (CZSL), cross entropy (CE) loss is often used to calculate the image classification loss. The use of CE loss can accelerate the rapid convergence of the model optimization process because it has a strong penalty for wrong predictions. However, this may cause the model to overfit on the training images, making the model not generalize well in the prediction of the test images. Therefore, it is crucial to avoid overfitting of the model while keeping the loss convergence quickly. This is even more serious in the combinatorial zero-shot learning image classification task because there are a large number of unseen combinations in the test phase, and there are unavoidable distribution differences compared with the combinations seen during training. Therefore, in order to solve this problem, the cross entropy loss needs to be improved when considering both the seen and unseen combinations for the combinatorial zero-shot learning image classification. A more relaxed cross entropy (RCE) loss can be used:
[0049]
[0050] in, For decoupled attributes, the branch represents the attribute; for decoupled objects, the branch represents the object; for coupled objects, the branch represents the combination. is a scalar used to control the peak value of the Softmax activation function distribution. Controls the degree of relaxation, ranging from 0 to 1. When it is set to 0, the RCE loss becomes the traditional CE loss.
[0051] In step 401, the entire network is trained end-to-end, and the three network branches correspond to three loss functions, which are attribute classification loss , object classification loss And the combined classification loss Taking all factors into consideration, in order to balance the losses of the three branches, the final loss function of the entire network is calculated as:
[0052]
[0053] in, Used to control the weight balance between primitive and combined loss terms.
[0054] Preferably, step 500 and step 501 specifically include:
[0055] The test image x is input into the optimized progressive mutual guidance network, and the corresponding fused attribute visual features are obtained through three branches (decoupled attribute branch, decoupled object branch and coupled combination branch) respectively. , object visual features and combined visual features , and then find the corresponding text features in the three shared embedding spaces respectively The scores for attributes, objects, and combinations are calculated, and these three scores are considered as the final combined prediction. The total score is calculated as:
[0056]
[0057] in, Used to adjust the scores of the three branches, It means finding the average of the maximum values.
[0058] Beneficial effects of the present invention:
[0059] In order to verify the progressive mutual guidance framework, the present invention sets the number of scales of progressive mutual guidance to multiple, and the experimental results show that the primitive visual features obtained by the present invention at the first scale. In the following stages, the primitive visual features and the combined visual features are gradually improved, and the primitive visual features and the combined visual features in the final stage become closer to the corresponding text features.
[0060] The present invention is compared with the most advanced combined zero-shot image classification methods, including DeCa, OADis, ADE, and CANet. For fair comparison, the results of these methods are provided directly by their authors or their original training models. Compared with the four most advanced methods, the present invention achieves state-of-the-art performance in all indicators on the three most common datasets, including the accuracy of seen combinations (Seen) and the accuracy of unseen combinations (Unseen); in particular, the area under the curve (AUC) and the harmonic mean (HM) are significantly improved compared with previous methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 It is a workflow diagram of the progressive mutual guidance combined zero-shot image classification method provided by the present invention;
[0062] Figure 2 is a schematic diagram of a zero-shot image classification network based on progressive mutual guidance provided by the present invention;
[0063] Figure 3 It is a schematic diagram of the specific operation of the dual attention combination generation (DACG) module in the network;
[0064] Figure 4 It is a schematic diagram of the proportion of primitive visual features of each part of the decoupled attribute branch and the decoupled object branch guided by the combined coupling branch respectively;
[0065] Figure 5 This is a visual comparison of the results of the present invention and other methods on the C-GQA dataset;
[0066] Figure 6It is the result of searching text by image on the UT-Zappos dataset in the open world in this invention;
[0067] Figure 7 This is the visualization result of the present invention on the UT-Zappos and C-GQA datasets. DETAILED DESCRIPTION
[0068] The specific implementation of the present invention is further described below in conjunction with the accompanying drawings and technical solutions.
[0069] Figure 1 This is a workflow diagram of the progressive mutual guidance combined zero-shot image classification method provided by the present invention. Figure 2 Taking the figure as an example, the entire progressive mutual guidance network (PMGNet) is divided into mutual guidance of primitive visual features and combined visual features at multiple different scales, including the following steps:
[0070] Step 100, training, training images The input images are resized to 224× 224, including translation, rotation and other image enhancement processes. The random seed of the whole experiment is set to 2021, and the Adam optimizer is used (see Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In 3rd International Conference on Learning Representations, ICLR, 2015), and the network learning rate is 5e-4. The whole network is experimented on an NVIDIA RTX 3090 GPU, and the batch size during training is set to 256 and the number of epochs is set to 150. The training time for the three datasets UT-Zappos, C-GQA and VAW-CZSL is 1 hour and 52 minutes, 6 hours and 41 minutes and 10 hours and 41 minutes respectively.
[0071] Step 101, primitive visual feature extraction, after the image is input into the feature extractor (ResNet18) pre-trained with ImageNet, the feature map output by the same intermediate layer is respectively subjected to different 1×1 convolution, Batch Norm, ReLU and different 3×3 convolution, Batch Norm, ReLU to obtain the original attribute visual features at multiple different scales. and the original visual features of the object .
[0072] Step 200, iterate the mutual guidance process between primitives and combinations, the number of iterations ;
[0073] Step 201, attribute guided combination, starting from the shallow attribute visual features of the pre-trained feature extractor (ResNet18), gradually adding deep attribute visual features to the decoupled attribute branch, and then inputting the fused attribute visual features at the current scale from the decoupled attribute branch to the coupled combination branch;
[0074] Step 202, object-guided combination, starting from the shallow object visual features of the pre-trained feature extractor (ResNet18), gradually adding deep object visual features to the decoupled attribute branch, and then inputting the fused object visual features at the current scale from the decoupled object branch to the coupled combination branch;
[0075] Step 203, coupling, for the fused attribute visual features at the same scale And the fused object visual features The dual attention combination generation module (DACG) is used to fuse features and obtain the combined visual features at the current scale. , Figure 3 The calculation process of the DACG module is shown. Specifically, The fused attribute visual features at different scales and the fused object visual embedding As input, first calculate their Hadamard product, then use the Softmax activation function to get the combined attention score, perform the Hadamard product of the obtained attention score with the primitive visual feature to be focused on, and then add it element-wise with another primitive visual feature. Through full-connected learning, the combined visual feature with attention can be obtained, considering the relationship between attributes and objects;
[0076] Step 204, combining guiding attributes, focusing on the combined visual features of the attributes Returning from the coupled combination branch to the decoupled attribute branch guides the fusion of attribute visual features;
[0077] Step 205, combining guidance objects, focusing on the combined visual features of the objects Returning from the coupled combination branch to the decoupled object branch guides the fusion of object visual features;
[0078] Step 206, decoupling, combining the guidance primitive visual features from three parts: the features at the current scale , the fused primitive visual features retained at the previous scale , and the combined visual features used for guidance , the coupling method adopts the weighted summation with learnable parameters, and the parameters are initialized to 1. In this embodiment, the proportions of the three parts after learning are as follows Figure 4 As shown, repeat steps 201 to 206;
[0079] Step 300: Extract text features and label the image attributes and object tags Convert word embedding (word2vector or word2vector+fasttext) into a 300-dimensional feature vector to obtain the corresponding attribute text features and object literal features ;
[0080] Step 301: text feature fusion, attribute text features and object literal features The combined text features are spliced together and input into the multi-layer perceptron (MLP) to reduce the dimension to obtain a 300-dimensional combined text feature. ;
[0081] Step 400, training loss, the final visual features and the corresponding text features are calculated in the same embedding space Relaxed Cross Entropy Loss (RCE loss);
[0082] Step 401, balancing the loss, balancing the loss of the primitive branch and the loss of the combination branch, and optimizing the progressive mutual guidance network (PMGNet);
[0083] Step 500, using the optimized progressive mutual guidance network (PMGNet) to test the image;
[0084] Step 501, combined label prediction, input the image into the progressive mutual guidance network (PMGNet), and obtain the predicted attribute score, object score and combination score through three branches (decoupled attribute branch, decoupled object branch and coupled combination branch). A comprehensive score is obtained by balancing these three scores, and the label with the largest comprehensive score is selected as the combined label for image prediction. The label prediction result is shown in Figure 5 As shown, the first match predicted by the Progressive Mutual Guidance Network (PMGNet) and the second match predicted are shown.
[0085] like Figure 6 As shown, the present invention conducts experiments in the most challenging open world, demonstrating that under relatively difficult conditions, the Progressive Mutual Guidance Network (PMGNet) also achieves satisfactory results, although there are some incorrect predictions, but they are within an acceptable range.
[0086] like Figure 7As shown in the figure, the experimental results of the present invention are compared with other unilateral guidance methods (decoupling only or coupling only). In comparison, the image classification results of the present invention are more accurate, especially in the prediction of unseen combinations. This alleviates the generalization and contextual problems of combined zero-shot tasks to a certain extent.
Claims
1. A combined zero-shot image classification method based on progressive mutual guidance, characterized in that: The following steps are involved: Step 100, training, inputting the training image x into the pre-trained visual feature extractor ResNet18; Step 101, primitive visual feature extraction, using different convolutional layers to extract the intermediate layer features of the trained ResNet18 to obtain multi-scale original attribute visual features and the original object visual features Step 200, iterating the mutual guidance process of primitives and combinations, the number of iterations i∈[1,N]; Step 201, attribute guided combination, the attribute visual features after fusion at the current scale are input from the decoupled attribute branch to the coupled combination branch; Step 202, object-guided combination, the fused object visual features at the current scale are input from the decoupled object branch to the coupled combination branch; Step 203, coupling, for the fused attribute visual features at the same scale And the fused object visual features The dual attention combination generation module DACG is used to fuse features to obtain the combined visual features at the current scale; Step 204, combining guiding attributes, focusing on the combined visual features of the attributes Returning from the coupled combination branch to the decoupled attribute branch guides the fusion of attribute visual features; Step 205, combining guidance objects, focusing on the combined visual features of the objects Returning from the coupled combination branch to the decoupled object branch guides the fusion of object visual features; Step 206, decoupling, combining the guidance primitive visual features from three parts: the features at the current scale The fused primitive visual features preserved at the previous scale and combined visual features for guidance Repeat steps 201 to 206; The progressive mutual guidance network PMGNet includes two parts: extraction of multi-scale visual features and mutual guidance of primitive visual features and combined visual features. For the extraction of multi-scale visual features, the pre-trained visual feature extractor ResNet18 in step 100 is selected; for the mutual guidance of primitive visual features and combined visual features, it mainly consists of three interdependent branches: decoupled attribute branch, decoupled object branch and coupled combination branch. In step 201, the decoupled attribute branch is the branch in the progressive mutual guidance network PMGNet that is responsible for classifying attributes; Receives feature maps from multiple residual blocks of the pre-trained visual feature extractor ResNet18, obtains attribute visual features at multiple scales through 1×1 convolution, 3×3 convolution and global pooling as input, and outputs attribute features that fuse attribute visual features at different scales under the guidance of combined visual features This branch is connected with the corresponding attribute text feature y a Calculating the loss function To optimize the attribute visual features; the formula is as follows: Among them, a represents the attribute text label predicted by the target image, Represents other attribute text labels within the attribute prediction range, A represents the set of all attribute prediction text labels, η is a scalar used to control the peak value of the Softmax activation function distribution, and γ controls the degree of relaxation, ranging from 0 to 1; for the fusion of attribute visual features at different scales, under the guidance of the combined visual features, the attribute features at the current scale are selected, and the attribute features at the previous scale are learnably weighted summed at the current scale. The formula is as follows: in, They represent the fused attribute visual features from the previous scale in the decoupled attribute branch. The weight and original attribute visual features at the current scale The weight and combination of guiding attribute branches The weight it occupies; In step 202, the decoupled object branch is a branch in the progressive mutual guidance network PMGNet responsible for classifying objects; it receives feature maps from multiple residual blocks of the pre-trained visual feature extractor ResNet18, and obtains attribute visual features at multiple scales through 1×1 convolution, 3×3 convolution and global pooling as input, and outputs object features that fuse object visual features at different scales under the guidance of the combined visual features. This branch is connected with the corresponding object text feature y b Calculating the loss function To optimize the visual features of the object; the formula is as follows: Among them, b represents the object text label predicted by the target image, Represents the text labels of other objects within the object prediction range, B represents the set of all object prediction text labels, η is a scalar used to control the peak value of the Softmax activation function distribution, and γ controls the degree of relaxation, ranging from 0 to 1; for the fusion of object visual features at different scales, under the guidance of the combined visual features, the object features at the current scale are selected, and the object features at the previous scale are learnably weighted summed at the current scale. The formula is as follows: in, They represent the fused object visual features from the previous scale in the decoupled object branch. The weight of the original object at the current scale The weight and combined guidance object branch The weight it occupies; In step 203, the coupled combination branch is a branch in the progressive mutual guidance network PMGNet that is responsible for classifying the combination; it receives attribute visual features and object visual features at multiple scales as input, and obtains the combined visual features by fusing them using the dual attention combination generation module DACG This branch calculates the loss function by combining the corresponding text features ym To optimize the combined visual features; the formula is as follows: Among them, m represents the combined text label predicted by the target image, represents other combined text labels within the combined prediction range, M represents the set of all combined predicted text labels, η is a scalar used to control the peak value of the Softmax activation function distribution, and k controls the degree of relaxation, ranging from 0 to 1; In step 203, the method of fusing primitive visual features to obtain combined visual features is as follows: By adopting the dual attention combination generation module DACG, it is encouraged to generate two different combined visual features; specifically, the fused attribute visual features at the i-th scale And the fused object visual features As input, first calculate their Hadamard product, then get the combined attention score through the Softmax activation function, perform Hadamard product of the obtained attention score with the primitive visual feature to be paid attention to, and then add it element-wise with another primitive visual feature. Through full connection learning, the combined visual feature with attention can be obtained, considering the relationship between attributes and objects; the operation of DACG is expressed by the formula: in Indicates the combined visual features that focus on attributes, Indicates the combined visual features of the object being focused on, represents the attribute visual features after the combination guidance fusion, represents the visual features of the object after the combination guidance fusion, represents the Hadamard product, represents element-wise addition, Softmax represents the Softmax activation function, and FC represents the fully connected layer; In step 206, the combination guides the primitive visual feature decoupling as follows: Using the generated combined visual features and to guide the disentanglement of the decoupled attribute branch and the decoupled object branch respectively, while preserving the context of the combination; specifically, by combining the visual features Original attribute visual features added to the decoupled attribute branch The fused attribute visual features from the previous scale By performing weighted summation in , we can obtain a more semantically rich primitive visual feature, which includes both fine-grained features and entanglement with another primitive visual feature. The same operation is also performed in the decoupled object branch; so this operation is formulated as: in, They represent the fused attribute visual features from the previous scale in the decoupled attribute branch. The weight and original attribute visual features at the current scale The weight and combination of guiding attribute branches The weight it occupies; They represent the fused object visual features from the previous scale in the decoupled object branch. The weight of the original object at the current scale The weight and combined guidance object branch The weight it occupies; Step 300: text feature extraction. The attribute label a and object label b of the image are converted into feature vectors through word embedding to obtain the corresponding attribute text feature y. a and object text features y b ; Step 301: text feature fusion, attribute text feature y a and object text features y b Spliced together and input into the multi-layer perceptron MLP to obtain the combined text feature y m ; Step 400, training loss, the final visual features and the corresponding text features are used to calculate the relaxed cross entropy loss RCEloss in the same embedding space; Step 401, balancing the loss, balancing the loss of the primitive branch and the loss of the combination branch, and optimizing the progressive mutual guidance network PMGNet; Step 500, using the optimized progressive mutual guidance network PMGNet to test the image; Step 501, combined label prediction, the combined label consists of an attribute plus an object; the image is input into the progressive mutual guidance network PMGNet, and the predicted attribute score, object score and combination score are obtained respectively through the decoupled attribute branch, the decoupled object branch and the coupled combination branch. A comprehensive score is obtained by balancing these three scores, and the label with the largest comprehensive score is selected as the combined label for image prediction.
2. The combined zero-shot image classification method based on progressive mutual guidance according to claim 1, characterized in that: In step 101, multi-scale attribute visual features and object visual features are extracted for progressive fusion, and the method is as follows: For the extraction of attribute visual features, the feature maps of multiple residual blocks of the visual feature extractor ResNet18 are selected, and the final multi-scale original attribute visual features are obtained through 1×1 convolution, 3×3 convolution and global pooling. Original visual features of the object The extraction of takes the same operation and is calculated by the following formula: where f i (·) represents the i-th block of the visual feature extractor, and They represent 1×1 convolution and 3×3 convolution respectively. Pool(·) represents global pooling. Parameters are not shared between convolutions. Attributes and objects are distinguished by aligning with the following text features.
3. A combined zero-shot image classification method based on progressive mutual guidance according to claim 1 or 2, characterized in that: Step 400 and step 401 specifically include: improving the cross entropy CE loss and adopting a more relaxed cross entropy RCE loss: Among them, z represents the attribute for the decoupled attribute branch, represents the object for the decoupled object branch, and represents the combination for the coupled combination branch. η is a scalar used to control the peak value of the Softmax activation function distribution, and γ controls the degree of relaxation, ranging from 0 to 1. In step 401, the entire network is trained end-to-end, and the three branches correspond to three loss functions, namely, attribute classification loss Object classification loss And the combined classification loss In order to balance the losses of the three branches, the final loss function of the entire network is calculated as: Among them, α is used to control the weight balance between the primitive and combined loss terms.
4. The combined zero-shot image classification method based on progressive mutual guidance according to claim 1 or 2, characterized in that: In step 500 and step 501, the method for predicting the image label is as follows: The test image x is input into the optimized progressive mutual guidance network, and the corresponding fused attribute visual features are obtained through three branches respectively. Object visual features and combined visual features Then, we find the corresponding text features y in the three shared embedding spaces and calculate the scores of attributes, objects, and combinations. We consider these three scores as the final combined prediction, and the total score is calculated as: Among them, β is used to adjust the scores of the three branches, and argmax represents the average of the maximum value.
