A high-resolution image target recognition method based on multi-feature interactive learning
By adopting a multi-feature interactive learning method in the image classification model, using Faster R-CNN and the feature interaction module MIS, the problems of detail loss and insufficient feature interaction in high-resolution image classification are solved, and the image classification performance is improved.
Patent Information
- Application Number
- CN202410368027.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-28
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-03-28
AI Technical Summary
When existing image classification models process high-resolution images, details and texture information are lost, and the similarities between images of different categories are large, resulting in a decline in classification performance, and the interaction between different features is not fully considered.
Using a method based on multi-feature interactive learning, the Faster R-CNN target detection network is used to locate sub-region images, and the overall features and sub-region features are combined for interactive learning. The feature interaction module MIS is used for feature refinement, interactive attention and fusion to improve image classification. performance.
It effectively overcomes the problem of subtle features being ignored, improves the accuracy and performance of image classification, and enhances the ability to learn fine-grained image information.
Smart Images

Figure CN118196524B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of target detection and image recognition, and in particular to a high-resolution image target recognition method based on multi-feature interactive learning. Background Art
[0002] Due to the great success of deep neural networks, image classification and object detection have made outstanding progress. In the field of image classification, more and more network models have emerged, and they have achieved high accuracy on the ImageNet dataset. However, for high-resolution images that have emerged with the development of imaging technology, the performance of these models may be greatly reduced. One of the main reasons is that the details, textures and other information contained in high-resolution images will be lost with convolution downsampling; the second reason is that images of different categories have similar appearances, with only subtle changes, and the similarity between classes is relatively large. Therefore, based on this problem, fine-grained image classification came into being. However, although previous works have achieved good results by highlighting areas that are meaningful for classification, they directly connect different features or simply multiply them by corresponding weights, which leads to the neglect of the interactions between different regions. Therefore, in order to solve this problem, we should consider the potential interactions between different features and their ability to predict categories, so that important features on a certain picture can make more contributions to category decisions. Therefore, how to design a high-resolution image recognition method based on multi-feature interactive learning to overcome the shortcomings of previous methods is still an unsolved problem.
[0003] Therefore, the present invention proposes a high-resolution image target recognition method based on multi-feature interactive learning to solve the above problems. Summary of the invention
[0004] In view of the deficiencies in the prior art, the present invention develops a high-resolution image target recognition method based on multi-feature interactive learning, which can improve the classification performance of the model.
[0005] The technical solution to the technical problem of the present invention is: a high-resolution image target recognition method based on multi-feature interactive learning, comprising the following steps:
[0006] a) The original high-resolution image dataset Divide into training set and validation set, then perform data preprocessing on the training set and validation set to enhance the original high-resolution image scaling and target detection data;
[0007] b) Input the preprocessed data into the Faster R-CNN target detection network to detect the target area of interest in the image and locate the target area. The target detection network locates the sub-area , the sub-region Map back to the original high-resolution image and crop this area to obtain three high-resolution sub-region images , ;
[0008] c) For the original high-resolution images and sub-region images in the training set Processing,data enhancement for image classification;
[0009] d) The original high-resolution image and sub-region image in the processed training set Input into the feature extraction module 1 of the recognition network to obtain the overall features and sub-regional characteristics ;
[0010] e) The overall characteristics and sub-regional characteristics Input into the feature interaction module MIS to obtain interactive features ;
[0011] f) The interactive features Input to the feature extraction module 2 of the recognition network to obtain the feature , The recognition result of the image is obtained through the fully connected layer.
[0012] Step a) comprises the following steps:
[0013] a-1) The original high-resolution image data set Divide into training sets according to a certain ratio and validation set , where n represents the number of high-resolution images, Represents the training set images, The validation set pictures, represents the number of training set images, Indicates the number of validation set images;
[0014] a-2) Label the training set using the labeling software LabelImg and validation set The target in the image is marked, and the marking information includes the location and category information of the target area;
[0015] a-3) For the labeled training set and validation set The images in the training set are uniformly scaled and then Perform image flipping and color gamut transformation operations to enhance image data and obtain the processed training set , represents the first data.
[0016] Step b) comprises the following steps:
[0017] b-1) The dataset The images Input into the Faster R-CNN backbone network ResNet-50 to obtain the features , and then the feature Input into the RPN network to generate detection box proposals;
[0018] b-2) The characteristics The detection box proposals are simultaneously input into the ROI pooling module implemented by maximum pooling to obtain the feature , the feature The category probability and the offset of the detection box are obtained through the fully connected layer ,in , is the offset of the center coordinates of the box where the target area predicted by the network is located. , The width and height scaling factors of the target area are then Predefined anchor boxes Calculate the target sub-region ,in , is the center coordinate of the anchor box, , is the width and height of the anchor box, and then the target sub-region Map back to the original high-resolution image and crop to get the sub-region image , , that is, the sub-region image is , and , Indicates how many different regional features there are in an image;
[0019] Target sub-area The calculation process is:
[0020] ,
[0021] ,
[0022] ,
[0023] ,
[0024] in, , Indicates sub-area The center coordinates of , Indicates sub-area The width and height, Represents the sigmoid function.
[0025] Step c) comprises the following steps:
[0026] For the training set Original high-resolution image And the sub-region images of the three images obtained by Faster R-CNN , , Perform preprocessing and data enhancement operations. Data enhancement mainly includes random cropping and random horizontal flipping. Preprocessing refers to standardization to obtain the processed original high-resolution image. And the sub-region images of the three images after processing , and .
[0027] Step d) comprises the following steps:
[0028] d-1) , , and Input into the feature extraction module 1 of the recognition network;
[0029] d-2) Feature extraction module 1 includes a downsampling layer, a first branch and a second branch;
[0030] The downsampling layer consists of a convolutional layer, a batch normalization layer, and a Swish activation function layer;
[0031] The first branch consists of a first convolutional attention block and a second convolutional attention block, where both the first convolutional attention block and the second convolutional attention block consist of a first convolutional layer, a depth-separable convolutional layer, a SE attention layer, a second convolutional layer, and an identity mapping layer;
[0032] The second branch consists of the first convolutional attention block, the second convolutional attention block, and the third convolutional attention block, wherein the first convolutional attention block, the second convolutional attention block, and the third convolutional attention block are each composed of the first convolutional layer, the depth-separable convolutional layer, the SE attention layer, the second convolutional layer, and the identity mapping layer;
[0033] Among them, the convolution kernel size of the downsampling layer is , the step size is 2, and the padding is 1; the convolution kernel size of the first convolutional attention block and the second convolutional attention block of the first branch and the first convolutional attention block, the second convolutional attention block, and the third convolutional attention block of the second branch is , with a stride of 1 and padding of 0; the kernel size of the depthwise separable convolution in the first convolutional attention block of the first branch is , with a stride of 2 and padding of 1, the kernel size of the depthwise separable convolution in the second convolutional attention block is , the stride is 1, and the padding is 1; the convolution kernel size of the depthwise separable convolution in the first convolutional attention block of the two branches is , the stride is 2, the padding is 2, and the kernel size of the depthwise separable convolution in the second convolutional attention block is , the stride is 1, the padding is 2, and the kernel size of the depthwise separable convolution in the third convolutional attention block is , the step size is 1, and the padding is 2;
[0034] , , and The specific process of inputting into the feature extraction module 1 of the recognition network is as follows:
[0035] (1) Data , , and Input to the downsampling layer to get the initial feature map , , and ;
[0036] (2) Characteristics , , and Input to the first convolutional attention block of the first branch to get the feature map , , and ;
[0037] (3) The characteristics , , and Input to the second convolutional attention block of the first branch to get the feature map , , and ;
[0038] (4) Features , , and Input to the first convolutional attention block of the second branch to obtain the feature map , , and ;
[0039] (5) Characteristics , , and Input to the second convolutional attention block of the second branch to obtain the feature map , , and ;
[0040] (6) Characteristics , , and Input to the third convolutional attention block of the second branch to obtain the feature map , , and ;
[0041] The calculation formula is as follows:
[0042] ,
[0043] ,
[0044] in, Represents the overall characteristics, Indicates the final Sub-regional characteristics, Indicates The processed original high-resolution image , Indicates the processed Sub-region images of an image, represents the downsampling layer, represents the first branch of feature extraction module 1, Represents the second branch of feature extraction module 1.
[0045] Step e) comprises the following steps:
[0046] e-1) Feature interaction module MIS includes feature refinement stage, interactive attention stage and fusion stage;
[0047] e-2) The feature refinement stage consists of the first BCD-Block and the second BCD-Block; the first BCD-Block and the second BCD-Block are both composed of a center difference convolution layer, a first convolution layer, a second convolution layer and an identity mapping layer. The center difference convolution includes sampling and aggregation, where sampling is sampling a patch in the input feature map, and aggregation is subtracting the center element from each element in the patch, and then passing the ordinary convolution of the center difference convolution layer to obtain the output feature. The ordinary convolution consists of a convolution layer, a batch normalization layer and a SiLU activation function layer; the first convolution layer and the second convolution layer are both composed of a convolution layer, a batch normalization layer and a ReLU activation function layer, and the center difference convolution layer is composed of a center difference convolution and an ordinary convolution; where the convolution kernel sizes of the first convolution layer and the second convolution layer of the first BCD-Block are both , the step size is 1, the padding is 1, and the convolution kernel size of the first convolution layer in the center difference convolution layer of the first BCD-Block is , the step size is 1, and the padding is 1; the convolution kernel size of the first convolution layer and the second convolution layer of the second BCD-Block is , the step size is 1, and the padding is 1; the convolution kernel size of the first convolution layer in the central difference convolution layer of the second BCD-Block is , the step size is 1, and the padding is 1;
[0048] The feature map , , and Input into the first BCD-Block of the feature refinement stage to obtain the feature map , , and , and then the feature map , , and Input to the second BCD-Block of the feature refinement stage to obtain the feature map , , and ;
[0049] The calculation formula of the center difference convolution layer is as follows:
[0050] Centered difference convolution of the center difference convolution layer: ;
[0051] Ordinary convolution of the center difference convolution layer: ;
[0052] The entire process of the central difference convolution layer: ;
[0053] in, represents the central difference convolution of the central difference convolution layer, represents the ordinary convolution of the center difference convolution layer, represents the input feature map, represents the weight parameter, Indicates the central element position of a patch in the input feature map, express Neighborhood, when the convolution kernel size is When is an eight-neighborhood, and the range is , Indicates control and The parameters of importance, , The larger the value, the greater the contribution of the central difference convolution;
[0054] The calculation formula of the overall process is as follows:
[0055] The process of the first BCD-Block:
[0056] ,
[0057] ;
[0058] The process of the second BCD-Block:
[0059] ,
[0060] ;
[0061] in, Represents the entire operation process of the central difference convolution layer, and Represents the first and second convolutional layers in the first BCD-Block, and Represents the first and second convolutional layers in the second BCD-Block;
[0062] e-3) The interactive attention layer includes a depthwise separable convolution and a multi-head attention layer: The depthwise separable convolution layer includes a depthwise convolution layer and a pointwise convolution layer. Both the depthwise convolution layer and the pointwise convolution layer are composed of a convolution layer, a batch normalization layer, and a LeakyReLU activation function layer. The convolution kernel size of the depthwise separable convolution layer is The stride is 1, the padding is 1, and the kernel size of the point-by-point convolution layer of the depth-wise separable convolution layer is , the step length is 1, and the filling is 0;
[0063] The input features are mapped through the depth-wise separable convolutional layer to obtain the query Q, key K, and value V vectors required by the attention mechanism. The multi-head attention layer divides each Q, K, and V into multiple branches. The number of branches is equivalent to the number of heads. The overall features are the key and value, and the sub-region features are the query.
[0064] The specific process is: the overall feature and the sub-region feature are calculated according to the self-attention formula. The similarity is then multiplied by the value vector to obtain the feature after the overall feature and multiple sub-region features are interactively enhanced. Input to the depth separable convolution layer to get K, V, and convert the feature map , and Input them into the depth separable convolution layer respectively to get the corresponding , and , then , K and V are input to the multi-head attention layer to obtain the feature map ,Will , K and V are input to the multi-head attention layer to obtain the feature map ,Will , K and V are input to the multi-head attention layer to obtain the feature map , and then the feature map , , and The feature map is obtained by concat splicing in the channel dimension ;
[0065] The calculation formula is as follows:
[0066] ,
[0067] ,
[0068] ,
[0069] in, represents depthwise separable convolution, represents multi-head self-attention, ;
[0070] e-4) The fusion stage consists of the first point-by-point convolution layer, the second point-by-point convolution layer, the spatial pyramid pooling layer SPP, the activation function layer and the third point-by-point convolution layer. The convolution kernel sizes of the first point-by-point convolution layer, the second point-by-point convolution layer and the third point-by-point convolution layer in the fusion stage are all , the step length is 1, and the filling is 0;
[0071] The fusion stage will enhance and complement the features obtained in the interactive attention stage, and the feature map The first point-by-point convolution layer and the second convolution layer of the fusion stage are input in sequence to obtain feature maps. and , and then the feature map Input to the spatial pyramid pooling layer SPP to get the feature map , and then the feature map Input to the Sigmoid activation function layer to get the feature map , and then the feature map and Perform element-by-element multiplication to obtain the feature map , the feature Input to the third point-by-point convolution layer to get the feature map , and finally the feature and Perform element-by-element addition to obtain the interactive features ;
[0072] The overall process formula is as follows:
[0073] ,
[0074] ,
[0075] in, , and They represent the first point-by-point convolution layer, the second point-by-point convolution layer, and the third point-by-point convolution layer in the fusion stage respectively.
[0076] Step f) comprises the following steps:
[0077] f-1) Feature extraction module 2 is composed of a first branch, a second branch and a third branch;
[0078] f-2) The first branch consists of the first convolutional attention block, the second convolutional attention block, and the third convolutional attention block. The first convolutional attention block, the second convolutional attention block, and the third convolutional attention block are all composed of the first convolutional layer, the depth-separable convolutional layer, the SE attention layer, the second convolutional layer, and the identity mapping layer;
[0079] The second branch consists of the first convolutional attention block, the second convolutional attention block, the third convolutional attention block and the fourth convolutional attention block, each of which consists of the first convolutional layer, the depth-separable convolutional layer, the SE attention layer, the second convolutional layer and the identity mapping layer;
[0080] The third branch consists of the first convolutional attention block, which consists of the first convolutional layer, the depth-wise separable convolutional layer, the SE attention layer, the second convolutional layer, and the identity mapping layer;
[0081] Among them, the convolution kernel sizes of the first convolutional attention block, the second convolutional attention block and the third convolutional attention block of the first branch, the first convolutional attention block, the second convolutional attention block, the third convolutional attention block and the fourth convolutional attention block of the second branch, and the first convolutional attention block of the third branch are , the stride is 1, the padding is 0, and the convolution kernel size of the depthwise separable convolution in the first convolutional attention block of the first branch is , the stride is 2, the padding is 1, and the convolution kernel size of the depthwise separable convolution in the second and third convolutional attention blocks is , with a stride of 1 and padding of 1; the kernel size of the depthwise separable convolution in the first convolutional attention block of the second branch is , the stride is 2, the padding is 2, and the convolution kernel size of the depthwise separable convolution in the second convolutional attention block, the third convolutional attention block, and the fourth convolutional attention block is , the stride is 1, and the padding is 2; the convolution kernel size of the depthwise separable convolution of the first convolutional attention block in the third branch is , the step size is 2, and the padding is 1;
[0082] The operation is: Input into the first branch to get , and then the feature map Input into the second branch to get the feature map , and then the feature map Input into the third branch to get the feature map ;
[0083] f-3) The characteristics After inputting into the global average pooling layer and the fully connected layer, the recognition result Output of each image is obtained;
[0084] The overall process formula is as follows:
[0085] ,
[0086] ,
[0087] in, , and They represent the first branch, the second branch and the third branch of feature extraction module 2 respectively, represents global average pooling, represents a fully connected layer;
[0088] During the training process, set the parameters epoch, batchsize, image size of the input model, learning rate, optimizer, and loss function type.
[0089] The effects provided in the content of the invention are only the effects of the embodiments, rather than all the effects of the invention. The above technical solution has the following advantages or beneficial effects:
[0090] This method obtains sub-region images after target detection, and these sub-region images are input into the feature extraction module 1 to obtain sub-region features; the overall features and sub-region features are cross-learned between multiple features through the interactive attention layer and fusion stage in the feature interaction module MIS, which fully considers the potential interaction between multi-region features, makes more contributions to category decisions, and further improves the performance of image classification. The feature refinement stage in the feature interaction module MIS proposed in this method can better learn the fine-grained information in the image, such as shape, texture information, etc., and better improves the situation of ignoring subtle features in previous methods. This method overcomes the shortcomings of previous methods, considers the importance of interactions between different features for target recognition, and improves recognition performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0091] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.
[0092] Figure 1 It is a schematic diagram of the method flow of the present invention.
[0093] Figure 2 It is a schematic diagram of the network flow of the present invention.
[0094] Figure 3 It is a schematic diagram of the feature interaction module of the present invention. DETAILED DESCRIPTION
[0095] In order to clearly illustrate the technical features of the present invention, the present invention is described in detail below through specific implementation methods and in conjunction with the accompanying drawings. The following disclosure provides many different embodiments or examples for implementing different structures of the present invention. In order to simplify the disclosure of the present invention, the components and settings of specific examples are described below.
[0096] Embodiment 1 A high-resolution image target recognition method based on multi-feature interactive learning comprises the following steps:
[0097] a) The original high-resolution image dataset Divide into training set and validation set, then perform data preprocessing on the training set and validation set to enhance the original high-resolution image scaling and target detection data;
[0098] b) Input the preprocessed data into the Faster R-CNN target detection network to detect the target area of interest in the image and locate the target area. The target detection network locates the sub-area , the sub-region Map back to the original high-resolution image and crop this area to obtain three high-resolution sub-region images , ;
[0099] c) For the original high-resolution images and sub-region images in the training set Processing,data enhancement for image classification;
[0100] d) The original high-resolution image and sub-region image in the processed training set Input into the feature extraction module 1 of the recognition network to obtain the overall features and sub-regional characteristics ;
[0101] e) The overall characteristics and sub-regional characteristics Input into the feature interaction module MIS to obtain interactive features ;
[0102] f) The interactive features Input to the feature extraction module 2 of the recognition network to obtain the feature , The recognition result of the image is obtained through the fully connected layer.
[0103] Step a) comprises the following steps:
[0104] a-1) The original high-resolution image data set Divide into training sets according to a certain ratio and validation set , where n represents the number of high-resolution images, Represents the training set images, The validation set pictures, represents the number of training set images, Indicates the number of validation set images;
[0105] a-2) Label the training set using the labeling software LabelImg and validation set The target in the image is marked, and the marking information includes the location and category information of the target area;
[0106] a-3) For the labeled training set and validation set The images in the training set are uniformly scaled and then Perform image flipping and color gamut transformation operations to enhance image data and obtain the processed training set , represents the first data.
[0107] Step b) comprises the following steps:
[0108] b-1) The dataset The images Input into the Faster R-CNN backbone network ResNet-50 to obtain the features , and then the feature Input into the RPN network to generate detection box proposals;
[0109] b-2) The characteristics The detection box proposals are simultaneously input into the ROI pooling module implemented by maximum pooling to obtain the feature , the feature The category probability and the offset of the detection box are obtained through the fully connected layer ,in , is the offset of the center coordinates of the box where the target area predicted by the network is located. , The width and height scaling factors of the target area are then and predefined anchor boxes Calculate the target sub-region ,in , is the center coordinate of the anchor box, , is the width and height of the anchor box, and then the target sub-region Map back to the original high-resolution image and crop to get the sub-region image , , that is, the sub-region image is , and Indicates how many different regional features there are in an image;
[0110] Target sub-area The calculation process is:
[0111] ,
[0112] ,
[0113] ,
[0114] ,
[0115] in, , Indicates sub-area The center coordinates of , Indicates sub-area The width and height, Represents the sigmoid function.
[0116] Step c) comprises the following steps:
[0117] For the training set Original high-resolution image And the sub-region images of the three images obtained by Faster R-CNN , and Perform preprocessing and data enhancement operations. Data enhancement mainly includes random cropping and random horizontal flipping. Preprocessing refers to standardization to obtain the processed original high-resolution image. And the sub-region images of the three images after processing , and .
[0118] Step d) comprises the following steps:
[0119] d-1) , , and Input into the feature extraction module 1 of the recognition network;
[0120] d-2) Feature extraction module 1 includes a downsampling layer, a first branch and a second branch;
[0121] The downsampling layer consists of a convolutional layer, a batch normalization layer, and a Swish activation function layer;
[0122] The first branch consists of a first convolutional attention block and a second convolutional attention block, where both the first convolutional attention block and the second convolutional attention block consist of a first convolutional layer, a depth-separable convolutional layer, a SE attention layer, a second convolutional layer, and an identity mapping layer;
[0123] The second branch consists of the first convolutional attention block, the second convolutional attention block, and the third convolutional attention block, wherein the first convolutional attention block, the second convolutional attention block, and the third convolutional attention block are each composed of the first convolutional layer, the depth-separable convolutional layer, the SE attention layer, the second convolutional layer, and the identity mapping layer;
[0124] Among them, the convolution kernel size of the downsampling layer is , the step size is 2, and the padding is 1; the convolution kernel size of the first convolutional attention block and the second convolutional attention block of the first branch and the first convolutional attention block, the second convolutional attention block, and the third convolutional attention block of the second branch is The stride is 1 and the padding is 0; the kernel size of the depthwise separable convolution in the first convolutional attention block of the first branch is , with a stride of 2 and padding of 1, the kernel size of the depthwise separable convolution in the second convolutional attention block is , with a stride of 1 and padding of 1; the kernel size of the depthwise separable convolution in the first convolutional attention block of the second branch is , the stride is 2, the padding is 2, and the kernel size of the depthwise separable convolution in the second convolutional attention block is , the stride is 1, the padding is 2, and the kernel size of the depthwise separable convolution in the third convolutional attention block is , the step size is 1, and the padding is 2;
[0125] , , and The specific process of inputting into the feature extraction module 1 of the recognition network is as follows:
[0126] (1) Data , , and Input to the downsampling layer to get the initial feature map , , and ;
[0127] (2) Characteristics , , and Input to the first convolutional attention block of the first branch to get the feature map , , and ;
[0128] (3) The characteristics , , and Input to the second convolutional attention block of the first branch to get the feature map , , and ;
[0129] (4) Features , , and Input to the first convolutional attention block of the second branch to obtain the feature map , , and ;
[0130] (5) Characteristics , , and Input to the second convolutional attention block of the second branch to obtain the feature map , , and ;
[0131] (6) Characteristics , , and Input to the third convolutional attention block of the second branch to obtain the feature map , , and ;
[0132] The calculation formula is as follows:
[0133] ,
[0134] ,
[0135] in, Represents the overall characteristics, Indicates the final Sub-regional characteristics, Indicates The processed original high-resolution image , Indicates the processed The sub-region image of the image, represents the downsampling layer, represents the first branch of feature extraction module 1, Represents the second branch of feature extraction module 1.
[0136] Step e) comprises the following steps:
[0137] e-1) Feature interaction module MIS includes feature refinement stage, interactive attention stage and fusion stage;
[0138] e-2) The feature refinement stage consists of the first BCD-Block and the second BCD-Block; the first BCD-Block and the second BCD-Block are both composed of a center difference convolution layer, a first convolution layer, a second convolution layer and an identity mapping layer. The center difference convolution includes sampling and aggregation, where sampling is sampling a patch in the input feature map, and aggregation is subtracting the center element from each element in the patch, and then passing the ordinary convolution of the center difference convolution layer to obtain the output feature. The ordinary convolution consists of a convolution layer, a batch normalization layer and a SiLU activation function layer; the first convolution layer and the second convolution layer are both composed of a convolution layer, a batch normalization layer and a ReLU activation function layer, and the center difference convolution layer is composed of a center difference convolution and an ordinary convolution; where the convolution kernel sizes of the first convolution layer and the second convolution layer of the first BCD-Block are both , the step size is 1, the padding is 1, and the convolution kernel size of the first convolution layer in the center difference convolution layer of the first BCD-Block is , the step size is 1, and the padding is 1; the convolution kernel size of the first convolution layer and the second convolution layer of the second BCD-Block is , the step size is 1, and the padding is 1; the convolution kernel size of the first convolution layer in the central difference convolution layer of the second BCD-Block is , the step size is 1, and the padding is 1;
[0139] The feature map , , and Input into the first BCD-Block of the feature refinement stage to obtain the feature map , , and , and then the feature map , , and Input to the second BCD-Block of the feature refinement stage to obtain the feature map , , , ;
[0140] The calculation formula of the center difference convolution layer is as follows:
[0141] Centered difference convolution of the center difference convolution layer: ;
[0142] Ordinary convolution of the center difference convolution layer: ;
[0143] The entire process of the central difference convolution layer: ;
[0144] in, represents the central difference convolution of the central difference convolution layer, represents the ordinary convolution of the center difference convolution layer, represents the input feature map, represents the weight parameter, Indicates the central element position of a patch in the input feature map, express Neighborhood, when the convolution kernel size is When is an eight-neighborhood, and the range is , Indicates control and The parameters of importance, , The larger the value, the greater the contribution of the central difference convolution;
[0145] The calculation formula of the overall process is as follows:
[0146] The process of the first BCD-Block:
[0147] ,
[0148] ;
[0149] The process of the second BCD-Block:
[0150] ;
[0151] ;
[0152] in, Represents the entire operation process of the central difference convolution layer, and Represents the first and second convolutional layers in the first BCD-Block, and Table 1: The first convolutional layer and the second convolutional layer in the second BCD-Block;
[0153] e-3) The interactive attention layer includes a depthwise separable convolution and a multi-head attention layer: The depthwise separable convolution layer includes a depthwise convolution layer and a pointwise convolution layer. Both the depthwise convolution layer and the pointwise convolution layer are composed of a convolution layer, a batch normalization layer, and a LeakyReLU activation function layer. The convolution kernel size of the depthwise separable convolution layer is , the stride is 1, the padding is 1, and the convolution kernel size of the point-by-point convolution layer of the depth-wise separable convolution layer is , the step length is 1, and the filling is 0;
[0154] The input features are mapped through the depth-wise separable convolutional layer to obtain the query Q, key K, and value V vectors required by the attention mechanism. The multi-head attention layer divides each Q, K, and V into multiple branches. The number of branches is equivalent to the number of heads. The overall features are the key and value, and the sub-region features are the query.
[0155] The specific process is: the overall feature and the sub-region feature are calculated according to the self-attention formula. The similarity is then multiplied by the value vector to obtain the feature after the overall feature and multiple sub-region features are interactively enhanced. Input to the depth separable convolution layer to get K, V, and convert the feature map , Input them into the depth separable convolution layer respectively to get the corresponding , and , then , K and V are input to the multi-head attention layer to obtain the feature map ,Will , K and V are input to the multi-head attention layer to obtain the feature map ,Will , K and V are input to the multi-head attention layer to obtain the feature map , and then the feature map , , and The feature map is obtained by concat splicing in the channel dimension ;
[0156] The calculation formula is as follows:
[0157] ,
[0158] ,
[0159] ,
[0160] in, represents depthwise separable convolution, represents multi-head self-attention, ;
[0161] e-4) The fusion stage consists of the first point-by-point convolution layer, the second point-by-point convolution layer, the spatial pyramid pooling layer SPP, the activation function layer and the third point-by-point convolution layer. The convolution kernel sizes of the first point-by-point convolution layer, the second point-by-point convolution layer and the third point-by-point convolution layer in the fusion stage are all , the step length is 1, and the filling is 0;
[0162] The fusion stage will enhance and complement the features obtained in the interactive attention stage, and the feature map The first point-by-point convolution layer and the second convolution layer of the fusion stage are input in sequence to obtain feature maps. and , and then the feature map Input to the spatial pyramid pooling layer SPP to get the feature map , and then the feature map Input to the Sigmoid activation function layer to get the feature map Then the feature map and Perform element-by-element multiplication to obtain the feature map , the feature Input to the third point-by-point convolution layer to get the feature map , and finally the feature and Perform element-by-element addition to obtain the interactive features ;
[0163] The overall process formula is as follows:
[0164] ,
[0165] ,
[0166] in, , and They represent the first point-by-point convolution layer, the second point-by-point convolution layer, and the third point-by-point convolution layer in the fusion stage respectively.
[0167] Step f) comprises the following steps:
[0168] f-1) Feature extraction module 2 is composed of a first branch, a second branch and a third branch;
[0169] f-2) The first branch consists of the first convolutional attention block, the second convolutional attention block, and the third convolutional attention block. The first convolutional attention block, the second convolutional attention block, and the third convolutional attention block are all composed of the first convolutional layer, the depth-separable convolutional layer, the SE attention layer, the second convolutional layer, and the identity mapping layer;
[0170] The second branch consists of the first convolutional attention block, the second convolutional attention block, the third convolutional attention block and the fourth convolutional attention block, each of which consists of the first convolutional layer, the depth-separable convolutional layer, the SE attention layer, the second convolutional layer and the identity mapping layer;
[0171] The third branch consists of the first convolutional attention block, which consists of the first convolutional layer, the depth-wise separable convolutional layer, the SE attention layer, the second convolutional layer, and the identity mapping layer;
[0172] Among them, the convolution kernel sizes of the first convolutional attention block, the second convolutional attention block and the third convolutional attention block of the first branch, the first convolutional attention block, the second convolutional attention block, the third convolutional attention block and the fourth convolutional attention block of the second branch, and the first convolutional attention block of the third branch are , the stride is 1, the padding is 0, and the convolution kernel size of the depthwise separable convolution in the first convolutional attention block of the first branch is , the stride is 2, the padding is 1, and the convolution kernel size of the depthwise separable convolution in the second and third convolutional attention blocks is , with a stride of 1 and padding of 1; the kernel size of the depthwise separable convolution in the first convolutional attention block of the second branch is , the stride is 2, the padding is 2, and the convolution kernel size of the depthwise separable convolution in the second convolutional attention block, the third convolutional attention block, and the fourth convolutional attention block is , the stride is 1, and the padding is 2; the convolution kernel size of the depthwise separable convolution of the first convolutional attention block in the third branch is , the step size is 2, and the padding is 1;
[0173] The operation is: Input into the first branch to get , and then the feature map Input into the second branch to get the feature map , and then the feature map Input into the third branch to get the feature map ;
[0174] f-3) The characteristics After inputting into the global average pooling layer and the fully connected layer, the recognition result Output of each image is obtained;
[0175] The overall process formula is as follows:
[0176] ,
[0177] ,
[0178] in, , and They represent the first branch, the second branch and the third branch of feature extraction module 2 respectively, represents global average pooling, represents a fully connected layer;
[0179] During the training process, the parameters are set as follows: epoch is 200, batch size is 16, the image size of the input model is 224*224, the learning rate is 0.01, the optimizer is SGD, and the loss function is the cross entropy loss function.
[0180] Example 2 Table 1 is a comparison of the results obtained by training and predicting the gastritis data set by the method of the present invention and other methods, and the accuracy, sensitivity, specificity, recall and precision are compared respectively. Accuracy refers to the proportion of correct predictions among all predicted samples, sensitivity and recall are calculated in the same way, referring to the proportion of predicted positive samples among all true positive samples, specificity refers to the proportion of predicted negative samples among all true negative samples, and precision refers to how many true positive samples there are among all predicted positive samples. As can be seen from Table 1, other methods all present a situation of high precision, low recall and high specificity, which shows that the model misses some true positive samples, and the five task indicators obtained by the method of the present invention make up for this defect, and the accuracy is also the highest. This is because the method of the present invention not only uses one feature, but also considers the interaction between multiple features, and supplements and emphasizes the classification of the entire image. Moreover, the method of the present invention improves the situation where subtle features are ignored, and further improves the classification performance of the model.
[0181] Table 1 Comparison of the prediction results obtained by the method of the present invention and other methods on the gastritis dataset
[0182]
[0183] Although the above describes the specific implementation mode of the invention in conjunction with the drawings, it is not intended to limit the scope of protection of the invention. Based on the technical solution of the present invention, various modifications or variations that can be made by those skilled in the art without creative work are still within the scope of protection of the present invention.
Claims
1. A high-resolution image target recognition method based on multi-feature interactive learning, characterized in that: The following steps are involved: a) The original high-resolution image dataset Divide into training set and validation set, then perform data preprocessing on the training set and validation set to enhance the original high-resolution image scaling and target detection data; b) Input the preprocessed data into the Faster R-CNN target detection network to detect the target area of interest in the image and locate the target area. The target detection network locates the sub-area , the sub-region Map back to the original high-resolution image and crop this area to obtain three high-resolution sub-region images , ; c) For the original high-resolution images and sub-region images in the training set Processing,data enhancement for image classification; d) The original high-resolution image and sub-region image in the processed training set Input into the feature extraction module 1 of the recognition network to obtain the overall features and sub-regional characteristics ; The feature extraction module 1 includes a downsampling layer, a first branch and a second branch; The downsampling layer consists of a convolutional layer, a batch normalization layer, and a Swish activation function layer; The first branch consists of a first convolutional attention block and a second convolutional attention block, where both the first convolutional attention block and the second convolutional attention block consist of a first convolutional layer, a depth-separable convolutional layer, a SE attention layer, a second convolutional layer, and an identity mapping layer; The second branch consists of the first convolutional attention block, the second convolutional attention block, and the third convolutional attention block, wherein the first convolutional attention block, the second convolutional attention block, and the third convolutional attention block are each composed of the first convolutional layer, the depth-separable convolutional layer, the SE attention layer, the second convolutional layer, and the identity mapping layer; Among them, the convolution kernel size of the downsampling layer is , with a stride of 2 and a padding of 1; the convolution kernel size of the first and second convolutional layers in the first convolutional attention block and the first, second and third convolutional attention blocks of the first branch is 1×1, with a stride of 1 and a padding of 0; the convolution kernel size of the depthwise separable convolution in the first convolutional attention block of the first branch is , with a stride of 2 and padding of 1, the kernel size of the depthwise separable convolution in the second convolutional attention block is , with a stride of 1 and padding of 1; the kernel size of the depthwise separable convolution in the first convolutional attention block of the second branch is , the stride is 2, the padding is 2, and the kernel size of the depthwise separable convolution in the second convolutional attention block is , the stride is 1, the padding is 2, and the kernel size of the depthwise separable convolution in the third convolutional attention block is , the step size is 1, and the padding is 2; e) The overall characteristics and sub-regional characteristics Input into the feature interaction module MIS to obtain interactive features ; The feature interaction module MIS includes feature refinement stage, interactive attention stage and fusion stage; The feature refinement stage consists of the first BCD-Block and the second BCD-Block; the first BCD-Block and the second BCD-Block are both composed of a center difference convolution layer, a first convolution layer, a second convolution layer and an identity mapping layer. The center difference convolution includes sampling and aggregation, where sampling is to sample a patch in the input feature map, and aggregation is to subtract the center element from each element in the patch, and then obtain the output feature through ordinary convolution of the center difference convolution layer. The ordinary convolution consists of a convolution layer, a batch normalization layer and a SiLU activation function layer; the first convolution layer and the second convolution layer are both composed of a convolution layer, a batch normalization layer and a ReLU activation function layer, and the center difference convolution layer is composed of a center difference convolution and an ordinary convolution; the convolution kernel sizes of the first convolution layer and the second convolution layer of the first BCD-Block are both , the step size is 1, the padding is 1, and the convolution kernel size of the first convolution layer in the center difference convolution layer of the first BCD-Block is , the step size is 1, and the padding is 1; the convolution kernel size of the first convolution layer and the second convolution layer of the second BCD-Block is , the step size is 1, and the padding is 1; the convolution kernel size of the first convolution layer in the center difference convolution layer of the second BCD-Block is , the step size is 1, and the padding is 1; The interactive attention layer includes a depthwise separable convolution and a multi-head attention layer: the depthwise separable convolution layer includes a depthwise convolution layer and a pointwise convolution layer. Both the depthwise convolution layer and the pointwise convolution layer are composed of a convolution layer, a batch normalization layer, and a LeakyReLU activation function layer. The convolution kernel size of the depthwise separable convolution layer is , the stride is 1, the padding is 1, and the convolution kernel size of the point-by-point convolution layer of the depth-wise separable convolution layer is , the step length is 1, and the filling is 0; The input features are mapped through the depth-wise separable convolutional layer to obtain the query Q, key K, and value V vectors required by the attention mechanism. The multi-head attention layer divides each Q, K, and V into multiple branches. The number of branches is equivalent to the number of heads. The overall features are the key and value, and the sub-region features are the query. The fusion stage consists of the first point-by-point convolution layer, the second point-by-point convolution layer, the spatial pyramid pooling layer SPP, the activation function layer and the third point-by-point convolution layer. The convolution kernel sizes of the first point-by-point convolution layer, the second point-by-point convolution layer and the third point-by-point convolution layer in the fusion stage are , the step length is 1, and the filling is 0; f) The interactive features Input to the feature extraction module 2 of the recognition network to obtain the feature , The recognition result of the image is obtained through the fully connected layer; The feature extraction module 2 is composed of a first branch, a second branch and a third branch; The first branch consists of the first convolutional attention block, the second convolutional attention block, and the third convolutional attention block. The first convolutional attention block, the second convolutional attention block, and the third convolutional attention block are all composed of the first convolutional layer, the depth-separable convolutional layer, the SE attention layer, the second convolutional layer, and the identity mapping layer; The second branch consists of the first convolutional attention block, the second convolutional attention block, the third convolutional attention block and the fourth convolutional attention block, each of which consists of the first convolutional layer, the depth-separable convolutional layer, the SE attention layer, the second convolutional layer and the identity mapping layer; The third branch consists of the first convolutional attention block, which consists of the first convolutional layer, the depth-separable convolutional layer, the SE attention layer, the second convolutional layer, and the identity mapping layer; Among them, the convolution kernel sizes of the first convolutional attention block, the second convolutional attention block and the third convolutional attention block of the first branch, the first convolutional attention block, the second convolutional attention block, the third convolutional attention block and the fourth convolutional attention block of the second branch, and the first convolutional attention block of the third branch are , the stride is 1, the padding is 0, and the convolution kernel size of the depthwise separable convolution in the first convolutional attention block of the first branch is , the stride is 2, the padding is 1, and the convolution kernel size of the depthwise separable convolution in the second and third convolutional attention blocks is , with a stride of 1 and padding of 1; the kernel size of the depthwise separable convolution in the first convolutional attention block of the second branch is , the stride is 2, the padding is 2, and the convolution kernel size of the depthwise separable convolution in the second convolutional attention block, the third convolutional attention block, and the fourth convolutional attention block is , the stride is 1, and the padding is 2; the convolution kernel size of the depthwise separable convolution of the first convolutional attention block in the third branch is , the stride is 2, and the padding is 1.
2. According to claim 1, a high-resolution image target recognition method based on multi-feature interactive learning is characterized in that: Step a) comprises the following steps: a-1) The original high-resolution image data set Divide into training sets according to a certain ratio and validation set , where n represents the number of high-resolution images, Represents the training set images, The validation set pictures, represents the number of training set images, Indicates the number of validation set images; a-2) Label the training set using the labeling software LabelImg and validation set The target in the image is marked, and the marking information includes the location and category information of the target area; a-3) For the labeled training set and validation set The images in the training set are uniformly scaled and then Perform image flipping and color gamut transformation operations to enhance image data and obtain the processed training set , represents the first data.
3. The high-resolution image target recognition method based on multi-feature interactive learning according to claim 2 is characterized in that: Step b) comprises the following steps: b-1) The dataset The images Input into the Faster R-CNN backbone network ResNet-50 to obtain the features , and then the feature Input into the RPN network to generate detection box proposals; b-2) The characteristics The detection box proposals are simultaneously input into the ROI pooling module implemented by maximum pooling to obtain the feature , the feature The category probability and the offset of the detection box are obtained through the fully connected layer ,in , is the offset of the center coordinates of the box where the target area predicted by the network is located. , The width and height scaling factors of the target area are then and predefined anchor boxes Calculate the target sub-region ,in , is the center coordinate of the anchor box, , is the width and height of the anchor box, and then the target sub-region Map back to the original high-resolution image and crop to get the sub-region image , , that is, the sub-region image is , and , Indicates how many different regional features there are in an image; Target sub-area The calculation process is: , , , , in, , Indicates sub-area The center coordinates of Indicates sub-area The width and height, Represents the sigmoid function.
4. The high-resolution image target recognition method based on multi-feature interactive learning according to claim 3 is characterized in that: Step c) comprises the following steps: For the training set Original high-resolution image And the sub-region images of the three images obtained by Faster R-CNN , , Perform preprocessing and data enhancement operations. Data enhancement mainly includes random cropping and random horizontal flipping. Preprocessing refers to standardization to obtain the processed original high-resolution image. And the sub-region images of the three images after processing , and .
5. The high-resolution image target recognition method based on multi-feature interactive learning according to claim 4 is characterized in that: Step d) comprises the following steps: d-1) , , and Input into the feature extraction module 1 of the recognition network; d-2) , , and The specific process of inputting into the feature extraction module 1 of the recognition network is as follows: (1) Data , , and Input to the downsampling layer to get the initial feature map , , and ; (2) Features , , and Input to the first convolutional attention block of the first branch to get the feature map , , and ; (3) Features , , and Input to the second convolutional attention block of the first branch to get the feature map , , and ; (4) Features , , and Input to the first convolutional attention block of the second branch to obtain the feature map , , and ; (5) Characteristics , , and Input to the second convolutional attention block of the second branch to obtain the feature map , , and ; (6) Characteristics , , and Input to the third convolutional attention block of the second branch to obtain the feature map , , and ; The calculation formula is as follows: , , in, Represents the overall characteristics, Indicates the final Sub-regional characteristics, Indicates The original high-resolution image after processing. Indicates the processed The sub-region image of the image, represents the downsampling layer, represents the first branch of feature extraction module 1, Represents the second branch of feature extraction module 1.
6. The high-resolution image target recognition method based on multi-feature interactive learning according to claim 5 is characterized in that: Step e) comprises the following steps: e-1) The feature map , , and Input into the first BCD-Block of the feature refinement stage to obtain the feature map , , and , and then the feature map , , and Input to the second BCD-Block of the feature refinement stage to obtain the feature map , , and ; The calculation formula of the central difference convolution layer is as follows: Centered difference convolution of the center difference convolution layer: ; Ordinary convolution of the center difference convolution layer: ; The entire process of the central difference convolution layer: ; in, represents the central difference convolution of the central difference convolution layer, represents the ordinary convolution of the center difference convolution layer, represents the input feature map, represents the weight parameter, Indicates the central element position of a patch in the input feature map, express Neighborhood, when the convolution kernel size is When is an eight-neighborhood, and the range is , Indicates control and The parameters of importance, , The larger the value, the greater the contribution of the central difference convolution; The calculation formula of the overall process is as follows: The process of the first BCD-Block: , ; The process of the second BCD-Block: , ; in, Represents the entire operation process of the central difference convolution layer, and Represents the first and second convolutional layers in the first BCD-Block, and Represents the first and second convolutional layers in the second BCD-Block; e-2) Calculate the similarity between the overall feature and the sub-region feature according to the self-attention formula, and then multiply it with the value vector to obtain the feature after the overall feature and multiple sub-region features are interactively enhanced. Input to the depth separable convolution layer to get K, V, and convert the feature map , and Input them into the depth separable convolution layer respectively to get the corresponding , and , then , K and V are input to the multi-head attention layer to obtain the feature map ,Will , K and V are input to the multi-head attention layer to obtain the feature map ,Will , K and V are input to the multi-head attention layer to obtain the feature map , and then the feature map , , and The feature map is obtained by concat splicing in the channel dimension ; The calculation formula is as follows: , , , in, represents depthwise separable convolution, represents multi-head self-attention, ; e-3) The fusion stage will enhance and complement the features obtained in the interactive attention stage. The first point-by-point convolution layer and the second convolution layer of the fusion stage are input in sequence to obtain feature maps. and , and then the feature map Input to the spatial pyramid pooling layer SPP to get the feature map , and then the feature map Input to the Sigmoid activation function layer to get the feature map , and then the feature map and Perform element-by-element multiplication to obtain the feature map , the feature Input to the third point-by-point convolution layer to get the feature map , and finally the feature and Perform element-by-element addition to obtain the interactive features ; The overall process formula is as follows: , , in, , and They represent the first point-by-point convolution layer, the second point-by-point convolution layer, and the third point-by-point convolution layer in the fusion stage respectively.
7. The high-resolution image target recognition method based on multi-feature interactive learning according to claim 6 is characterized in that: Step f) comprises the following steps: The characteristics Input into the first branch to get , and then the feature map Input into the second branch to get the feature map , and then the feature map Input into the third branch to get the feature map ; The characteristics After inputting into the global average pooling layer and the fully connected layer, the recognition result Output of each image is obtained; The overall process formula is as follows: , , in, , and They represent the first branch, the second branch and the third branch of feature extraction module 2 respectively, represents global average pooling, represents a fully connected layer; During the training process, set the parameters epoch, batchsize, image size of the input model, learning rate, optimizer, and loss function type.
Citation Information
Patent Citations
Intelligent identification method for small targets in high-resolution image based on deep learning
CN115984846A
High-resolution remote sensing image land coverage classification method and device and storage medium
CN117036936A
Method for detecting building change area in dual-temporal remote sensing image based on residual neural network
CN117765361A
Multi-directional scene text recognition method and system based on multi-element attention mechanism
US20220121871A1
