Belt tearing detection method and system based on key feature fusion
Through the dual-stream fusion network and feature fusion technology, the problems of false detection and missed detection in belt tear detection are solved, the detection accuracy is improved, and efficient identification of belt surface tear is achieved.
Patent Information
- Application Number
- CN202410945217.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2044-07-15
AI Technical Summary
Existing belt tear detection technology is prone to missed detection and missed detection when tearing the belt surface interferers and small targets, making it difficult to meet the requirements of high-precision detection.
Using a dual-stream fusion network based on key feature fusion, common feature information is extracted through the shared feature layer, and combining bidirectional feature pyramid fusion, dual-branch perceived attention mechanism and false detection feature enhancement module to improve the model's recognition ability of small targets and interference objects. , reduce false detection and missed detection.
It effectively improves the accuracy of belt tear detection, reduces the rate of false detection and missed detection, and ensures the practicality and accuracy of the detection system.
Smart Images

Figure CN118887183A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of belt tear detection, and in particular to a belt tear detection method and system based on key feature fusion. Background Art
[0002] The belt tear detection technology aims to analyze the texture, shape and other characteristic information in the belt surface imaging, and accurately locate and classify the defects in the belt. Common tear types include edge damage, belt stacking, patch scratches, large-area damage and small target tearing. In actual industrial production, large equipment, high-speed mechanical systems and harsh operating conditions are usually involved. Various environmental factors such as material abnormalities, equipment wear, and excessive loads greatly increase the risk of belt tearing. The belt tear detection technology collects high-resolution belt surface image data to quickly obtain the type of tear on the belt surface and the location of the tear. It can not only stop the machine in time when serious tear damage is detected on the belt surface, but also quickly identify the risk when it is slightly torn, so as to prevent production interruption after major tearing. However, the surface damage caused by the belt tearing is easily confused with interferences such as water stains, textures, dust particles on the belt during the recognition process of the detection model, resulting in false detection. At the same time, the tear categories with a small number of samples in the data and the small target tear with a small shape are easily missed, which is very challenging to achieve the high-precision requirements of detection. Summary of the invention
[0003] The present invention provides a belt tear detection method and system based on key feature fusion to solve the problems existing in the above-mentioned prior art. The technical solution is as follows:
[0004] On the one hand, a belt tear detection method based on key feature fusion is provided, comprising:
[0005] S1. Collect and preprocess a plurality of belt surface images, annotate the plurality of belt surface images for target detection tasks and segmentation tasks, and divide the plurality of belt surface images into training sets and validation sets;
[0006] S2, input the images in the training set and train the shared feature layer of the two-stream fusion network, extract common feature information, perform feature fusion based on the bidirectional feature pyramid, and output the fused feature image for sharing in subsequent two-branch tasks;
[0007] S3, input the fused feature image and train the lightweight target detection branch of the dual-stream fusion network for missed detection problems, and closely combine the global features with the key features of the missed detection category through the dual-branch perception attention mechanism, so as to enhance the model's sensitivity to the feature information of small targets and small sample tearing categories, output the positioning detection anchor frame of the target detection and the category prediction result of the target, and output the confidence C corresponding to the predicted category. d ;
[0008] S4, input the fused feature image and train the lightweight segmentation decision branch of the dual-stream fusion network for the false detection problem, and improve the model's recognition ability of the texture features of the interference object through the false detection feature enhancement module, accurately distinguish the interference object in the image background from the real torn area, and output the prediction result of whether the target is really torn and the corresponding confidence C s ;
[0009] S5, C d and C s Input and train the confidence fuser of the two-stream fusion network, output the final classification of the detected target, and determine the detection anchor frame position where the target is finally marked according to the predicted frame position of the detected target of the lightweight target detection branch;
[0010] S6. Use the trained two-stream fusion network to perform belt tear detection on the belt surface image to be detected.
[0011] Optionally, after the shared feature layer performs data enhancement for the belt surface image that is common to the dual-branch task, part of the image is subjected to feature extraction through 9 convolution layers with a convolution kernel size of 5×5, and each convolution operation is followed by a batch normalization process to normalize each feature channel to a zero-mean distribution with unit variance, and then a nonlinear transformation is introduced through a ReLU activation function, and finally the resolution of each layer is reduced by half to obtain common feature information of different scales; another part of the image is subjected to 3 maximum pooling layers that will reduce the image resolution, thereby reducing the spatial dimension and the amount of model calculation, while improving the generalization ability of the model and capturing higher-level and more abstract global feature information;
[0012] After merging the common feature information of different scales with the pooled global feature information, efficient bidirectional cross-scale feature fusion is performed through the bidirectional feature pyramid structure in the shared feature layer. Not only are high-level abstract features upsampled layer by layer along a top-down path to match the scale of bottom-level features and fuse with each other, but a bottom-up feedback mechanism is also introduced to gradually downsample the bottom-level features containing rich details and interact with high-level features. After that, a fused feature image with the same dimension as the input feature is output through a 1x1 convolutional layer.
[0013] Optionally, the lightweight target detection branch extracts preliminary feature information from the fused feature image through a 3×3 initial convolution layer, then sends the fused feature image to a batch normalization layer for standardization, and then performs nonlinear transformation through an h-swish activation function, thereby obtaining basic features provided to a lightweight detection module;
[0014] The lightweight detection module inputs the basic features into a 3×3 depth-separable convolution layer with a step size of 2 to extract the deep convolution features, and then integrates the deep convolution features through 1×1 point-by-point convolution and reduces the number of feature channels. The feature map output by the point-by-point convolution is then nonlinearly transformed through the h-swish activation function to enhance the expression ability of the model. The above steps are repeated 11 times to obtain 11 feature maps F with different resolutions. i , i = 1, 2, ..., 11, a top-down approach in a feature pyramid is used to gradually merge feature maps of adjacent levels until a fusion feature map F_fusion is formed;
[0015] The fusion feature map F_fusion is input into the dual-branch perception attention mechanism module, and the global feature perception attention submodule of the dual-branch perception attention mechanism module outputs the global feature weighted vector X global , the missed detection category feature perception attention submodule of the dual-branch perception attention mechanism module outputs the missed detection category feature weighted vector X local , X global and X local The two are concatenated and the channel size is converted through the fully connected layer to obtain the dual-branch perception attention output X output ;
[0016] According to X output , the positioning loss function, confidence loss function, and classification loss function are calculated for the target detection anchor box and target category prediction, and the category balance loss function is added to specifically solve the problem of unbalanced data category ratio. The calculation formula of the category balance loss function is as follows:
[0017] F(p t )=-(1-p t ) γ log(p t )
[0018] Among them, p tis the model's predicted probability that a sample is a positive class. γ is used as a modulation parameter to control the relative loss contribution of easy-to-classify samples and difficult samples. When γ>0, difficult samples will obtain a larger loss weight, making the model pay more attention to sample categories that are easily misclassified. After this calculation process, the model outputs the positioning detection anchor box of the target detection and the target category prediction result, and also outputs the confidence C corresponding to the predicted category. d .
[0019] Optionally, the dual-branch perception attention mechanism module multiplies the input fusion feature map F_fusion with different weight parameters to obtain the input of the three branches Q, K, and V, and then passes through three 1×1 convolutions Query_Conv, Key_Conv, and Value_Conv respectively, and at the same time uses the view function in the Pytorch environment to transform the dimensions of the Query and Key feature vectors, and uses the permute function to invert the Query vector to obtain feature vector outputs of three different dimensions Q, K, and V;
[0020] The global feature perception attention submodule of the dual-branch perception attention mechanism module extracts global information through the fully connected layer to obtain Q_global, K_global and V_global, and then downsamples K_global and V_global through global pooling, multiplies Q_global by the downsampled K_global matrix and performs Softmax normalization, and then multiplies the result by the downsampled V_global matrix, finally extracts low-frequency global information, and obtains the global feature weighted vector Xglobal, which is expressed as follows:
[0021] X global =Softmax(Q_global·Pool(K_global))·Pool(V_globa)
[0022] The missed category feature perception attention submodule of the dual-branch perception attention mechanism module specifically captures the high-frequency feature information corresponding to the missed category for perception enhancement. For feature vectors of three different dimensions, Q, K, and V, three depthwise separable convolutions with a step size of 1×1 are used to extract local information to obtain Q_local, K_local, and V_local. At the same time, the weights of the depthwise separable convolution layer are globally shared, and then the Hadamard product of Q_local and K_local is calculated, so that the two are combined to generate a context-aware feature matrix M. context , then through a fully connected layer and a Swish activation function, and then through a fully connected layer and a Tanh activation function, the result is feature integrated and nonlinearly transformed to obtain a context-aware feature W between -1 and 1 contex, the relevant formula is expressed as follows:
[0023] M context =Q_local⊙k_local
[0024]
[0025] Where n represents the number of feature channels, the symbol ⊙ represents the Hadamard product, and FC represents the fully connected layer;
[0026] Then use W contex The Hadamard product is performed again with V_local after the 1×1 depth-separable convolution feature information is integrated to obtain the feature weighted vector X after the feature perception of the missed category is enhanced. local , X local =W context ⊙V_local;
[0027] X global and X local The two are concatenated and the channel size is converted through the fully connected layer to obtain the dual-branch perception attention output X output , X output =FC(Contact(X global ,X local )), so that the model can effectively perceive high and low frequency information at the same time.
[0028] Optionally, the lightweight segmentation decision branch first passes the fused feature image through a lightweight segmentation module and uses a deep separable convolutional network for lightweight improvement, specifically including:
[0029] Use a depthwise separable convolution with a size of 15×15 and a stride of 1 to extract deep convolutional features, then use a 1×1 point-by-point convolution to integrate the deep convolutional features and reduce the number of feature channels. The nonlinear activation function ReLU is used for the first time to increase the amount of feature map information, and then a 1×1 convolution layer is used to reduce the number of output channels, and batch normalization is performed and the nonlinear activation function ReLU is used again to obtain a single-channel feature map;
[0030] While obtaining the single-channel feature map, the feature map output after the first use of the nonlinear activation function ReLU is input into the false detection area feature enhancement module, the axial global attention submodule of the false detection area feature enhancement module outputs the enhanced global feature information, the false detection area detail feature enhancement submodule of the false detection area feature enhancement module outputs the false detection detail enhancement feature, the enhanced global feature information is multiplied and fused with the false detection detail enhancement feature to obtain a feature map with higher semantic information, which is spliced with the single-channel feature map to obtain the feature map output of the lightweight segmentation module as the input of the decision module;
[0031] The decision module outputs the feature map of the lightweight segmentation module through a two-layer combination repeated three times, wherein the two-layer combination includes a 2×2 maximum pooling layer and a convolution layer with a convolution kernel size of 5×5, and the number of channels is set to increase as the feature resolution decreases. The three layers of convolution are set to 8, 16, and 32 channels respectively, and then global maximum pooling and global average pooling operations are performed to generate 64 output neurons; in addition, the single-channel feature map output in the lightweight segmentation module is also connected to 2 output neurons after the results of global maximum pooling and global average pooling respectively; and then 66 neurons are output through the fully connected layer, and after the integration process of the linear weight combination layer and the use of the sigmoid activation function, the prediction result of whether the target is truly torn and its corresponding confidence C are finally output. s .
[0032] Optionally, the false detection region feature enhancement module obtains a query vector Q, a key vector K and a value vector V by linear transformation of the feature map output after the first use of the nonlinear activation function ReLU, and then processes the global features and the false detection detail features respectively through the axial global attention submodule and the false detection region detail feature enhancement submodule;
[0033] Among them, the axial global attention submodule, in order to obtain global features closely related to the context, first performs axial pooling operations on the input feature map along the horizontal and vertical directions to transform it into compact rows and columns. For the feature vector Q, H and W are the height and width of the feature map respectively, C is the number of channels, and the horizontal axial pooling result Q of the H×W×C feature map is h And the vertical axis pooling result Q v The expression is as follows:
[0034]
[0035] Among them, since the number of channels of vector Q and vector K is the same, they are uniformly expressed as C QK , Q →(·) Indicates the arrangement of the dimensions of Q, I W Ⅰ H is a vector whose elements are all equal to 1;
[0036] Then Q h and Q v Perform lateral and longitudinal compression to achieve dimensional conversion and obtain H×1×C QK and 1×W×C QK The two axial eigenvectors of ;
[0037] Then, multi-channel and multi-angle attention is calculated for these two vectors to capture the dependencies between multi-angle axial feature vectors covering 360°, including:
[0038] The horizontal and vertical axial feature vectors used as input are concatenated into a new feature matrix using the Concat concatenation function. Multiple parallel channels are designed, and each channel uses a 3×3 directional convolution kernel with different directions. The parameter θ, 0°<θ<360°, is used to adjust the direction angle of the axial feature vector. The weight parameter values in the convolution kernel are all related to θ, so that the convolution kernel assigns a higher weight to the specified angle θ, realizing the extraction of multi-angle axial feature vectors. Then, a linear transformation is performed to obtain the Q, K, and V inputs corresponding to each channel, and the scaling dot product operation is performed to obtain the attention vector of each channel. This process is completed N times in the multi-channel multi-angle attention mechanism. The parameters of the linear transformation between the channels are not shared. The N attention vectors are then concatenated and fused by a linear transformation. The results of the multi-channel multi-angle attention mechanism are output. On this basis, a 1×1 convolution layer is used to regress the dimension of the original input feature map, and finally the global feature information enhanced by the axial global attention submodule is output to reduce the false detection phenomenon caused by the lack of global context feature information.
[0039] The submodule for enhancing the detail features of the misdetected area adopts a new convolution-based detail enhancement design based on the texture characteristics of the blurred boundaries of the interference objects in the image background that are easily misdetected as torn areas, which increases the clarity of the boundaries and facilitates the model to distinguish them from the torn areas, including:
[0040] Connect the channels of Q, K, and V. Since the channels of Q and K are the same, they are both C. QK , so the size is H×W×(2C QK +C V ) feature map, and then pass it to a block consisting of 3×3 depth-separable convolution and batch normalization to assist in aggregating local details from Q, K, V, and then use a 1×1 convolution layer with ReLU6 activation function and batch normalization for linear projection to convert (2C QK +C V ) dimension is compressed to the original dimension, and the false detection detail enhancement feature is output.
[0041] Optionally, the confidence fuser first converts C d and C s Splice into an input vector X = [C d ,C s ], and then input the vector X into a multi-layer perceptron neural network, whose output hi is expressed as:
[0042] hi=f(W i hi-1 +b i )
[0043] Where h0=X, f is the ReLU activation function, W i is the weight matrix of the i-th layer, b i is the bias vector, h of the last layer n The final fusion confidence is generated through an output operation. The fusion formula is as follows:
[0044] C fusion =ɑ(W ou th n +b out )
[0045] Among them, ɑ is the Sigmoid function, which converts the output into a probability value between 0 and 1, W out is the weight matrix in the output operation, b out is the bias vector;
[0046] Finally, the two-stream fusion network is based on C fusion The value of is used to determine the final classification of the detected target, and at the same time, the detection anchor frame position where the target is finally marked is determined according to the predicted frame position of the detected target of the lightweight target detection branch.
[0047] On the other hand, a belt tear detection system based on key feature fusion is provided, the system comprising:
[0048] A collection preprocessing and segmentation module is used to collect and preprocess multiple belt surface images, annotate the multiple belt surface images for target detection tasks and segmentation tasks, and divide the images into training sets and verification sets;
[0049] The shared feature extraction module is used to input the images in the training set and train the shared feature layer of the two-stream fusion network, extract common feature information, perform feature fusion based on the bidirectional feature pyramid, and output the fused feature image for sharing by subsequent two-branch tasks;
[0050] The target detection module is used to input the fused feature image and train the lightweight target detection branch of the dual-stream fusion network for missed detection problems. Through the dual-branch perception attention mechanism, the global features are closely combined with the key features of the missed detection category, and the model is targeted to enhance the perception sensitivity of the feature information of small targets and small sample tearing categories. The positioning detection anchor frame of the target detection and the category prediction result of the target are output, and the confidence C corresponding to the predicted category is output at the same time. d ;
[0051] The segmentation decision module is used to input the fusion feature image and train the lightweight segmentation decision branch of the dual-stream fusion network for the false detection problem. Through the false detection feature enhancement module, the model's ability to recognize the texture features of the interference object is improved in a targeted manner, and the interference object in the image background and the real torn area are accurately distinguished. The prediction result of whether the target is really torn and the corresponding confidence C are output. s ;
[0052] Fusion module for C d and C s Input and train the confidence fuser of the two-stream fusion network, output the final classification of the detected target, and determine the detection anchor frame position where the target is finally marked according to the predicted frame position of the detected target of the lightweight target detection branch;
[0053] The detection module is used to use the trained two-stream fusion network to perform belt tear detection on the belt surface image to be detected.
[0054] On the other hand, an electronic device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the above-mentioned belt tear detection method based on key feature fusion.
[0055] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement the above-mentioned belt tear detection method based on key feature fusion.
[0056] The beneficial effects brought about by the technical solution provided by the present invention include at least:
[0057] The present invention proposes a belt surface tear detection method and system based on key feature fusion. Firstly, the shared feature information of image data is obtained through a shared feature extraction process. A bidirectional feature pyramid fusion mechanism is added to the network structure of this process to achieve effective fusion of shallow detail information and deep advanced semantic information, thereby improving the model's processing capability for targets of different scales. Secondly, for the shared feature information, dual-task processing of target detection and segmentation decision is performed respectively. At the same time, a lightweight design concept based on a deep separable network structure is introduced into the dual-branch backbone network part to ensure the efficiency and practicality of the scheme in industry. In the target detection branch, a dual-branch perception attention mechanism is designed for the tear category features that are easily missed, and the category balanced loss function is combined to make it more accurate. The missed detection rate of tearing categories of small targets and small samples is effectively reduced; at the same time, the image segmentation task is first performed in the parallel segmentation decision branch, and a false detection area feature enhancement module with dual functions of axial global attention and false detection area detail enhancement is set for the features of the easily false detection area, and a more refined feature map is input to the decision module for the final judgment of whether the target is torn, thereby reducing the occurrence of false detection of interference objects such as water stains and impurity particles on the belt surface as tears; finally, the confidence output results of target detection and segmentation decision are integrated through the confidence fusion process, and the tear type and detection anchor frame position of the detected target are selectively output by weighted summation, so as to achieve the ultimate purpose of solving the problem of missed detection and false detection of tearing at the same time and ensuring the practicality and accuracy of the detection system. The advantages of the present invention are specifically as follows:
[0058] 1) Aiming at the problem that the existing single-stage detection scheme cannot simultaneously improve the problems of missed detection and false detection, a dual-stream fusion network is designed. Through the design of a dual-branch shared feature extraction layer for target detection and segmentation decision, feature information of different levels and scales is efficiently integrated, so that the detection accuracy of the two tasks is improved simultaneously. At the same time, relying on the confidence fusion design, the detection results output by the two tasks are effectively combined, overcoming the technical difficulties of mutual constraints between false detection and missed detection problems when optimizing under the same model, and greatly improving the detection accuracy.
[0059] 2) To address the problem of missed detection caused by limited perception of some tearing category features, dual-branch perception attention is introduced in the target detection branch, and the correlation between low-frequency features in different regions is strengthened in the global feature perception attention submodule to achieve close integration of global features. In the missed detection category feature perception attention submodule, perception enhancement design is added for the high-frequency features unique to the missed detection category to accurately capture the features of the missed detection category, and then the category balance loss function is used to improve the detection ability of small samples and small target tears that are difficult to detect, thereby reducing the model's missed detection rate.
[0060] 3) In order to solve the problem that existing models have difficulty in distinguishing false detections caused by surface interference and real tearing, a false detection area feature enhancement module is added to the segmentation decision branch. In the axial global attention sub-module, a multi-angle and multi-channel attention mechanism is used to realize 360° axial decomposition of global features, thereby improving the model's ability to learn the global structure and overcoming the problem that the connection between the features of the falsely detected area and the global features is not close enough. At the same time, the false detection area detail feature enhancement sub-module is used to improve the boundary recognition clarity and texture feature distinction ability of the falsely detected area, thereby maximizing the recognition sensitivity of the key features of the falsely detected area and reducing the model's false detection rate.
[0061] 4) In order to solve the problem of high computational complexity caused by the key feature enhancement process, a lightweight structure design is added to the dual-branch task. The convolution structure in the backbone network is replaced with a depth-wise separable convolution. In addition, a single-channel mapping shortcut is introduced in the segmentation process. The above operations greatly reduce the number of parameters and computational complexity of the model, realize the miniaturization and efficiency of the model, and thus ensure the practicability of the detection scheme in industry. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0063] Figure 1 It is a flow chart of a belt tear detection method based on key feature fusion provided by an embodiment of the present invention;
[0064] Figure 2 is a general flow chart of a belt tear detection method provided by an embodiment of the present invention;
[0065] Figure 3 is a schematic diagram of a shared feature layer provided by an embodiment of the present invention;
[0066] Figure 4 It is a schematic diagram of a lightweight target detection branch for missed detection problems provided by an embodiment of the present invention;
[0067] Figure 5 is a schematic diagram of a dual-branch perception attention mechanism module provided by an embodiment of the present invention;
[0068] Figure 6 It is a schematic diagram of a lightweight segmentation decision branch for the false detection problem provided by an embodiment of the present invention;
[0069] Figure 7 is a schematic diagram of a false detection region feature enhancement module provided in an embodiment of the present invention;
[0070] Figure 8 is a schematic diagram of a multi-channel and multi-angle attention mechanism provided by an embodiment of the present invention;
[0071] Fig. 9 is a schematic diagram of a confidence fuser provided in an embodiment of the present invention;
[0072] Fig.10 is a block diagram of a belt tear detection system based on key feature fusion provided by an embodiment of the present invention;
[0073] Fig.11 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0074] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0075] The embodiment of the present invention provides a belt tear detection method based on key feature fusion, which can be implemented by an electronic device, which can be a terminal or a server. Figure 1 A flow chart of a belt tear detection method based on key feature fusion is shown, and the processing flow of the method may include the following steps:
[0076] S1. Collect and preprocess a plurality of belt surface images, annotate the plurality of belt surface images for target detection tasks and segmentation tasks, and divide the plurality of belt surface images into training sets and validation sets;
[0077] S2, input the images in the training set and train the shared feature layer of the two-stream fusion network, extract common feature information, perform feature fusion based on the bidirectional feature pyramid, and output the fused feature image for sharing in subsequent two-branch tasks;
[0078] S3, input the fused feature image and train the lightweight target detection branch of the dual-stream fusion network for missed detection problems, and closely combine the global features with the key features of the missed detection category through the dual-branch perception attention mechanism, so as to enhance the model's sensitivity to the feature information of small targets and small sample tearing categories, output the positioning detection anchor frame of the target detection and the category prediction result of the target, and output the confidence C corresponding to the predicted category. d ;
[0079] S4, input the fused feature image and train the lightweight segmentation decision branch of the dual-stream fusion network for the false detection problem, and improve the model's recognition ability of the texture features of the interference object through the false detection feature enhancement module, accurately distinguish the interference object in the image background from the real torn area, and output the prediction result of whether the target is really torn and the corresponding confidence Cs ;
[0080] S5, C d and C s Input and train the confidence fuser of the two-stream fusion network, output the final classification of the detected target, and determine the detection anchor frame position where the target is finally marked according to the predicted frame position of the detected target of the lightweight target detection branch;
[0081] S6. Use the trained two-stream fusion network to perform belt tear detection on the belt surface image to be detected.
[0082] The embodiment of the present invention provides a belt surface tear detection method based on key feature fusion, designs a dual-task shared feature extraction layer and a confidence fusion layer, relies on the dual-branch perception attention set in the target detection task, enhances the detection ability of easily missed categories, and at the same time, with the help of the false detection feature enhancement module added in the segmentation task, improves the false detection problem of misdetecting the image background as tearing, and realizes the dual role of parallel optimization of false detection and missed detection problems. The overall network structure of the system is as follows: Figure 2 As shown in the figure: First, in order to most efficiently obtain the common feature information such as edges, textures, shapes, etc. shared by the two tasks, a shared feature layer of the two-stream fusion network is constructed, and a bidirectional feature pyramid fusion mechanism is added to the shared feature extraction link, combining feature information of different depths to improve the expression ability of the common feature information extracted in the early stage. Then, for the common feature information extracted by the shared feature layer, two prediction tasks, target detection and segmentation decision, are performed respectively. A lightweight design based on deep separable convolution is introduced into the backbone network of the target detection task, and a global pooling process is used instead of the fully connected layer to greatly reduce the amount of calculation parameters. At the same time, a dual-branch perception attention mechanism of the feature fusion process and a category balanced loss function of the post-processing process are designed to effectively deal with the problem that small targets and small sample tearing categories are easily missed. While the target detection task is optimized, the other segmentation decision task is divided into two steps: obtaining a more refined feature map in the segmentation process, and integrating feature information in the decision process to obtain a prediction result. Based on morphological features such as water stains and textures that are easily misdetected as tears, a false detection feature enhancement mechanism is designed in the segmentation network. Relying on its strong pertinence to easily confused features, it makes a faster and more accurate judgment on whether the target is a tear. The prediction results output by the dual tasks are then input into the fusion network. Further judgment is made based on the category confidence of the detected target output by the target detection branch and the tear confidence of the detected target output by the segmentation decision network, thereby discarding the actual part of the target that is misdetected, and further avoiding misdetection of interference objects such as water stains and impurity particles on the belt surface as defects, and finally achieving the ultimate goal of effectively reducing the missed detection rate and false detection rate of the model. The following is a complete technical solution:
[0083] S1. Collect and preprocess a plurality of belt surface images, annotate the plurality of belt surface images for target detection tasks and segmentation tasks, and divide the plurality of belt surface images into training sets and validation sets;
[0084] In an embodiment of the present invention, an industrial camera is used to periodically capture belt surface images (2D) during the operation of the belt in a complex industrial scenario. The pixel size of all images is 2048×2000. Due to the difficulty in obtaining data and the imbalanced proportion of images containing torn areas, the data needs to be preprocessed subsequently, including: performing an appropriate amount of manual expansion to achieve a balanced ratio between defective and non-defective images.
[0085] The embodiment of the present invention uses the labelme annotation tool to respectively perform annotation of target detection tasks and segmentation tasks: the former uses a rectangular tool to select the torn area, and divides the target box into damage categories such as edge damage, belt stacking, patch scratches, large area damage, small target tearing, etc. according to the tearing form to be detected on site, and exports a txt target detection annotation file; the latter uses a polygon or brush tool to finely depict the boundaries of the torn area at each pixel level, and uniformly classifies all selected areas as "belonging to tearing", and exports a json segmentation annotation file.
[0086] In the embodiment of the present invention, all image-target detection label pairs are divided into training sets and verification sets at a ratio of 4:1. The defective and non-defective images in all image-segmentation label pairs are divided into two groups of training sets and verification sets at a ratio of 4:1 respectively. The two training sets are merged to generate training sets, defective verification sets and non-defective verification sets. Both branch tasks are trained on the training set, and then the model effect is tested on the verification set, and the model with the best effect is selected as the final model.
[0087] S2, input the images in the training set and train the shared feature layer of the two-stream fusion network, extract common feature information (edge, texture, shape, etc.), and perform feature fusion based on the bidirectional feature pyramid, and output the fused feature image for subsequent dual-branch task sharing;
[0088] Alternatively, if Figure 3As shown, the shared feature layer performs data enhancement (cropping, scaling, color adjustment, contrast adjustment, etc.) for the belt surface image that is common to dual-branch tasks, and then extracts features from part of the image (randomly select part of the image) through 9 convolution layers with a convolution kernel size of 5×5. Each convolution operation is followed by a batch normalization process, normalizing each feature channel to a zero-mean distribution with unit variance, and then introducing a nonlinear transformation through a ReLU activation function, and finally reducing the resolution of each layer by half to obtain universal feature information of different scales; another part of the image passes through 3 maximum pooling layers that will reduce the image resolution, reducing the spatial dimension and reducing the amount of model calculation, while improving the generalization ability of the model and capturing higher-level and more abstract global feature information;
[0089] After merging the common feature information of different scales with the pooled global feature information, efficient bidirectional cross-scale feature fusion is performed through the bidirectional feature pyramid structure in the shared feature layer. Not only are high-level abstract features upsampled layer by layer along a top-down path to match the scale of bottom-level features and fuse with each other, but a bottom-up feedback mechanism is also introduced to gradually downsample the bottom-level features containing rich details and interact with high-level features. After that, a fused feature image with the same dimension as the input feature is output through a 1x1 convolutional layer.
[0090] S3, input the fused feature image and train the lightweight target detection branch of the dual-stream fusion network for missed detection problems, and closely combine the global features with the key features of the missed detection category through the dual-branch perception attention mechanism, so as to enhance the model's sensitivity to the feature information of small targets and small sample tearing categories, output the positioning detection anchor frame of the target detection and the category prediction result of the target, and output the confidence C corresponding to the predicted category. d ;
[0091] Alternatively, if Figure 4 As shown, the lightweight target detection branch extracts preliminary feature information from the fused feature image through a 3×3 initial convolution layer, and then sends it to a batch normalization layer for standardization, and then performs nonlinear transformation through an h-swish activation function, thereby obtaining basic features provided to the lightweight detection module;
[0092] The specific formula of the h-swish activation function is as follows:
[0093] f(x)=x·ReLU6(x+3) / 6
[0094] Where ReLU6(x+3)=min(ReLU(x+3),6).
[0095] The lightweight detection module inputs the basic features into a 3×3 depth-separable convolution layer with a step size of 2 to extract the deep convolution features, and then integrates the deep convolution features through 1×1 point-by-point convolution and reduces the number of feature channels. The feature map output by the point-by-point convolution is then nonlinearly transformed through the h-swish activation function to enhance the expression ability of the model. The above steps are repeated 11 times (this process has a significant effect on reducing the amount of calculation parameters of the model) to obtain 11 feature maps F with different resolutions. i , i = 1, 2, ..., 11, a top-down approach in a feature pyramid is used to gradually merge feature maps of adjacent levels until a fusion feature map F_fusion is formed;
[0096] The fusion feature map F_fusion is input into the dual-branch perception attention mechanism module, and the global feature perception attention submodule of the dual-branch perception attention mechanism module outputs the global feature weighted vector X global , the missed detection category feature perception attention submodule of the dual-branch perception attention mechanism module outputs the missed detection category feature weighted vector X local , X global and X local The two are concatenated and the channel size is converted through the fully connected layer to obtain the dual-branch perception attention output X output ;
[0097] According to X output , the positioning loss function, confidence loss function, and classification loss function are calculated for the target detection anchor box and target category prediction, and the category balance loss function is added to specifically solve the problem of unbalanced data category ratio. The calculation formula of the category balance loss function is as follows:
[0098] F(p t )=-(1-p t ) γ log(p t )
[0099] Among them, pt is the model's predicted probability that a sample is a positive category, and γ is used as a modulation parameter to control the relative loss contribution of easy-to-classify (i.e., high confidence) samples and difficult (i.e., low confidence) samples. When γ>0, difficult samples will obtain a larger loss weight, so that the model pays more attention to sample categories that are easily misclassified. After this calculation process, the model outputs the positioning detection anchor box of the target detection and the category prediction result of the target, and also outputs the confidence C corresponding to the predicted category. d .
[0100] Alternatively, if Figure 5As shown in the figure, the dual-branch perception attention mechanism module multiplies the input fusion feature map F_fusion with different weight parameters to obtain the input of the three branches Q, K, and V, and then passes through three 1×1 convolutions Query_Conv, Key_Conv, and Value_Conv respectively, and uses the view function in the Pytorch environment to transform the dimensions of the Query and Key feature vectors, and uses the permute function to invert the Query vector to obtain feature vector outputs of three different dimensions Q, K, and V;
[0101] The global feature perception attention submodule of the dual-branch perception attention mechanism module extracts global information through the fully connected layer to obtain Q_global, K_global and V_global, and then downsamples K_global and V_global through global pooling, multiplies Q_global by the downsampled K_global matrix and performs Softmax normalization, and then multiplies the result by the downsampled V_global matrix, finally extracts low-frequency global information, and obtains the global feature weighted vector Xglobal, which is expressed as follows:
[0102] X global =Softmax(Q_global·Pool(K_global)·Pool(V_global)
[0103] The missed category feature perception attention submodule of the dual-branch perception attention mechanism module specifically captures the high-frequency feature information corresponding to the missed category for perception enhancement. For feature vectors of three different dimensions, Q, K, and V, three depthwise separable convolutions with a step size of 1×1 are used to extract local information to obtain Q_local, K_local, and V_local. At the same time, the weights of the depthwise separable convolution layer are shared globally. Then, the Hadamard product of Q_local and K_local is calculated to combine the two to generate a context-aware feature matrix M. context , and then through the fully connected layer and the Swish activation function (the specific formula of the Swish activation function is as follows: Where β is a custom training parameter), and then through a fully connected layer and Tanh activation function, the result is feature integrated and nonlinearly transformed to obtain the context-aware feature W between -1 and 1. contex , the relevant formula is expressed as follows:
[0104] M context =Q_local⊙k_local
[0105]
[0106] Where n represents the number of feature channels, the symbol ⊙ represents the Hadamard product, and FC represents the fully connected layer;
[0107] Then use W contex The Hadamard product is performed again with V_local after the 1×1 depth-separable convolution feature information is integrated to obtain the feature weighted vector X after the feature perception of the missed category is enhanced. local , X local =W context ⊙V_local;
[0108] X global and X local The two are concatenated and the channel size is converted through the fully connected layer to obtain the dual-branch perception attention output X output , X output =FC(Contact(X global ,X local )), so that the model can effectively perceive high-frequency and low-frequency information at the same time (solving the problem of missed detection of small targets and small sample tearing categories due to the neglect of high-frequency features).
[0109] S4, input the fused feature image and train the lightweight segmentation decision branch of the dual-stream fusion network for the false detection problem, and improve the model's recognition ability of the texture features of the interference object through the false detection feature enhancement module, accurately distinguish the interference object in the image background from the real torn area, and output the prediction result of whether the target is really torn and the corresponding confidence C s ;
[0110] Alternatively, if Figure 6 As shown, the lightweight segmentation decision branch first passes the fused feature image through a lightweight segmentation module and uses a deep separable convolutional network for lightweight improvement, specifically including:
[0111] Use a depthwise separable convolution with a size of 15×15 and a stride of 1 to extract deep convolutional features, then use a 1×1 point-by-point convolution to integrate the deep convolutional features and reduce the number of feature channels. The nonlinear activation function ReLU is used for the first time to increase the amount of feature map information, and then a 1×1 convolution layer is used to reduce the number of output channels, and batch normalization is performed and the nonlinear activation function ReLU is used again to obtain a single-channel feature map;
[0112] While obtaining the single-channel feature map, the feature map output after the first use of the nonlinear activation function ReLU is input into the false detection area feature enhancement module, the axial global attention submodule of the false detection area feature enhancement module outputs the enhanced global feature information, the false detection area detail feature enhancement submodule of the false detection area feature enhancement module outputs the false detection detail enhancement feature, the enhanced global feature information is multiplied and fused with the false detection detail enhancement feature to obtain a feature map with higher semantic information, which is spliced with the single-channel feature map to obtain the feature map output of the lightweight segmentation module as the input of the decision module;
[0113] The decision module outputs the feature map of the lightweight segmentation module through a two-layer combination repeated three times, wherein the two-layer combination includes a 2×2 maximum pooling layer and a convolution layer with a convolution kernel size of 5×5, and the number of channels is set to increase as the feature resolution decreases. The three layers of convolution are set to 8, 16, and 32 channels respectively, and then global maximum pooling and global average pooling operations are performed to generate 64 output neurons; in addition, the single-channel feature map output in the lightweight segmentation module is also connected to 2 output neurons after the results of global maximum pooling and global average pooling (providing a shortcut when the segmentation map has ensured the detection accuracy, thereby avoiding the use of a large number of feature maps in unnecessary situations and reducing the detection speed); and then 66 neurons are output through the fully connected layer, and after the integration process of the linear weight combination layer and the use of the sigmoid activation function, the prediction result of whether the target is truly torn and its corresponding confidence C are finally output. s .
[0114] Alternatively, if Figure 7 As shown, the false detection area feature enhancement module obtains the query vector Q, the key vector K and the value vector V through linear transformation of the feature map output after the first use of the nonlinear activation function ReLU, and then processes the global features and the false detection detail features respectively through the axial global attention submodule and the false detection area detail feature enhancement submodule;
[0115] Among them, the axial global attention submodule, in order to obtain global features closely related to the context, first performs axial pooling operations on the input feature map along the horizontal and vertical directions to transform it into compact rows and columns. For the feature vector Q (taking the feature vector Q as an example, K and V are similar), H and W are the height and width of the feature map, respectively, and C is the number of channels. The horizontal axial pooling result Q of the H×W×C feature map is h And the vertical axis pooling result Q v The expression is as follows:
[0116]
[0117] Among them, since the number of channels of vector Q and vector K is the same, they are uniformly expressed as C QK , Q →(·) Indicates the arrangement of the dimensions of Q, I W Ⅰ H is a vector whose elements are all equal to 1;
[0118] Then Q h and Q v Perform lateral and longitudinal compression to achieve dimensional conversion and obtain H×1×C QK and 1×W×C QK The two axial eigenvectors of ;
[0119] Then, multi-channel and multi-angle attention is calculated for these two vectors respectively to capture the dependencies between the multi-angle axial feature vectors covering 360°, such as Figure 8 As shown, including:
[0120] The horizontal and vertical axial feature vectors used as input are concatenated into a new feature matrix using the Concat concatenation function. Multiple parallel channels are designed, and each channel uses a 3×3 directional convolution kernel with different directions. The parameter θ, 0°<θ<360°, is used to adjust the direction angle of the axial feature vector. The weight parameter values in the convolution kernel are all related to θ, so that the convolution kernel is assigned a higher weight at the specified angle θ, and the extraction of multi-angle axial feature vectors is realized. Then, a linear transformation is performed to obtain the Q, K, and V inputs corresponding to each channel, and the scaling dot product operation is performed to obtain the Attention vector of each channel. This process is completed N times in the multi-channel multi-angle attention mechanism. The parameters of the linear transformation between the channels are not shared. Then, the N Attention vectors are concatenated, and after another linear transformation is performed to fuse them, the results of the multi-channel multi-angle attention mechanism are output.
[0121] On this basis, a 1×1 convolutional layer is used to regress the dimension of the original input feature map, and finally the global feature information enhanced by the axial global attention submodule is output to reduce the false detection caused by the lack of global context feature information.
[0122] The submodule for enhancing the detail features of the falsely detected area adopts a new detail enhancement design based on convolution, based on the texture characteristics of the blurred boundaries of interference objects (water stains, particles, etc.) in the image background that are easily falsely detected as tears, to increase the clarity of the boundaries so that the model can distinguish them from the torn areas. Figure 7 As shown, including:
[0123] Connect the channels of Q, K, and V. Since the channels of Q and K are the same, they are both C. QK , so the size is H×W×(2C QK +CV ) feature map, and then pass it to a block consisting of 3×3 depth-separable convolution and batch normalization to assist in aggregating local details from Q, K, V, and then use a 1×1 convolution layer with ReLU6 activation function and batch normalization for linear projection to convert (2C QK +C V ) dimension is compressed to the original dimension, and the false detection detail enhancement feature is output.
[0124] S5, C d and C s Input and train the confidence fuser of the two-stream fusion network, output the final classification of the detected target, and determine the detection anchor frame position where the target is finally marked according to the predicted frame position of the detected target of the lightweight target detection branch;
[0125] Alternatively, if Fig. 9 As shown, the confidence fusion device first converts C d and C s Splice into an input vector X = [C d ,C s ], and then input the vector X into a multi-layer perceptron neural network, whose output hi is expressed as:
[0126] hi=f(W i h i-1 +b i )
[0127] Where h0=X, f is the ReLU activation function, W i is the weight matrix of the i-th layer, b i is the bias vector, h of the last layer n The final fusion confidence is generated through an output operation. The fusion formula is as follows:
[0128] C fusion =ɑ(W out h n +b out )
[0129] Among them, ɑ is the Sigmoid function, which converts the output into a probability value between 0 and 1, W out is the weight matrix in the output operation, b out is the bias vector;
[0130] Finally, the two-stream fusion network is based on C fusion The value of is used to determine the final classification of the detected target, and at the same time, the detection anchor frame position where the target is finally marked is determined according to the predicted frame position of the detected target of the lightweight target detection branch.
[0131] S6. Use the trained two-stream fusion network to perform belt tear detection on the belt surface image to be detected.
[0132] like Fig.10 As shown, an embodiment of the present invention further provides a belt tear detection system based on key feature fusion, the system comprising:
[0133] A collection preprocessing and segmentation module 1010 is used to collect and preprocess a plurality of belt surface images, annotate the plurality of belt surface images for target detection tasks and segmentation tasks, and divide the plurality of belt surface images into a training set and a validation set;
[0134] The shared feature extraction module 1020 is used to input the images in the training set and train the shared feature layer of the dual-stream fusion network, extract common feature information, perform feature fusion based on the bidirectional feature pyramid, and output the fused feature image for sharing by subsequent dual-branch tasks;
[0135] The target detection module 1030 is used to input the fused feature image and train the lightweight target detection branch of the dual-stream fusion network for missed detection problems. Through the dual-branch perception attention mechanism, the global features are closely combined with the key features of the missed detection category, and the model is targeted to enhance the perception sensitivity of the feature information of small targets and small sample tearing categories. The positioning detection anchor frame of the target detection and the target category prediction result are output, and the confidence C corresponding to the predicted category is output. d ;
[0136] The segmentation decision module 1040 is used to input the fused feature image and train the lightweight segmentation decision branch of the dual-stream fusion network for the false detection problem. Through the false detection feature enhancement module, the model's recognition ability of the texture features of the interference object is improved in a targeted manner, and the interference object in the image background and the real tear area are accurately distinguished. The prediction result of whether the target is really torn and the corresponding confidence C are output. s ;
[0137] Fusion module 1050 is used to combine C d and C s Input and train the confidence fuser of the two-stream fusion network, output the final classification of the detected target, and determine the detection anchor frame position where the target is finally marked according to the predicted frame position of the detected target of the lightweight target detection branch;
[0138] The detection module 1060 is used to use the trained dual-stream fusion network to perform belt tear detection on the belt surface image to be detected.
[0139] An embodiment of the present invention provides a belt tear detection system based on key feature fusion, and its functional structure corresponds to a belt tear detection method based on key feature fusion provided by an embodiment of the present invention, which will not be described in detail here.
[0140] Fig.11 It is a structural diagram of an electronic device 1100 provided in an embodiment of the present invention. The electronic device 1100 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 1101 and one or more memories 1102, wherein at least one instruction is stored in the memory 302, and the at least one instruction is loaded and executed by the processor 1101 to implement the steps of the above-mentioned belt tear detection method based on key feature fusion.
[0141] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including instructions, which can be executed by a processor in a terminal to complete the above-mentioned belt tear detection method based on key feature fusion. For example, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0142] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0143] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A belt tear detection method based on key feature fusion, characterized in that: The method comprises: S1. Collect and preprocess a plurality of belt surface images, annotate the plurality of belt surface images for target detection tasks and segmentation tasks, and divide the plurality of belt surface images into training sets and validation sets; S2, input the images in the training set and train the shared feature layer of the two-stream fusion network, extract common feature information, perform feature fusion based on the bidirectional feature pyramid, and output the fused feature image for sharing in subsequent two-branch tasks; S3, input the fused feature image and train the lightweight target detection branch of the dual-stream fusion network for missed detection problems, and closely combine the global features with the key features of the missed detection category through the dual-branch perception attention mechanism, so as to enhance the model's sensitivity to the feature information of small targets and small sample tearing categories, output the positioning detection anchor frame of the target detection and the category prediction result of the target, and output the confidence C corresponding to the predicted category. d ; S4, input the fused feature image and train the lightweight segmentation decision branch of the dual-stream fusion network for the false detection problem, and improve the model's recognition ability of the texture features of the interference object through the false detection feature enhancement module, accurately distinguish the interference object in the image background from the real torn area, and output the prediction result of whether the target is really torn and the corresponding confidence C s ; S5, C d and C s Input and train the confidence fuser of the two-stream fusion network, output the final classification of the detected target, and determine the detection anchor frame position where the target is finally marked according to the predicted frame position of the detected target of the lightweight target detection branch; S6. Use the trained two-stream fusion network to perform belt tear detection on the belt surface image to be detected.
2. The method according to claim 1, characterized in that The shared feature layer performs data enhancement for the belt surface image that is common to the dual-branch task, and then extracts features from part of the image through 9 convolution layers with a convolution kernel size of 5×5. Each convolution operation is followed by a batch normalization process to normalize each feature channel to a zero-mean distribution with unit variance, and then introduces a nonlinear transformation through a ReLU activation function, and finally reduces the resolution of each layer by half to obtain common feature information of different scales; another part of the image passes through 3 maximum pooling layers that will reduce the image resolution, reduces the spatial dimension and reduces the model calculation amount, while improving the generalization ability of the model and capturing higher-level and more abstract global feature information; After merging the common feature information of different scales with the pooled global feature information, efficient bidirectional cross-scale feature fusion is performed through the bidirectional feature pyramid structure in the shared feature layer. Not only are high-level abstract features upsampled layer by layer along a top-down path to match the scale of bottom-level features and fuse with each other, but a bottom-up feedback mechanism is also introduced to gradually downsample the bottom-level features containing rich details and interact with high-level features. After that, a fused feature image with the same dimension as the input feature is output through a 1x1 convolutional layer.
3. The method according to claim 1, characterized in that: The lightweight object detection branch extracts preliminary feature information from the fused feature image through a 3×3 initial convolution layer, and then sends it to a batch normalization layer for standardization, and then performs nonlinear transformation through an h-swish activation function, thereby obtaining basic features provided to the lightweight detection module; The lightweight detection module inputs the basic features into a 3×3 depth-separable convolution layer with a step size of 2 to extract the deep convolution features, and then integrates the deep convolution features through 1×1 point-by-point convolution and reduces the number of feature channels. The feature map output by the point-by-point convolution is then nonlinearly transformed through the h-swish activation function to enhance the expression ability of the model. The above steps are repeated 11 times to obtain 11 feature maps F with different resolutions. i , i = 1, 2, ..., 11, a top-down approach in a feature pyramid is used to gradually merge feature maps of adjacent levels until a fusion feature map F_fusion is formed; The fusion feature map F_fusion is input into the dual-branch perception attention mechanism module, and the global feature perception attention submodule of the dual-branch perception attention mechanism module outputs the global feature weighted vector X global , the missed detection category feature perception attention submodule of the dual-branch perception attention mechanism module outputs the missed detection category feature weighted vector X local , X global and X local The two are concatenated and the channel size is converted through the fully connected layer to obtain the dual-branch perception attention output X output ; According to X output , the positioning loss function, confidence loss function, and classification loss function are calculated for the target detection anchor box and target category prediction, and the category balance loss function is added to specifically solve the problem of unbalanced data category ratio. The calculation formula of the category balance loss function is as follows: F(p t )=-(1-p t ) γ log(p t ) Among them, p t is the model's predicted probability that a sample is a positive class. γ is used as a modulation parameter to control the relative loss contribution of easy-to-classify samples and difficult samples. When γ>0, difficult samples will obtain a larger loss weight, making the model pay more attention to sample categories that are easily misclassified. After this calculation process, the model outputs the positioning detection anchor box of the target detection and the target category prediction result, and also outputs the confidence C corresponding to the predicted category. d .
4. The method according to claim 3, characterized in that The dual-branch perception attention mechanism module multiplies the input fusion feature map F_fusion with different weight parameters to obtain the input of the three branches Q, K, and V, and then passes through three 1×1 convolutions Query_Conv, Key_Conv, and Value_Conv respectively, and uses the view function in the Pytorch environment to transform the dimensions of the Query and Key feature vectors, and uses the permute function to invert the Query vector to obtain feature vector outputs of three different dimensions Q, K, and V; The global feature perception attention submodule of the dual-branch perception attention mechanism module extracts global information through the fully connected layer to obtain Q_global, K_global and V_global, and then downsamples K_global and V_global through global pooling, multiplies Q_global with the downsampled K_global matrix and performs Softmax normalization, and then multiplies the result with the downsampled V_global matrix, finally extracts low-frequency global information, and obtains the global feature weighted vector X global , the formula is as follows: X global =Softmax_global·Pool(K_global))·Pool(V_global The missed category feature perception attention submodule of the dual-branch perception attention mechanism module specifically captures the high-frequency feature information corresponding to the missed category for perception enhancement. For feature vectors of three different dimensions, Q, K, and V, three depthwise separable convolutions with a step size of 1×1 are used to extract local information to obtain Q_local, K_local, and V_local. At the same time, the weights of the depthwise separable convolution layer are globally shared, and then the Hadamard product of Q_local and K_local is calculated, so that the two are combined to generate a context-aware feature matrix M. context , then through a fully connected layer and a Swish activation function, and then through a fully connected layer and a Tanh activation function, the result is feature integrated and nonlinearly transformed to obtain a context-aware feature W between -1 and 1 contex , the relevant formula is expressed as follows: M context =Q_local⊙k_local Where n represents the number of feature channels, the symbol ⊙ represents the Hadamard product, and FC represents the fully connected layer; Then use W contex The Hadamard product is performed again with V_local after the 1×1 depth-separable convolution feature information is integrated to obtain the feature weighted vector X after the feature perception of the missed category is enhanced. local , X local =W context ⊙V_local; X global and X local The two are concatenated and the channel size is converted through the fully connected layer to obtain the dual-branch perception attention output X output , X output =FC(Contact(X global ,X local )), so that the model can effectively perceive high and low frequency information at the same time.
5. The method according to claim 1, characterized in that The lightweight segmentation decision branch first passes the fused feature image through a lightweight segmentation module and uses a deep separable convolutional network for lightweight improvement, specifically including: Use a depthwise separable convolution with a size of 15×15 and a stride of 1 to extract deep convolutional features, then use a 1×1 point-by-point convolution to integrate the deep convolutional features and reduce the number of feature channels. The nonlinear activation function ReLU is used for the first time to increase the amount of feature map information, and then a 1×1 convolution layer is used to reduce the number of output channels, and batch normalization is performed and the nonlinear activation function ReLU is used again to obtain a single-channel feature map; While obtaining the single-channel feature map, the feature map output after the first use of the nonlinear activation function ReLU is input into the false detection area feature enhancement module, the axial global attention submodule of the false detection area feature enhancement module outputs the enhanced global feature information, the false detection area detail feature enhancement submodule of the false detection area feature enhancement module outputs the false detection detail enhancement feature, the enhanced global feature information is multiplied and fused with the false detection detail enhancement feature to obtain a feature map with higher semantic information, which is spliced with the single-channel feature map to obtain the feature map output of the lightweight segmentation module as the input of the decision module; The decision module outputs the feature map of the lightweight segmentation module through a two-layer combination repeated three times, wherein the two-layer combination includes a 2×2 maximum pooling layer and a convolution layer with a convolution kernel size of 5×5, and the number of channels is set to increase as the feature resolution decreases. The three layers of convolution are set to 8, 16, and 32 channels respectively, and then global maximum pooling and global average pooling operations are performed to generate 64 output neurons; in addition, the single-channel feature map output in the lightweight segmentation module is also connected to 2 output neurons after the results of global maximum pooling and global average pooling respectively; and then 66 neurons are output through the fully connected layer, and after the integration process of the linear weight combination layer and the use of the sigmoid activation function, the prediction result of whether the target is truly torn and its corresponding confidence C are finally output. s .
6. The method according to claim 5, characterized in that The false detection area feature enhancement module obtains the query vector Q, the key vector K and the value vector V through linear transformation of the feature map output after the first use of the nonlinear activation function ReLU, and then processes the global features and the false detection detail features respectively through the axial global attention submodule and the false detection area detail feature enhancement submodule; Among them, the axial global attention submodule, in order to obtain global features closely related to the context, first performs axial pooling operations on the input feature map along the horizontal and vertical directions to transform it into compact rows and columns. For the feature vector Q, H and W are the height and width of the feature map respectively, C is the number of channels, and the horizontal axial pooling result Q of the H×W×C feature map is h And the vertical axis pooling result Q v The expression is as follows: Among them, since the number of channels of vector Q and vector K is the same, they are uniformly expressed as C QK , Q →(·) Indicates the arrangement of the dimensions of Q, I W Ⅰ H is a vector whose elements are all equal to 1; Then Q h and Q v Perform lateral and longitudinal compression to achieve dimensional conversion and obtain H×1×C QK and 1×W×C QK The two axial eigenvectors of ; Then, multi-channel and multi-angle attention is calculated for these two vectors to capture the dependencies between multi-angle axial feature vectors covering 360°, including: The horizontal and vertical axial feature vectors used as input are concatenated into a new feature matrix using the Concat concatenation function. Multiple parallel channels are designed, and each channel uses a 3×3 directional convolution kernel with different directions. The parameter θ, 0°<θ<360°, is used to adjust the direction angle of the axial feature vector. The weight parameter values in the convolution kernel are all related to θ, so that the convolution kernel assigns a higher weight to the specified angle θ, realizing the extraction of multi-angle axial feature vectors. Then, a linear transformation is performed to obtain the Q, K, and V inputs corresponding to each channel, and the scaling dot product operation is performed to obtain the attention vector of each channel. This process is completed N times in the multi-channel multi-angle attention mechanism. The parameters of the linear transformation between the channels are not shared. The N attention vectors are then concatenated and fused by a linear transformation. The results of the multi-channel multi-angle attention mechanism are output. On this basis, a 1×1 convolution layer is used to regress the dimension of the original input feature map, and finally the global feature information enhanced by the axial global attention submodule is output to reduce the false detection phenomenon caused by the lack of global context feature information. The submodule for enhancing the detail features of the misdetected area adopts a new convolution-based detail enhancement design based on the texture characteristics of the blurred boundaries of the interference objects in the image background that are easily misdetected as torn areas, which increases the clarity of the boundaries and facilitates the model to distinguish them from the torn areas, including: Connect the channels of Q, K, and V. Since the channels of Q and K are the same, they are both C. QK , so the size is H×W×(2C QK +C V ) feature map, and then pass it to a block consisting of 3×3 depth-separable convolution and batch normalization to assist in aggregating local details from Q, K, V, and then use a 1×1 convolution layer with ReLU6 activation function and batch normalization for linear projection to convert (2C QK +C V ) dimension is compressed to the original dimension, and the false detection detail enhancement feature is output.
7. The method according to claim 1, characterized in that The confidence fuser first converts C d and C s Splice into an input vector X = [C d ,C s ], and then input the vector X into a multi-layer perceptron neural network, whose output hi is expressed as: hi=f(W i h i-1 +b i ) Where h0=X, f is the ReLU activation function, W i is the weight matrix of the i-th layer, b i is the bias vector, h of the last layer n The final fusion confidence is generated through an output operation. The fusion formula is as follows: C fusion =ɑ(W out h n +b out ) Among them, ɑ is the Sigmoid function, which converts the output into a probability value between 0 and 1, W out is the weight matrix in the output operation, b out is the bias vector; Finally, the two-stream fusion network is based on C fusion The value of is used to determine the final classification of the detected target, and at the same time, the detection anchor frame position where the target is finally marked is determined according to the predicted frame position of the detected target of the lightweight target detection branch.
8. A belt tear detection system based on key feature fusion, characterized in that: The system comprises: A collection preprocessing and segmentation module is used to collect and preprocess multiple belt surface images, annotate the multiple belt surface images for target detection tasks and segmentation tasks, and divide the images into training sets and verification sets; The shared feature extraction module is used to input the images in the training set and train the shared feature layer of the two-stream fusion network, extract common feature information, perform feature fusion based on the bidirectional feature pyramid, and output the fused feature image for sharing by subsequent two-branch tasks; The target detection module is used to input the fused feature image and train the lightweight target detection branch of the dual-stream fusion network for missed detection problems. Through the dual-branch perception attention mechanism, the global features are closely combined with the key features of the missed detection category, and the model is targeted to enhance the perception sensitivity of the feature information of small targets and small sample tearing categories. The positioning detection anchor frame of the target detection and the category prediction result of the target are output, and the confidence C corresponding to the predicted category is output at the same time. d ; The segmentation decision module is used to input the fusion feature image and train the lightweight segmentation decision branch of the dual-stream fusion network for the false detection problem. Through the false detection feature enhancement module, the model's ability to recognize the texture features of the interference object is improved in a targeted manner, and the interference object in the image background and the real torn area are accurately distinguished. The prediction result of whether the target is really torn and the corresponding confidence C are output. s ; Fusion module for C d and C s Input and train the confidence fuser of the two-stream fusion network, output the final classification of the detected target, and determine the detection anchor frame position where the target is finally marked according to the predicted frame position of the detected target of the lightweight target detection branch; The detection module is used to use the trained two-stream fusion network to perform belt tear detection on the belt surface image to be detected.
9. An electronic device, comprising a processor and a memory, wherein at least one instruction is stored in the memory, wherein: The at least one instruction is loaded and executed by the processor to implement the belt tear detection method based on key feature fusion as described in any one of claims 1-7.
10. A computer-readable storage medium, wherein at least one instruction is stored in the storage medium, characterized in that: The at least one instruction is loaded and executed by the processor to implement the belt tear detection method based on key feature fusion as described in any one of claims 1-7.
Citation Information
Patent Citations
An object detection method based on semantic segmentation enhancement
CN109214349A
Automatic gallstone recognition and segmentation system based on deep learning, computer equipment and storage medium
CN112233777A
Belt tearing detection method based on deep learning
CN114359779A
Lung nodule detection method based on 3DCNN and double-branch structure technology
CN115984161A
Belt tearing detection method, device and equipment and storage medium
CN117302896A
Cited By
Grazing detection method and system based on double links
CN119379998A
Novel mining belt tearing segmentation model and degree detection method
CN119850585A
A new mining belt tearing segmentation model and degree detection method
CN119850585B
3D medical image fuzzy boundary segmentation method and system based on multi-feature perception
CN120163840A
3D Medical Image Blurred Boundary Segmentation Method and System Based on Multi-Feature Perception
CN120163840B
