Ca-swint-based hierarchical image classification method and system

The CA-SwinT method, which introduces the SwinTransformer and a dual cross-attention mechanism, solves the problem of capturing the relationship between images and labels in hierarchical image classification, and achieves more efficient and accurate hierarchical image classification.

WO2026098241A1PCT designated stage Publication Date: 2026-05-15GUANGDONG OCEAN UNIVERSITY
View PDF 6 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
GUANGDONG OCEAN UNIVERSITY
Filing Date
2025-10-23
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively capture the complex structured relationship between images and labels in hierarchical image classification, resulting in insufficient recognition accuracy.

Method used

We adopt a CA-SwinT-based approach, combining SwinTransformer and a dual cross-attention mechanism. We extract image features through the SwinT module and use the dual cross-attention mechanism to construct a fine mapping relationship between images and labels.

Benefits of technology

It improves the accuracy and efficiency of hierarchical image classification by reducing model complexity and the number of parameters, enhancing the mapping ability between global and local image features and label semantics, and improving recognition accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025129481_15052026_PF_FP_ABST
    Figure CN2025129481_15052026_PF_FP_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of artificial intelligence, and disclosed are a CA-SwinT-based hierarchical image classification method and system. The method comprises: S1, acquiring an original image, and preprocessing the original image; S2, performing feature extraction on the image by means of a SwinT module; S3, using a dual cross-attention mechanism to fully fuse extracted image features and classification label information so as to construct fine mapping between the image and a hierarchical label; and S4, on the basis of the fine mapping in S3, generating a corresponding label by means of a label generation module, and updating the classification label information. S2 comprises: patch-based processing, linear embedding processing, two-stage Swin module processing, patch merging processing, two-stage Swin processing, and linear embedding processing. In the present invention, rich feature information of an image can be effectively extracted from spaces of different dimensions, thereby identifying a multi-level label of the image more efficiently.
Need to check novelty before this filing date? Find Prior Art

Description

A hierarchical image classification method and system based on CA-SwinT Technical Field

[0001] This invention belongs to the field of artificial intelligence technology, specifically relating to a hierarchical image classification method and system based on CA-SwinT. Background Technology

[0002] Hierarchical image classification tasks target multi-labeled images with hierarchical structures, playing a crucial role in many practical applications. To facilitate easy product searching for consumers, e-commerce platforms have built finely segmented product classification systems. In these systems, broader categories (e.g., "electronic products") extend into more detailed subcategories (e.g., "laptops"). In hierarchical image classification for design patents, an image labeled as the subcategory "bed" can also be classified under the broader category "furniture." In animal classification, the Leonberg dog can be subdivided under the category "dog" or broadly categorized under the parent category "animal." All these examples demonstrate the hierarchical relationships between labels.

[0003] In recent years, with significant breakthroughs in artificial intelligence technology, image classification and segmentation have received unprecedented attention. However, due to the more complex hierarchical dependency structure of image labels in the real world, hierarchical image classification tasks face even greater challenges. This is not only because the task difficulty far exceeds that of traditional single-label classification, but also because it requires a deep understanding and precise handling of the hierarchical relationships between multiple labels.

[0004] Previous research on hierarchical image classification has largely employed traditional convolutional neural network (CNN) methods. While these methods have achieved good results, they primarily focus on constructing and analyzing the correlation between images and labels, failing to fully consider the structured relationships between labels, and requiring multiple classifiers to complete multi-label hierarchical classification. To address this deficiency, subsequent research introduced a CNN-RNN-based approach. Although CNN-RNN methods have improved in modeling label relevance, they still rely on global image features and global correlations between labels, limiting feature description capabilities and a deeper understanding of potential label dependencies.

[0005] With the successful application of attention mechanisms in various fields, there is increasing interest in using these techniques to solve hierarchical image classification problems. Furthermore, attention-based hierarchical image classification methods have achieved better recognition results. However, despite these advancements, they still have shortcomings in fully capturing the correlation between images and labels and in terms of accuracy. Summary of the Invention

