An image classification system and method based on ResNet improvement

By introducing a multi-scale receptive field dilated residual module and an attention mechanism module into the ResNet network, the problems of large target scale differences and noise in image classification are solved, thereby improving classification accuracy.

CN117409259BActive Publication Date: 2026-07-03ANHUI NORMAL UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ANHUI NORMAL UNIV
Filing Date
2023-11-23
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

The existing ResNet network faces increased classification difficulty in image classification due to the large differences in the scale of the classification targets, as well as high noise and low resolution, which affects the classification performance.

Method used

An improved ResNet-based approach is adopted, combining a multi-scale receptive field dilated residual module and an attention mechanism module. Through preprocessing, feature extraction, and classification prediction, the feature extraction capability and classification accuracy are improved.

Benefits of technology

By combining a multi-scale receptive field structure and an attention mechanism module, the feature extraction performance and classification accuracy of the ResNet model are improved, especially with an accuracy improvement of approximately 3.4% on the ImageNet-1K dataset.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117409259B_ABST
    Figure CN117409259B_ABST
Patent Text Reader

Abstract

This invention provides an image classification system and method based on an improved ResNet, comprising: a preprocessing module for preprocessing acquired images to generate feature maps; a feature extraction module comprising a combination of several sequentially connected dilated residual modules and attention mechanism modules, wherein in each combination, the dilated residual module extracts features from the input feature map and extracts detailed features through a multi-scale receptive field; the attention mechanism module extracts effective information about the target of interest from the feature map output by the dilated residual module from three dimensions and suppresses noise in the feature map, and the resulting feature map is output after fusing the feature map input by the dilated residual module; and a classification prediction module for performing classification prediction on the feature map output by the feature extraction module and outputting the final classification result. This invention can effectively improve the feature extraction effect, help to filter out meaningful feature information, and improve classification accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing technology, specifically relating to an image classification system and method based on an improved ResNet. Background Technology

[0002] ResNet, a classic backbone framework for deep learning, solved the vanishing gradient problem that has plagued deep learning by proposing the residual connection method, thus enhancing the feature extraction capabilities of convolutional neural network models. While ResNet has achieved significant results in improving the learning capabilities of convolutional neural networks, its application in classification, localization, detection, and segmentation problems still needs further improvement.

[0003] In the field of image classification, the significant differences in the scale of the classification target across images increase the difficulty of classification, leading to unsatisfactory results. For example, using the ImageNet-1K dataset for a classification task, which contains 1,281,167 images and a validation set of 50,000 images, resulting in 1,000 different categories, and without any constraints on image size, ImageNet-1K contains real-world objects that are not only noisy and low-resolution, but also vary in scale and features, posing a considerable challenge to recognition. Summary of the Invention

[0004] This invention addresses the shortcomings of existing technologies by providing an image classification system based on an improved ResNet.

[0005] To achieve the above objectives, the present invention adopts the following technical solution:

[0006] An image classification system based on an improved ResNet, characterized by comprising:

[0007] The preprocessing module is used to preprocess the acquired images and generate feature maps.

[0008] The feature extraction module consists of a combination of several sequentially connected dilated residual modules and attention mechanism modules. In each combination, the dilated residual module extracts features from the input feature map and extracts detailed features through a multi-scale receptive field. The attention mechanism module obtains effective information about the target of interest from three dimensions of the feature map output by the dilated residual module and suppresses noise in the feature map. The resulting feature map is output after fusing the feature map input by the dilated residual module.

[0009] The classification prediction module is used to perform classification prediction on the feature maps output by the feature extraction module and output the final classification result.

[0010] To optimize the above technical solution, the specific measures also include:

[0011] Furthermore, the preprocessing module processes the acquired image format (C, H, W) into (C, 256, 256); then crops it to (C, 224, 224) through random centering, sets the random horizontal flip probability to 0.5, and performs normalization; finally, it generates a feature map through convolution and max pooling operations; where C is the number of image channels, H is the image height, and W is the image width.

[0012] Furthermore, the dilated residual module sequentially includes a 1×1 convolutional layer, a depth-separable dilated convolutional layer, a 3×3 convolutional layer, and a 1×1 convolutional layer. The preprocessed image first passes through a 1×1 convolutional layer to compress the number of feature map channels; then it enters a dilated convolutional layer, the dilation rate of which is set by the multi-scale receptive field; next, it enters a 3×3 convolutional layer, where the information contained in a single pixel in the feature map is at least a 5×5 region in the original feature map input to the dilated convolutional layer; finally, it enters a 1×1 convolutional layer to restore the number of channels in the feature map.

