Classification detection method, system and equipment for nickel plate shearing products and medium

By improving the YOLO-NiSeam model, the problems of low accuracy and slow speed in detecting nickel plate shearing products were solved, achieving efficient and accurate automated detection, which is suitable for the classification and detection of nickel plate shearing products.

CN121095677APending Publication Date: 2025-12-09LANZHOU UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511275576.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-08
Publication Date
2025-12-09

AI Technical Summary

Technical Problem

Existing technologies have low detection accuracy and slow detection speed for nickel plate shearing products, and rely on manual sorting, which has problems such as low efficiency, high labor costs and high safety risks.

Method used

The YOLO-NiSeam model was used to process the images of nickel plate shearing products. The C2f module of the backbone network was improved to a C2f-S module, a spatially aware multi-head self-attention module S-MHSA was inserted, and the lightweight upsampling operator CARAFE was used to extract multi-scale correlation features, generate comprehensive enhanced features, perform dimensionality reduction and local contour feature extraction, and generate high-resolution clear feature maps.

Benefits of technology

It improves the detection accuracy and efficiency of nickel plate shearing products, reduces misjudgments and edge blurring, adapts to industrial quality inspection scenarios, and enhances the level of automation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121095677A_ABST
    Figure CN121095677A_ABST
Patent Text Reader

Abstract

The invention provides a classification detection method, system and equipment for nickel plate shearing products and a medium, and belongs to the technical field of shearing nickel visual recognition detection.The method comprises the steps that multiple target shearing nickel images are collected, multi-scale correlation characteristics including local details and all contours of the products are extracted, the weight is calculated, and enhanced characteristics are output; splitting into a plurality of attention heads, and obtaining a multi-subspace relation feature matrix fused with information of a plurality of heads through independent calculation; generating horizontal and vertical coding matrixes, adding element positions according to the feature matrixes to obtain a space coding matrix, converting the feature matrixes into Q, K and V vectors, respectively obtaining feature and space attention scores, and carrying out weighted summation on V to obtain a comprehensive enhanced feature; and finally, carrying out dimension reduction and extracting local contour features, obtaining a normalized customized sampling kernel, carrying out weighted calculation to generate new pixel points, splicing to obtain an amplified clear feature map, and carrying out classified detection on a target shearing nickel product.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of shearing nickel visual recognition detection, and particularly relates to a classification detection method, system, equipment and medium for shearing products of nickel plates. BACKGROUND

[0002] Nickel is an important metal element in industry and is widely used in power batteries and metal rust prevention fields. In the production process, nickel ore is obtained as 800mm*800mm high-purity nickel plates through smelting, electrolysis and other processes. After entering an intelligent packaging workshop, the work personnel complete the links of stacking, inspection, shearing and unqualified product rejection, and then separate nickel strips, nickel ears and nickel edges through shearing equipment. The current industry mainly relies on manual sorting, and there are problems such as low efficiency, high labor cost and great safety risk.

[0003] In actual production scenarios, due to factors such as light intensity variation, random target position, material overlap and reflection interference, the traditional target detection method is difficult to work stably, resulting in low precision of accurate identification of nickel strips, nickel edges, nickel ears and other targets and slow grabbing. In order to improve the detection precision and automation level, a new method needs to be designed to overcome these problems. SUMMARY

[0004] In order to solve the problems of low detection precision and slow detection speed, the application provides a classification detection method, system, computer equipment and medium for shearing products of nickel plates.

[0005] In order to achieve the above purpose, the application provides a classification detection method for shearing products of nickel plates, which comprises the following steps: Collecting images of different target nickel plate shearing products.

[0006] Extracting multi-scale correlation features containing local details and overall contours of the nickel plate shearing product images; calculating a multi-subspace relationship feature matrix fused with multiple head information from the multi-scale correlation features; generating a horizontal encoding matrix and a vertical encoding matrix from the multi-subspace relationship feature matrix respectively; sequentially adding the first row of the horizontal encoding matrix and the first row of the vertical encoding matrix corresponding to the element positions (i, j) of the multi-subspace relationship feature matrix to obtain a spatial encoding matrix; calculating feature attention scores and spatial attention scores based on the multi-subspace relationship feature matrix and the spatial encoding matrix; and obtaining comprehensive enhanced features by using the multi-subspace relationship feature matrix, the feature attention scores and the spatial attention scores. i j i j