[0006] The present invention aims to improve the accuracy of hierarchical classification by using a lightweight framework, and effectively solves the shortcomings of the above-mentioned technologies.

[0007] Therefore, the purpose of this invention is to provide a hierarchical image classification method and system based on CA-SwinT. This method introduces the main mechanisms of SwinTransformer and double cross-attention mechanism. The SwinT module based on SwinTransformer effectively reduces model parameters, reduces model complexity, and extracts rich and fine-grained feature information of the image. At the same time, the double cross-attention mechanism can better construct a more comprehensive feature mapping relationship between the image and the label, thereby efficiently identifying multi-level labels of the image.

[0008] To solve the above-mentioned technical problems, the present invention is implemented as follows:

[0009] This invention provides a hierarchical image classification method based on CA-SwinT, the method comprising:

[0010] S1. Obtain the original image and preprocess the original image;

[0011] S2. Extract features from the image using the SwinT module;

[0012] S3. By utilizing the double cross-attention mechanism, the extracted image features and classification label information are fully integrated to construct a fine mapping between images and hierarchical labels;

[0013] S4. Based on the fine mapping in S3, generate the corresponding tags through the tag generation module and update the category tag information.

[0014] In addition, the hierarchical image classification method based on CA-SwinT according to the present invention may also have the following additional technical features:

[0015] In some implementations, step S2, which involves feature extraction from the image using the SwinT module, includes:

[0016] S201, Slicing and Blocking Processing: Dividing the image into a series of small blocks;

[0017] S202, Linear Embedding Processing: Flatten each block and pass it through a fully connected linear embedding layer to convert the pixel value of each block into a high-dimensional feature vector;

[0018] S203, Two-level Swing module processing: The processing results of S202 are continuously input into the two-level Swing module for feature extraction;

[0019] S204, Block merging processing: The image height and width are halved and the number of channels are doubled by downsampling the image;

[0020] S205, Two-stage Swing processing: The processing results of S204 are continuously input into the two-stage Swing module for feature extraction;

[0021] S206, Linear Embedding Processing: Perform a linear transformation on the processing result of S205.

[0022] In some implementations, the processing steps of each Swin module in steps S203 and S205 include:

[0023] Layer normalization: to achieve data standardization;

[0024] Multi-head self-attention processing: Divide all pixels of the corresponding input image into multiple windows, and calculate the correlation between each pixel and other pixels within each window to capture local features;

[0025] The residual connection process involves adding the input features directly to the self-attention processing result from the previous step to form a residual connection.

[0026] Multilayer perceptron processing: Features are transformed and combined in a complex manner through fully connected layers and nonlinear activation functions to improve the feature representation capability of the model;

[0027] Moving window multi-head self-attention processing: Divide all pixels of the corresponding input image into multiple windows. When dividing the windows, shift the divided windows to the right and down by several pixels at the same time. Calculate the correlation between each pixel and other pixels within each window, thereby realizing information interaction between different windows.

[0028] The residual connection process involves adding the input features directly to the self-attention processing result from the previous step to form a residual connection.

[0029] Multilayer perceptron processing: By using fully connected layers and nonlinear activation functions to perform complex transformations and combinations on features, the feature representation capability of the model is improved.

[0030] In some implementations, step S3 utilizes a dual cross-attention mechanism to fully fuse extracted image features and label information, constructing a fine mapping between the image and hierarchical labels.

[0031] S301. Use the features of each block extracted by the SwinT module as keys and values, use the current classification label information as queries, perform multi-head attention mechanism processing, merge the processing results and then perform layer normalization processing to obtain the output result of the first layer cross-attention mechanism.

[0032] S302. Using the features of each block extracted by the SwinT module as keys and values, and the results of S301 as queries, perform multi-head attention mechanism processing, merge the processing results and then perform layer normalization processing to obtain the output results of the second layer cross-attention mechanism.

[0033] In some implementations, the content of generating the corresponding tags through the tag generation module includes:

[0034] S401, Multilayer Perceptron Processing: Processes input data through two fully connected layers to improve feature representation capabilities;

[0035] S402. Classification Processing: Confidence is calculated using the softmax function to achieve classification.

