Slab surface quality detection system and method based on deep learning
Through multi-level preprocessing and deep learning technology, combined with ResNet, SE and Swin Transformer models, the high accuracy and adaptability of slab surface quality detection is achieved, solving the performance degradation of existing systems under noise, lighting and dynamic changes, and improving the robustness of detection and the operation efficiency of production lines.
Patent Information
- Application Number
- CN202510362834.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-03-26
AI Technical Summary
The existing deep learning-based slab surface quality detection system is difficult to achieve high precision, adaptability and scalability when facing noise interference, uneven light, large defect scale changes and insufficient data, and traditional deep learning methods are difficult to adaptively update when dynamic changes in the production environment.
Multi-stage preprocessing techniques are adopted, including adaptive non-local mean filtering, CLAHE, Laplace edge enhancement and Gamma correction, denoising and equalizing lighting. Local features are extracted in combination with ResNet and SE modules, and global information is extracted through Swin Transformer. Multi-scale feature fusion and incremental learning strategies are adopted to achieve intelligent self-learning and model optimization.
It significantly improves the accuracy and robustness of the surface quality detection of slabs, realizes effective detection of defects of different scales and morphology, enhances the adaptability and scalability of the system, and improves the operating efficiency of the production line through real-time feedback and closed-loop control.
Smart Images