[0007] ​​​​The dimensions of the comprehensive enhancement features are reduced, and the local contour features of the low-dimensional comprehensive enhancement features are extracted to obtain a normalized custom sampling kernel for each pixel. The local neighborhood features of the corresponding pixel in the comprehensive enhancement features are weighted using the custom sampling kernel to generate a magnified new pixel. All new pixels are stitched together to obtain a magnified feature map. The target sheared nickel products are classified and detected using the magnified feature map.

[0008] Preferably, the image of the sheared product of the target nickel plate is processed by the YOLO-NiSeam model to obtain an enlarged feature map; the YOLO-NiSeam model is an improvement on the traditional YOLOv8s-obb model, specifically including: replacing the C2f module in the backbone network of the traditional YOLOv8s-obb model with the C2f-S module; inserting a spatially aware multi-head self-attention module S-MHSA between the output layer of the backbone network and the input layer of the neck network; and replacing the nearest neighbor interpolation of the traditional neck network with the lightweight upsampling operator CARAFE.

[0009] Preferably, the C2f-S module is an improvement derived from the traditional C2f module by inserting a SimAM attention-free mechanism after the Conv2 convolutional layer; the C2f-S module processes the multi-scale correlation features to obtain a multi-subspace relational feature matrix; specifically including: The multi-scale correlation features are linearly transformed into query vector Q, key vector K, and value vector V; Decompose Q, K, and V according to the channel dimension. h Each attention head performs attention independently. Calculate the dot product similarity between Q and K; convert the dot product similarity into attention weights, sum the weights over V, and output the subspace feature relationships captured by the head; h The outputs of each element are concatenated according to the channel dimension to obtain a multi-subspace relationship feature matrix.

[0010] Preferably, the S-MHSA module includes a multi-head attention mechanism, a spatial information encoding module, an attention calculation layer, and an output layer; the spatially aware multi-head self-attention module S-MHSA processes the multi-subspace relationship feature matrix to obtain comprehensive enhanced features.

[0011] Preferably, the CARAFE consists of a channel compressor, a content encoder, a kernel normalizer, and a content-aware reconstruction module connected in sequence; the CARAFE processes the comprehensive enhanced features to obtain an enlarged feature map.

[0012] Preferably, the horizontal encoding matrix has the same number of rows as the multi-subspace relationship feature matrix, and the vertical encoding matrix has the same number of columns as the multi-subspace relationship feature matrix.

[0013] The present invention also provides a classification and detection system for sheared nickel, comprising: The sample acquisition module is used to acquire images of various target nickel plate shearing products.

[0014] The data processing module is used to extract multi-scale correlation features containing local details and the entire contour of the nickel plate shearing product image; calculate a multi-subspace relationship feature matrix that fuses multiple head information from the multi-scale correlation features; generate a horizontal encoding matrix and a vertical encoding matrix from the multi-subspace relationship feature matrix respectively; and process the multi-subspace relationship feature matrix according to the element positions ( i , j ), and sequentially the horizontal coding matrix of the first i The row and the first vertical encoding matrix j The corresponding rows are added together to obtain the spatial encoding matrix; based on the multi-subspace relationship feature matrix and the spatial encoding matrix, the feature attention score and the spatial attention score are calculated respectively; using the multi-subspace relationship feature matrix, the feature attention score and the spatial attention score, the comprehensive enhanced feature is obtained.

[0015] The model application module is used to reduce the dimensionality of the comprehensive enhancement features and extract the local contour features of the low-dimensional comprehensive enhancement features to obtain a normalized customized sampling kernel for each pixel. The customized sampling kernel is used to perform weighted calculation on the local neighborhood features of the corresponding pixels in the comprehensive enhancement features to generate magnified new pixels. All new pixels are stitched together to obtain a magnified feature map. The magnified feature map is used to classify and detect the target sheared nickel products.

[0016] The present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement any of the steps in the method for classifying and detecting nickel plate shearing products.

[0017] The present invention also provides a computer-readable storage medium storing a computer program that, when loaded by a processor, is capable of executing any of the steps in the method for classifying and detecting nickel plate shearing products.

