A method and system for image classification based on discrete wavelet attention module

By using an image classification method based on discrete wavelet attention modules, the problems of loss of detailed feature information and high computational cost caused by downsampling in convolutional neural networks are solved, and more efficient image feature extraction and classification are achieved.

CN114419336BInactive Publication Date: 2024-11-08NANJING UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210087838.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-25
Publication Date
2024-11-08
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In existing image classification methods, convolutional neural networks are prone to loss of detailed feature information when performing downsampling operations, and improvements to spatial attention mechanisms result in high computational costs.

Method used

An image classification method based on discrete wavelet attention module is adopted. The discrete wavelet transform mechanism and spatial attention mechanism are used to extract image features from the feature map, construct an image classification model, and improve the robustness of the model through data augmentation technology.

Benefits of technology

It effectively reduces information loss caused by downsampling operations, lowers computational costs, improves image feature learning capabilities, and enhances the accuracy of image classification models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114419336B_ABST
    Figure CN114419336B_ABST
Patent Text Reader

Abstract

The present invention proposes an image classification method and system based on a discrete wavelet attention module, which belongs to the field of image classification technology and includes constructing a training data set; constructing an image classification model; the image classification model includes a feature map extraction module, a feature extraction module and a feature classification module connected in sequence; the feature extraction module includes a discrete wavelet attention module, the discrete wavelet attention module extracts image features from a feature map output by the feature map extraction module based on a discrete wavelet transform mechanism and a spatial attention mechanism, and inputs the extracted image features into a feature classification module to obtain an image classification result; the image classification model is trained using the training data set to obtain a trained image classification model; the size of an image to be classified is adjusted to the same size as that of a training image, and the image is input into the trained image classification model to obtain an image classification result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image classification, and in particular to an image classification method and system based on a discrete wavelet attention module. Background Art

[0002] Due to its excellent feature extraction capabilities, convolutional neural networks (CNNs) have been widely used in computer vision and have achieved substantial breakthroughs in the performance of visual tasks such as image classification, object detection, and semantic segmentation. However, inherent noise and some other factors may weaken the effectiveness of convolutional feature statistics. Among them, all neural network structures have structures that perform downsampling operations, whether average pooling or maximum pooling, which will seriously damage the transmission of feature detail information. The spatial attention mechanism focuses on the transmission of detailed features within the image, but most existing spatial attention technologies choose to obtain attention by calculating the correlation between pixels, which will greatly increase the computational cost of the network.

[0003] When using convolutional neural networks for image classification, the image information that is exposed mainly includes low-frequency information and high-frequency information. Low-frequency information mainly includes image texture and semantic information, and high-frequency information mainly includes sharp changes in edges and pixels, as well as noise. Human vision relies on low-frequency information when recognizing objects, while CNN mainly perceives mixed information of low and high frequencies. Since high-frequency information contains detailed information related to data distribution, as the number of training rounds increases, CNN will learn more about image feature extraction capabilities from high-frequency information.

[0004] In view of the problems existing in existing convolutional neural networks and the characteristics of image information itself, there is an urgent need for an image classification method that can not only ensure the transmission of feature detail information but also reduce the computational cost. Summary of the invention

[0005] The purpose of the present invention is to provide an image classification method and system based on a discrete wavelet attention module, so as to solve the problem that the existing image classification method uses CNN for downsampling operation, which is prone to cause the loss of detail feature information, and the improvement of the spatial attention mechanism leads to high computational cost.

[0006] To achieve the above object, the present invention provides an image classification method based on a discrete wavelet attention module, comprising the following steps:

[0007] A training dataset including training images and labels of the training images is constructed; each training image has the same size.

[0008] Construct an image classification model; the image classification model includes a feature map extraction module, a feature extraction module and a feature classification module connected in sequence; the feature extraction module includes a discrete wavelet attention module, and the discrete wavelet attention module is used to extract image features from the feature map output by the feature map extraction module based on a discrete wavelet transform mechanism and a spatial attention mechanism, and input the extracted image features into the feature classification module to obtain an image classification result.