[0036] This invention also provides a hierarchical image classification system based on CA-SwinT, the system comprising:

[0037] The preprocessing module is used to receive the original image and preprocess the original image;

[0038] The feature extraction module is used to extract features from images using the SwinT module;

[0039] The dual cross-attention module is used to fully integrate the extracted image features and classification label information using the dual cross-attention mechanism, and to construct a fine mapping between the image and the hierarchical label.

[0040] The tag generation module is used to generate corresponding tags based on the fine mapping obtained by the dual cross-attention module and update the classification tag information.

[0041] In addition, the hierarchical image classification system based on CA-SwinT according to the present invention may also have the following additional technical features:

[0042] In some embodiments, the feature extraction module includes the following components connected in sequence:

[0043] Slicing and partitioning layer: Used to divide an image into a series of small blocks;

[0044] Linear embedding layer: used to flatten each block and pass it through a fully connected linear embedding layer to transform the pixel values ​​of each block into a high-dimensional feature vector;

[0045] Two-level Swin module: used to extract features from the processing results of the previous linear embedding layer;

[0046] Block merging module: used to halve the height and width of an image and double the number of channels by downsampling;

[0047] Two-level Swin module: used to extract features from the processing results of the previous block merging module;

[0048] Linear Embedding Module: Used to perform linear transformations on the processing results of the previous two Swin modules.

[0049] In some implementations, each level of the Swin module includes sequentially connected:

[0050] Layer normalization layer: Used to standardize input data;

[0051] Multi-head self-attention module: It is used to divide all the pixels of the corresponding input image into multiple windows, calculate the correlation between each pixel and other pixels within each window, and thus capture local features;

[0052] Residual connection + layer normalization module: used to directly add the input features to the self-attention processing result of the previous module to form a residual connection, and then perform layer normalization processing;

[0053] Multilayer perceptron: used to perform complex transformations and combinations of features through fully connected layers and non-linear activation functions, thereby improving the feature representation capability of the model;

[0054] The moving window multi-head self-attention module is used to divide all the pixels of the corresponding input image into multiple windows. When dividing the windows, the divided windows are simultaneously shifted to the right and down by several pixels. Within each window, the correlation between each pixel and other pixels is calculated, thereby realizing information interaction between different windows.

[0055] Residual connection + layer normalization module: used to directly add the input features to the self-attention processing result of the previous module to form a residual connection, and then perform layer normalization processing;

[0056] Multilayer perceptron: Used to perform complex transformations and combinations of features through fully connected layers and non-linear activation functions, thereby improving the feature representation capability of the model.

[0057] In some of these implementations, the dual cross-concern module includes:

[0058] The first cross-attention mechanism layer: uses the features of each block extracted by the SwinT module as keys and values, the current classification label information as queries, performs multi-head attention mechanism processing, merges the processing results and performs layer normalization processing to obtain the output result of the first layer cross-attention mechanism.

[0059] The second cross-focus mechanism layer is used to take the features of each block extracted by the SwinT module as keys and values, take the output of the first-layer cross-focus mechanism as a query, perform multi-head focus mechanism processing, merge the processing results and then perform layer normalization processing to obtain the output of the second-layer cross-focus mechanism.

[0060] In some embodiments, the label generation module includes:

[0061] Multilayer perceptron: Used to process input data through two fully connected layers to improve feature representation capabilities;

[0062] Classification module: Used to calculate confidence scores using the softmax function, thereby achieving classification.

[0063] Compared with the prior art, the present invention has at least the following beneficial effects:

[0064] In this embodiment of the invention, the hierarchical image classification method based on CA-SwinT provided has better feature representation capabilities. This advantage mainly comes from the local window attention mechanism and window movement strategy of the SwinT module, which can better capture the global and detailed information of the image while reducing the number of model parameters and building a lightweight framework.

[0065] In this embodiment of the invention, the hierarchical image classification method based on CA-SwinT provided has higher accuracy. This advantage mainly comes from the dual cross-attention mechanism, which can effectively exchange information between different modal features and enhance the mapping ability between global and local features of the image and the semantics of the label. This mechanism helps to more accurately represent the mapping between complex image content and semantics, and increase the recognition accuracy of the model.