[0018] The method for classifying and detecting nickel plate shearing products provided by this invention has the following beneficial effects: Images of nickel plates sheared at different rates are acquired, and multi-scale correlation features containing local details and global contours are extracted. These features are then fused to obtain a multi-subspace relational feature matrix, reducing feature redundancy interference and improving feature discrimination. Spatial coding is introduced to bind feature relationships with spatial location information, generating comprehensive enhanced features that contain both semantic and spatial information, avoiding misjudgments of overlapping or tilted targets. By reducing feature dimensions and generating customized sampling kernels adapted to each pixel, the local regions of the comprehensive enhanced features are weighted and calculated, resulting in a high-resolution, clear feature map that avoids edge blurring and detail loss. Based on the magnified feature map, the classification and detection of nickel plate shearing products are achieved, adapting to industrial quality inspection scenarios and improving detection accuracy and efficiency. Attached Figure Description

[0019] To more clearly illustrate the embodiments and design schemes of the present invention, the accompanying drawings required for this embodiment will be briefly described below. The drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart of a method for classifying and detecting nickel plate shearing products according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the YOLO-NiSeam model structure in an embodiment of the present invention; Figure 3 This is a schematic diagram of the C2f-S module in an embodiment of the present invention; Figure 4 This is a schematic diagram of the spatial awareness multi-head self-attention module S-MHSA in an embodiment of the present invention; Figure 5 This is a schematic diagram of the lightweight upsampling operator CARAFE in an embodiment of the present invention; Figure 6 This is a diagram showing the detection effect of sheared nickel targets in an embodiment of the present invention; Figure 7 is a comparison of experimental results in the embodiments of the present invention. Figure 7(a) shows the model before improvement, and Figure 7(b) shows the model after improvement. Detailed Implementation

[0021] To enable those skilled in the art to better understand and implement the technical solutions of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and should not be construed as limiting the scope of protection of the present invention.

[0022] This invention provides a method for classifying and detecting nickel plate shearing products, specifically as follows: Figure 1 As shown, it includes: S1. Acquire images of sheared products from various target nickel plates.

[0023] Collect an image dataset containing materials generated from shearing nickel plates, label and preprocess the dataset, including image enhancement and normalization operations, and image enhancement including rotation, horizontal flipping, vertical flipping, scaling, and image stitching.

[0024] Images of nickel shearing were collected from an actual production line at a metal smelter in China. A total of 30,000 images were collected, containing four types of materials produced during shearing: nickel bars, nickel edges, nickel lugs, and thin nickel bars. The dataset was divided into training, validation, and test sets in an 8:1:1 ratio. Images in the training set were labeled and preprocessed. Labeling included identifying the category and location of the target. Image preprocessing included rotation, horizontal flipping, vertical flipping, scaling, image stitching, and normalization to improve the model's generalization ability.

[0025] Based on the YOLOv8s-obb algorithm, the YOLO-NiSeam model is improved, as follows: Figure 2 The diagram illustrates the relationships and data flow between the various modules. Specific improvements include: constructing a SimAM attention-free mechanism module based on an attention-free mechanism; adding this module after the ordinary convolutional module in the C2f basic feature extraction module of the backbone network to form a C2f-S convolutional module; replacing the C2f module in the traditional backbone network with a C2f-S module; inserting a spatially aware multi-head self-attention module S-MHSA between the output layer of the traditional backbone network and the input layer of the neck network; and replacing the nearest neighbor interpolation of the traditional neck network with the lightweight upsampling operator CARAFE.

[0026] The YOLO-NiSeam model was initialized with parameters and trained using a preprocessed dataset. Training parameters such as training parameters, batch size, and learning rate were set. The learning rate was dynamically adjusted, gradually decreasing as the training epochs increased and the loss value decreased. The preprocessed training set data was then fed into the improved model for training. In each training epoch, the model's loss value was calculated, and the Adam optimizer was used to update the model parameters. Simultaneously, the model was validated using validation set data, and various performance metrics such as precision, recall, and mean average precision (mAP) were monitored to optimize the training data in the next training epoch and prevent overfitting.

[0027] The trained model is evaluated using a test set, and metrics such as precision, recall, and mean average precision (mAP) are calculated to assess the detection performance of the trained model. The evaluation results are then compared with the unimproved model to verify that the improved model algorithm is superior.

