Fine-grained visual classification method with adjustable positioning and multi-angle attention
By introducing a combination method of adjustable positioning and multi-angle attention modules in fine-grained visual classification, local positioning and information attention are optimized, the problem of secondary information interference in the positioning area is solved, and the model extracts and classification of object features is significantly improved. Accuracy.
Patent Information
- Application Number
- CN202311534324.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-17
- Publication Date
- 2024-12-13
AI Technical Summary
Existing fine-grained visual classification methods contain a large amount of secondary information in the location area, resulting in a decrease in the accuracy of the model focusing on the object itself.
The combination method of adjustable positioning module and multi-angle attention module is adopted to optimize the local positioning area through normalization and background masking of attention maps, reduce secondary information interference, and identify the differences between primary and secondary information through multi-angle attention modules. Increase the model's attention to object characteristics.
It effectively reduces interference from secondary information, improves the model's attention to the object itself and feature extraction ability, and improves the accuracy of fine-grained visual classification.
Smart Images

Figure CN119131440A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fine-grained visual classification, and in particular to a fine-grained visual classification method with adjustable positioning and multi-angle attention. Background Art
[0002] Fine-grained visual classification is to distinguish subcategories at different levels of subordination within a general category, and these subcategories have subtle differences, such as Figure 1 shown.
[0003] Currently, a common practice in the field of fine-grained visual classification is to introduce additional annotations as auxiliary information, such as region annotation methods based on manually annotated bounding boxes / partial annotations. However, the generation of additional annotations usually requires a lot of manpower and time, which limits their practical use.
[0004] In order to get rid of the dependence on additional annotations, some weakly supervised methods have emerged recently. For example, MGE-CNN [1] It consists of several experts and a gating network. Each expert learns the previous knowledge from the previous experts. The gating network determines the weight assigned by each expert to the final prediction and finally makes the prediction.
[0005] WS-DAN [2] The randomly selected attention map guides data augmentation, and the bilinear attention pooling is used to extract object features and locate the object. Finally, the initial image and the localization map are comprehensively predicted.
[0006] AP-CNN [3] By integrating low-level information (e.g., color, edge connectivity, texture patterns), the performance can be improved by enhancing feature representation and accurately locating discriminative regions.
[0007] SADmix [4] A data mixing augmentation strategy, namely semantic and attention data mixing, is proposed to select semantic patches for generating new training samples to improve the performance of the model.
[0008] CDLT-cd [5] The relationship between different discriminative regions contains rich posture information. By adding posture information, the model can learn the non-behavior of the target attributes.
[0009] PMRC contains rich posture information about the relationship between different discriminative regions. By adding posture information, the model can learn the non-behavior of target attributes.
[0010] However, the areas located by the above methods still contain a lot of secondary information (such as background information), which causes the model to sometimes include a lot of secondary information in local positioning. This secondary information will interfere with the model's focus on the object itself, reducing the accuracy of the model's classification. Summary of the invention
[0011] In view of this, the purpose of the present invention is to propose a fine-grained visual classification method with adjustable positioning and multi-angle attention, so as to solve the problem that the area positioned by the existing classification method still contains a large amount of secondary information (such as background information), resulting in the model sometimes containing a large amount of secondary information during local positioning, and these secondary information will interfere with the model's attention to the object itself.
[0012] Based on the above purpose, the present invention provides a fine-grained visual classification method with adjustable positioning and multi-angle attention, including a backbone network and an ALMA model, wherein the ALMA model includes an adjustable positioning module and a multi-angle attention module, and the steps of using the ALMA model for fine-grained visual classification are as follows:
[0013] S1. The attention map is obtained by convolving the feature map with multiple convolution kernels. The attention map is used as the input of the adjustable positioning module and the multi-angle attention module respectively. A represents the attention map, A k An attention map representing the input to the adjustable localization module;
[0014] S2, the attention map A selected by the adjustable positioning module k Normalization is first performed and then input into the adjustable positioning module;
[0015] S3, in the adjustable positioning module, firstly locally locate the area of interest of the target;
[0016] S4, shielding a part of the background in the local positioning area through the generated background masking area, so as to better focus on the discrimination area of the object, and generating a new local positioning area;
[0017] S5, enlarge and crop the new local positioning area to capture more detailed information, so that the model can pay more attention to the object itself and extract feature information more effectively;
[0018] S6. The multi-angle attention module will enable the model to better identify the main information and the secondary information, and gradually increase the difference between the areas of attention of the two. This module hopes that the model can better distinguish the main information from the secondary information, and finally focus on the area of the main information to help the model reduce the interference of the secondary information.
[0019] Preferably, the backbone network is Inception v3 and Resnet101 on three data sets: CUB-200-2011, FGVC Aircraft, and Stanford Car.
[0020] Preferably, in S1, the attention map can be expressed as:
[0021]
[0022] Where f(·) represents the convolution function, F represents the feature map, A represents the attention map, and A k Represents an attention map of the input adjustable positioning module, k represents the initial attention map number, and M represents the number of set attention maps.
[0023] Preferably, in S2, the normalization process can be expressed as:
[0024]
[0025] Where max(·) and min(·) represent the maximum and minimum values of the input tensor, respectively. Indicates A K Normalized results.
[0026] Preferably, in S3, first select the normalized attention map Generate a local positioning box. The process can be expressed as:
[0027]
[0028] Among them C k represents the entire region of 0 and 1, θ C Represents the set threshold, the selected normalized attention map Greater than the threshold θ C It will be assigned a value of 1, otherwise it will be assigned a value of 0, and then a rectangular box is generated as small as possible to contain the area assigned with a value of 1, forming a local positioning box to locate the local area.
[0029] Preferably, in S4, the generation of the background masking area can be expressed as:
[0030]
[0031] Among them A * represents the result of normalization of A, θ m Indicates the set threshold, B M Represents the entire range of 0 and 1.
[0032] Preferably, the step of S5 is:
[0033] S5.1, the new local positioning area will avoid the covered area and regenerate a new area;
[0034] S5.2. Minimize the new local positioning area to include C k 1, the new local positioning area is more accurate and reduces background information;
[0035] S5.3. After the new local positioning area is enlarged and cropped, a large amount of secondary information is reduced while retaining the main information. The model can pay more attention to the object itself and extract feature information more effectively.
[0036] Preferably, in S6, the attention map focusing on the main information mainly focuses on the object itself, while the random attention map focusing on the secondary information mainly observes the background area. The process of focusing on the main information can be expressed as:
[0037]
[0038] Where i represents the stage, j represents the prediction, and A M represents the Mth attention map, P(·) is the prediction function, F represents the feature map, and the focus on secondary information can be expressed as:
[0039]
[0040] Among them A r represents a random attention map, represents the Mth random attention map.
[0041] Preferably, the regional differences are maximized from different angles to help the model better understand the main information, thereby improving the accuracy of image prediction and obtaining the third prediction probability. The process can be expressed as:
[0042]
[0043] In the multi-view attention module and It will be output as an important reference for the final predicted probability. Similarly, similar operations are performed when the target positioning map is obtained, and finally four predicted probabilities are obtained.
[0044] Preferably, the proposed ALMA model uses different attention angle qualities to supervise and guide the attention learning process, and the composition structure of the loss function is as follows:
[0045] ζ=ζ ce (Y final , Y)+ζ cl
[0046] where Yfinal represents the final predicted label, Y represents the classification label, ζ ce represents the binary cross entropy loss function, ζ cl represents the feature center loss function, ζ ce(·,·) The structure is as follows:
[0047]
[0048] Where H and W are the length and width of the predicted image. ce The structure of the feature center loss function is as follows:
[0049]
[0050] where f k Represents some features, c k Represents the center of some features.
[0051] The beneficial effects of the present invention are as follows:
[0052] 1. The adjustable positioning module (AL) is used to optimize the attention map selected each time, so that a large amount of secondary information is reduced in each local positioning. In this module, more attention will be paid to the local features of the object. The multi-angle attention module (MA) allows the model to better identify the main information and secondary information, and gradually increase the difference between the areas of attention of the two. This module hopes that the model can better distinguish between the main information and the secondary information, and finally focus on the area of the main information to help the model reduce the interference of the secondary information. The main information will focus on the area of the object itself, and the secondary information will pay more attention to the background area. The two modules are optimized from the local and overall aspects respectively, reducing the interference of secondary information and helping the model improve its classification ability.
[0053] 2. In summary, the ALMA model uses adjustable localization (AL) to solve the problem of local localization containing a large amount of secondary information, so that more attention can be focused on the object itself. Then, ALMA uses the proposed multi-angle attention module (MA) to identify the difference between primary and secondary information, so as to better focus on the object itself. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0055] Figure 1 Schematic diagram of subcategories at different subordinate levels in an embodiment of the present invention;
[0056] Figure 2 This is a diagram of the algorithm network model architecture of an embodiment of the present invention;
[0057] Figure 3 It is a structural schematic diagram of an adjustable positioning module in an embodiment of the present invention;
[0058] Figure 4 Schematic diagram of the structure of a multi-angle attention module in an embodiment of the present invention;
[0059] Figure 5 Schematic diagram of the comparison between the attention map in the embodiment of the present invention and the mainstream method. DETAILED DESCRIPTION
[0060] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.
[0061] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The "first", "second" and similar words used in the present invention do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connecting" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0062] like Figure 1 , Figure 2 , Figure 3 , Figure 4 , Figure 5 As shown, a fine-grained visual classification method with adjustable positioning and multi-angle attention includes a backbone network and an ALMA model. The ALMA model includes an adjustable positioning module and a multi-angle attention module. The steps of using the ALMA model for fine-grained visual classification are as follows:
[0063] S1. The attention map is obtained by convolving the feature map with multiple convolution kernels. The attention map is used as the input of the adjustable positioning module and the multi-angle attention module respectively. A represents the attention map, A k An attention map representing the input to the adjustable localization module;
[0064] S2, the attention map A selected by the adjustable positioning modulek Normalization is first performed and then input into the adjustable positioning module;
[0065] S3, in the adjustable positioning module, firstly locally locate the area of interest of the target;
[0066] S4, shielding a part of the background in the local positioning area through the generated background masking area, so as to better focus on the discrimination area of the object, and generating a new local positioning area;
[0067] S5, enlarge and crop the new local positioning area to capture more detailed information, so that the model can pay more attention to the object itself and extract feature information more effectively;
[0068] S6. The multi-angle attention module will enable the model to better identify the main information and the secondary information, and gradually increase the difference between the two. This module hopes that the model can better distinguish the main information from the secondary information, and finally focus on the area of main information to help the model reduce the interference of secondary information.
[0069] The adjustable positioning module is used to optimize the attention map selected each time, so that a large amount of secondary information is reduced in each local positioning. In this module, more attention will be paid to the local features of the object. The multi-angle attention module allows the model to better identify the primary and secondary information, and gradually increase the difference between the two. This module hopes that the model can better distinguish the primary and secondary information, and finally focus on the area of the primary information to help the model reduce the interference of the secondary information. The primary information will focus on the area of the object itself, and the secondary information will focus more on the background area. The two modules optimize from the local and overall aspects respectively, reduce the interference of secondary information, and help the model improve its classification ability.
[0070] S1. The attention map is obtained by convolving the feature map with multiple convolution kernels. The attention map is used as the input of the adjustable positioning module and the multi-angle attention module respectively. A represents the attention map, A k An attention map representing the input to the adjustable localization module.
[0071] like Figure 2 As shown in the figure, the algorithm consists of a backbone network, an adjustable positioning module and a multi-angle attention module. The algorithm is applicable to any backbone network. We use Inception v3 and Resnet101 on three datasets, CUB-200-2011, FGVC Aircraft, and Stanford Car, as the backbone network for testing. In addition, the attention map is obtained by convolving the feature map with multiple 1×1 convolution kernels, which are used as the input of the adjustable positioning module and the multi-angle attention module respectively. The attention map can be expressed as:
[0072]
[0073] Where f(·) represents the convolution function, F represents the feature map, A represents the attention map, and A k Represents an attention map of the input adjustable positioning module, k represents the initial attention map number, and M represents the number of set attention maps.
[0074] S2. The attention map selected by the adjustable positioning module is first normalized and then input into the adjustable positioning module.
[0075] Adjustable attention map A selected by the positioning module k Normalization is first performed and then input into the adjustable positioning module. The normalization process can be expressed as:
[0076]
[0077] Where max(·) and min(·) represent the maximum and minimum values of the input tensor, respectively. Indicates A K Normalized results.
[0078] Local area positioning has achieved certain results in the field of image processing. However, in most cases, the positioning of local areas often contains a lot of secondary information, which interferes with the model's focus on the main information. In order to solve this problem, the algorithm of the present invention proposes an adjustable positioning module (AL) to guide the initial positioning area to pay more attention to the main information.
[0079] S3. In the adjustable positioning module, firstly perform local positioning on the target area of interest.
[0080] like Figure 3 The process of the adjustable positioning module is as follows: first, the normalized attention map is selected Generate a local positioning box. The process can be expressed as:
[0081]
[0082] Among them C k represents the entire region of 0 and 1, θ C Indicates the set threshold. Figure 3 (a) shows the selected normalized attention map Greater than the threshold θ C It will be assigned a value of 1, otherwise it will be assigned a value of 0. Then a rectangular box is generated as small as possible to contain the area assigned with a value of 1, forming a local positioning box to locate the local area.
[0083] However, local localization regions may contain a lot of secondary information, especially in datasets with small objects, which may limit the performance of the model. Different attention maps tend to focus on different areas. We hope to block part of the background to better focus on the discriminative area of the object and generate new adjustment areas. Extract object features more effectively while retaining the most discriminative areas. This allows the model to better focus on the object itself.
[0084] S4. Mask a part of the background in the local positioning area through the generated background masking area so as to better focus on the discrimination area of the object, and generate a new local positioning area.
[0085] like Figure 3 The background mask region shown in (b) is generated by A( Figure 4 ) and threshold θ m For less than θ m If there are parts, then the value is 0 and we will generate mask blocks in these areas, otherwise it is 1. j When the area of 1 overlaps with the mask area 0, C k Set to 0, which further limits the size and position of the generated area. The generation of the masked area can be expressed as:
[0086]
[0087] Among them A * represents the result of normalization of A, θ m Indicates the set threshold, B M Represents the entire range of 0 and 1.
[0088] S5. Enlarge and crop the new local positioning area to capture more detailed information, so that the model can focus more on the object itself and extract feature information more effectively.
[0089] The new local positioning area will avoid the covered area and regenerate a new area. The new local positioning area minimizes the area containing C k 1 in . After adjustment, the new local positioning area is more accurate and reduces background information. After adjustment, the new local positioning area is enlarged as shown below Figure 3 As shown in (c), while retaining the main information, a large amount of secondary information is reduced. The model can pay more attention to the object itself and extract feature information more effectively. In the adjustable positioning module, one attention map is selected each time and the above operation is performed M times in total. Finally, a target positioning frame is generated, which includes the local positioning frame generated M times and the original image multiplied to obtain Figure 2 Target localization map for stage 2. The background mask in the adjustable localization is only added during training.
[0090] S6. The multi-angle attention module will enable the model to better identify the main information and the secondary information, and gradually increase the difference between the areas of attention of the two. This module hopes that the model can better distinguish the main information from the secondary information, and finally focus on the area of the main information to help the model reduce the interference of the secondary information.
[0091] Using attention maps to extract features from objects is an effective way to improve model performance. However, due to the lack of reasonable supervision signals, the model will be disturbed by secondary information and cannot observe the object itself well. To solve this problem, we introduced a multi-angle attention module. Figure 4 As shown in the figure, the attention map that focuses on the main information mainly focuses on the object itself. The random attention map that focuses on the secondary information mainly observes the background area. In order to allow the model to better distinguish between the main information and the secondary information, the difference in the attention area of the main information and the secondary information will gradually increase. Then the features of the areas of attention of the two are extracted and input into the fully connected layer and Softmax for prediction. The process of focusing on the main information can be expressed as:
[0092]
[0093] Where i represents the stage, j represents the prediction, and A M represents the Mth attention map, P(·) is the prediction function, and F represents the feature map. Paying attention to secondary information can be expressed as:
[0094]
[0095] Among them A r represents a random attention map, represents the Mth random attention map.
[0096] We maximize regional differences from different angles to help the model better understand the main information, thereby improving the accuracy of image prediction and obtaining the third prediction probability The process can be expressed as:
[0097]
[0098] In the multi-view attention module and It will be output as an important reference for the final predicted probability. Similarly, similar operations are performed after obtaining the target positioning map, and finally four predicted probabilities are obtained.
[0099] exist Figure 2The input is divided into two stages, and the two stages complement each other's feature information, which will help the model learn the main information and improve the model's ability to make final predictions. We sum and average the two prediction probabilities output by each multi-angle attention module to obtain the final prediction probability. The process can be expressed as:
[0100]
[0101] Among them, P final Represents the probability of the final prediction.
[0102] In the proposed ALMA model, we use different attention angle qualities to supervise and guide the attention learning process. The composition structure of the loss function is as follows:
[0103] ζ=ζ ce (Y final , Y)+ζ cl
[0104] where Y final represents the final predicted label, Y represents the classification label, ζ ce represents the binary cross entropy loss function, ζ cl Denotes the feature center loss function. ζ ce(·,·) The structure is as follows:
[0105]
[0106] Where H and W are the length and width of the predicted image. ce The structure of the feature center loss function is as follows:
[0107]
[0108] where f k Represents some features, c k Represents the center of some features.
[0109] In order to evaluate the effectiveness of the proposed algorithm on fine-grained visual classification data, we conducted experiments on the CUB-200-2011, FGVC Aircraft, and Stanford Car datasets, compared them with several recently published algorithms, and explored the role of each module on the three datasets. We compared ELoPE [8] 、PMG [9] 、SADMix
[10] , FBSD
[11] 、MPCF-NET
[12] 、WS-DAN [2] The mainstream advanced method, the algorithm of the present invention adopts the classification accuracy as the main evaluation index.
[0110] 1. Parameter selection
[0111] Table 1 Ablation experiments of ALMA model
[0112]
[0113]
[0114] We explored the role of each module on three datasets. We chose ALMA with the Inception v3 backbone network as our comparative experimental method because WS-DAN adopted a similar approach and also used Inception v3 as the backbone network. As shown in Table 1, when we added background masking, ALMA can achieve a relatively good result in the three datasets, and the accuracy is improved by 1.94% on the Aircraft dataset, proving the effectiveness of the proposed adjustable positioning module. The multi-angle attention module also improves on the three datasets, and improves by 1.25% on the Aircraft dataset. When the two modules are added to the model at the same time, the improvement is obvious in the three datasets, which proves that the two modules are compatible and can be used together to better improve the performance of the model.
[0115] 2. Qualitative comparison
[0116] To provide a quantitative comparison between our algorithm and recently published fine-grained visual classification algorithms, we visualize the attention maps on the test sets from three datasets.
[0117] Figure 5 The attention areas of the fine-grained visual classification model are shown and compared with the WS-DAN model, which is a similar method used in recent years. In the Aircraft dataset, the visualization of the WS-DAN attention area shows that the model cannot observe the entire object well, and even many points appear in the area of secondary information. The secondary information interferes with the model's attention to the entire object, which may be the reason why the performance of this model is limited on this dataset. In our model, the interference of secondary information is effectively reduced, and more attention is focused on the entire object. In the CUB-200-2011 and Stanford Car datasets, although WS-DAN reduces the attention to secondary information, it also reduces the attention to the object itself. Because the amount of primary information extracted is insufficient, the accuracy of the model is poor. In these two datasets, our model can still observe the entire object well, which further improves the performance of the model.
[0118] 3. Quantitative comparison
[0119] Table 2 Quantitative comparison of ALMA on three datasets
[0120] Methods CUB Aircraft Car ELoPE 88.5 93.4 94.5 MPCF-NET 89.1 93.6 95.0 FBSD 89.3 92.7 94.4 SADMix 89.3 93.8 95.1 PMG 89.6 93.4 94.1 WS-DAN (Inception v3) 89.3 93.0 94.5 ALMA (Inception v3) 89.8 94.2 94.8 ALMA (Resnet101) 90.3 94.2 95.2
[0121] Table 2 shows the evaluation results on the test sets of the three datasets. The proposed ALMA model performs well on different fine-grained visual classification tasks with state-of-the-art accuracy. On the CUB200-2011 task, ALMA's attention region can achieve better performance compared to MPCF-NET by scaling a region of interest at different stages. On the CUB20-2011 task, the ALMA model significantly improves MPCF-NET by 1.2%.
[0122] In the WS-DAN model with similar ideas, we also achieved significant improvements using the same backbone network Inception v3, especially in Aircraft, where the improvement was 1.2%. Figure 5 It can be observed that in the Aircraft dataset, WS-DAN pays too much attention to minor information, which limits the performance of the model. When we introduce the adjustable positioning module and the multi-angle attention module, the model can effectively reduce minor information and focus more on the object itself, which will further improve the performance of the model.
[0123] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present invention is limited to these examples. Under the concept of the present invention, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the present invention as described above, which are not provided in detail for the sake of simplicity.
[0124] The embodiments of the present invention are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A fine-grained visual classification method with adjustable localization and multi-angle attention, characterized in that The invention comprises a backbone network and an ALMA model, wherein the ALMA model comprises an adjustable positioning module and a multi-angle attention module. The steps of using the ALMA model for fine-grained visual classification are as follows: S1, the attention map is obtained by convolving the feature map with a 1×1 convolution kernel. The attention map is used as the input of the adjustable positioning module and the multi-angle attention module respectively. A represents the attention map, A k An attention map representing the input to the adjustable localization module; S2, the attention map A selected by the adjustable positioning module k Normalization is first performed and then input into the adjustable positioning module; S3, in the adjustable positioning module, firstly locally locate the area of interest of the target; S4, shielding a part of the background in the local positioning area through the generated background masking area, so as to better focus on the discrimination area of the object, and generating a new local positioning area; S5, enlarge and crop the new local positioning area to capture more detailed information, so that the model can focus more on the object itself and extract feature information more effectively; S6. The multi-angle attention module will enable the model to better identify the main information and the secondary information, and gradually increase the difference between the areas of attention of the two. This module hopes that the model can better distinguish the main information from the secondary information, and finally focus on the area of the main information to help the model reduce the interference of the secondary information.
2. The method of fine-grained visual classification with adjustable positioning and multi-angle attention according to claim 1, characterized in that: The backbone network is Inception v3 and Resnet101 on the three data sets CUB-200-2011, FGVC Aircraft, and Stanford Car.
3. The method of fine-grained visual classification with adjustable positioning and multi-angle attention according to claim 1, characterized in that: In S1, the attention map can be expressed as: Where f(·) represents the convolution function, F represents the feature map, A represents the attention map, and A k Represents an attention map of the input adjustable positioning module, k represents the initial attention map number, and M represents the number of set attention maps.
4. The method of fine-grained visual classification with adjustable positioning and multi-angle attention according to claim 3, characterized in that: In S2, the normalization process can be expressed as: Where max(·) and min(·) represent the maximum and minimum values of the input tensor, respectively. Indicates A K Normalized results.
5. The method of fine-grained visual classification with adjustable positioning and multi-angle attention according to claim 4, characterized in that: In S3, we first select the normalized attention map Generate a local positioning box. The process can be expressed as: Among them C k represents the entire region of 0 and 1, θ C Represents the set threshold, the selected normalized attention map Greater than the threshold θ C It will be assigned a value of 1, otherwise it will be assigned a value of 0, and then a rectangular box is generated as small as possible to contain the area assigned with a value of 1, forming a local positioning box to locate the local area.
6. The method of fine-grained visual classification with adjustable positioning and multi-angle attention according to claim 5, characterized in that: In S4, the generation of the background mask area can be expressed as: Among them A * represents the result of normalization of A, θ m Indicates the set threshold, B M Represents the entire range of 0 and 1.
7. The method of fine-grained visual classification with adjustable positioning and multi-angle attention according to claim 6, characterized in that: The steps of S5 are: S5.1, the new local positioning area will avoid the covered area and regenerate a new area; S5.
2. Minimize the new local positioning area to include C k 1, the new local positioning area is more accurate and reduces background information; S5.
3. After the new local positioning area is enlarged and cropped, a large amount of secondary information is reduced while retaining the main information. The model can pay more attention to the object itself and extract feature information more effectively.
8. The method of fine-grained visual classification with adjustable positioning and multi-angle attention according to claim 4, characterized in that: In S6, the attention map that focuses on the main information mainly focuses on the object itself, while the random attention map that focuses on the secondary information mainly observes the background area. The process of focusing on the main information can be expressed as: Where i represents the stage, j represents the prediction, and A M represents the Mth attention map, P(·) is the prediction function, F represents the feature map, and the focus on secondary information can be expressed as: Among them A r represents a random attention map, represents the Mth random attention map.
9. The method of fine-grained visual classification with adjustable positioning and multi-angle attention according to claim 8, characterized in that: Maximizing regional differences from different angles helps the model better understand the main information, thereby improving the accuracy of image prediction and obtaining the third prediction probability. The process can be expressed as: In the multi-view attention module and It will be output as an important reference for the final predicted probability. Similarly, similar operations are performed when the target positioning map is obtained, and finally four predicted probabilities are obtained.
10. The method of fine-grained visual classification with adjustable positioning and multi-angle attention according to claim 1, characterized in that: The proposed ALMA model uses different attention angle qualities to supervise and guide the attention learning process. The composition structure of the loss function is as follows: g=g ce (Y final ,Y)+ζ cl where Y final represents the final predicted label, Y represents the classification label, ζ ce represents the binary cross entropy loss function, ζ cl represents the feature center loss function, ζ ce The structure of (·,·) is as follows: Where H and W are the length and width of the predicted image. ce The structure of the feature center loss function is as follows: where f k Represents some features, c k Represents the center of some features.