[0009] The image classification model is trained using the training data set to obtain a trained image classification model.

[0010] The size of the image to be classified is adjusted to the same size as the training image, and is input into the trained image classification model to obtain an image classification result.

[0011] Optionally, the feature extraction module further includes: a convolution layer for adjusting the number of channels.

[0012] Optionally, the using the training data set to train the image classification model to obtain a trained image classification model specifically includes:

[0013] Input each training image in the training data set into the feature map extraction module in turn to obtain a feature map.

[0014] The feature map is input into the discrete wavelet attention module, and image features are extracted from the feature map based on a discrete wavelet transform mechanism and a spatial attention mechanism to obtain image features.

[0015] The image features are input into the feature classification module to obtain the image category of the training image.

[0016] The classification loss is calculated according to the image category of the training image and the training image label corresponding to the training image, and the parameters of the feature map extraction module are updated according to the classification loss.

[0017] Optionally, the step of inputting the feature map into the discrete wavelet attention module, extracting image features from the feature map based on a discrete wavelet transform mechanism and a spatial attention mechanism to obtain image features specifically includes:

[0018] The feature map is subjected to discrete wavelet transform to obtain a low-frequency component, a high-frequency vertical component, a high-frequency horizontal component and a high-frequency diagonal component.

[0019] The high-frequency vertical component and the high-frequency horizontal component are added together, and a Softmax operation is performed to obtain a global distribution feature.

[0020] The global distribution feature is multiplied by the low-frequency component to obtain the global detail feature.

[0021] The global detail features are superimposed on the low-frequency components to obtain image features.

[0022] Optionally, after constructing the training data set including the training images and the corresponding training image labels, the image classification method further includes performing data enhancement on each training image, specifically including:

[0023] The training images in the training data set are taken out in sequence.

[0024] Pixel expansion is performed around the training image to obtain an expanded training image.

[0025] The expanded training image is randomly cropped to obtain a cropped training image of the original size.

[0026] The cropped training image is randomly flipped horizontally to obtain an enhanced training image, and the enhanced training image is used to replace the original training image.

[0027] On the other hand, corresponding to the aforementioned image classification method based on a discrete wavelet attention module, the present invention also provides an image classification system based on a discrete wavelet attention module, the image classification system comprising:

[0028] The training data set construction unit is used to construct a training data set including training images and labels of the training images; the sizes of the training images are the same.

[0029] An image classification model construction unit is used to construct an image classification model; the image classification model includes a feature map extraction module, a feature extraction module and a feature classification module connected in sequence; the feature extraction module includes a discrete wavelet attention module, and the discrete wavelet attention module is used to extract image features from the feature map output by the feature map extraction module based on a discrete wavelet transform mechanism and a spatial attention mechanism, and input the extracted image features into the feature classification module to obtain an image classification result.

[0030] The image classification model training unit is used to train the image classification model using the training data set to obtain a trained image classification model.

[0031] The image classification model application unit is used to adjust the size of the image to be classified to the same size as the training image, input it into the trained image classification model, and obtain the image classification result.

[0032] Optionally, the feature extraction module further includes: a convolution layer for adjusting the number of channels.

[0033] Optionally, the image classification model training unit includes:

[0034] The feature map extraction subunit is used to input each training image in the training data set into the feature map extraction module in sequence to obtain a feature map corresponding to each training image.

[0035] The image feature extraction subunit is used to input the feature map into the discrete wavelet attention module, extract image features from the feature map based on discrete wavelet transform mechanism and spatial attention mechanism, and obtain image features.

[0036] The image category determination subunit is used to input the image features into the feature classification module to obtain the image category of the training image.

[0037] The parameter updating subunit is used to calculate the classification loss according to the image category of the training image and the training image label corresponding to the training image, and update the parameters of the feature map extraction module according to the classification loss.