[0028] To evaluate the detection performance of the YOLO-NiSeam model in visual recognition of sheared nickel, recall (R), precision (P), and mean precision (mAP) were selected as evaluation metrics. Recall measures the percentage of actual positive cases correctly detected; precision measures the percentage of models predicting positive cases that are actually positive; and mean precision (mAP) is a comprehensive measure of both recall and precision, with higher mAP indicating more comprehensive and accurate detection results, reflecting the model's overall detection capability.

[0029] S2. Extract multi-scale correlation features containing local details and the entire contour of the nickel plate shearing product image; calculate a multi-subspace relationship feature matrix fused with multiple head information from the multi-scale correlation features; generate horizontal and vertical encoding matrices from the multi-subspace relationship feature matrix respectively; and sort the elements of the multi-subspace relationship feature matrix according to their positions ( i , j ), and sequentially the horizontal coding matrix of the first i The row and the first vertical encoding matrix j The corresponding rows are added together to obtain the spatial encoding matrix; based on the multi-subspace relation feature matrix and the spatial encoding matrix, the feature attention score and the spatial attention score are calculated respectively; using the multi-subspace relation feature matrix, the feature attention score and the spatial attention score, the comprehensive enhanced feature is obtained.

[0030] The nickel shearing products to be detected are input into the trained YOLO-NiSeam model for detection, and the location and category information of the nickel shearing products in the image are output. Specifically, a SimAM attention-free mechanism module is constructed based on an attention-free mechanism. After the ordinary convolutional module in the C2f basic feature extraction module unit of the backbone network is added using the SimAM attention-free mechanism module, a C2f-S convolutional module is formed to further improve the ability to extract target features. A spatial information multi-head self-attention mechanism S-MHSA is proposed, which enhances the backbone network's ability to extract spatial and contextual information features of the target. The lightweight upsampling operator CARAFE (content-aware feature reassembly) is used to replace nearest neighbor interpolation. The lightweight upsampling operator CARAFE improves the problems of block artifacts and lack of smoothness in the image when sampling the neck network.

[0031] Multi-scale correlation features containing local details and the entire contour of the sheared nickel image are extracted; the weights of the multi-scale correlation features are calculated using the C2f-S module; based on the weights and the multi-scale correlation features, enhanced multi-scale correlation features are output; the enhanced multi-scale correlation features are split into multiple attention heads, and each head is calculated independently to obtain a multi-subspace relation feature matrix that integrates information from multiple heads.

[0032] The horizontal and vertical encoding matrices of the multi-subspace relationship feature matrix are generated using the spatially aware multi-head self-attention module S-MHSA. The spatial information encoding module then encodes the matrix according to the element positions of the multi-subspace relationship feature matrix. i , j ), and sequentially the horizontal coding matrix of the first i The row and the first vertical encoding matrix j The corresponding rows are added together to obtain the spatial encoding matrix; the multi-subspace relation feature matrix is ​​linearly transformed into a query Q, key K, and value V vector using a multi-head attention mechanism; the feature attention score is obtained from Q and K using an attention calculation layer; the spatial attention score is obtained from Q and the spatial encoding matrix; and the comprehensive enhanced feature is obtained by weighted summation of the feature attention score and the spatial attention score on V.

[0033] The dimensionality of the comprehensive enhancement features is reduced by using the channel compressor of the lightweight upsampling operator CARAFE. The local contour features of the low-dimensional comprehensive enhancement features are extracted by the content encoder. The kernel normalizer is used to obtain the normalized custom sampling kernel for each pixel. The local neighborhood features of the corresponding pixels in the comprehensive enhancement features are weighted by the custom sampling kernel to generate magnified new pixels. The content-aware reconstruction module is used to stitch together all the new pixels to obtain a magnified clear feature map. Then, the target sheared nickel products are classified and detected.

[0034] like Figure 3 As shown, this further enhances the ability to extract target features. The SimAM attention-free mechanism module is constructed as follows: for feature maps... In the passage Location The neuron value is denoted as .

[0035] The neuron energy function is constructed as follows: In the above formula, It is a passage Location Neuron energy, It is a passage The mean, It is a passage variance The value is 0.0001 to prevent the denominator from being zero.

[0036] Convert energy values ​​into attention weights: In the above formula, It is a passage Location Energy weights of neurons.