Figure CN119888379A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of industrial detection technology, and in particular to a slab surface quality detection system and method based on deep learning. Background Art
[0002] In the production process of modern steel industry, slab is an important intermediate product of hot-rolled steel, and its surface quality directly affects the performance and market competitiveness of the final product. However, due to the complexity of the production environment, the surface of slab is often affected by defects such as cracks, scratches, inclusions, pits, etc. If not detected in time and corresponding measures are not taken, it will not only lead to product scrapping and waste of resources, but also may cause safety hazards. At present, traditional slab surface detection methods mainly rely on manual visual inspection or rule-based machine vision inspection, but manual inspection has problems such as strong subjectivity, low efficiency, and easy fatigue, while traditional machine vision methods are often limited to fixed feature extraction methods and are difficult to adapt to defects of different types and complex forms. In recent years, deep learning technology has made breakthrough progress in the field of computer vision, providing new solutions for industrial inspection. The slab surface defect detection method based on deep learning can automatically learn features and achieve high-precision and high-robustness defect recognition in complex backgrounds.
[0003] A Chinese invention patent application with publication number CN115358977A discloses a carbon filament surface defect detection method based on deep learning, including a convolution layer to extract carbon filament features from an original image, filter background information, and generate multiple feature maps; send the multiple feature maps to an encoder module for encoding; after the feature maps are encoded, use a backbone network to extract and fuse high- and low-level features of carbon filament defects to generate a multi-scale feature map; send the multi-scale feature map generated by the backbone network to a decoder module for decoding; fuse the feature map generated after decoding by the decoder with the result feature map after preliminary convolution for classification and regression prediction of carbon filament defects; output the results of classification prediction and regression prediction; the invention reduces the interference of human subjectivity, which makes a great contribution to improving the production speed of large carbon filament bundles, ensuring the quality of carbon filament products, and reducing the workload of workers.
[0004] However, existing deep learning-based inspection systems still face many challenges, such as noise interference, uneven lighting, large variations in defect scales, and insufficient generalization capabilities due to insufficient data. In addition, traditional deep learning methods are difficult to adaptively update in the face of dynamic changes in the production environment, resulting in a gradual decline in model performance. Therefore, how to combine advanced image preprocessing technology, multi-scale feature fusion mechanism, intelligent incremental learning strategy and real-time feedback optimization to improve the accuracy, adaptability and scalability of slab surface quality inspection has become a key issue that needs to be solved urgently. Summary of the invention
[0005] The purpose of the present invention is to address the problems existing in the background technology and to propose a slab surface quality detection system and method based on deep learning.
[0006] The technical solution of the present invention is a method for detecting the surface quality of a slab based on deep learning, comprising the following specific implementation steps: S1. Collect slab surface data; S2, based on adaptive non-local mean filtering denoising, using global redundant information to remove noise from each pixel, combining adaptive histogram equalization to balance illumination and Laplacian operator to enhance edges, optimizing contrast through Gamma correction, performing Z-score normalization, and generating binary matching codes; S3. Use binary matching codes to screen data, build a hybrid anomaly detection model, combine ResNet and SE modules to extract local features, and match local and global features. Use Swin Transformer to extract global information, fuse multi-scale features, classify defects through the fully connected layer, and output {defect category, target bounding box location, defect confidence}; S4. Obtain defect categories based on deep learning reasoning, optimize classification results through confidence fusion, use adaptive position correction algorithm to improve defect location accuracy, and generate inspection reports based on defect categories and location information; S5. Analyze defect types and severity, automatically evaluate slab quality, and make decision recommendations; S6. Through incremental learning and knowledge distillation, transfer learning is used to fine-tune the pre-trained model to optimize new defect recognition, and federated learning is used to share the optimized hybrid anomaly detection model among multiple production lines; S7. Visual display of slab surface data, test reports and decision suggestions.
[0007] Preferably, the denoising process of adaptive non-local mean filtering denoising is as follows: S21, convert the collected slab surface data into a grayscale image I(x,y), extract a fixed-size image block centered on any pixel point (x,y), i.e., a neighborhood block, denoted as N{x,y}: N{x,y}={I(x+l x ,y+l y )|l x ,l y ∈[-k,k]}; Where k is the radius of the neighborhood block, k is a positive integer; l x Indicates the lateral offset; l y Indicates the longitudinal offset; S22. Calculate the local mean and variance within the image block: ; ; Wherein, μ(x,y) represents the average gray value of the image block N(x,y); It reflects the local noise level and detail complexity within the image block N(x,y); S23, design adaptive parameters h(x,y): h(x,y)=s×σ(x,y)+h0; ; Where s represents the adjustment factor proportional to the noise level; σ(x,y) represents the local standard deviation; h0 represents the basic smoothing parameter; S24. In a larger search window centered on the current pixel (x, y), perform image block similarity measurement on each candidate pixel (i, j) ∈ Ω(i, j): ; ; in, represents the Gaussian weight function; σ G is the preset parameter, σ G =k / 2; Ω represents the search area; represents a similarity measure; S25. Use the adaptive parameter h(x,y) to convert the distance into weight w(x,y,i,j): ; ; Where Z(x,y) represents the normalization factor; S26, calculate the denoised grayscale value of the current pixel (x, y) as the weighted average of all candidate pixels in the search window, and output the denoised image data I'(x, y): .
[0008] Preferably, the binary matching code is generated as follows: S31, the processed image data Convert to binary data data; S32, select a random number r∈ , calculate the auxiliary code Ac=g r mod p; Where g is the generator of the predefined group G; G is the predefined group A subgroup of order q; p is a predefined large prime number such that q is a factor of p-1; S33, based on the matching code CM=H(data||Ac||P1||P2) mod q; Among them, || is a concatenation operation; P1 is a predefined unary auxiliary code, P1=g a mod p; P2 is a predefined binary auxiliary code, P2=g b mod p; a, b are predefined random components, a, b∈ ; H is a predefined hash function; S34, calculating the unary code C1=ra·CM (mod q), calculating the binary code C2=rb·CM (mod q); S35. Generate a binary matching code CⅡM=(CM, C1, C2).
[0009] Preferably, the screening process for data screening using binary matching codes is as follows: S41, image data Convert to binary data data'; S42, calculate the unary screening code Co: , calculate the binary screening code Ct: ; S43. If Co=Ct, it means that the received image data If the primary screening is passed, an alarm will be given immediately; otherwise, S44, calculate the reference code CS = H (data'||Co||P1||P2) mod q; S45. If CS=CM, it means the received image data If it complies with the regulations, an alarm will be given immediately.
[0010] Preferably, the detection process of the hybrid anomaly detection model is as follows: S51, the processed image data Input ResNet+SE network for preliminary feature extraction, and use ResNet to extract the feature map F of the lth layer (l) , and use the SE module to adjust the weight of the features of each channel: ; ; In the formula, F (l) represents the feature map of layer l; W (l) and b (l) Respectively represent convolution kernel and bias; Pool() represents global average pooling operation; W1 and W2 represent the weights of the fully connected layer; S c represents SE attention weight; Represents the enhanced local features; S52, construct an adaptive feature enhancement unit AFE, adaptively adjust the local features, and convert the features F adjusted by AFE into AFE Swin Transformer is used to extract global information, and F AFE Divide into several windows, each window independently calculates self-attention, and extracts global features F of different scales tran ; S53, obtain the global feature F of the same scale tran , weighted fusion of global scale and enhanced local features to generate fusion feature F fusion , the fusion feature F fusion Send it to the fully connected layer for defect classification and output the probability P of different defect categories; S54. Calculate the confidence C by using multi-scale confidence fusion: , output {defect category P, target bounding box location Bounding Box, defect confidence C}; In the formula, C i represents the defect confidence level of the i-th scale; Represents the weight corresponding to the i-th level scale.
[0011] Preferably, the process of adaptively adjusting the local features is as follows: S61. Calculate local feature F SE and the global feature F global The similarity between: ; In the formula, F global represents the global feature; S represents the similarity matrix between the local feature and the global feature; T represents the matrix transposition operation; S62, calculate feature adjustment weight W AFE :W AFE =softmax(S); S63. Calculate the enhanced feature F AFE : .
[0012] Preferably, the global feature F global In the first round of reasoning, the local feature F SE Use global average pooling to get the initial global features: ; in, As a pseudo-global feature; GAP() represents a global average pooling operation.
[0013] Preferably, the optimization process for optimizing the classification results is as follows: S81. Extracting a predefined confidence threshold C threshold, exclude the confidence level lower than the confidence threshold C threshold The test results; S82. Based on the defect category P, the defect category and the confidence are combined through a confidence weighting strategy to improve the reliability of classification: P'=P·C; Among them, P′ is the final weighted defect category vector; C is the defect confidence; S83. Determine the final category of the defect by maximizing the weighted category probability P': P final =argmax(P'); Among them, P final Indicates the defect category finally determined; S84, using the adaptive position correction algorithm, fine-tuning the positioning result based on the defect confidence C: ; ; Where Δx and Δy represent the correction amount of the bounding box in the x and y directions respectively; α and β represent the scaling factors, which adjust the correction amplitude in the x and y directions respectively; (x min ,y min ) and (x max ,y max ) represent the upper left corner and lower right corner coordinates of the defect respectively; S85. Update the located defect position to BBox: BBox=[(x min -Δx,y min -Δy),(x max +Δx,y max +Δy)].
[0014] The technical solution of the present invention is a slab surface quality detection system based on deep learning, which is used to execute the above-mentioned slab surface quality detection method based on deep learning, comprising: Image acquisition module, used to collect slab surface data; Slab surface data preprocessing module, used for image enhancement, noise removal, and normalization operations; Deep learning detection module, which is used to identify defects based on deep learning models, i.e., building a hybrid anomaly detection model; Abnormal analysis module, which is used to conduct intelligent analysis based on defect type, size, and shape, and provide quality assessment; Real-time feedback and alarm module, which is used to automatically trigger the alarm mechanism after detecting defects and provide adjustment suggestions to the production line control system; Cloud storage and optimization module, which is used to optimize new defect identification by fine-tuning pre-trained models through incremental learning and knowledge distillation, and to share optimized hybrid anomaly detection models across multiple production lines using federated learning; The user interaction terminal visualizes the slab surface data and displays detected anomaly information and decision suggestions.
[0015] Compared with the prior art, the above technical solution of the present invention has the following beneficial technical effects: The present invention designs a method which, through multi-level preprocessing, advanced deep learning detection technology and closed-loop self-learning mechanism, not only achieves significant breakthroughs in technology, but also has the potential for practical implementation and promotion in industrial applications, reflecting significant beneficial technical effects: (1) Improving detection accuracy and robustness: High-resolution industrial cameras, line scan cameras and laser sensors are used to collect slab surface images in real time. Preprocessing methods such as adaptive non-local mean filtering, CLAHE, Laplace edge enhancement, gamma correction and Z-score normalization are used to effectively suppress noise, balance illumination and enhance key defect edges. This makes the images input to the deep learning model have higher clarity and consistency, ensuring that the model can still work stably in complex industrial environments, greatly improving the detection accuracy and robustness. (2) Realize intelligent self-learning and continuous optimization: By introducing incremental learning, transfer learning, and federated learning mechanisms, the system can automatically update and optimize the model when faced with ever-changing new defect samples, solving the problem of "catastrophic forgetting" that traditional models are prone to when processing new data. It not only maintains a high recognition ability for existing defect knowledge, but also can adapt to new defects that appear in the production process, thereby ensuring long-term stable and efficient detection performance; (3) Multi-scale feature fusion, taking into account both small and large defects: The adaptive feature enhancement (AFE) and attention-guided multi-scale fusion (AGMSF) strategies are used to achieve the effective connection between local details and global context information, and can capture both small cracks and large-area damage at the same time, making the detection system more adaptable and accurate when dealing with defects of different sizes and shapes; (4) Real-time feedback and closed-loop control: Real-time monitoring of the entire process from data collection, processing, defect identification to abnormal analysis and automatic feedback is achieved. The detection results can be immediately transmitted to the production control system, and alarms can be triggered or production parameters can be adjusted according to preset rules, thereby achieving automated quality control and closed-loop optimization, reducing production risks caused by manual judgment lags or errors, and improving the overall operating efficiency of the production line; (5) Ensure the anti-interference and status consistency of information during transmission: By generating binary matching codes and related digital screening mechanisms, image data is matched and verified to ensure the anti-interference and status consistency of data during transmission. This mechanism not only enhances the security of the system, but also provides a reliable data basis for subsequent model training and optimization. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is a system architecture diagram of a slab surface quality detection system based on deep learning proposed by the present invention; Figure 2 This is a method flow chart of a slab surface quality detection method based on deep learning proposed in the present invention. DETAILED DESCRIPTION
[0017] Embodiment 1, as Figure 1 As shown, the present invention proposes a slab surface quality detection system based on deep learning, including: an image acquisition module, a slab surface data preprocessing module, a deep learning detection module, an abnormality analysis module, a real-time feedback and alarm module, a cloud storage and optimization module, and a user interaction terminal.
[0018] The image acquisition module uses a high-resolution industrial camera to collect high-definition images of the slab surface; The slab surface data preprocessing module includes image enhancement, noise removal, and normalization operations to improve detection robustness; The deep learning detection module performs defect identification based on the deep learning model; The abnormal analysis module combines defect type, size, and shape for intelligent analysis and provides quality assessment; The real-time feedback and alarm module automatically triggers the alarm mechanism after detecting defects and provides adjustment suggestions to the production line control system; The cloud storage and optimization module uses incremental learning and knowledge distillation, adopts transfer learning to fine-tune the pre-trained model to optimize new defect identification, and uses federated learning to share the optimized hybrid anomaly detection model among multiple production lines; The user interaction terminal visualizes the slab surface data and displays detected anomaly information and decision suggestions.
[0019] Embodiment 2, as Figure 2 As shown, a slab surface quality detection method based on deep learning proposed in the present invention is applied to a slab surface quality detection system based on deep learning proposed in Example 1, and its specific implementation steps are as follows: S1. High-resolution industrial cameras, line scan cameras and laser sensors are arranged on the slab production line to collect slab surface images in real time, and combined with light sources to optimize lighting and reduce ambient light interference; The image acquisition module collects the acquired slab surface image data and transmits the slab surface image data to the slab surface data preprocessing module.
[0020] S2, the slab surface data preprocessing module performs noise removal, illumination balance, grayscale, edge enhancement, and contrast adjustment preprocessing operations on the collected slab surface image data to improve the image quality, and standardizes and normalizes the image to ensure that the data distribution input into the deep learning model is consistent. The specific implementation process is as follows: S21, based on the Adaptive Non-Local Means (ANLM) method, is used to remove noise from the slab surface image. In combination with the non-local mean filtering, local statistical characteristics are introduced to adaptively adjust the filtering parameters, thereby better retaining edges and details while suppressing noise. Specifically: S2101, converting the collected slab surface image data into a grayscale image I(x,y), extracting a fixed-size image block (neighborhood block) centered at each pixel point (x,y), recorded as N{x,y}: N{x,y}={I(x+l x ,y+l y )|l x ,l y ∈[-k,k]}; Where k (a positive integer) is the radius of the neighborhood block, and its size determines the area used to calculate local statistical information; l x Indicates the lateral offset; l y Indicates the longitudinal offset; S2102, calculating the local mean and variance in the image block: ; ; Wherein, μ(x,y) represents the average gray value of the image block N(x,y); It reflects the local noise level and detail complexity in the area; S2103. The smoothing parameter h in the traditional non-local mean filter has an important influence on noise removal and detail retention. In order to enable the filter to automatically adjust according to the noise characteristics of different regions, an adaptive parameter h(x,y) is designed: h(x,y)=s×σ(x,y)+h0; ; Where s represents the adjustment factor proportional to the noise level; σ(x,y) represents the local standard deviation; h0 represents the basic smoothing parameter, which is used to ensure a certain smoothing effect in low-noise areas; S2104. In a larger search window centered at the current pixel (x, y) (assuming the search window size is (2R+1)×(2R+1), where R is the search radius), perform image block similarity measurement on each candidate pixel (i, j)∈Ω(i, j) (Ω represents the search area), using weighted Euclidean distance as the similarity measurement. : ; ; In the formula, represents the Gaussian weight function; σ G is the preset parameter, σ G = k / 2; S2105. Use adaptive parameter h(x,y) to convert the distance into weight w(x,y,i,j): ; ; Where Z(x,y) represents the normalization factor to ensure that the sum of all weights is 1; S2106, calculate the denoised grayscale value of the current pixel (x, y) as the weighted average of all candidate pixels in the search window, and output the denoised image data I'(x, y): ; Based on this: the global redundant information is used to remove noise from each pixel, and the smoothing degree is adaptively adjusted to perform strong smoothing in high-noise areas while retaining more structural information in detail-rich areas; S22. Since the uneven illumination of the acquisition environment may cause overexposure or underexposure in some areas, affecting the accuracy of defect detection, the adaptive histogram equalization (CLAHE, Contrast Limited Adaptive Histogram Equalization) method is used to normalize the illumination. The calculation process is as follows: ; In the formula, I eq (x, y) represents the image pixel value after illumination equalization; I min ,I max Respectively represent the minimum and maximum pixel values within the local window; S23. In order to highlight the defect contour of the slab surface, the Laplacian Operator is used for edge enhancement. The calculation formula is as follows: ; ; In the formula, represents Laplace; I edge (x,y) represents the image after edge enhancement; Based on this: the edges of defects such as cracks and scratches are highlighted, making it easier for deep learning models to detect target features; S24. Since some defects may have a low contrast with the background and are difficult to detect, the gamma correction method is used to enhance the contrast. The adjustment formula is as follows: ; In the formula, I gamma (x, y) represents the pixel value after gamma correction; γ represents the gamma value, which is set to 0.5≤γ≤2.5 in this embodiment. When γ<1, the dark area contrast is improved, and when γ>1, the highlight area is compressed; Based on this: optimize the visual effect of the image, make the defect area more obvious, and improve the detection accuracy; S25. In order to improve the stability of the deep learning model, the pixel values need to be normalized to a fixed range. The Z-score normalization method is used. The calculation formula is as follows: ; ; ; In the formula, μ represents the mean of the image; σ represents the standard deviation of the image; M and N represent the number of rows and columns of the image, that is, the height and width of the image, specifically: M: the number of pixel rows in the image, representing the vertical size of the image; N: the number of pixel columns in the image, representing the horizontal size of the image; S26: Output processed image data , is the processed image data Generate a binary matching code. The generation process is as follows: S2601, the processed image data Convert to binary data data; S2602, select a random number r∈ , calculate the auxiliary code Ac=g r mod p; Where g is the generator of the predefined group G; G is the predefined group A subgroup of order q; p is a predefined large prime number such that q is a factor of p-1; S2603, based on the matching code CM=H(data||Ac||P1||P2) mod q; Among them, || is a concatenation operation; P1 is a predefined unary auxiliary code, P1=g a mod p; P2 is a predefined binary auxiliary code, P2=gb mod p; a, b are predefined random components, a, b∈ ; H is a predefined hash function; S2604, calculate the unary code C1=ra·CM (mod q); S2605, calculate the binary code C2=rb·CM (mod q); S2606, generate a binary matching code CⅡM=(CM, C1, C2); S27, {binary matching code CⅡM=(CM,C1,C2), processed image data }Transmitted to the deep learning detection module.
[0021] S3, the deep learning detection module builds a hybrid anomaly detection model, introduces the Adaptive Feature Enhancement (AFE) mechanism and the Attention-Guided Multi-Scale Fusion (AGMSF) strategy to fully utilize the local feature extraction capability of CNN and the global context modeling capability of Transformer, specifically: S31, receiving {binary matching code CⅡM=(CM, C1, C2), processed image data }, extract the binary matching code CⅡM=(CM,C1,C2) and the processed image data , using the binary matching code CⅡM=(CM,C1,C2) to carry out digital image screening, the screening process is as follows: S3101, receive the image data Convert to binary data data'; S3102, calculate the unary screening code Co: , calculate the binary screening code Ct: ; S3103, if Co=Ct, it means that the received image data If the primary screening is passed, an alarm will be given immediately; otherwise, S3104. Calculate reference code CS=H(data'||Co||P1||P2) mod q; S3105, if CS = CM, then the received image data If it complies with the specification, an alarm will be given immediately; otherwise, S32, extracting processed image data , the processed image data Input ResNet+SE (Squeeze-and-Excitation) network for preliminary feature extraction, learn local texture features, and enhance the importance of features through SE module. The specific process is as follows: S3201, convolutional layer extracts features: ; In the formula, F (l) represents the feature map of layer l; W (l) and b (l) Represent the convolution kernel and bias respectively; S3202, Channel Attention Enhancement (SE module): Adjust the weight of each channel feature to enhance key features: ; ; Where Pool() represents the global average pooling operation; W1 and W2 represent the weights of the fully connected layer; S c represents the channel attention weight; Indicates the enhanced features; S33, local features F extracted by CNN SE There is a distribution deviation from the global features required by the subsequent Transformer. For this reason, an AFE unit is constructed to adaptively adjust the local features to match the input of the Transformer. Specifically: S3301, calculate local feature F SE and the global feature F global The similarity between: ; In the formula, F global represents the global features (extracted by the subsequent Transformer model); S represents the similarity matrix between local features and global features; T represents the matrix transposition operation; It should be noted that in the first round of reasoning, AFE needs to calculate the local feature F SE With the global feature F global The similarity between them, but at this time F global Not yet generated, in order to solve this problem, first use Global Average Pooling (GAP) to approximate the initial global features: ; in, As a pseudo-global feature, it provides preliminary global information; S3302, calculate feature adjustment weight W AFE :W AFE =softmax(S); This weight is used to adjust local features to make them more consistent with the global feature distribution, reduce the deviation between local features and global features, and enhance detection capabilities; S3303, calculate the enhanced feature F AFE : ; Based on this: dynamically adjust local features to make them more consistent with the distribution of global features and improve the overall performance of the model; S34, characteristic F after AFE adjustment AFE The data is sent to Swin Transformer to extract global information. Swin Transformer learns features at different scales through a sliding window mechanism, which can capture long-distance information more accurately. Specifically: S3401, Window Division: F AFE Divide into multiple windows, and calculate self-attention independently for each window: ; Where Q, K, and V represent query, key, and value matrices, respectively; k represents the dimension of the key vector; S3402, hierarchical feature extraction: extract global features F of different scales through multi-layer Transformer blocks tran , that is, F global ; S35. The surface defects of slabs may be of different scales. It may not be possible to fully detect all defects by relying on features of a single scale. Therefore, an attention-guided multi-scale fusion (AGMSF) mechanism is constructed to perform weighted fusion of features of different scales. Specifically: S3501. Obtain global features F of the same scale tran , that is, multi-scale features: small-scale features (applicable to small cracks), medium-scale features (applicable to medium defects), and large-scale features (applicable to large-area damage); S3502. Calculate attention weight: W scale =softmax(MLP(F tran )); Where W scale represents multi-scale weight, that is, the importance of features at different scales. Each scale feature is weighted according to its contribution to the final classification. The larger the weight, the more important the scale feature plays in defect classification. MLP() represents Multi-Layer Perceptron, which is used here to further process the feature F after the Transformer network. tran , and outputs the weight of each scale. MLP consists of several fully connected layers and can learn the nonlinear relationship between scale features; S3503: Weighted fusion of features at different scales to generate fusion feature F fusion ; Based on this: improve detection accuracy and make the model more sensitive to defects of different scales; S36, fusion feature F fusion Send to the fully connected layer for defect classification: ; Where P represents the probability of different defect categories; W fc represents the weight of the fully connected layer; b fc Indicates bias; S37. Calculate the confidence C by using multi-scale confidence fusion: ; In the formula, C i represents the defect confidence level of the i-th scale; represents the weight corresponding to the i-th level scale; S38. Output {defect category P, target bounding box position Bounding Box, defect confidence C} and transmit it to the anomaly analysis module.
[0022] S4, the anomaly analysis module is based on {defect category P, target bounding box location Bounding Box, defect confidence C}. By integrating this information, the defect classification and location are performed to accurately determine the defect type, location and confidence, while improving the accuracy, robustness and real-time performance of the detection. Specifically: S41. Through deep learning model reasoning, the defect category P obtained is the result of classifying each detected defect, and the multi-dimensional confidence fusion technology is used to combine the confidence C and the correlation of the category to optimize the classification result, specifically: S4101, extracting a predefined confidence threshold C threshold , exclude the detection results with confidence lower than the threshold; S4102. Based on the defect category P, the defect category and the confidence are combined through the confidence weighted strategy to improve the reliability of classification: P'=P·C; Among them, P′ is the final weighted defect category vector; C is the defect confidence, that is, the reliability of defect location and category detection; S4103, by maximizing the weighted category probability P', determine the final category of the defect: P final =argmax(P'); Among them, P final Indicates the defect category finally determined; Based on this: the defect confidence and category probability are combined, and some high-confidence misclassifications are eliminated through weighted methods, thus improving the accuracy of the overall classification; S42. When locating defects, the defect location is accurately confirmed based on the Bounding Box inferred by the model. The Bounding Box format is [(x min ,y min ),(x max ,y max )],(x min ,y min ) and (x max ,y max ) represent the coordinates of the upper left corner and lower right corner of the defect. In order to improve the positioning accuracy, the adaptive localization correction algorithm is used to fine-tune the positioning result based on the defect confidence C: ; ; Where Δx and Δy represent the correction amount of the bounding box in the x and y directions respectively; α and β represent scaling factors, which adjust the correction amplitude in the x and y directions respectively; Update the located defect position to BBox: BBox=[(x min -Δx,y min -Δy),(x max +Δx,y max +Δy)]; Based on this: Adaptive position correction is used to reduce errors, optimize positioning accuracy, and achieve precise positioning of high-confidence defects; S43, combine the defect category and defect location to output the final detection result, and use the comprehensive defect category probability P final and bounding box position BBox, generate a complete defect detection report Report, Report = {defect category: P final ;Defect location: BBox;Confidence: C}; S44, transmitting the defect detection report Report to the real-time feedback and alarm module and the cloud storage and optimization module.
[0023] S5, real-time feedback and alarm module automatically evaluates slab quality and makes corresponding decisions based on defect type and severity combined with production standards: If the defect is a minor surface defect (including but not limited to small scratches), automatically determine whether it can be repaired through subsequent processes (including but not limited to polishing and spraying); If defects affect structural safety (including but not limited to severe cracks), send an alarm immediately and recommend adjusting production parameters; If the defects exceed the set acceptable range, the slab will be automatically marked as defective and recommended to be scrapped or reworked.
[0024] S6, the cloud storage and optimization module stores the test results, combines historical test data, and uses transfer learning and incremental learning to optimize the hybrid anomaly detection model to adapt it to new defect types. At the same time, the system uses federated learning or cloud training technology to continuously improve the detection accuracy of the model without affecting production. Specifically: S61. As new defect types may appear on the slab surface with changes in production conditions, in order to avoid the catastrophic forgetting problem, that is, the learning of new data will cause the model to forget old knowledge, incremental learning is introduced, combined with the knowledge distillation method, so that the model can maintain high detection accuracy of original defects while learning new defect types: Define the current model as , whose parameter is θ t , the goal is to find the new defect sample D new When arriving, optimize the model without forgetting old knowledge: L total =L new +λL distill ; ; ; Among them, L total Represents the total loss of the model in the current iteration, which is used to measure the comprehensive error of new data learning and old knowledge retention; L new represents the loss function based on new defect data; L distill represents the knowledge distillation loss, which uses KL divergence to measure the difference between the output of the new model and the output of the old model to prevent the model from forgetting the old knowledge when learning new knowledge; λ represents the trade-off factor, which is used to adjust the ratio between the new loss and the distillation loss to ensure that the model can adapt to new data while maintaining the memory of previous knowledge; N' represents the total number of new defective data samples; x i Represents the input image data of the i-th new sample; y i represents the true defect category label corresponding to the i-th one, and this embodiment adopts one-hot encoding; Represents the current model (with parameters θ t ) for input x i The predicted probability reflects the model's judgment on each category; P old (xi ) indicates that the old model (previous version) is effective for sample x i The predicted probability distribution of the output is used as a "soft label"; P new (x i ) indicates that the current model is good at sampling x i The output prediction probability distribution is used to compare with the old model to ensure that the new model does not deviate from the original judgment when learning new knowledge; S62. Since the amount of new defect sample data is small, it is costly to directly train the hybrid anomaly detection model from scratch. Therefore, transfer learning is used for optimization. The pretrained model is used to perform fine-tuning on the existing defect data set. The fine-tuning strategy is as follows: freeze the first few layers of the feature extraction layer and only optimize the classification layer (set the parameters of the hybrid anomaly detection model to consist of the feature extraction layer and the classification layer); and perform a small amount of training on the new data set to prevent overfitting. S63. Since slab production may be distributed in multiple factories and the defect types of different production lines may be different, Federated Learning (FL) is used to update the model through the Federated Average Algorithm (FedAvg), train local models on several devices, and perform model fusion in the cloud to ensure that different production lines share the optimized intelligent detection model.
[0025] S7. The user interaction terminal visually displays the slab surface data, test reports and decision suggestions.
[0026] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited thereto, and various changes can be made within the knowledge scope of technicians in the relevant technical field without departing from the purpose of the present invention.
Claims
1. A slab surface quality detection method based on deep learning, characterized in that: The specific implementation steps include the following: S1. Collect slab surface data; S2, based on adaptive non-local mean filtering denoising, using global redundant information to remove noise from each pixel, combining adaptive histogram equalization to balance illumination and Laplacian operator to enhance edges, optimizing contrast through Gamma correction, performing Z-score normalization, and generating binary matching codes; S3. Use binary matching codes to screen data, build a hybrid anomaly detection model, combine ResNet and SE modules to extract local features, and match local and global features. Use Swin Transformer to extract global information, fuse multi-scale features, classify defects through the fully connected layer, and output {defect category, target bounding box location, defect confidence}; S4. Obtain defect categories based on deep learning reasoning, optimize classification results through confidence fusion, use adaptive position correction algorithm to improve defect location accuracy, and generate inspection reports based on defect categories and location information; S5. Analyze defect types and severity, automatically evaluate slab quality, and make decision recommendations; S6. Through incremental learning and knowledge distillation, transfer learning is used to fine-tune the pre-trained model to optimize new defect recognition, and federated learning is used to share the optimized hybrid anomaly detection model among multiple production lines; S7. Visual display of slab surface data, test reports and decision recommendations.
2. A slab surface quality detection method based on deep learning according to claim 1, characterized in that: The denoising process of adaptive non-local mean filtering denoising is as follows: S21, convert the collected slab surface data into a grayscale image I(x,y), extract a fixed-size image block centered on any pixel point (x,y), i.e., a neighborhood block, denoted as N{x,y}: N{x,y}={I(x+l x ,y+l y )|l x ,l y ∈[-k,k]}; Where k is the radius of the neighborhood block, k is a positive integer; l x Indicates the lateral offset; l y Indicates the longitudinal offset; S22. Calculate the local mean and variance within the image block: ; ; Wherein, μ(x,y) represents the average gray value of the image block N(x,y); It reflects the local noise level and detail complexity within the image block N(x,y); S23, design adaptive parameters h(x,y): h(x,y)=s×σ(x,y)+h0; ; Where s represents the adjustment factor proportional to the noise level; σ(x,y) represents the local standard deviation; h0 represents the basic smoothing parameter; S24. In a larger search window centered on the current pixel (x, y), perform image block similarity measurement on each candidate pixel (i, j) ∈ Ω(i, j): ; ; in, represents the Gaussian weight function; σ G is the preset parameter, σ G =k / 2; Ω represents the search area; represents a similarity measure; S25. Use the adaptive parameter h(x,y) to convert the distance into weight w(x,y,i,j): ; ; Where Z(x,y) represents the normalization factor; S26, calculate the denoised grayscale value of the current pixel (x, y) as the weighted average of all candidate pixels in the search window, and output the denoised image data I'(x, y): .
3. The slab surface quality detection method based on deep learning according to claim 1 is characterized in that: The binary matching code generation process is as follows: S31, the processed image data Convert to binary data data; S32, select a random number r∈ , calculate the auxiliary code Ac=g r mod p; Where g is the generator of the predefined group G; G is the predefined group A subgroup of order q; p is a predefined large prime number such that q is a factor of p-1; S33, based on the matching code CM=H(data||Ac||P1||P2) mod q; Among them, || is a concatenation operation; P1 is a predefined unary auxiliary code, P1=g a mod p; P2 is a predefined binary auxiliary code, P2=g b mod p; a, b are predefined random components, a, b∈ ; H is a predefined hash function; S34, calculating the unary code C1=ra·CM (mod q), calculating the binary code C2=rb·CM (mod q); S35. Generate a binary matching code CⅡM=(CM, C1, C2).
4. The slab surface quality detection method based on deep learning according to claim 3 is characterized in that: The screening process for data screening using binary matching codes is as follows: S41, image data Convert to binary data data'; S42, calculate the unary screening code Co: , calculate the binary screening code Ct: ; S43. If Co=Ct, it means that the received image data If the primary screening is passed, an alarm will be given immediately; otherwise, S44, calculate the reference code CS = H (data'||Co||P1||P2) mod q; S45. If CS=CM, it means the received image data If it complies with the regulations, an alarm will be given immediately.
5. The slab surface quality detection method based on deep learning according to claim 1 is characterized in that: The detection process of the hybrid anomaly detection model is as follows: S51, the processed image data Input ResNet+SE network for preliminary feature extraction, and use ResNet to extract the feature map F of the lth layer (l) , and use the SE module to adjust the weight of the features of each channel: ; ; In the formula, F (l) represents the feature map of the lth layer; W (l) and b (l) Respectively represent convolution kernel and bias; Pool() represents global average pooling operation; W1 and W2 represent the weights of the fully connected layer; S c represents SE attention weight; Represents the enhanced local features; S52, construct an adaptive feature enhancement unit AFE, adaptively adjust the local features, and convert the features F adjusted by AFE into AFE Swin Transformer is used to extract global information, and F AFE Divide into several windows, each window independently calculates self-attention, and extracts global features F of different scales tran ; S53, obtain the global feature F of the same scale tran , weighted fusion of global scale and enhanced local features to generate fusion feature F fusion , the fusion feature F fusion Send it to the fully connected layer for defect classification and output the probability P of different defect categories; S54. Calculate the confidence C by using multi-scale confidence fusion: , output {defect category P, target bounding box location Bounding Box, defect confidence C}; In the formula, C i represents the defect confidence level of the i-th scale; Represents the weight corresponding to the i-th level scale.
6. A slab surface quality detection method based on deep learning according to claim 5, characterized in that: The process of adaptively adjusting local features is as follows: S61. Calculate local feature F SE and the global feature F global The similarity between: ; In the formula, F global represents the global feature; S represents the similarity matrix between local features and global features; T represents the matrix transposition operation; S62, calculate feature adjustment weight W AFE :W AFE =softmax(S); S63. Calculate the enhanced feature F AFE : .
7. A slab surface quality detection method based on deep learning according to claim 6, characterized in that: Global feature F global In the first round of reasoning, the local feature F SE Use global average pooling to get the initial global features: ; in, As a pseudo-global feature; GAP() represents a global average pooling operation.
8. The method for detecting slab surface quality based on deep learning according to claim 1, characterized in that: The optimization process for optimizing classification results is as follows: S81. Extracting a predefined confidence threshold C threshold , exclude the confidence values below the confidence threshold C threshold The test results; S82. Based on the defect category P, the defect category and the confidence are combined through a confidence weighting strategy to improve the reliability of classification: P'=P·C; Among them, P′ is the final weighted defect category vector; C is the defect confidence; S83. Determine the final category of the defect by maximizing the weighted category probability P': P final =argmax(P'); Among them, P final Indicates the defect category finally determined; S84, using the adaptive position correction algorithm, fine-tuning the positioning result based on the defect confidence C: ; ; Where Δx and Δy represent the correction amount of the bounding box in the x and y directions respectively; α and β represent the scaling factors, which adjust the correction amplitude in the x and y directions respectively; (x min ,y min ) and (x max ,y max ) represent the coordinates of the upper left corner and lower right corner of the defect; S85. Update the located defect position to BBox: BBox=[(x min -Δx,y min -Δy),(x max +Δx,y max +Δy)]。 9. A slab surface quality detection system based on deep learning, which is used to execute a slab surface quality detection method based on deep learning according to any one of claims 1 to 8, characterized in that: include: Image acquisition module, used to collect slab surface data; Slab surface data preprocessing module, used for image enhancement, noise removal, and normalization operations; Deep learning detection module, which is used to identify defects based on deep learning models, i.e., building a hybrid anomaly detection model; Abnormal analysis module, which is used to conduct intelligent analysis based on defect type, size, and shape, and provide quality assessment; Real-time feedback and alarm module, which is used to automatically trigger the alarm mechanism after detecting defects and provide adjustment suggestions to the production line control system; Cloud storage and optimization module, which is used to optimize new defect identification by fine-tuning pre-trained models through incremental learning and knowledge distillation, and to share optimized hybrid anomaly detection models across multiple production lines using federated learning; The user interaction terminal visualizes the slab surface data and displays detected anomaly information and decision suggestions.
Citation Information
Patent Citations
Carbon filament surface defect detection method based on deep learning
CN115358977A
Casting surface defect detection method and system based on improved DETR
CN117314837A
Product visual image accurate identification and processing integrated platform
CN118982543A
Optical detection method for apparent defects of flexible production line
CN119477862A
METHOD FOR CHARACTERIZING A DEFECT IN A PIPELINE
FR3146008A1
Cited By
Image recognition and classification system and method based on machine learning
CN120689682A
Air cooler defrosting management control method and system based on machine vision and AI algorithm
CN120760395A
Incremental learning visual defect identification system and method for industrial quality inspection
CN121482479A