[0013] Furthermore, the attention mechanism module obtains effective information about the target of attention from three dimensions of the feature map, as follows:

[0014] The feature map input to the attention mechanism module is represented as follows: C represents the number of image channels, H represents the image height, and W represents the image width. Compression of each of the three dimensions of the feature map yields three feature tensors.

[0015]

[0016] In the formula, and These represent average pooling operations performed on the (H, W), (C, H), and (C, W) dimensions of the feature map X, respectively. These represent summations of elements along the (H, W), (C, H), and (C, W) dimensions, respectively, centered at dimensions C, W, and H.

[0017] For three feature tensors Feature mapping was performed separately to obtain

[0018]

[0019] In the formula, δ is the nonlinear activation function, F C F W F H These represent the feature maps corresponding to dimensions C, W, and H, respectively; ω C ω Wω H These represent the weights corresponding to dimensions C, W, and H, respectively. C b W b H These represent the bias parameters corresponding to the C, W, and H dimensions, respectively.

[0020] Z obtained from feature mapping c Z W Z H Tensor multiplication is performed to obtain the corresponding tensor attention weights. The feature map X is obtained by element-wise multiplying the feature map X with the tensor attention weights (attention) to obtain the feature map output by the attention mechanism module.

[0021]

[0022] In the formula, This indicates element-wise multiplication between tensors, and σ represents the sigmoid activation function.

[0023] Furthermore, the classification prediction module performs a fully connected (FC) operation on the feature map output by the feature extraction module, performs classification processing on the fully connected feature map, outputs a probability value for each category, and takes the classification result with the highest probability value as the final prediction result.

[0024] Furthermore, this invention proposes an image classification method based on an improved ResNet, characterized by the following steps:

[0025] The acquired images are preprocessed to generate feature maps;

[0026] Feature extraction is performed on the input feature map, and detailed features are extracted through multi-scale receptive fields. Based on the attention mechanism, effective information of the target of interest is obtained from the feature map from three dimensions, and noise in the feature map is suppressed. The resulting feature map is then output after fusing with the input feature map.

[0027] Perform classification prediction on the output feature map and output the final classification result.

[0028] Furthermore, the data preprocessing involves processing the acquired image format (C, H, W) into (C, 256, 256); then cropping it to (C, 224, 224) using a random center, setting the random horizontal flip probability to 0.5, and performing a normalization operation; finally, generating a feature map through convolution and max pooling operations; where C is the number of image channels, H is the image height, and W is the image width.

[0029] Furthermore, feature extraction is performed on the preprocessed image, and detailed features are extracted through multi-scale receptive fields to generate a feature map, as detailed below:

[0030] The preprocessed image first passes through a 1×1 convolutional layer to compress the number of feature map channels; then it enters a dilated convolutional layer, the dilation rate of which is set by the multi-scale receptive field; next, it enters a 3×3 convolutional layer, where the information contained in a single pixel in the feature map is at least a 5×5 region in the original feature map input to the dilated convolutional layer; finally, it enters a 1×1 convolutional layer to restore the number of channels in the feature map, and the restored feature map is fused with the original feature map and output.

[0031] Furthermore, the effective information of the target of interest is obtained from the three dimensions of the feature map based on the attention mechanism, as follows:

[0032] Feature map representation C represents the number of image channels, H represents the image height, and W represents the image width. Compression of each of the three dimensions of the feature map yields three feature tensors.

[0033]

[0034] In the formula, and These represent average pooling operations performed on the (H, W), (C, H), and (C, W) dimensions of the feature map X, respectively. These represent summations of elements along the (H, W), (C, H), and (C, W) dimensions, respectively, centered at dimensions C, W, and H.

[0035] For three feature tensors Feature mapping was performed separately to obtain

[0036]

[0037] In the formula, δ is the nonlinear activation function, F C F W F H These represent the feature maps corresponding to dimensions C, W, and H, respectively; ω C ω W ω H These represent the weights corresponding to dimensions C, W, and H, respectively. C b W b H These represent the bias parameters corresponding to the C, W, and H dimensions, respectively.

[0038] Z obtained from feature mapping c Z W ZH Tensor multiplication is performed to obtain the corresponding tensor attention weights. The feature map X is obtained by element-wise multiplying the feature map X with the tensor attention weights (attention).

[0039]

[0040] In the formula, This indicates element-wise multiplication between tensors, and σ represents the sigmoid activation function.