[0066] In this embodiment of the invention, the provided CA-SwinT-based hierarchical image classification method has higher efficiency. This advantage mainly comes from the combination of the SwinT module and the dual cross-attention module, which constitutes the entire CA-SwinT model. Specifically, the SwinT module segments the image into small windows using a moving window mechanism and calculates attention within local regions. This significantly reduces computational complexity, and the moving window mechanism ensures that features across windows can share information, further improving model efficiency. The dual cross-attention module effectively reduces redundant computation by exchanging feature attention across modalities, focusing only on important feature relationship mappings, thereby improving computational efficiency.

[0067] The CA-SwinT-based hierarchical image classification system of the present invention can realize the content of the CA-SwinT-based hierarchical image classification method, and therefore has at least all the features and advantages of the CA-SwinT-based hierarchical image classification method, which will not be repeated here. Additional aspects and advantages of the present invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0068] Figure 1 is a flowchart of a hierarchical image classification method based on CA-SwinT disclosed in an embodiment of the present invention;

[0069] Figure 2 is a schematic diagram of the structure of each module used in the hierarchical image classification method based on CA-SwinT disclosed in an embodiment of the present invention. Detailed Implementation

[0070] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0071] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings and specific examples and application scenarios.

[0072] In some embodiments of the present invention, a hierarchical image classification method based on CA-SwinT is provided. This method introduces the main mechanisms of SwinTransformer and double cross-attention mechanism. The SwinT module based on SwinTransformer effectively reduces model parameters, reduces model complexity, and extracts rich and fine-grained feature information of the image. At the same time, the double cross-attention mechanism can better construct a more comprehensive feature mapping relationship between the image and the label, thereby efficiently identifying multi-level labels of the image.

[0073] Referring to Figure 1, in some embodiments of the present invention, the method includes the following three main parts: a SwinT module, a dual cross-interest module, and a label generation module. The SwinT module is mainly responsible for extracting image features, the dual cross-interest module is responsible for modeling the association between the image and the label, and the label generation module is used to obtain the final label information of the image. The steps of this classification method include:

[0074] Step 1: First, preprocess the image data to create a label file (JSON file) corresponding to the image data. This label file is used as input for model training and for calculating model accuracy during optimization.

[0075] Step 2: The image data is first processed by the SwinT module, which is mainly responsible for extracting image features. The module structure is shown in Figure 2, and mainly includes slicing, linear embedding, the Swin module, and slice merging. Its structure consists of a slicing layer, a linear embedding layer, a two-level Swin module, a slice merging layer, another two-level Swin module, and a linear embedding layer, arranged sequentially. Wherein:

[0076] The slice-and-block layer divides the image into a series of small, non-overlapping patches, allowing the model to perform local processing on each patch and effectively reducing the computational complexity of the model. Here, the input image (H×W×3) is divided into several 4×4 image patches, for a total of (H / 4)×(W / 4)×48 image patches, where 48 represents the number of channels.

[0077] In the linear embedding layer, each patch is flattened and passed through a fully connected linear embedding layer, which transforms the pixel values ​​of each patch into a higher-dimensional feature vector to better capture features, adjusting the number of channels to 96.

[0078] The Swin module, derived from the Swin Transformer Block in the SwinTransformer model, achieves feature perception and information fusion from local to global perspectives through a series of carefully designed sub-modules. The structure of the Swin module is shown in Figure 2, and mainly includes, in sequence, a layer normalization module, a window multi-head self-attention module (W-MSA), a residual connection + layer normalization module, a multilayer perceptron, a shifted window multi-head self-attention module (SW-MSA), a residual connection + layer normalization module, and a multilayer perceptron.