[0038] Optionally, the image classification system further includes an image data enhancement unit, which is used to perform data enhancement on each training image in the training data set; the image data enhancement unit includes:

[0039] The image expansion subunit is used to sequentially extract each training image in the training data set, and perform pixel expansion around the training image to obtain an expanded training image.

[0040] The image cropping subunit is used to randomly crop the expanded training image to obtain a cropped training image of the original size.

[0041] The image flipping subunit is used to randomly flip the cropped training image horizontally to obtain an enhanced training image, and replace the original training image with the enhanced training image.

[0042] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0043] The present invention provides an image classification method and system based on a discrete wavelet attention module, which constructs a training data set; constructs an image classification model; the image classification model comprises a feature map extraction module, a feature extraction module and a feature classification module connected in sequence; the feature extraction module comprises a discrete wavelet attention module, which extracts image features from a feature map output by a feature map extraction module based on a discrete wavelet transform mechanism and a spatial attention mechanism, and inputs the extracted image features into a feature classification module to obtain an image classification result; the image classification model is trained using the training data set to obtain a trained image classification model; the size of an image to be classified is adjusted to the same size as that of a training image, and is input into the trained image classification model to obtain an image classification result; the present invention utilizes a discrete wavelet attention module based on a discrete wavelet transform mechanism and a spatial attention mechanism as a feature extraction module in an image classification model, and on the one hand, utilizes a discrete wavelet transform mechanism to greatly reduce information loss caused by downsampling operations of an original feature extraction module; on the other hand, the use of an attention mechanism can conveniently and accurately obtain global detail features of an image, so that the image feature learning ability of the improved image classification model is improved, and the computational cost is reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] 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 will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0045] Figure 1 A flowchart of an image classification method based on a discrete wavelet attention module provided in Example 1 of the present invention;

[0046] Figure 2 A flowchart of step S3 in the image classification method provided in Example 1 of the present invention;

[0047] Figure 3 This is a flowchart of step S32 in the image classification method provided in Example 1 of the present invention;

[0048] Figure 4 A flowchart of a data enhancement step in an image classification method provided in Embodiment 1 of the present invention;

[0049] Figure 5 A schematic diagram of the structure of an image classification system based on a discrete wavelet attention module provided in Example 2 of the present invention;

[0050] Figure 6A schematic diagram of the structure of a discrete wavelet attention module in the method provided in Example 3 of the present invention;

[0051] Figure 7 A schematic diagram of optional structural connections within a feature extraction module in the method provided in Embodiment 3 of the present invention;

[0052] Figure 8 A structural diagram of the discrete wavelet attention module provided in Example 3 of the present invention applied to ResNet18.

[0053] Symbol explanation: 1: training data set construction unit; 2: image classification model construction unit; 3: image classification model training unit; 4: image classification model application unit; 5: image data enhancement unit; 31: feature map extraction subunit; 32: image feature extraction subunit; 33: image category determination subunit; 34: parameter update subunit; 51: image expansion subunit; 52: image cropping subunit; 53: image flipping subunit. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] The purpose of the present invention is to provide an image classification method and system based on a discrete wavelet attention module, so as to solve the problem that the existing image classification method uses CNN for downsampling operation, which is prone to cause the loss of detail feature information, and the improvement of the spatial attention mechanism leads to high computational cost.

[0056] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0057] Embodiment 1:

[0058] like Figure 1 As shown in the flowchart, this embodiment provides an image classification method based on a discrete wavelet attention module, comprising the following steps:

[0059] S1. Construct a training data set including training images and labels of the training images; the sizes of the training images are the same.

[0060] S2. Construct an image classification model; the image classification model includes a feature map extraction module, a feature extraction module and a feature classification module which are connected in sequence; the feature extraction module includes a discrete wavelet attention module, and the discrete wavelet attention module is used to extract image features from the feature map output by the feature map extraction module based on a discrete wavelet transform mechanism and a spatial attention mechanism, and input the extracted image features into the feature classification module to obtain an image classification result.

