MEC-PA-based bearing surface feature extraction method and system, and storage medium
Through the MEC-PA method, global average pooling and parallel convolution kernels are combined with jump connections and dual attention models to solve the problem of insufficient recognition of tiny defects in bearing surface feature extraction, achieving higher detection accuracy and background interference suppression.
Patent Information
- Application Number
- CN202510617945.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2025-09-19
Smart Images

Figure CN120673079A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of bearings, and more particularly, to a method, system and storage medium for extracting bearing surface features based on MEC-PA. Background Art
[0002] In modern industrial production, bearings are core components of mechanical equipment. Surface defects directly impact the equipment's operating accuracy, service life, and safety. Traditional bearing surface defect detection relies primarily on manual visual inspection or rule-based image processing techniques. Manual visual inspection suffers from low efficiency and high subjectivity, making it difficult to adapt to the demands of large-scale production. Traditional image processing algorithms are sensitive to complex backgrounds and noise, significantly reducing detection accuracy under conditions of uneven lighting, minor defects, or complex operating conditions.
[0003] In recent years, deep learning-based image segmentation techniques (such as U-Net) have shown promise in industrial inspection. However, existing models have limited feature extraction capabilities in complex backgrounds, making it difficult to distinguish between minor defects and noise. Furthermore, multi-scale defect recognition relies on convolutional kernels at a single scale, resulting in insufficient fusion of local details with global context. Therefore, a bearing surface feature extraction technology that balances feature representation and interference resistance is urgently needed. Summary of the Invention
[0004] In view of the above problems, the purpose of the present invention is to provide a bearing surface feature extraction method, system and storage medium based on MEC-PA, which dynamically optimizes channel weights through global average pooling to enhance key feature expression; utilizes parallel convolution kernels to extract local details and global context information, and combines jump connections to achieve multi-scale feature complementarity; introduces a spatial and channel dual attention enhancement mechanism to accurately focus on defect areas and suppress background interference. The present invention significantly improves the accuracy of bearing surface feature extraction through a dual convolution enhancement model (DEC), a multi-scale convolution residual model (MCBR) and a dual attention model (PACA).
[0005] A first aspect of the present invention provides a bearing surface feature extraction method based on MEC-PA, the method comprising:
[0006] Acquiring a first characteristic image of the bearing surface;
[0007] According to the first feature image, perform global average pooling on each channel to generate channel weight information;
[0008] Multiplying the channel weight information by the first feature image channel by channel, and then processing the first feature image based on a preset convolution refinement to obtain a first convolution feature map;
[0009] adding the first characteristic image and the second characteristic image element by element to obtain a second characteristic image;
[0010] Processing the second feature image based on preset downsampling and upsampling to obtain a second convolution feature map;
[0011] Processing the second convolutional feature map based on a preset skip connection to obtain a third convolutional feature map;
[0012] Adding the third convolution feature map to the second feature image element by element to obtain a third feature image;
[0013] According to the third feature image, the feature map is enhanced based on the dual attention model to obtain a multi-scale feature map.
[0014] In this solution, the global average pooling performed on each channel is specifically as follows:
[0015] Performing global average pooling on each channel of the first feature image in the spatial dimension to generate a scalar value of the corresponding channel;
[0016] The scalar value is input into the fully connected layer, and the dependency between channels is modeled by the dynamically adjusted convolution kernel to generate a channel weight vector;
[0017] The channel weight vector is mapped to the [0, 1] interval range through a preset activation function to obtain the channel weight information.
[0018] In this solution, the convolution refinement process is specifically as follows:
[0019] Perform a 3×3 convolution operation on the first feature image after channel-by-channel multiplication to obtain the first local feature information;
[0020] Running a preset batch normalization function and an activation function on the first local feature information in sequence to obtain a first convolutional feature map;
[0021] The first convolutional feature map is used to be added element-by-element with the first feature image through a residual connection.
[0022] In this solution, the downsampling operation and the upsampling operation are specifically:
[0023] The downsampling operation is to compress the second feature image according to a 3×3 convolution with a step size of 2 to obtain a first resolution feature image;
[0024] The upsampling operation is to restore the resolution of the first resolution feature map by using transposed convolution to obtain a second resolution feature map;
[0025] The second resolution feature map is used to fuse with the elements of the corresponding layer of the first feature image through skip connection processing to obtain a third convolution feature map.
[0026] In this solution, the skip connection processing is specifically as follows:
[0027] Aligning the spatial dimensions of the second resolution feature map with the first feature image of the corresponding layer, fusing multi-scale features by element-by-element addition or concatenation to obtain a first fused feature map;
[0028] According to the first fusion feature map, the number of channels is adjusted according to 1×1 convolution to obtain a third convolution feature map.
[0029] In this solution, the dual attention model includes a channel attention model and a spatial attention model, specifically:
[0030] The channel attention model extracts channel-level statistical information through global average pooling and global maximum pooling to dynamically adjust channel weights;
[0031] The spatial attention model generates a spatial mask through conditional features, increasing the pixel weights in the defect area and reducing the pixel weights in the background area;
[0032] The outputs of the channel attention model and the spatial attention model are weightedly fused to obtain a multi-scale feature map.
[0033] A second aspect of the present invention provides a bearing surface feature extraction system based on MEC-PA, including a bearing surface feature extraction method program based on MEC-PA. When the bearing surface feature extraction method program based on MEC-PA is executed by the processor, the following steps are implemented:
[0034] Acquiring a first characteristic image of the bearing surface;
[0035] According to the first feature image, perform global average pooling on each channel to generate channel weight information;
[0036] Multiplying the channel weight information by the first feature image channel by channel, and then processing the first feature image based on a preset convolution refinement to obtain a first convolution feature map;
[0037] adding the first characteristic image and the second characteristic image element by element to obtain a second characteristic image;
[0038] Processing the second feature image based on preset downsampling and upsampling to obtain a second convolution feature map;
[0039] Processing the second convolutional feature map based on a preset skip connection to obtain a third convolutional feature map;
[0040] Adding the third convolution feature map to the second feature image element by element to obtain a third feature image;
[0041] According to the third feature image, the feature map is enhanced based on the dual attention model to obtain a multi-scale feature map.
[0042] In this solution, the global average pooling performed on each channel is specifically as follows:
[0043] Performing global average pooling on each channel of the first feature image in the spatial dimension to generate a scalar value of the corresponding channel;
[0044] The scalar value is input into the fully connected layer, and the dependency between channels is modeled by the dynamically adjusted convolution kernel to generate a channel weight vector;
[0045] The channel weight vector is mapped to the [0, 1] interval range through a preset activation function to obtain the channel weight information.
[0046] In this solution, the convolution refinement process is specifically as follows:
[0047] Perform a 3×3 convolution operation on the first feature image after channel-by-channel multiplication to obtain the first local feature information;
[0048] Running a preset batch normalization function and an activation function on the first local feature information in sequence to obtain a first convolutional feature map;
[0049] The first convolutional feature map is used to be added element-by-element with the first feature image through a residual connection.
[0050] The third aspect of the present invention provides a computer-readable storage medium, which includes a bearing surface feature extraction method program based on MEC-PA. When the bearing surface feature extraction method program based on MEC-PA is executed by a processor, the steps of the bearing surface feature extraction method based on MEC-PA as described in any one of the above items are implemented.
[0051] The present invention provides a bearing surface feature extraction method, system and storage medium based on MEC-PA. First, global average pooling is performed on each channel of the input feature map to generate channel weight information and dynamically adjust the semantic response of the key channel; then, after a preset convolution refinement process, the original features and the processed features are added element by element, and then combined with downsampling, upsampling and jump connection operations to fuse shallow high-resolution details with deep semantic features; finally, a dual attention model is used, in which channel attention dynamically adjusts channel weights through global pooling, and spatial attention generates masks to enhance the pixel weights of the defective area. After weighted fusion of the two, the target area is accurately located, thereby achieving precise positioning of the target area. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope.
[0053] Figure 1 A flow chart of a bearing surface feature extraction method based on MEC-PA of the present invention is shown;
[0054] Figure 2 An operational flow chart of performing global average pooling according to an embodiment of the present invention is shown;
[0055] Figure 3 A flow chart of convolution refinement processing provided by an embodiment of the present invention is shown;
[0056] Figure 4 A block diagram of a bearing surface feature extraction system based on MEC-PA is shown in the present invention. DETAILED DESCRIPTION
[0057] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. 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 making creative efforts are within the scope of protection of the present invention.
[0058] Unless otherwise defined, all terms (including technical and scientific terms) used in the embodiments of the present invention have the same meaning as commonly understood by those skilled in the art to which the present invention belongs. It should also be understood that terms such as those defined in common dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant technology, and should not be interpreted in an idealized or extremely formal sense, unless explicitly defined in this manner in the embodiments of the present invention.
[0059] The words "first", "second" and similar terms used in the embodiments of the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Words such as "one", "an" or "the" do not indicate a quantity limitation, but rather indicate the existence of at least one. Similarly, words such as "include" or "comprise" mean that the elements or objects preceding the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Words such as "connect" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The steps before or after the method of the embodiment of the present invention do not necessarily have to be performed in exact order. On the contrary, the various steps may be processed in reverse order or simultaneously. At the same time, other operations may be added to these processes, or one or more steps may be removed from these processes.
[0060] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0061] Figure 1 A flow chart of a bearing surface feature extraction method based on MEC-PA of the present invention is shown.
[0062] like Figure 1 As shown, the first aspect of the present invention discloses a bearing surface feature extraction method based on MEC-PA, the method comprising:
[0063] S102, acquiring a first characteristic image of the bearing surface;
[0064] S104, performing global average pooling on each channel according to the first feature image to generate channel weight information;
[0065] S106, multiplying the channel weight information by the first feature image channel by channel, and then processing the first feature image based on a preset convolution refinement to obtain a first convolution feature map;
[0066] S108, adding the first characteristic image to the second characteristic image element by element to obtain a second characteristic image;
[0067] S110, processing the second feature image based on preset downsampling and upsampling to obtain a second convolution feature map;
[0068] S112, processing the second convolutional feature map based on a preset skip connection to obtain a third convolutional feature map;
[0069] S114, adding the third convolution feature map and the second feature image element by element to obtain a third feature image;
[0070] S116: According to the third feature image, enhance the feature map based on the dual attention model to obtain a multi-scale feature map.
[0071] It should be noted that the encoder performs a preliminary convolution on the bearing surface defect image to extract an initial feature map, which serves as the first feature image of the bearing surface. Global average pooling is performed on each channel of the initial feature map to generate channel-level scalar values. This is then fed into a fully connected layer to dynamically model inter-channel dependencies and generate weight information. This weight information is multiplied channel-by-channel with the initial feature map to generate a weighted feature map, which is used to enhance key channel features. This weighted feature map undergoes convolutional refinement, including but not limited to 3×3 convolution, batch normalization, and ReLU activation, to extract local detail features, resulting in the first convolutional feature map. Subsequently, the first convolutional feature map is element-wise added to the initial feature map, preserving the initial information and mitigating gradients, to form the second feature map. The second feature map is then downsampled by compressing the spatial dimensions of the feature map using a 3×3 convolution with a stride of 2. It is then upsampled by restoring the resolution using a transposed convolution, resulting in the second convolutional feature map. Subsequently, skip connections are applied to the second convolutional feature map to fuse shallow details with deep semantics, generating a third feature image that balances local details with global context, improving the recognition of complex defects. Finally, for the third feature image, a channel attention model dynamically adjusts channel weights through global pooling, while a spatial attention model generates a spatial mask to enhance the defect area. A weighted fusion of the two outputs a multi-scale feature map, minimizing background interference and improving segmentation accuracy in the target area.
[0072] Figure 2 A flowchart of an operation of performing global average pooling provided by an embodiment of the present invention is shown.
[0073] According to an embodiment of the present invention, Figure 2 As shown, the global average pooling performed on each channel is specifically as follows:
[0074] S202, performing global average pooling on each channel of the first feature image in a spatial dimension to generate a scalar value of the corresponding channel;
[0075] S204, inputting the scalar value into a fully connected layer, modeling the dependency between channels through a dynamically adjusted convolution kernel, and generating a channel weight vector;
[0076] S206 , mapping the channel weight vector to the interval range of [0, 1] through a preset activation function to obtain channel weight information.
[0077] It should be noted that the input feature map of size C×H×W is taken as an example, where C represents the number of channels and H×W represents the spatial dimension. Average pooling is performed on each channel in the spatial dimension to obtain C average scalar values, where each scalar value represents the global semantic strength of the corresponding channel. Then, the scalar value is input into the fully connected layer, and the interaction weights between channels are calculated by the dynamically adjusted 1×1 convolution kernel to generate a weight vector of C dimensions. The weight vector is mapped to the [0,1] interval by the Sigmoid function to obtain weight information, which is used to multiply the original feature map channel by channel, thereby enhancing the response of important channels and suppressing redundant information. In this embodiment, global semantic modeling is used to strengthen the channel features related to defects and improve the sensitivity of the model to key information. In addition, the 1×1 convolution kernel is used to avoid explicit dimensionality reduction, reduce computational overhead, and is suitable for real-time detection scenarios.
[0078] Figure 3 A flowchart of convolution refinement processing provided by an embodiment of the present invention is shown.
[0079] According to an embodiment of the present invention, Figure 3 As shown in FIG, the convolution refinement process is specifically as follows:
[0080] S302, performing a 3×3 convolution operation on the first feature image after channel-by-channel multiplication to obtain first local feature information;
[0081] S304: sequentially executing a preset batch normalization function and an activation function on the first local feature information to obtain a first convolutional feature map;
[0082] The first convolutional feature map is used to be added element-by-element with the first feature image through a residual connection.
[0083] It should be noted that, first, a 3×3 convolution operation is performed on the channel-weighted feature map to extract detailed features such as local edges and textures as the first local feature information; wherein, the 3×3 convolution strengthens the local feature extraction, which is suitable for the identification of small defects. Then, the convolution output value is processed according to batch normalization (BN) to standardize the data distribution and achieve accelerated convergence. The nonlinear expression ability is then enhanced by the ReLU activation function, thereby obtaining the first convolution feature map after convolution refinement. Among them, the refined convolution feature map is used to add the initial feature map element by element, thereby retaining the structural information of the initial feature.
[0084] According to an embodiment of the present invention, the downsampling operation and the upsampling operation are specifically:
[0085] The downsampling operation is to compress the second feature image according to a 3×3 convolution with a step size of 2 to obtain a first resolution feature image;
[0086] The upsampling operation is to restore the resolution of the first resolution feature map by using transposed convolution to obtain a second resolution feature map;
[0087] The second resolution feature map is used to fuse with the elements of the corresponding layer of the first feature image through skip connection processing to obtain a third convolution feature map.
[0088] It should be noted that the downsampling operation compresses the spatial dimension of the feature map through a 3×3 convolution with a stride of 2, so that the resolution is halved, thereby expanding the receptive field to capture global context information. In addition, a Dropout layer is introduced to randomly discard neurons based on a preset random probability, thereby suppressing overfitting. The upsampling operation uses transposed convolution on the compressed feature map to gradually restore the resolution. For example, a transposed convolution is used on a 32×32 feature map, and the resolution of the feature map is gradually restored to the initial resolution by doubling the resolution to 64×64, 128×128, and 256×256. At this point, the low-resolution shallow features can jump to the high-resolution details, realizing the fusion of shallow features and deep semantics.
[0089] According to an embodiment of the present invention, the skip connection processing is specifically as follows:
[0090] Aligning the spatial dimensions of the second resolution feature map with the first feature image of the corresponding layer, fusing multi-scale features by element-by-element addition or concatenation to obtain a first fused feature map;
[0091] According to the first fusion feature map, the number of channels is adjusted according to 1×1 convolution to obtain a third convolution feature map.
[0092] It should be noted that the skip connection process includes spatial alignment, feature fusion, and channel adjustment stages. First, the low-resolution feature map from the upsampling process is spatially aligned with the high-resolution feature map from the corresponding layer in the encoding stage through bilinear interpolation. Then, the aligned feature maps are fused through element-by-element addition or channel concatenation, preserving shallow details such as image edges and deep semantics such as bearing defect areas. Finally, the number of channels of the fused feature map is adjusted using a 1×1 convolution to ensure consistency with the decoder input dimension, avoiding information conflicts caused by dimensional mismatch.
[0093] According to an embodiment of the present invention, the dual attention model includes a channel attention model and a spatial attention model, specifically:
[0094] The channel attention model extracts channel-level statistical information through global average pooling and global maximum pooling to dynamically adjust channel weights;
[0095] The spatial attention model generates a spatial mask through conditional features, increasing the pixel weights in the defect area and reducing the pixel weights in the background area;
[0096] The outputs of the channel attention model and the spatial attention model are weightedly fused to obtain a multi-scale feature map.
[0097] It should be noted that the channel attention model performs global average pooling and global max pooling on the input feature map to generate a channel-level statistical vector. The fully connected layer then dynamically adjusts the channel weights to enhance key semantics. The spatial attention model adds shallow features from the encoding phase to deep features, then generates a spatial mask through convolution and sigmoid activation. This strengthens the pixel weights in the defective area and enhances the defective area. Finally, the channel attention weights are element-wise multiplied by the spatial mask to generate the final multi-scale feature map.
[0098] It is worth mentioning that the element-by-element addition operation also includes:
[0099] Add the two feature maps, and then adjust the number of channels through 1×1 convolution to obtain the first element feature map;
[0100] Performing a preset nonlinear activation function processing on the first element feature map to obtain a second element feature map;
[0101] The second element feature map is processed according to a preset residual connection to obtain an element-by-element addition output image.
[0102] It should be noted that, in this embodiment, the operation details of element-by-element addition are as follows: first, the two feature maps to be added are adjusted to have the same number of channels through 1×1 convolution to ensure the consistency of dimensions; then, the added feature maps are processed by the ReLU activation function to enhance the nonlinear expression capability; finally, the activated feature maps are fused with the original input through a residual connection to stabilize the image gradient.
[0103] It is worth mentioning that the generation process of the multi-scale feature map also includes:
[0104] Extract local details and global context features respectively through parallel 3×3 and 5×5 convolution kernels;
[0105] Feature maps of different scales are fused layer by layer through a pyramid structure to integrate multi-resolution information;
[0106] The fused feature map is subjected to channel compression and nonlinear activation processing for defect segmentation.
[0107] It should be noted that, in this embodiment, the generation process of the multi-scale feature map is as follows: first, features of different scales are extracted by parallel 3×3 convolution and 5×5 convolution kernels, where 3×3 convolution is used to extract local details and 5×5 convolution is used to extract global context semantics; then, feature maps of different resolutions are fused layer by layer to form a feature pyramid to integrate multi-scale information; finally, the fused feature map is compressed by 1×1 convolution to reduce the number of channels, and then output to the decoder through ReLU activation for subsequent defect recognition and segmentation.
[0108] Figure 4 A block diagram of a bearing surface feature extraction system based on MEC-PA is shown in the present invention.
[0109] like Figure 4 As shown, the second aspect of the present invention discloses a bearing surface feature extraction system 4 based on MEC-PA, including a memory 41 and a processor 42. The memory includes a bearing surface feature extraction method program based on MEC-PA. When the bearing surface feature extraction method program based on MEC-PA is executed by the processor, the following steps are implemented:
[0110] Acquiring a first characteristic image of the bearing surface;
[0111] According to the first feature image, perform global average pooling on each channel to generate channel weight information;
[0112] Multiplying the channel weight information by the first feature image channel by channel, and then processing the first feature image based on a preset convolution refinement to obtain a first convolution feature map;
[0113] adding the first characteristic image and the second characteristic image element by element to obtain a second characteristic image;
[0114] Processing the second feature image based on preset downsampling and upsampling to obtain a second convolution feature map;
[0115] Processing the second convolutional feature map based on a preset skip connection to obtain a third convolutional feature map;
[0116] Adding the third convolution feature map to the second feature image element by element to obtain a third feature image;
[0117] According to the third feature image, the feature map is enhanced based on the dual attention model to obtain a multi-scale feature map.
[0118] It should be noted that the encoder performs a preliminary convolution on the bearing surface defect image to extract an initial feature map, which serves as the first feature image of the bearing surface. Global average pooling is performed on each channel of the initial feature map to generate channel-level scalar values. This is then fed into a fully connected layer to dynamically model inter-channel dependencies and generate weight information. This weight information is multiplied channel-by-channel with the initial feature map to generate a weighted feature map, which is used to enhance key channel features. This weighted feature map undergoes convolutional refinement, including but not limited to 3×3 convolution, batch normalization, and ReLU activation, to extract local detail features, resulting in the first convolutional feature map. Subsequently, the first convolutional feature map is element-wise added to the initial feature map, preserving the initial information and mitigating gradients, to form the second feature map. The second feature map is then downsampled by compressing the spatial dimensions of the feature map using a 3×3 convolution with a stride of 2. It is then upsampled by restoring the resolution using a transposed convolution, resulting in the second convolutional feature map. Subsequently, skip connections are applied to the second convolutional feature map to fuse shallow details with deep semantics, generating a third feature image that balances local details with global context, improving the recognition of complex defects. Finally, for the third feature image, a channel attention model dynamically adjusts channel weights through global pooling, while a spatial attention model generates a spatial mask to enhance the defect area. A weighted fusion of the two outputs a multi-scale feature map, minimizing background interference and improving segmentation accuracy in the target area.
[0119] According to an embodiment of the present invention, performing global average pooling on each channel is specifically as follows:
[0120] Performing global average pooling on each channel of the first feature image in the spatial dimension to generate a scalar value of the corresponding channel;
[0121] The scalar value is input into the fully connected layer, and the dependency between channels is modeled by the dynamically adjusted convolution kernel to generate a channel weight vector;
[0122] The channel weight vector is mapped to the [0, 1] interval range through a preset activation function to obtain the channel weight information.
[0123] It should be noted that the input feature map of size C×H×W is taken as an example, where C represents the number of channels and H×W represents the spatial dimension. Average pooling is performed on each channel in the spatial dimension to obtain C average scalar values, where each scalar value represents the global semantic strength of the corresponding channel. Then, the scalar value is input into the fully connected layer, and the interaction weights between channels are calculated by the dynamically adjusted 1×1 convolution kernel to generate a weight vector of C dimensions. The weight vector is mapped to the [0,1] interval by the Sigmoid function to obtain weight information, which is used to multiply the original feature map channel by channel, thereby enhancing the response of important channels and suppressing redundant information. In this embodiment, global semantic modeling is used to strengthen the channel features related to defects and improve the sensitivity of the model to key information. In addition, the 1×1 convolution kernel is used to avoid explicit dimensionality reduction, reduce computational overhead, and is suitable for real-time detection scenarios.
[0124] According to an embodiment of the present invention, the convolution refinement process is specifically as follows:
[0125] Perform a 3×3 convolution operation on the first feature image after channel-by-channel multiplication to obtain the first local feature information;
[0126] Running a preset batch normalization function and an activation function on the first local feature information in sequence to obtain a first convolutional feature map;
[0127] The first convolutional feature map is used to be added element-by-element with the first feature image through a residual connection.
[0128] It should be noted that, first, a 3×3 convolution operation is performed on the channel-weighted feature map to extract detailed features such as local edges and textures as the first local feature information; wherein, the 3×3 convolution strengthens the local feature extraction, which is suitable for the identification of small defects. Then, the convolution output value is processed according to batch normalization (BN) to standardize the data distribution and achieve accelerated convergence. The nonlinear expression ability is then enhanced by the ReLU activation function, thereby obtaining the first convolution feature map after convolution refinement. Among them, the refined convolution feature map is used to add the initial feature map element by element, thereby retaining the structural information of the initial feature.
[0129] According to an embodiment of the present invention, the downsampling operation and the upsampling operation are specifically:
[0130] The downsampling operation is to compress the second feature image according to a 3×3 convolution with a step size of 2 to obtain a first resolution feature image;
[0131] The upsampling operation is to restore the resolution of the first resolution feature map by using transposed convolution to obtain a second resolution feature map;
[0132] The second resolution feature map is used to fuse with the elements of the corresponding layer of the first feature image through skip connection processing to obtain a third convolution feature map.
[0133] It should be noted that the downsampling operation compresses the spatial dimension of the feature map through a 3×3 convolution with a stride of 2, so that the resolution is halved, thereby expanding the receptive field to capture global context information. In addition, a Dropout layer is introduced to randomly discard neurons based on a preset random probability, thereby suppressing overfitting. The upsampling operation uses transposed convolution on the compressed feature map to gradually restore the resolution. For example, a transposed convolution is used on a 32×32 feature map, and the resolution of the feature map is gradually restored to the initial resolution by doubling the resolution to 64×64, 128×128, and 256×256. At this point, the low-resolution shallow features can jump to the high-resolution details, realizing the fusion of shallow features and deep semantics.
[0134] According to an embodiment of the present invention, the skip connection processing is specifically as follows:
[0135] Aligning the spatial dimensions of the second resolution feature map with the first feature image of the corresponding layer, fusing multi-scale features by element-by-element addition or concatenation to obtain a first fused feature map;
[0136] According to the first fusion feature map, the number of channels is adjusted according to 1×1 convolution to obtain a third convolution feature map.
[0137] It should be noted that the skip connection process includes spatial alignment, feature fusion, and channel adjustment stages. First, the low-resolution feature map from the upsampling process is spatially aligned with the high-resolution feature map from the corresponding layer in the encoding stage through bilinear interpolation. Then, the aligned feature maps are fused through element-by-element addition or channel concatenation, preserving shallow details such as image edges and deep semantics such as bearing defect areas. Finally, the number of channels of the fused feature map is adjusted using a 1×1 convolution to ensure consistency with the decoder input dimension, avoiding information conflicts caused by dimensional mismatch.
[0138] According to an embodiment of the present invention, the dual attention model includes a channel attention model and a spatial attention model, specifically:
[0139] The channel attention model extracts channel-level statistical information through global average pooling and global maximum pooling to dynamically adjust channel weights;
[0140] The spatial attention model generates a spatial mask through conditional features, increasing the pixel weights in the defect area and reducing the pixel weights in the background area;
[0141] The outputs of the channel attention model and the spatial attention model are weightedly fused to obtain a multi-scale feature map.
[0142] It should be noted that the channel attention model performs global average pooling and global max pooling on the input feature map to generate a channel-level statistical vector. The fully connected layer then dynamically adjusts the channel weights to enhance key semantics. The spatial attention model adds shallow features from the encoding phase to deep features, then generates a spatial mask through convolution and sigmoid activation. This strengthens the pixel weights in the defective area and enhances the defective area. Finally, the channel attention weights are element-wise multiplied by the spatial mask to generate the final multi-scale feature map.
[0143] It is worth mentioning that the element-by-element addition operation also includes:
[0144] Add the two feature maps, and then adjust the number of channels through 1×1 convolution to obtain the first element feature map;
[0145] Performing a preset nonlinear activation function processing on the first element feature map to obtain a second element feature map;
[0146] The second element feature map is processed according to a preset residual connection to obtain an element-by-element addition output image.
[0147] It should be noted that, in this embodiment, the operation details of element-by-element addition are as follows: first, the two feature maps to be added are adjusted to have the same number of channels through 1×1 convolution to ensure the consistency of dimensions; then, the added feature maps are processed by the ReLU activation function to enhance the nonlinear expression capability; finally, the activated feature maps are fused with the original input through a residual connection to stabilize the image gradient.
[0148] It is worth mentioning that the generation process of the multi-scale feature map also includes:
[0149] Extract local details and global context features respectively through parallel 3×3 and 5×5 convolution kernels;
[0150] Feature maps of different scales are fused layer by layer through a pyramid structure to integrate multi-resolution information;
[0151] The fused feature map is subjected to channel compression and nonlinear activation processing for defect segmentation.
[0152] It should be noted that, in this embodiment, the generation process of the multi-scale feature map is as follows: first, features of different scales are extracted by parallel 3×3 convolution and 5×5 convolution kernels, where 3×3 convolution is used to extract local details and 5×5 convolution is used to extract global context semantics; then, feature maps of different resolutions are fused layer by layer to form a feature pyramid to integrate multi-scale information; finally, the fused feature map is compressed by 1×1 convolution to reduce the number of channels, and then output to the decoder through ReLU activation for subsequent defect recognition and segmentation.
[0153] The third aspect of the present invention provides a computer-readable storage medium, which includes a bearing surface feature extraction method program based on MEC-PA. When the bearing surface feature extraction method program based on MEC-PA is executed by a processor, the steps of the bearing surface feature extraction method based on MEC-PA as described in any one of the above items are implemented.
[0154] The present invention provides a bearing surface feature extraction method, system and storage medium based on MEC-PA. First, global average pooling is performed on each channel of the input feature map to generate channel weight information and dynamically adjust the semantic response of the key channel; then, after a preset convolution refinement process, the original features and the processed features are added element by element, and then combined with downsampling, upsampling and jump connection operations to fuse shallow high-resolution details with deep semantic features; finally, a dual attention model is used, in which channel attention dynamically adjusts channel weights through global pooling, and spatial attention generates masks to enhance the pixel weights of the defective area. After weighted fusion of the two, the target area is accurately located, thereby achieving precise positioning of the target area.
[0155] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0156] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A bearing surface feature extraction method based on MEC-PA, characterized in that: The method comprises: Acquiring a first characteristic image of the bearing surface; According to the first feature image, perform global average pooling on each channel to generate channel weight information; Multiplying the channel weight information by the first feature image channel by channel, and then processing the first feature image based on a preset convolution refinement to obtain a first convolution feature map; adding the first characteristic image and the second characteristic image element by element to obtain a second characteristic image; Processing the second feature image based on preset downsampling and upsampling to obtain a second convolution feature map; Processing the second convolutional feature map based on a preset skip connection to obtain a third convolutional feature map; Adding the third convolution feature map to the second feature image element by element to obtain a third feature image; According to the third feature image, the feature map is enhanced based on the dual attention model to obtain a multi-scale feature map.
2. The bearing surface feature extraction method based on MEC-PA according to claim 1, characterized in that: The global average pooling performed on each channel is specifically as follows: Performing global average pooling on each channel of the first feature image in the spatial dimension to generate a scalar value of the corresponding channel; The scalar value is input into the fully connected layer, and the dependency between channels is modeled by the dynamically adjusted convolution kernel to generate a channel weight vector; The channel weight vector is mapped to the [0, 1] interval range through a preset activation function to obtain the channel weight information.
3. The bearing surface feature extraction method based on MEC-PA according to claim 1, characterized in that: The convolution refinement process is specifically as follows: Perform a 3×3 convolution operation on the first feature image after channel-by-channel multiplication to obtain the first local feature information; Running a preset batch normalization function and an activation function on the first local feature information in sequence to obtain a first convolutional feature map; The first convolutional feature map is used to be added element-by-element with the first feature image through a residual connection.
4. The bearing surface feature extraction method based on MEC-PA according to claim 1, characterized in that: The downsampling operation and the upsampling operation are specifically: The downsampling operation is to compress the second feature image according to a 3×3 convolution with a step size of 2 to obtain a first resolution feature image; The upsampling operation is to restore the resolution of the first resolution feature map by using transposed convolution to obtain a second resolution feature map; The second resolution feature map is used to fuse with the elements of the corresponding layer of the first feature image through skip connection processing to obtain a third convolution feature map.
5. The method for extracting bearing surface features based on MEC-PA according to claim 4, characterized in that: The skip connection process is specifically as follows: Aligning the spatial dimensions of the second resolution feature map with the first feature image of the corresponding layer, fusing multi-scale features by element-by-element addition or concatenation to obtain a first fused feature map; According to the first fusion feature map, the number of channels is adjusted according to 1×1 convolution to obtain a third convolution feature map.
6. The method for extracting bearing surface features based on MEC-PA according to claim 1, characterized in that: The dual attention model includes a channel attention model and a spatial attention model, specifically: The channel attention model extracts channel-level statistical information through global average pooling and global maximum pooling to dynamically adjust channel weights; The spatial attention model generates a spatial mask through conditional features, increasing the pixel weights in the defect area and reducing the pixel weights in the background area; The outputs of the channel attention model and the spatial attention model are weightedly fused to obtain a multi-scale feature map.
7. A bearing surface feature extraction system based on MEC-PA, characterized in that: The system includes a memory and a processor. The memory includes a bearing surface feature extraction method program based on MEC-PA. When the bearing surface feature extraction method program based on MEC-PA is executed by the processor, the following steps are implemented: Acquiring a first characteristic image of the bearing surface; According to the first feature image, perform global average pooling on each channel to generate channel weight information; Multiplying the channel weight information by the first feature image channel by channel, and then processing the first feature image based on a preset convolution refinement to obtain a first convolution feature map; adding the first characteristic image and the second characteristic image element by element to obtain a second characteristic image; Processing the second feature image based on preset downsampling and upsampling to obtain a second convolution feature map; Processing the second convolutional feature map based on a preset skip connection to obtain a third convolutional feature map; Adding the third convolution feature map to the second feature image element by element to obtain a third feature image; According to the third feature image, the feature map is enhanced based on the dual attention model to obtain a multi-scale feature map.
8. The bearing surface feature extraction system based on MEC-PA according to claim 7, characterized in that: The global average pooling performed on each channel is specifically as follows: Performing global average pooling on each channel of the first feature image in the spatial dimension to generate a scalar value of the corresponding channel; The scalar value is input into the fully connected layer, and the dependency between channels is modeled by the dynamically adjusted convolution kernel to generate a channel weight vector; The channel weight vector is mapped to the [0, 1] interval range through a preset activation function to obtain the channel weight information.
9. The bearing surface feature extraction system based on MEC-PA according to claim 7, characterized in that: The convolution refinement process is specifically as follows: Perform a 3×3 convolution operation on the first feature image after channel-by-channel multiplication to obtain the first local feature information; Running a preset batch normalization function and an activation function on the first local feature information in sequence to obtain a first convolutional feature map; The first convolutional feature map is used to be added element-by-element with the first feature image through a residual connection.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The computer-readable storage medium includes a bearing surface feature extraction method program based on MEC-PA. When the bearing surface feature extraction method program based on MEC-PA is executed by a processor, the steps of the bearing surface feature extraction method based on MEC-PA as described in any one of claims 1 to 6 are implemented.