CN-121999266-A - Defect identification method and model based on state space and multi-scale dynamic fusion
Abstract
The invention provides a defect identification method and a model based on state space and multi-scale dynamic fusion, wherein the defect identification model comprises a preprocessing network, a main network and a classification head, wherein a feature extraction layer adopts CBAM mixed attention mechanisms, a state space model and a time sequence self-adaptive fusion strategy, a ResNet-Mamba mixed structure is established, specifically CMamba blocks are combined with Mamba framework and CBAM attention mechanisms to embed the multi-scale feature fusion strategy, a multi-receptive field feature map is generated by parallel deployment of convolution kernels with different expansion rates, and local details and global semantic information are integrated through a feature pyramid structure, so that the model can adaptively focus defect features with different scales, and the accuracy and efficiency of the model in detection in a complex industrial scene containing multi-scale defects are improved.
Inventors
- JIANG ZHANSI
- WU SHAOFANG
- LIANG RIQIANG
- JIANG HUI
- HUANG KAN
- YU Renhui
- ZHAO GANG
- FAN PENG
- BI QILIN
- YANG QIJIANG
Assignees
- 广州航海学院
Dates
- Publication Date
- 20260508
- Application Date
- 20251208
Claims (10)
- 1. The defect identification model based on the state space and the multi-scale dynamic fusion is characterized by comprising a preprocessing network, a backbone network and a classification head; The preprocessing network is used for preprocessing the image to be detected to obtain preprocessed image characteristics; The main network is used for carrying out multi-scale feature extraction on the preprocessed image features to obtain a feature map, and comprises a plurality of feature extraction layers, wherein each feature extraction layer comprises a residual block, a layer normalization layer and CMamba blocks which are sequentially connected, the input end and the output end of CMamba form a jump connection structure, wherein the CMamba blocks add CBAM attention mechanisms on Mamba short convolution branches, and convolution kernels with different expansion rates are parallelly arranged on SSM branches and short convolution branches; And the classification head is used for carrying out classification prediction according to the feature map to obtain a defect identification result.
- 2. The state space and multiscale dynamic fusion-based defect recognition model of claim 1, wherein the feature extraction layer further comprises: and the input end of the selective feature fusion layer is connected with the output end of the CMamba blocks, and the output end of the selective feature fusion layer and the input end of the CMamba blocks form a jump connection structure.
- 3. The state space and multiscale dynamic fusion-based defect recognition model of claim 2, wherein the backbone network further comprises: One end of the fine tuning layer is connected with the output end of the last feature extraction layer, and the other end of the fine tuning layer is subjected to feature fusion with the output of the last feature extraction layer; The fine tuning layer is used for carrying out bilinear difference transformation on the output of the penultimate feature extraction layer to obtain a resampled feature map after scale transformation.
- 4. A state space and multiscale dynamic fusion based defect recognition model according to claim 3, wherein a CBAM attention block is embedded in the main path of the residual block in each feature extraction layer.
- 5. The state space and multiscale dynamic fusion-based defect recognition model of claim 4, wherein the preprocessing network comprises: PatchEmbed, convolutional and CBAM layers connected in sequence.
- 6. The defect identification method based on state space and multi-scale dynamic fusion is characterized by comprising the following steps of: S10, preprocessing an image to be detected to obtain preprocessed image features; s20, carrying out multi-scale feature extraction on the preprocessed image features to obtain a final feature map, wherein each feature extraction comprises the following steps: S201, carrying out convolution processing on the preprocessed features and splicing the preprocessed features with the convolved features through residual connection to obtain first intermediate features; s202, carrying out layer normalization on the first intermediate features to obtain features after layer normalization; s203.1, carrying out state space processing extraction on the normalized characteristics of the layers through 1X 1 convolution processing to obtain second intermediate characteristics containing long-range dependency relationship; S203.2, activating relu the layer normalized feature after 3×3 convolution processing, and then obtaining a third intermediate feature after CBAM attention mechanism processing; S203.3, splicing the second intermediate feature, the third intermediate feature and the layer normalized feature to obtain an intermediate feature map; and S30, carrying out classification prediction according to the final feature map to obtain a defect identification result.
- 7. The method for identifying defects based on state space and multi-scale dynamic fusion according to claim 7, wherein each feature extraction process of S20 further comprises: And S204, carrying out weighted enhancement on the third intermediate feature according to the second intermediate feature in the intermediate feature map to obtain a weighted feature map, and splicing the weighted feature map and the layer normalized feature through jump connection to obtain a fusion feature map.
- 8. The method for identifying defects based on state space and multi-scale dynamic fusion according to claim 7, further comprising, after the second last feature extraction of S20: s205, carrying out bilinear difference transformation on the output of the penultimate feature extraction layer to obtain a resampled feature map after scale transformation; At this time, S204 of the last feature extraction of S20 becomes: And splicing the weighted feature map, the layer normalized features and the resampling feature map through jump connection to obtain a final feature map.
- 9. The defect identification method based on state space and multi-scale dynamic fusion according to claim 8, wherein after the step S201 of convolving the preprocessed feature, further comprising: and carrying out CBAM attention processing on the features after the convolution processing, and splicing the features after the pretreatment and the features after the CBAM attention processing to obtain a first intermediate feature.
- 10. A training method of a defect identification model based on state space and multi-scale dynamic fusion is characterized by comprising the following steps: The method comprises the steps of obtaining multi-frame industrial defect images, manually marking and positioning according to the industrial defect images to obtain a real data set, and dividing the real data set to obtain a training set, a verification set and a test set; constructing a defect recognition model according to any one of claims 1-5; Training a preset defect recognition model according to the training set, and fine-tuning the trained defect recognition model according to the verification set and the test set to obtain a trained defect recognition model.
Description
Defect identification method and model based on state space and multi-scale dynamic fusion Technical Field The invention relates to the field of image processing, in particular to a defect identification method and model based on state space and multi-scale dynamic fusion. Background Lithium batteries are an important component of electrochemical energy storage, and become an essential functional material in the new energy era. The energy storage and conversion carrier has the characteristics of high energy conversion, repeated charge and discharge, strong portability and the like, is an important energy storage and conversion carrier, and is widely applied to the fields of electric automobiles, consumer electronics, energy storage power stations, aerospace and the like. However, due to the characteristics of electrode materials and complexity of manufacturing processes, lithium batteries are very susceptible to various defects including pits, scratches, stains, etc. on their surfaces during the production process. These defects affect the energy density, cycle life and safety performance of the battery, and may even cause thermal runaway, which seriously threatens the life safety of the user. Therefore, it is important to perform defect detection work of lithium batteries before shipment, which is not only related to product performance but also public safety. The conventional inspection method mostly uses a machine learning method of manual visual inspection and manual design characteristics to perform inspection, and has a certain level of effect, but is quite low, and depends on expert experience seriously, so that there is a difficulty in operating in a manufacturing shop with high requirements on the environment. With the rapid development of artificial intelligence technology, particularly the wide application of deep learning technology in image recognition, the defect detection method is gradually changed from the traditional strategy of relying on manual characteristics and classifiers to an end-to-end representation learning framework. The deep learning technology can automatically learn the discriminative multi-level characteristic representation from the original image, remarkably improves the modeling capability of the complex defect mode, and has the advantages of high detection speed, high precision and the like. However, there are certain limitations to the search in this field. On one hand, the deep learning framework proposed in some researches is difficult to fuse multi-scale defect characteristics, so that the sensitivity of a model to micro defects and macro defects is different, a method for modeling a sequential image or a defect evolution process under a dynamic process is lacking, and a time sequence dependence relationship is difficult to grasp. On the other hand, the industrial site has very strict requirements on the efficiency of calculation, strong fault tolerance capability on disturbance and limitation on deployment, and a general deep learning framework can hardly meet the requirements. Therefore, how to enhance the capability of detecting multi-scale target defects while ensuring the calculation efficiency and the detection instantaneity becomes a key problem to be solved urgently. Based on the method, the lithium battery surface defect identification and classification method which can effectively enhance the calculation efficiency and the detection precision of the model is designed to have very important significance. Disclosure of Invention Aiming at the situation, the invention provides a defect identification method and model based on state space and multi-scale dynamic fusion, which are used for solving at least one problem in the technology. The invention is realized by the following technical scheme, in one aspect, the invention provides a defect identification model based on state space and multi-scale dynamic fusion, which comprises a preprocessing network, a backbone network and a classification head; The preprocessing network is used for preprocessing the image to be detected to obtain preprocessed image characteristics; The main network is used for carrying out multi-scale feature extraction on the preprocessed image features to obtain a feature map, and comprises a plurality of feature extraction layers, wherein each feature extraction layer comprises a residual block and CMamba blocks which are sequentially connected, the input end and the output end of CMamba form a jump connection structure, wherein the CMamba blocks add CBAM attention mechanisms on Mamba short convolution branches, and convolution kernels with different expansion rates are parallelly deployed on SSM branches and short convolution branches; And the classification head is used for carrying out classification prediction according to the feature map to obtain a defect identification result. Further, the feature extraction layer further includes: The input end of the selective feature fusion