[0061] S3, using the training data set to train the image classification model to obtain a trained image classification model; Figure 2 As shown, step S3 specifically includes:

[0062] S31. Input each training image in the training data set into the feature map extraction module in sequence to obtain a feature map.

[0063] S32, inputting the feature map into the discrete wavelet attention module, extracting image features from the feature map based on the discrete wavelet transform mechanism and the spatial attention mechanism, and obtaining image features; Figure 3 As shown, step S32 specifically includes:

[0064] S321. Perform discrete wavelet transform on the feature map to obtain a low-frequency component, a high-frequency vertical component, a high-frequency horizontal component and a high-frequency diagonal component.

[0065] S322, performing an addition operation on the high-frequency vertical component and the high-frequency horizontal component, and performing a Softmax operation to obtain a global distribution feature.

[0066] S323: Multiply the global distribution feature by the low-frequency component to obtain a global detail feature.

[0067] S324: superimpose the global detail feature onto the low-frequency component to obtain image features.

[0068] S33: Input the image features into the feature classification module to obtain the image category of the training image.

[0069] S34. Calculate the classification loss according to the image category of the training image and the training image label corresponding to the training image, and update the parameters of the feature map extraction module according to the classification loss.

[0070] S4. Adjust the size of the image to be classified to the same size as the training image, and input it into the trained image classification model to obtain an image classification result.

[0071] Since the discrete wavelet attention module does not have the function of adjusting the number of channels, the feature extraction module also includes: a convolution layer for adjusting the number of channels.

[0072] In order to enhance the robustness of the method, the image classification method provided by the present invention further includes a step of performing data enhancement on each training image after constructing the training data set, such as Figure 4 As shown, the steps of performing data enhancement on each training image specifically include:

[0073] A1. Take out each training image in the training data set in sequence.

[0074] A2. Perform pixel expansion around the training image to obtain an expanded training image.

[0075] A3. Randomly crop the expanded training image to obtain a cropped training image of the original size.

[0076] A4. Randomly flip the cropped training image horizontally to obtain an enhanced training image, and replace the original training image with the enhanced training image.

[0077] In this embodiment, a discrete wavelet attention module based on a discrete wavelet transform mechanism and a spatial attention mechanism is used as a feature extraction module in an image classification model. On the one hand, the discrete wavelet transform mechanism is used to greatly reduce the information loss caused by the downsampling operation of the original feature extraction module; on the other hand, the attention mechanism can be used to conveniently and accurately obtain the global detail features of the image, thereby improving the image feature learning ability of the improved image classification model and reducing the computational cost.

[0078] Embodiment 2:

[0079] In addition, an image classification method based on a discrete wavelet attention module corresponding to Example 1 is as follows: Figure 5 As shown, the present invention also provides an image classification system based on a discrete wavelet attention module, comprising the following units:

[0080] The training data set construction unit 1 is used to construct a training data set including training images and labels of the training images; the sizes of the training images are the same.

[0081] The image classification model construction unit 2 is used to construct an image classification model; the image classification model includes a feature map extraction module, a feature extraction module and a feature classification module connected in sequence; the feature extraction module includes a discrete wavelet attention module, and the discrete wavelet attention module is used to extract image features from the feature map output by the feature map extraction module based on a discrete wavelet transform mechanism and a spatial attention mechanism, and input the extracted image features into the feature classification module to obtain an image classification result.

[0082] The image classification model training unit 3 is used to train the image classification model using the training data set to obtain a trained image classification model.

[0083] The image classification model application unit 4 is used to adjust the size of the image to be classified to the same size as the training image, input it into the trained image classification model, and obtain the image classification result.

[0084] Since the discrete wavelet attention module does not have the function of adjusting the number of channels, the feature extraction module may also include: a convolution layer for adjusting the number of channels.