[0041] Furthermore, the classification prediction is performed on the feature map after the attention mechanism is processed, and the final classification result is output, as follows:

[0042] The output feature map is subjected to a fully connected (FC) operation. After the feature map is fully connected, it is classified. A probability value is output for each category, and the classification result with the highest probability value is taken as the final prediction result.

[0043] The beneficial effects of this invention are:

[0044] 1. This invention, based on the ResNet model, designs a dilated residual module with a multi-scale receptive field structure. This expands the receptive field size when the feature map is convolved in different dilated residual modules, and the size of the receptive field can be adjusted according to the change in the feature map downsampling size. This design allows the network to extract detailed features of different sizes from the feature map in different dilated residual modules, thereby improving the feature extraction performance of the ResNet model.

[0045] 2. In this invention, the feature map processed by the hollow residual module is fused with the original input feature map through the add function, so that the feature map retains both the high-level abstract semantic information after processing and some low-level semantic information.

[0046] 3. This invention designs an attention mechanism module that fully utilizes the feature information of the three dimensions (C, H, W) of the feature map to calculate the weight corresponding to each element in the feature map. This helps to filter out meaningful feature information. For effective information, the attention mechanism module will assign a larger weight value to the element, while for noise, it will assign a weight close to 0, so that the network can ignore noise as much as possible and focus on calculating effective information, thereby improving the classification accuracy. Attached Figure Description

[0047] Figure 1 This is a diagram illustrating the implementation process of the image classification method based on the improved ResNet proposed in this invention.

[0048] Figure 2This is a flowchart of the processing of the void residual module proposed in this invention.

[0049] Figure 3 This is a flowchart of the downsampling process performed by the void residual module proposed in this invention.

[0050] Figure 4 This is a flowchart of the attention mechanism module proposed in this invention. Detailed Implementation

[0051] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.

[0052] Example 1

[0053] This invention proposes an image classification system based on an improved ResNet, comprising:

[0054] The preprocessing module is used to preprocess the acquired images and generate feature maps.

[0055] The feature extraction module consists of a combination of several sequentially connected dilated residual modules and attention mechanism modules. In each combination, the dilated residual module extracts features from the input feature map and extracts detailed features through a multi-scale receptive field. The attention mechanism module obtains effective information about the target of interest from three dimensions of the feature map output by the dilated residual module and suppresses noise in the feature map. The resulting feature map is output after fusing the feature map input by the dilated residual module.

[0056] The classification prediction module is used to perform classification prediction on the feature maps output by the feature extraction module and output the final classification result.

[0057] In the image classification process, the image classification system is an image processing model built based on ResNet50, a Dil-Residual module, and an attention mechanism module. The multi-scale receptive field structure in the Dil-Residual module enhances the network's ability to capture detailed information in feature maps. Combined with the attention mechanism module, the network can strengthen the effective information in each dimension of the feature maps and suppress noise, thus enhancing the overall feature extraction capability of the network. On the ImageNet-1k public dataset, this invention, through an improved ResNet50-like network structure, can improve the classification accuracy of ResNet50 by approximately 3.4%.

[0058] In this embodiment, to better facilitate the input of image data to the Dil-Residual module, data preprocessing includes:

[0059] The input image format (C, H, W) is processed into (C, 256, 256), then cropped to (C, 224, 224) through random centering. The random horizontal flip probability is set to 0.5, and the image is normalized. Finally, a feature map is generated through convolution and max pooling operations. Here, C is the number of image channels, H is the image height, and W is the image width.

[0060] In this embodiment, the Dil-Residual module is a convolutional module designed inside the network. After each convolutional layer, a normalization layer (BN) and an activation layer (ReLU) are passed; for example, if the input image data format is (3, 128, 96), after data preprocessing and transformation, it becomes (3, 24, 224).

[0061] In this embodiment, to achieve the output of the convolutional layer feature map, the feature extraction module's processing includes:

[0062] The preprocessed feature map is processed by the Dil-Residual module to extract different features, and detailed features are obtained by multi-scale receptive field fusion.

[0063] Meaningful features in different dimensions are obtained through fusion processing by the attention mechanism module;

[0064] The image features obtained by the attention mechanism module are extracted, and the image features are convolved and fused to output a feature map.

[0065] The Dil-Residual module handles the following:

[0066] The feature map enters the Dil-Residual module, where it first passes through a 1×1 convolution to compress the number of channels in the feature map;