[0079] In some embodiments of this application, layer normalization serves to: standardize the input of each layer, making the neural network easier to train, accelerating convergence, and enabling the model to achieve better performance with fewer training epochs; this is typically achieved by normalizing the activation values ​​of each sample to a mean of 0 and a variance of 1, and then applying learnable scaling and translation parameters. The Windowed Multi-Head Self-Attention (W-MSA) module divides all pixels (i.e., the input image) into multiple fixed-size windows, and then calculates the correlation between each pixel and other pixels within each window, thereby capturing local features. The Shifted Windowed Multi-Head Self-Attention (SW-MSA) module shifts the window division to the right and down by x pixels simultaneously, thereby enabling information interaction between different windows. This significantly reduces computational cost. Simultaneously, W-MSA and SW-MSA are performed alternately, allowing the self-attention module to gradually increase its perceptual range from local to global through layer-by-layer stacking. Residual connections: Input features are directly added to the output of the self-attention module to form residual connections. These connections reduce gradient vanishing, promote gradient flow, prevent degradation, and make the model easier to train, thereby optimizing deep models. Adding a normalization layer further stabilizes the training process. Multilayer Perceptron (MLP): Through fully connected layers and non-linear activation functions, MLPs perform complex transformations and combinations of features, enhancing the model's feature representation capabilities.

[0080] The attention mechanism algorithm for each Swin module is as follows: r′ l =Q W-MSA (LN(r′ l-1 ))+r′ l-1 (1) r l =MLP(LN(r l ))+r′ l (2) r′ l+1 =Q SW-MSA (LN(r l ))+r l (3) r l+1 =MLP(LN(r′) l+1 ))+r′ l+1 (4)

[0081] The Swin module described above in this invention, by alternating between W-MSA and SW-MSA, can gradually increase the perceptual range in a layer-by-layer stacking process, capturing global features from local features; through window partitioning and shifting operations, the Swin module can significantly reduce the amount of computation and improve model efficiency; the use of layer normalization and residual connections makes the Swin module more stable and easier to optimize during training.

[0082] The slicing and merging layer primarily downsamples the image to reduce the size of the feature map and increase the number of channels. In this embodiment, the height and width are halved, and the number of channels is doubled. Here, the image size becomes (H / 8) × (W / 8) × 192. Afterward, it undergoes two Swin modules and a linear transformation. After processing by the entire SwinT module, the resulting feature representation is: r = Q SwinT (x) (5)

[0083] The resulting image feature size is (H / 8)×(W / 8)×d m .

[0084] In this embodiment, the two-stage Swing processing after the block merging layer aims to further capture high-level features in the image, providing a more effective feature representation for subsequent classification. A further linear embedding process is then performed, primarily for channel number transformation.

[0085] Step 3: Introduce a dual cross-attention mechanism, using the text label information input stream to guide the features of the image input stream, to achieve full information fusion and construct a fine-level mapping between the image and the hierarchical labels.

[0086] Referring to Figure 2, in the dual cross-focus module, the feature vector r obtained from the SwinT module is used as the key and value extracted from the image, and the corresponding label w is used as the query. Let... and Given the learned weight matrix, then An attention weight matrix is ​​calculated based on the query Q and key K, and the similarity between the query and the key is measured using a dot product operation. As follows:

[0087] Here, j takes the value 1 or 2, representing the first-layer cross-attention mechanism or the second-layer cross-attention mechanism, respectively. V i j The dimensions are all i represents the number of followers. This is the dimension of the key, used to scale the dot product result. We focus on a total of t heads, and... This mechanism allows each attention head to learn the correlation between global image features and the current label independently, generating image-label attention graphs at different dimensional levels.

[0088] Subsequently, the outputs of the multi-head attention are concatenated and transformed using a linear transformation matrix W. h1Generate the attention output. This output is then reintegrated with the initial input via a residual connection and layer normalized to obtain the output H1 of the first layer of the cross-attention mechanism. This step helps mitigate overfitting and enhances the model's stability.

[0089] In the second layer of the dual cross-attention mechanism, the output H1 of the first layer is used as the query for further querying, while the original image features are reused as keys and values ​​to further learn the mapping relationship between image features and hierarchical labels at a deeper level. For the attention of each head, a new set of linear transformation matrices is used to calculate the attention scores of these inputs, which are then scaled and normalized to determine the weight distribution, as shown in Equation (6), where j is 2. Similar to the first layer, the attention outputs of all heads are concatenated and then processed by a linear matrix W. h2 Perform the transformation to generate the final output of this layer:

[0090] H2 represents the relational mapping representation obtained after fully considering the association between the image and the hierarchical label, providing information-rich fusion features for subsequent hierarchical classification.

[0091] The output of the second-layer cross-interest mechanism is combined with the output H1 of the first-layer cross-interest mechanism via a residual connection. Subsequently, the data is layer-normalized to generate the final output Z of the dual cross-interest mechanism. x The calculation is as follows: Z x =LayerNorm(H1+H2) (9)

[0092] A dual cross-attention mechanism is employed to establish a two-way cross-attention relationship between images and text labels. On the one hand, text label information is used to guide the learning of image features, making the image features more consistent with the descriptions of the text labels; on the other hand, image features can also be used to enrich the representation of text labels, making them more specific and accurate. This two-way information flow helps to achieve full integration between images and text labels, constructing a more refined mapping relationship between images and hierarchical labels.

[0093] Step 4: Obtain comprehensive attention information Z x Finally, the hierarchical label information is obtained using the label generation module. The label generation module consists of an MLP layer and a softmax layer. The MLP layer uses two fully connected layers, followed by a softmax function to obtain the confidence score for each label.

[0094] Finally, the model training uses cross-entropy as the loss function. The formulas are as follows:

[0095] Where N is the total number of data samples, and M is the total number of label categories. ik This represents the true label value of the current sample. Predict the label value for the current sample.

[0096] For any parts of this invention not described in detail, please refer to the prior art or techniques known to those skilled in the art.

[0097] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of the present invention.

Claims

1. A hierarchical image classification method based on CA-SwinT, characterized in that, The method includes: S1. Obtain the original image and preprocess the original image; S2. Extract features from the image using the SwinT module; S3. By utilizing the double cross-attention mechanism, the extracted image features and classification label information are fully integrated to construct a fine mapping between images and hierarchical labels; S4. Based on the fine mapping in S3, generate the corresponding labels through the label generation module and update the category label information; Step S2, which involves feature extraction from the image using the SwinT module, includes: S201, Slicing and Blocking Processing: Dividing the image into a series of small blocks; S202, Linear Embedding Processing: Flatten each block and pass it through a fully connected linear embedding layer to convert the pixel value of each block into a high-dimensional feature vector; S203, Two-level Swing module processing: The processing results of S202 are continuously input into the two-level Swing module for feature extraction; S204, Block merging processing: The image height and width are halved and the number of channels are doubled by downsampling the image; S205, Two-stage Swing processing: The processing results of S204 are continuously input into the two-stage Swing module for feature extraction; S206, Linear Embedding Processing: Perform a linear transformation on the processing result of S205. The processing steps of each Swin module in steps S203 and S205 each include the following sequential steps: Layer normalization: to achieve data standardization; Multi-head self-attention processing: Divide all pixels of the corresponding input image into multiple windows, and calculate the correlation between each pixel and other pixels within each window to capture local features; The residual connection process involves adding the input features directly to the self-attention processing result from the previous step to form a residual connection. Multilayer perceptron processing: Features are transformed and combined in a complex manner through fully connected layers and nonlinear activation functions to improve the feature representation capability of the model; Moving window multi-head self-attention processing: Divide all pixels of the corresponding input image into multiple windows. When dividing the windows, shift the divided windows to the right and down by several pixels at the same time. Calculate the correlation between each pixel and other pixels within each window, thereby realizing information interaction between different windows. The residual connection process involves adding the input features directly to the self-attention processing result from the previous step to form a residual connection. Multilayer perceptron processing: Features are transformed and combined in a complex manner through fully connected layers and nonlinear activation functions to improve the feature representation capability of the model; Step S3, which utilizes a dual cross-attention mechanism to fully fuse extracted image features and label information and construct a fine-grained mapping between images and hierarchical labels, includes the following steps: S301. Use the features of each block extracted by the SwinT module as keys and values, use the current classification label information as queries, perform multi-head attention mechanism processing, merge the processing results and then perform layer normalization processing to obtain the output result of the first layer cross-attention mechanism. S302. Use the features of each block extracted by the SwinT module as keys and values, use the results of S301 as queries, perform multi-head attention mechanism processing, merge the processing results and then perform layer normalization processing to obtain the output results of the second layer cross-attention mechanism. The content generated by the tag generation module includes: S401, Multilayer Perceptron Processing: Processes input data through two fully connected layers to improve feature representation capabilities; S402. Classification Processing: Confidence is calculated using the softmax function to achieve classification.