[0037] A larger attention weight indicates that the feature value at that location is more important. The output weight matrix... A With the input feature matrix X Weighting is performed to produce the final output. Y :

[0038] ; In the above formula, the input feature matrix X From the C2f-S feature extraction module, weight matrix A Attention weights derived from energy value conversion.

[0039] like Figure 4 As shown, a spatially aware multi-head self-attention module (S-MHSA) is constructed, and the specific modeling is as follows: ; In the above formula, These are input features. , , There are three different weight matrices. Q It is a query vector. K It is a key vector. V It is a value vector. It is the dimension of the input.

[0040] Spatial information modeling is as follows: ; In the above formula, r It is a two-dimensional spatial encoding. It is a learnable horizontal spatial information encoding, shape , representing the attention vector in the height direction. It is a learnable vertical spatial encoding, shape , representing the attention vector in the width direction.

[0041] The spatially aware multi-head self-attention module is modeled as follows: The above formula, This represents a feature vector that carries spatial and contextual information.

[0042] The lightweight upsampling operator CARAFE is used to replace nearest-neighbor interpolation upsampling in the neck network. For example... Figure 5 As shown, first, the input... 3D feature compression To reduce computational load in subsequent operations, a dimension is used for compressed feature maps. The predicted size of the convolutional layer is: The upsampling kernel. Among them... It is the size of the predicted upsampling kernel, in this embodiment It is 5. It's 3. Input feature map X go through The convolutional kernel performs feature extraction to guide the upsampling process; the specific formula is as follows:

[0043] It is a content-encoded feature map that contains contextual information about spatial location.

[0044] Secondly, the kernel is reassembled and generated, based on... F Generate a reassembled core for each output position. K and its corresponding weights W The specific formula is as follows: In the above formula, Indicates global average pooling, Compress to Global features; It is The convolution maps global features to an upsampling kernel of size 5; It is a content-encoded feature map that contains contextual information about spatial location.

[0045] In the above formula, Application of F Convolution, with the number of output channels being That is, each output channel corresponds to a kernel weight; It is an unnormalized weight tensor; application softmax Perform normalization to generate normalized weights. W The specific formula is as follows: In the above formula, These are the normalized weights. k There are 25 positions in total, for each position in the index core.

[0046] Then, after processing the output feature map Y Each position The input feature map is obtained by weighted summation. X Reassembled from neighboring pixels, the specific formula is as follows: In the above formula, m , n Iterate through every position in the kernel; 5 represents the kernel size. It's about weights and indexes. The corresponding core k One location, It is the value of the input feature map within the kernel coverage area. Ensure the core center is aligned.

[0047] S3. Dimensionality reduction of the comprehensive enhancement feature and extraction of local contour features of the low-dimensional comprehensive enhancement feature to obtain a normalized customized sampling kernel for each pixel; weighted calculation of the local neighborhood features of the corresponding pixel in the comprehensive enhancement feature using the customized sampling kernel to generate a magnified new pixel; stitching together all the new pixels to obtain a magnified feature map; classifying and detecting the target sheared nickel product using the magnified feature map.

[0048] Practical verification was conducted based on the YOLO-NiSeam model, and experimental comparisons were performed with the original YOLOv8 model. The detection results of the YOLO-NiSeam model for sheared nickel materials are as follows: Figure 6 As shown in the figure, the rectangle represents the location of the target to be detected, and the text above the rectangle indicates the detection type and the probability of determining that type. It can be seen from the figure that the improved algorithm shows high detection accuracy in actual detection.

[0049] Figure 7 shows the PR curves on the test set. Figure 7(a) shows the PR curve for the algorithm before improvement, and Figure 7(b) shows the PR curve for the algorithm after improvement. In the figures, the horizontal axis represents recall, the vertical axis represents precision, and the legend in the upper right corner shows the precision of detecting four types of sheared nickel targets, as well as the mean precision (mAP) for the four types of detections. Comparing Figure 7(a) and (b), it is clear that the improved algorithm has improved detection precision and mean precision across all categories.