[0085] certainly, Figure 5 The architecture shown is only exemplary and can be omitted according to actual needs when implementing different functions. Figure 5 In one or at least two components of the system shown, it is possible that some units may also have subunits for implementing their functions, for example, the image classification model training unit 3 also includes:

[0086] The feature map extraction subunit 31 is used to input each training image in the training data set into the feature map extraction module in sequence to obtain a feature map corresponding to each training image.

[0087] The image feature extraction subunit 32 is used to input the feature map into the discrete wavelet attention module, extract image features from the feature map based on a discrete wavelet transform mechanism and a spatial attention mechanism, and obtain image features.

[0088] The image category determination subunit 33 is used to input the image features into the feature classification module to obtain the image category of the training image.

[0089] The parameter updating subunit 34 is used to calculate the classification loss according to the image category of the training image and the training image label corresponding to the training image, and update the parameters of the feature map extraction module according to the classification loss.

[0090] In order to enhance the robustness of the method, the image classification system further includes an image data enhancement unit 5, which is used to perform data enhancement on each training image in the training data set; the image data enhancement unit 5 includes:

[0091] The image expansion subunit 51 is used to sequentially extract each training image in the training data set, and perform pixel expansion around the training image to obtain an expanded training image.

[0092] The image cropping subunit 52 is used to randomly crop the expanded training image to obtain a cropped training image of the original size.

[0093] The image flipping subunit 53 is used to randomly flip the cropped training image horizontally to obtain an enhanced training image, and replace the original training image with the enhanced training image.

[0094] The program part of the technology can be considered as a "product" or "manufactured product" in the form of executable code and / or related data, which is participated in or realized by computer-readable media. Tangible and permanent storage media can include any memory or storage used by any computer, processor, or similar device or related module. For example, various semiconductor memories, tape drives, disk drives or any similar devices that can provide storage functions for software.

[0095] All or part of the software may sometimes communicate over a network, such as the Internet or other communications network. Such communications can load software from one computer device or processor to another. For example: from a server or host computer of a video target detection device to a hardware platform of a computer environment, or other computer environment that implements the system, or a system with similar functions related to providing information required for target detection. Therefore, another medium capable of transmitting software elements can also be used as a physical connection between local devices, such as light waves, radio waves, electromagnetic waves, etc., transmitted through cables, optical cables or air. Physical media used to carry carriers, such as cables, wireless connections or optical cables and the like, can also be considered as media that carry software. As used herein, unless limited to tangible "storage" media, other terms referring to computer or machine "readable media" refer to media involved in the process of the processor executing any instructions.

[0096] Embodiment 3:

[0097] In this embodiment, an image classification method based on a discrete wavelet attention module provided by the present invention is described in combination with specific parameters, including the following steps:

[0098] Step 1: Construct a training data set, which includes several images with a length and width of n, and the labels corresponding to each image data.

[0099] Step 2: Perform data enhancement on the image data read in step 1; first, fill the image data with 4 rows or columns of pixels to obtain image data with a length and width of n+8; then randomly crop the padded image data to obtain image data with a length and width of n; finally, perform random horizontal flipping to obtain image data ready to be input into the convolutional neural network model.

[0100] Step 3: According to the organizational structure of the existing convolutional neural network model, the discrete wavelet attention module is used to replace the original downsampling layer to construct a new convolutional neural network model for image classification; the structure of the discrete wavelet attention module is as follows Figure 6 shown.

[0101] The downsampling operations commonly used in convolutional neural network models are pooling layers and strided convolution layers.

[0102] For convolutional neural networks using pooling layers, the discrete wavelet attention module can be directly replaced, as shown in the attached Figure 7 As shown in (a). The structure of the VGG neural network is relatively simple, with several convolutional layers as a group and maxpool used for downsampling in the middle. When building the model, this solution directly uses the discrete wavelet attention module to replace the maxpool layer in VGG, and the rest of the structure remains unchanged. It should be noted that this solution only modifies the feature extraction part of the neural network, that is, the downsampling part, and retains the original classifier structure.