[0067] Next, a depth-separable void convolutional layer is entered, the void ratio of which is set by the multi-scale receptive field;

[0068] Then, it enters the regular 3×3 convolution. After the feature map is dilated and then convolved with the regular 3×3, the information contained in a single pixel in the feature map is at least a 5×5 area in the original feature map.

[0069] Finally, it re-enters a 1×1 convolution to restore the number of channels in the feature map.

[0070] For the Dil-Residual module with downsampling operation, simple pooling and convolution operations are performed on the original input feature map to preserve its original low-level semantic information as much as possible.

[0071] In the Dil-Residual module, the input feature map is first reduced in dimensionality to compress the number of channels, and then continuous dilated convolution and regular 3×3 convolution operations are used to expand the overall receptive field of the network, which can capture more detailed information and different features in the feature map. The Dil-Residual module can effectively reduce the information loss caused by downsampling.

[0072] In the Dil-Residual module, multi-scale receptive field fusion includes:

[0073] Based on the size change of the feature map caused by the downsampling operation during convolution, dilated convolutions of different sizes are used to adjust the receptive field of the network at multiple scales, so that the network can capture detailed information of the feature map during the convolution operation.

[0074] Because of the downsampling operation in the network, if the receptive field remains consistently large, it will fail to capture more detailed features when the feature map size is small, and conversely, it will fail to capture global information from the feature map. Designing a multi-scale receptive field fusion structure can effectively solve this problem. By controlling the dilation rate parameter of the dilated convolution, different receptive field sizes can be set in different Dil-Residual modules, so that the overall receptive field of the network shrinks as the feature map size decreases, thus ensuring that the overall receptive field size of the network is appropriate.

[0075] In this embodiment, to better complete feature extraction, the attention mechanism module processes the following:

[0076] Attention is focused on the key target regions in the feature map from three different dimensions (C, H, W) to obtain effective information about the target and suppress noise in the feature map.

[0077] Since feature maps from different channels capture one or more features from the original image, and different locations within these feature maps also possess different feature information, the attention mechanism helps to filter out meaningful feature information. For effective information, the attention mechanism assigns a larger weight value to the element, while assigning a weight close to 0 to noise, allowing the network to ignore noise as much as possible and focus on calculating effective information.

[0078] In the attention mechanism module, the currently input feature map is represented as follows: Compression of the three dimensions of the feature map yields three feature tensors.

[0079]

[0080] In the formula, and These represent average pooling operations performed on the (H, W), (C, H), and (C, W) dimensions of the feature map X, respectively. These represent summations of elements along the (H, W), (C, H), and (C, W) dimensions, respectively, centered at dimensions C, W, and H.

[0081] For three feature tensors Feature mapping was performed separately to obtain

[0082]

[0083] In the formula, δ is the nonlinear activation function, F C F W F H These represent the feature maps corresponding to dimensions C, W, and H, respectively; ω C ω W ω H These represent the weights corresponding to dimensions C, W, and H, respectively. C b W b H These represent the bias parameters corresponding to the C, W, and H dimensions, respectively.

[0084] Regarding the above Z c Z W Z H Perform tensor multiplication to obtain the corresponding tensor attention weights. feature map and Element-wise multiplication yields feature maps obtained through the attention mechanism.

[0085]

[0086] Among them, symbols This indicates element-wise multiplication between tensors. The symbol × represents tensor multiplication, and σ represents the sigmoid activation function, which controls the attention weights between 0 and 1.

[0087] The feature map processed by the attention mechanism is fused with the original input feature map through the add function, so that the feature map retains both the high-level abstract semantic information after processing and some low-level semantic information.

[0088] Example 2

[0089] This invention also provides an image classification method based on an improved ResNet50, comprising the following steps:

[0090] The acquired images are preprocessed to generate feature maps;

[0091] Feature extraction is performed on the input feature map, and detailed features are extracted through multi-scale receptive fields. Based on the attention mechanism, effective information of the target of interest is obtained from the feature map from three dimensions, and noise in the feature map is suppressed. The resulting feature map is then output after fusing with the input feature map.

[0092] Perform classification prediction on the output feature map and output the final classification result.

[0093] The image classification method corresponds to the image classification system in Example 1. The specific principles and processes of each step are the same as the workflow of each module of the image classification system, so they will not be repeated here.

[0094] Next, this invention provides a specific implementation process for the image classification method, such as... Figure 1 As shown, it includes the following steps:

[0095] Step 1: The input image data format is (3, 128, 96). After data preprocessing and transformation, it becomes (3, 224, 224). After 7x7 convolution and 3×3 max pooling, the data format becomes (64, 56, 56).

[0096] Step 2: After passing through the Dil-Residual-1 module, the number of channels remains unchanged when initially passing through a 1×1 convolution. Then, it passes through a dilated convolution with a dilation rate of 3 and a normal convolution of size 3×3. At this time, the receptive field size is 9×9. Finally, a 1×1 convolution is passed to increase the number of channels of the feature map to 256, and the feature map size is (256, 56, 56). After the attention mechanism is applied, the original input feature map is simply upsized and then added to it to obtain the output feature map.

[0097] Step 3: After downsampling by the Dil-Residual-2 module, the feature map size is (512, 28, 28). After a 1×1 convolution, the channel dimension is compressed to 128. Then, it goes through a dilated convolution with a dilation rate of 2 and a normal convolution of size 3×3. At this point, the receptive field size is 7×7. Finally, a 1×1 convolution restores the number of channels of the feature map to 512. After the attention mechanism is applied, the original input feature map is added to it to obtain the output feature map.

[0098] Step 4: After downsampling by the Dil-Residual-3 module, the feature map size is (1024, 14, 14). After a 1×1 convolution, the channel dimension is compressed to 256. Then, after a dilated convolution with a dilation rate of 1 and a normal convolution of size 3×3, the receptive field size is 5×5. Finally, a 1×1 convolution restores the number of channels of the feature map to 1024. After the attention mechanism is applied, the original input feature map is added to it to obtain the output feature map.

[0099] Step 5: After downsampling by the Dil-Residual-4 module, the feature map size is (2048, 7, 7). After a 1×1 convolution, the channel dimension is compressed to 512. Then, after a dilated convolution with a dilation rate of 1 and a normal convolution of size 3×3, the receptive field size is 5×5. Finally, a 1×1 convolution restores the number of channels of the feature map to 2048. After the attention mechanism is applied, the original input feature map is added to it to obtain the output feature map.

[0100] Step 6: After global average pooling, the final output feature map is passed through a fully connected layer for classification prediction, and the maximum probability is taken as the final prediction.

[0101] The image classification method designed in this invention uses the ImageNet-1k dataset, where the training set contains 1,281,167 images and the validation set contains 50,000 images, representing 1,000 different image categories. Performance is evaluated by calculating the Top1 error rate (the error rate of the class with the highest classification probability in the validation set matching the actual result) and the Top5 error rate (the error rate of the top five classes matching the actual result). The proposed method is compared with four other methods: ResNet50, ResNet101, ResNet50-SE, and VGG16-SE, where the suffix SE indicates that the corresponding network has added a channel attention mechanism. Table 1 reports the classification performance of different methods on the ImageNet-1k dataset, demonstrating the rationality of the model design and contributing to improved classification accuracy. Therefore, this method can be extended to other image classification fields for wider application.

[0102] Table 1. Classification performance (%) of all methods on ImageNet-1k

[0103] Method Top1-error Top 5 errors GFlops ResNet50 24.80 7.48 4.09 ResNet101 23.6 7.1 7.80 ResNet50-SE 23.29 6.62 4.10 VGG1 6-SE 25.22 7.70 15.48 ResNet50-Our 22.73 6.55 4.11

[0104] The above are merely preferred embodiments of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should be considered within the scope of protection of the present invention.

Claims