[0050] To verify the individual and combined application effects of the C2f-S, S-MHSA, and CARAFE modules in the detection of sheared nickel targets, ablation experiments were conducted, and the results are shown in Table 1. (Table 1 is incomplete and requires further context.) "" indicates that the module was used in the experiment, and "-" indicates that the module was not used in the experiment. By comparing the ablation experiment results, the improved algorithm, by adding the three modules C2f-S, S-MHSA, and CARAFE, achieved a mAP0.5 of 99.3% and a mAP0.5-0.95 of 92.6% compared to the YOLOv8 basic algorithm, with a 2 percentage point increase in mPA0.5, demonstrating the superiority of the improved algorithm.

[0051] Table 1 Ablation Experiment Results Based on the YOLO-NiSeam model, the detection data of the four detection targets—nickel edge, nickel lug, nickel bar, and thin nickel bar—are shown in Figure 2.

[0052] Table 2. Test data for each type of sheared nickel material Based on the same inventive concept, the present invention also provides a classification and detection system for nickel plate shearing products, comprising: The sample acquisition module is used to acquire images of various different target sheared nickel.

[0053] The data processing module is used to extract multi-scale correlation features containing local details and the entire contour of the sheared nickel image; calculate the weights of the multi-scale correlation features, and output enhanced multi-scale correlation features based on the weights and multi-scale correlation features; decompose the enhanced multi-scale correlation features into multiple attention heads, calculate independently for each head, and obtain a multi-subspace relation feature matrix that fuses information from multiple heads; generate the horizontal encoding matrix and vertical encoding matrix of the multi-subspace relation feature matrix respectively, according to the element position of the multi-subspace relation feature matrix ( i , j ), and sequentially the horizontal coding matrix of the first i The row and the first vertical encoding matrix j Row-wise addition yields the spatial encoding matrix; the multi-subspace relation feature matrix is ​​linearly transformed into a vector of query Q, key K, and value V; feature attention scores are obtained from Q and K; spatial attention scores are obtained from Q and the spatial encoding matrix; V is weighted and summed using the sum of feature attention scores and spatial attention scores to obtain the comprehensive enhanced feature; the dimensionality of the comprehensive enhanced feature is reduced, and local contour features of the low-dimensional comprehensive enhanced feature are extracted to obtain a normalized customized sampling kernel for each pixel; the local neighborhood features of the corresponding pixel in the comprehensive enhanced feature are weighted using the customized sampling kernel to generate a magnified new pixel.

[0054] The model application module is used to stitch together all new pixels to obtain a magnified and clear feature map; then, it is used to classify and detect the target sheared nickel products.

[0055] This invention also provides a computer device. At the hardware level, the computer device includes a processor, an internal bus, a network interface, memory, and non-volatile memory, and may also include other hardware required for business operations. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the above-mentioned classification, detection, and analysis method for sheared nickel.

[0056] The present invention also provides a computer-readable storage medium storing a computer program that can be used to execute the above-described method for classifying, detecting, and analyzing sheared nickel.

[0057] Specific limitations of the computational system for the classification, detection, and evaluation method of sheared nickel can be found in the limitations of the classification and detection method for sheared nickel products described above, and will not be repeated here. Each module in the above-mentioned classification and detection system for sheared nickel can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.

[0058] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification. Furthermore, the above embodiments only illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

[0059] It should be noted that the specific embodiments described above enable those skilled in the art to more fully understand the present invention, but do not limit the present invention in any way. Therefore, although the present invention has been described in detail in this specification and embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the present invention; and all technical solutions and improvements that do not depart from the spirit and scope of the present invention are covered within the protection scope of the patent of the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

Claims

1. A method for classifying and detecting nickel plate shearing products, characterized in that, include: Images of sheared products from various target nickel plates were acquired. Extract multi-scale correlation features of local details and full contours from images containing nickel plate shearing products; A multi-subspace relationship feature matrix fusing multiple head information is calculated from the multi-scale association features; a horizontal encoding matrix and a vertical encoding matrix are generated from the multi-subspace relationship feature matrix; and the elements of the multi-subspace relationship feature matrix are arranged according to their positions ( i , j ), and sequentially the horizontal coding matrix of the first i The row and the first vertical encoding matrix j The rows are summed to obtain the spatial encoding matrix; Based on the multi-subspace relation feature matrix and the spatial encoding matrix, the feature attention score and the spatial attention score are calculated respectively. Using the multi-subspace relation feature matrix, feature attention score, and spatial attention score, a comprehensive enhanced feature is obtained; The dimensions of the comprehensive enhancement features are reduced, and the local contour features of the low-dimensional comprehensive enhancement features are extracted to obtain a normalized custom sampling kernel for each pixel. The local neighborhood features of the corresponding pixel in the comprehensive enhancement features are weighted using the custom sampling kernel to generate a magnified new pixel. All new pixels are stitched together to obtain a magnified feature map. The target sheared nickel products are classified and detected using the magnified feature map.