[0103] For a convolutional neural network using a strided convolutional layer, it is necessary to replace it with a combination of a discrete wavelet attention module and a convolutional layer to maintain the original number of channels. As for the combination of connecting convolutional layers, this embodiment provides two options. One is to connect a normal convolutional layer, such as the attached Figure 7 (b) shows that the other is to connect a 1*1 convolutional layer, as shown in the attached Figure 7 As shown in (c). ResNet18 consists of 8 basic blocks, two of which form one layer, for a total of four layers. Except for the first layer, the first basic block of each layer needs to be downsampled using strided convolution. The structure is shown in the attached figure. Figure 8 (a). This solution adds a new spatial attention module based on discrete wavelet transform to the basic module. When building the model, only the spatial attention module in the basic module that needs to be downsampled will be activated. At this time, the structure of the basic module is as shown in the attached figure. Figure 8 (b) shows the rest of the structure of ResNet18. It should be noted that this scheme only modifies the feature extraction part of CNN and retains the original classifier structure.

[0104] Step 4: Input the image data processed in step 2 into the new convolutional neural network model constructed in step 3. The image data is processed by the convolution layer to generate the feature map X.

[0105] Step 5: The feature map X generated in step 4 is input into the discrete wavelet attention module; the specific processing process is: the feature map X is subjected to discrete wavelet transform to obtain a low-frequency component X ll , three high frequency components X lh , X hl and Xhh ; Discard the high-frequency diagonal component X hh , for the remaining high-frequency vertical component X lh and high frequency level classification X hl First, add the corresponding pixels, then do the Softmax operation to get the global distribution features; then add the global distribution features to the low-frequency component X ll Perform the corresponding pixel multiplication operation to obtain the global detail feature; finally, superimpose the global detail feature on the low-frequency component X ll Get the image features.

[0106] Step 6: Input the image features obtained in step 5 into the classifier at the end of the convolutional neural network model to obtain the probability that the image data belongs to each category. After training with a large amount of image data, a trained convolutional neural network model is obtained, and the parameters of the convolutional neural network model are saved.

[0107] Step 7: Get the image data that needs to be classified and adjust it to the input size of the convolutional neural network model.

[0108] Step 8: Read the convolutional neural network model parameters saved in step 6, build a usable image classification model, input the image data processed in step 7, and obtain the probability that the image data belongs to each category.

[0109] Step 9: Based on the probability that the image data obtained in step 8 belongs to each category, output the classification result of the image data.

[0110] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core ideas of the present invention. Those skilled in the art should understand that the modules or steps of the present invention can be implemented by a general-purpose computer device. Alternatively, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into integrated circuit modules, or multiple modules or steps can be made into a single integrated circuit module. The present invention is not limited to any specific combination of hardware and software.

[0111] Meanwhile, for those skilled in the art, according to the concept of the present invention, there will be changes in the specific implementation and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. An image classification method based on discrete wavelet attention module, characterized in that: The image classification method comprises: Constructing a training data set including training images and labels of the training images; the sizes of the training images are the same; Constructing an image classification model; the image classification model comprises a feature map extraction module, a feature extraction module and a feature classification module which are connected in sequence; the feature extraction module comprises a discrete wavelet attention module, the discrete wavelet attention module is used to extract image features from the feature map output by the feature map extraction module based on a discrete wavelet transform mechanism and a spatial attention mechanism, and input the extracted image features into the feature classification module to obtain an image classification result; Using the training data set to train the image classification model to obtain a trained image classification model; Adjust the size of the image to be classified to the same size as the training image, input it into the trained image classification model, and obtain the image classification result; After constructing the training data set including the training images and the corresponding training image labels, the image classification method further includes performing data enhancement on each training image, specifically including: Taking out each training image in the training data set in sequence; Performing pixel expansion around the training image to obtain an expanded training image; Randomly cropping the expanded training image to obtain a cropped training image of the original size; The cropped training image is randomly flipped horizontally to obtain an enhanced training image, and the enhanced training image is used to replace the original training image.