1. An image classification system based on an improved ResNet, characterized in that, include: The preprocessing module is used to preprocess the acquired images and generate feature maps. The feature extraction module consists of a combination of several sequentially connected dilated residual modules and attention mechanism modules. In each combination, the dilated residual module extracts features from the input feature map and extracts detailed features through a multi-scale receptive field. The attention mechanism module obtains effective information about the target of interest from three dimensions of the feature map output by the dilated residual module and suppresses noise in the feature map. The resulting feature map is then output after fusing the feature map input by the dilated residual module. The void residual module includes 1 in sequence. 1 convolutional layer, depth-separable dilated convolutional layer, 3 3 convolutional layers and 1 1 convolutional layer; the preprocessed image is first passed through 1 convolutional layer. One convolutional layer to compress the number of feature map channels; Then it enters the dilated convolutional layer, the void ratio of which is set by the multi-scale receptive field; then it enters 3 3 convolutional layers, where the information contained in a single pixel in the feature map is at least 5 times that in the original feature map of the input dilated convolutional layer. A region of size 5; finally, enter 1. One convolutional layer to recover the number of channels in the feature map; The attention mechanism module obtains effective information about the target of interest from three dimensions of the feature map, as follows: The feature map input to the attention mechanism module is represented as follows: , C For the number of image channels, H Image height W To obtain three feature tensors, the feature map is compressed along its three dimensions, which are equal to the image width. : In the formula, , and These represent the feature maps respectively. In , and Average pooling is performed on the dimension. , , They represent respectively with C , W , H Dimension-centered pair , , Summing elements across a dimension; For three feature tensors Feature mapping was performed separately to obtain : In the formula, It is a non-linear activation function. , , They represent C , W , H Feature mapping corresponding to dimension; , , They represent C , W , H The weights corresponding to the dimensions , , They represent C , W , H The bias parameter corresponding to the dimension; The feature mapping obtained Tensor multiplication is performed to obtain the corresponding tensor attention weights. , feature map With tensor attention weights Element-wise multiplication yields the feature map output by the attention mechanism module. : In the formula, This represents element-wise multiplication between tensors. This represents the sigmoid activation function; The classification prediction module is used to perform classification prediction on the feature maps output by the feature extraction module and output the final classification result.

2. The image classification system based on ResNet as described in claim 1, characterized in that: The preprocessing module processes the acquired image format (C, H, W) into (C, 256, 256); then crops it to (C, 224, 224) using a random center, sets the random horizontal flip probability to 0.5, and performs normalization; finally, it generates a feature map through convolution and max pooling operations. C For the number of image channels, H Image height W This refers to the image width.

3. The image classification system based on ResNet improvement as described in claim 1, characterized in that: The classification prediction module performs a fully connected (FC) operation on the feature map output by the feature extraction module, performs classification processing on the fully connected feature map, outputs a probability value for each category, and takes the classification result with the highest probability value as the final prediction result.

4. An image classification method based on an improved ResNet, characterized in that, Includes the following steps: The acquired images are preprocessed to generate feature maps; Feature extraction is performed on the input feature map, and detailed features are extracted through multi-scale receptive fields; Based on the attention mechanism, effective information about the target of interest is obtained from the feature map from three dimensions, and noise in the feature map is suppressed. The resulting feature map is then output after fusing with the input feature map. The preprocessed image undergoes feature extraction, and detailed features are extracted through multi-scale receptive fields to generate a feature map, as detailed below: The preprocessed image is first passed through 1 One convolutional layer to compress the number of feature map channels; Then it enters the dilated convolutional layer, the void ratio of which is set by the multi-scale receptive field; then it enters 3 3 convolutional layers, where the information contained in a single pixel in the feature map is at least 5 times that in the original feature map of the input dilated convolutional layer. A region of size 5; finally, enter 1. One convolutional layer to recover the number of channels in the feature map; The effective information of the target of interest is obtained from the three dimensions of the feature map based on the attention mechanism, as follows: Feature map representation , C For the number of image channels, H Image height W To obtain three feature tensors, the feature map is compressed along its three dimensions, which are equal to the image width. : In the formula, , and These represent the feature maps respectively. In , and Average pooling is performed on the dimension. , , They represent respectively with C , W , H Dimension-centered pair , , Summing elements across a dimension; For three feature tensors Feature mapping was performed separately to obtain : In the formula, It is a non-linear activation function. , , They represent C , W , H Feature mapping corresponding to dimension; , , They represent C , W , H The weights corresponding to the dimensions , , They represent C , W , H The bias parameter corresponding to the dimension; The feature mapping obtained Tensor multiplication is performed to obtain the corresponding tensor attention weights. , feature map With tensor attention weights The feature map is obtained by element-wise multiplication. : In the formula, This represents element-wise multiplication between tensors. This represents the sigmoid activation function; Perform classification prediction on the output feature map and output the final classification result.

5. The image classification method based on ResNet as described in claim 4, characterized in that: The data preprocessing involves converting the acquired image format (C, H, W) to (C, 256, 256); then cropping it to (C, 224, 224) using a random center, setting the random horizontal flip probability to 0.5, and performing normalization; finally, feature maps are generated through convolution and max pooling operations. C For the number of image channels, H Image height W This refers to the image width.

6. The image classification method based on ResNet as described in claim 4, characterized in that: The process of classifying and predicting the feature maps after attention mechanism processing, and outputting the final classification result, is as follows: The output feature map is subjected to a fully connected (FC) operation. After the feature map is fully connected, it is classified. A probability value is output for each category, and the classification result with the highest probability value is taken as the final prediction result.