2. The method for classifying and detecting nickel plate shearing products according to claim 1, characterized in that, The image of the sheared product of the target nickel plate is processed using the YOLO-NiSeam model to obtain an enlarged feature map. The YOLO-NiSeam model is an improvement on the traditional YOLOv8s-obb model, specifically including: replacing the C2f module in the backbone network of the traditional YOLOv8s-obb model with a C2f-S module; inserting a spatially aware multi-head self-attention module S-MHSA between the output layer of the backbone network and the input layer of the neck network; and replacing the nearest neighbor interpolation of the traditional neck network with the lightweight upsampling operator CARAFE.

3. The method for classifying and detecting nickel plate shearing products according to claim 2, characterized in that, The C2f-S module is an improvement on the traditional C2f module by inserting a SimAM attention-free mechanism after the Conv2 convolutional layer. The C2f-S module processes the multi-scale correlation features to obtain a multi-subspace relational feature matrix; specifically, it includes: The multi-scale correlation features are linearly transformed into query vector Q, key vector K, and value vector V; Decompose Q, K, and V according to the channel dimension. h Each attention head performs attention independently. Calculate the dot product similarity between Q and K; convert the dot product similarity into attention weights, sum the weights over V, and output the subspace feature relationships captured by the head; h The outputs of each element are concatenated according to the channel dimension to obtain a multi-subspace relationship feature matrix.

4. The method for classifying and detecting nickel plate shearing products according to claim 2, characterized in that, The S-MHSA module includes a multi-head attention mechanism, a spatial information encoding module, an attention calculation layer, and an output layer; the spatially perceptive multi-head self-attention module S-MHSA processes the multi-subspace relationship feature matrix to obtain comprehensive enhanced features.

5. The method for classifying and detecting nickel plate shearing products according to claim 2, characterized in that, The CARAFE consists of a channel compressor, a content encoder, a kernel normalizer, and a content-aware reconstruction module connected in sequence; the CARAFE processes the comprehensive enhanced features to obtain an enlarged feature map.

6. The method for classifying and detecting nickel plate shearing products according to claim 1, characterized in that, The horizontal encoding matrix has the same number of rows as the multi-subspace relationship feature matrix, and the vertical encoding matrix has the same number of columns as the multi-subspace relationship feature matrix.

7. A classification and detection system for sheared nickel, characterized in that, include: The sample acquisition module is used to acquire images of sheared products from various target nickel plates. The data processing module is used to extract multi-scale correlation features containing local details and the entire contour of the nickel plate shearing product image; calculate a multi-subspace relationship feature matrix that fuses multiple head information from the multi-scale correlation features; generate a horizontal encoding matrix and a vertical encoding matrix from the multi-subspace relationship feature matrix respectively; and process the multi-subspace relationship feature matrix according to the element positions ( i , j ), and sequentially the horizontal coding matrix of the first i The row and the first vertical encoding matrix j The rows are summed to obtain the spatial encoding matrix; Based on the multi-subspace relation feature matrix and the spatial encoding matrix, the feature attention score and the spatial attention score are calculated respectively. Using the multi-subspace relation feature matrix, feature attention score, and spatial attention score, a comprehensive enhanced feature is obtained; The model application module is used to reduce the dimensionality of the comprehensive enhancement features and extract the local contour features of the low-dimensional comprehensive enhancement features to obtain a normalized customized sampling kernel for each pixel. The customized sampling kernel is used to perform weighted calculation on the local neighborhood features of the corresponding pixels in the comprehensive enhancement features to generate magnified new pixels. All new pixels are stitched together to obtain a magnified feature map. The magnified feature map is used to classify and detect the target sheared nickel products.

8. A computer device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is loaded by the processor, it is able to perform the steps of the method according to any one of claims 1 to 6.