2. The image classification method according to claim 1, characterized in that: The feature extraction module also includes: a convolution layer for adjusting the number of channels.

3. The image classification method according to claim 1, characterized in that: The using the training data set to train the image classification model to obtain a trained image classification model specifically includes: Inputting each training image in the training data set into the feature map extraction module in sequence to obtain a feature map; Inputting the feature map into the discrete wavelet attention module, extracting image features from the feature map based on a discrete wavelet transform mechanism and a spatial attention mechanism to obtain image features; Inputting the image features into the feature classification module to obtain the image category of the training image; The classification loss is calculated according to the image category of the training image and the training image label corresponding to the training image, and the parameters of the feature map extraction module are updated according to the classification loss.

4. The image classification method according to claim 3, characterized in that: The step of inputting the feature map into the discrete wavelet attention module, extracting image features from the feature map based on a discrete wavelet transform mechanism and a spatial attention mechanism to obtain image features, specifically includes: Performing discrete wavelet transform on the feature map to obtain a low-frequency component, a high-frequency vertical component, a high-frequency horizontal component, and a high-frequency diagonal component; Performing an addition operation on the high-frequency vertical component and the high-frequency horizontal component, and performing a Softmax operation to obtain a global distribution feature; Multiplying the global distribution feature with the low-frequency component to obtain a global detail feature; The global detail features are superimposed on the low-frequency components to obtain image features.

5. An image classification system based on discrete wavelet attention module, characterized in that: The image classification system comprises: A training data set construction unit, used to construct a training data set including training images and labels of the training images; the sizes of the training images are the same; An image classification model construction unit is used to construct an image classification model; the image classification model includes a feature map extraction module, a feature extraction module and a feature classification module connected in sequence; the feature extraction module includes a discrete wavelet attention module, and the discrete wavelet attention module is used to extract image features from the feature map output by the feature map extraction module based on a discrete wavelet transform mechanism and a spatial attention mechanism, and input the extracted image features into the feature classification module to obtain an image classification result; An image classification model training unit, used to train the image classification model using the training data set to obtain a trained image classification model; An image classification model application unit is used to adjust the size of the image to be classified to the same size as the training image, input it into the trained image classification model, and obtain an image classification result; The image classification system further includes an image data enhancement unit, which is used to perform data enhancement on each training image in the training data set; the image data enhancement unit includes: An image expansion subunit is used to sequentially extract each training image in the training data set, and perform pixel expansion around the training image to obtain an expanded training image; An image cropping subunit, used for randomly cropping the expanded training image to obtain a cropped training image of the original size; The image flipping subunit is used to randomly flip the cropped training image horizontally to obtain an enhanced training image, and replace the original training image with the enhanced training image.

6. The image classification system according to claim 5, characterized in that: The feature extraction module also includes: a convolution layer for adjusting the number of channels.

7. The image classification system according to claim 5, characterized in that: The image classification model training unit comprises: A feature map extraction subunit, used to sequentially input each training image in the training data set into the feature map extraction module to obtain a feature map corresponding to each training image; An image feature extraction subunit, used for inputting the feature map into the discrete wavelet attention module, extracting image features from the feature map based on a discrete wavelet transform mechanism and a spatial attention mechanism, and obtaining image features; An image category determination subunit, used for inputting the image features into the feature classification module to obtain the image category of the training image; The parameter updating subunit is used to calculate the classification loss according to the image category of the training image and the training image label corresponding to the training image, and update the parameters of the feature map extraction module according to the classification loss.

Citation Information

Patent Citations

  • Bidirectional feature fusion deep convolutional neural network construction method based on discrete wavelet transform

    CN113435376A

  • Image detection-based fine-grained classification model processing method, and related devices

    WO2021143267A1