2. A hierarchical image classification system based on CA-SwinT, characterized in that, The system is capable of implementing the CA-SwinT-based hierarchical image classification method as described in claim 1; the system comprises: The preprocessing module is used to receive the original image and preprocess the original image; The feature extraction module is used to extract features from images using the SwinT module; The dual cross-attention module is used to fully integrate the extracted image features and classification label information using the dual cross-attention mechanism, and to construct a fine mapping between the image and the hierarchical label. The tag generation module is used to generate corresponding tags based on the fine mapping obtained by the dual cross-attention module and update the classification tag information.

3. The hierarchical image classification system based on CA-SwinT according to claim 2, characterized in that, The feature extraction module comprises the following components connected in sequence: Slicing and partitioning layer: Used to divide an image into a series of small blocks; Linear embedding layer: used to flatten each block and pass it through a fully connected linear embedding layer to transform the pixel values ​​of each block into a high-dimensional feature vector; Two-level Swin module: used to extract features from the processing results of the previous linear embedding layer; Block merging module: used to halve the height and width of an image and double the number of channels by downsampling; Two-level Swin module: used to extract features from the processing results of the previous block merging module; Linear Embedding Module: Used to perform linear transformations on the processing results of the previous one or two Swin modules.

4. The hierarchical image classification system based on CA-SwinT according to claim 3, characterized in that, Each level of the Swin module includes the following sequentially connected components: Layer normalization layer: Used to standardize input data; Multi-head self-attention module: It is used to divide all the pixels of the corresponding input image into multiple small windows, calculate the correlation between each pixel and other pixels within each window, and thus capture local features; Residual connection + layer normalization module: This module adds the input features directly to the self-attention processing result of the previous module to form a residual connection, and then performs layer normalization processing to alleviate the gradient vanishing problem. Multilayer perceptron: used to perform complex transformations and combinations of features through fully connected layers and non-linear activation functions, thereby improving the feature representation capability of the model; The moving window multi-head self-attention module is used to divide all the pixels of the corresponding input image into multiple small windows. When dividing the windows, the divided windows are simultaneously shifted to the right and down by several pixels. Within each window, the correlation between each pixel and other pixels is calculated, thereby realizing information interaction between different windows. Residual connection + layer normalization module: This module adds the input features directly to the self-attention processing result of the previous module to form a residual connection, and then performs layer normalization processing to alleviate the gradient vanishing problem. Multilayer perceptron: Used to perform complex transformations and combinations of features through fully connected layers and non-linear activation functions, thereby improving the feature representation capability of the model.

5. The hierarchical image classification system based on CA-SwinT according to claim 4, characterized in that, The dual-cross attention module includes: The first cross-attention mechanism layer: uses the features of each block extracted by the SwinT model as keys and values, the current classification label information as queries, performs multi-head attention mechanism processing, merges the processing results and performs layer normalization processing to obtain the output result of the first cross-attention mechanism layer. The second cross-attention mechanism layer: uses the features of each block extracted by the SwinT model as keys and values, takes the output of the first-layer cross-attention mechanism as a query, performs multi-head attention mechanism processing, merges the processing results and performs layer normalization processing to obtain the output of the second-layer cross-attention mechanism.

6. The hierarchical image classification system based on CA-SwinT according to claim 4, characterized in that, The label generation module includes: Multilayer perceptron: Used to process input data through two fully connected layers to improve feature representation capabilities; Classification module: Used to calculate confidence scores using the softmax function, thereby achieving classification.