Unet-based continuous casting billet defect detection method, system and equipment and storage medium
The improved U-Net network with BAM attention mechanisms enhances billet defect detection, addressing inefficiencies in existing methods by providing rapid and accurate defect assessment.
Patent Information
- Application Number
- CN202411030063.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-12-17
AI Technical Summary
Existing methods for detecting internal defects in continuous casting billets are subjective and inefficient, leading to inconsistencies in quality assessment.
A method and system utilizing an improved U-Net network with a Bilateral (Unet) module for defect detection, incorporating image processing enhancements and BAM attention mechanisms to enhance image processing, and a computer device for implementing the method.
The method achieves rapid, accurate, and intelligent detection of continuous casting billet defects, ensuring high detection accuracy and robustness across varying backgrounds and sizes.
Smart Images

Figure CN119151861A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of continuous casting billet defect detection, and more specifically, to a continuous casting billet defect detection method, system, equipment and storage medium based on Unet. Background Art
[0002] The production of continuous casting billets is a key link in the entire steel production line. Due to the relative flow of molten steel with high concentration of solute at the solidification front, macro-segregation cannot be completely eliminated during the subsequent rolling and homogenization heat treatment process, which has an important impact on the performance and stability of steel products. Therefore, rapid and accurate detection and quality rating of internal defects of continuous casting billets are crucial to the production process of continuous casting steel slabs. In addition, internal defects of continuous casting billets greatly affect the quality of continuous casting. The detection of internal defects is an important criterion for measuring the quality of casting. At present, internal defects are mainly rated manually, and the manual rating method has problems such as high subjectivity and low efficiency. Summary of the invention
[0003] The technical problem to be solved by the present invention is to address the above-mentioned deficiencies in the prior art. One purpose of the present invention is to provide an intelligent, fast and accurate continuous casting billet defect detection method based on Unet.
[0004] The second objective of the present invention is to provide a continuous casting billet defect detection system based on Unet.
[0005] A third object of the present invention is to provide a computer device.
[0006] A fourth objective of the present invention is to provide a computer storage medium.
[0007] In order to achieve the above-mentioned objective 1, the present invention provides a continuous casting billet defect detection method based on Unet, comprising the following steps:
[0008] Step 1. Obtaining a billet image of a billet sample after etching and cleaning according to the standard;
[0009] Step 2. Perform image enhancement processing on the billet image to obtain an enhanced image, annotate the defects in the billet image and the enhanced image, and prepare a continuous casting billet surface defect dataset, and divide the continuous casting billet surface defect dataset into a training set, a verification set and a test set;
[0010] Step 3. Improve the Unet network, use the Leaky Relu function as the activation function in the Conv structure, send the feature map after the convolution module in the encoding structure to the BAM attention module, and concatenate the feature map output by the BAM attention module with the feature map of the same dimension obtained after the deconvolution operation;
[0011] Step 4. Use the training set to train the improved Unet network model, set the epoch in the range of 200-300 during training, and then fine-tune the parameters of the Unet network model to complete the continuous casting billet defect segmentation model based on the improved Unet;
[0012] Using the verification set to verify the continuous casting billet defect segmentation model and perform parameter optimization;
[0013] The optimized continuous casting billet defect segmentation model is tested using the test set, the accuracy, recall rate, precision and mIoU segmentation index of the continuous casting billet defect segmentation model are calculated, the performance of the continuous casting billet defect segmentation model is verified, and the optimal parameters are determined to obtain a defect detection model;
[0014] Step 5. Use the defect detection model to detect the image of the billet to be detected, obtain a defect mask area generated according to the detection area, perform statistics on the defect mask area to obtain a statistical ratio of the defect area to the billet area, and evaluate the defect level of the billet to be detected according to the statistical ratio.
[0015] As a further improvement, the billet samples are collected from an industrial production line; the billet samples are etched and cleaned according to the processing requirements in the standard "YB / T4002-2013 Continuous Cast Steel Billet Macrostructure Defect Rating Chart".
[0016] Furthermore, the billet image requires that the billet be completely photographed and the billet surface be clean, and there should not be any area with excessively large illumination differences on the billet surface.
[0017] Furthermore, the image enhancement processing includes:
[0018] Add image noise, select at least one of Gaussian noise, salt and pepper noise, and Poisson noise to change different signal-to-noise ratios to generate data.
[0019] S1(o)=S(i)+N(θ)
[0020] Where S1(o) is the enhanced image, S(i) is the original image, N(θ) is the noise, and θ is the noise parameter;
[0021] Image blurring: select at least one of mean filtering, Gaussian filtering, motion blur, and contrast enhancement filtering, and set different parameters to obtain the image after the filter.
[0022] S2(o)=F(S(i)|φ)
[0023] Where S2(o) is the enhanced image, F(·) is the filter, and φ is the filter parameter;
[0024] Change the brightness of the image, select different brightness ratios: 20%, 50%, 80%, and transform the brightness value of the original image.
[0025] S3(o)=f(S(i))
[0026] Where S3(o) is the enhanced image, and f(·) is the brightness change function;
[0027] Image quality adjustment: reduce the quality of jpeg images according to jpeg encoding specifications, and obtain images with two different qualities of 75% and 90%.
[0028] S4(o)=M(S(i))
[0029] Where S4(o) is the enhanced image and M(·) is the jpeg encoding quality adjustment function.
[0030] Furthermore, the defects in each image are annotated using the graphic image annotation tool Labelme.
[0031] Furthermore, the ratio of the number of images in the training set, validation set, and test set is 8:1:1.
[0032] Furthermore, the case diagram given in the standard "YB / T 4002-2013 Continuous Cast Steel Billet Macrostructure Defect Rating Diagram" is marked and divided, and the threshold ratio is added by interpolation method. The grade division method is as follows:
[0033] The ratio of the defect area to the ingot area is 0.01%-1.95%, and the content is 1.95%, corresponding to the segregation grade of 0.5;
[0034] The ratio of the defect area to the ingot area is 1.96%-3.01%, and the content is 3.01%, corresponding to the segregation grade of 1;
[0035] The ratio of the defect area to the ingot area is 3.02%-5.62%, containing 5.62%, corresponding to the segregation grade of 1.5;
[0036] The ratio of the defect area to the ingot area is 5.63%-7.96%, containing 7.96%, corresponding to the segregation grade of 2;
[0037] The ratio of the defect area to the ingot area is 7.97%-11.58%, containing 11.58%, corresponding to a segregation grade of 2.5;
[0038] The ratio of the defect area to the ingot area is 11.59%-14.15%, containing 14.15%, corresponding to the segregation grade of 3;
[0039] The ratio of the defect area to the ingot area is 14.16%-19.59%, containing 19.59%, corresponding to a segregation grade of 3.5;
[0040] When the ratio of the detected defect area to the ingot area is higher than 19.60%, the corresponding segregation grade is 4.
[0041] In order to achieve the above-mentioned second objective, the present invention provides a continuous casting billet defect detection system based on Unet, comprising:
[0042] An acquisition module, used to acquire a billet image of the billet sample after being etched and cleaned according to the standard;
[0043] an enhancement module, configured to perform image enhancement processing on the billet image to obtain an enhanced image, annotate the defects in the billet image and the enhanced image, and prepare a continuous casting billet surface defect dataset, and divide the continuous casting billet surface defect dataset into a training set, a validation set, and a test set;
[0044] Unet improvement module, used to improve the Unet network, use the Leaky Relu function as the activation function in the Conv structure, send the feature map after the convolution module in the encoding structure to the BAM attention module, and concatenate the feature map output by the BAM attention module with the feature map of the same dimension obtained after the deconvolution operation;
[0045] A training module, used to train the improved Unet network model using the training set, setting the epoch in the range of 200-300 during training, and then fine-tuning the parameters of the Unet network model to complete the continuous casting billet defect segmentation model based on the improved Unet; using the verification set to verify the continuous casting billet defect segmentation model and perform parameter optimization; using the test set to test the optimized continuous casting billet defect segmentation model, calculating the accuracy, recall rate, precision and mIoU segmentation index of the continuous casting billet defect segmentation model, verifying the performance of the continuous casting billet defect segmentation model, and determining the optimal parameters to obtain a defect detection model;
[0046] The detection module is used to use the defect detection model to detect the image of the square billet to be detected, obtain a defect mask area generated according to the detection area, perform statistics on the defect mask area to obtain a statistical ratio of the defect area to the billet area, and evaluate the defect level of the square billet to be detected according to the statistical ratio.
[0047] In order to achieve the third objective above, the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the above-mentioned Unet-based continuous casting billet defect detection method is implemented.
[0048] In order to achieve the fourth objective above, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the above-mentioned Unet-based continuous casting billet defect detection method is implemented.
[0049] Beneficial Effects
[0050] Compared with the prior art, the present invention has the following advantages:
[0051] The present invention greatly expands the training samples by performing image enhancement processing on the billet image; when improving the Unet network, the feature map output by the BAM attention module is spliced with the feature map of the same dimension obtained after the deconvolution operation, which improves the anti-interference and accuracy of the network. The Unet network model is trained to detect defects in continuous casting billets, which can be used for continuous casting billets with different backgrounds, corrosion degrees and sizes, and can ensure high detection accuracy, rapidity and intelligence. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 is a flow chart of the present invention;
[0053] Figure 2 Improved schematic diagram for Unet network;
[0054] Figure 3 Comparison of mIoU indicators between Unet with BAM added and Unet without BAM added during training;
[0055] Figure 4 This is a comparison chart of mIoU indication between Unet with BAM added and Unet without BAM added in actual detection.
[0056] Figure 5 This is a schematic diagram of the statistical proportion of defect areas to billet area in the case given in the standard "YB / T 4002-2013 Continuous Cast Steel Billet Macrostructure Defect Rating Diagram";
[0057] Figure 6 This is a schematic diagram of the statistical proportion of defect area to ingot area in actual detection. DETAILED DESCRIPTION
[0058] The present invention will be further described below with reference to the specific embodiments in the accompanying drawings.
[0059] See also Figure 1 to Figure 6 A continuous casting billet defect detection method based on Unet includes the following steps 1 to 5:
[0060] Step 1. Obtain the billet image of the billet sample after etching and cleaning according to the standard. Specifically, collect billet samples from the industrial production line, etch and clean the billet samples according to the processing requirements in the standard "YB / T 4002-2013 Continuous Cast Steel Billet Low-Magnification Defect Rating Chart", and use an industrial camera to collect billet images. The billet image requires that the billet be completely photographed, the billet surface is clean, and there should be no areas on the billet surface with excessive lighting differences. In this example, the camera height is about 2 meters.
[0061] Step 2. Considering the small amount of data acquired from industrial production lines, in order to improve the robustness of detection and recognition accuracy, the square billet image is enhanced to obtain an enhanced image.
[0062] Image enhancement processing specifically includes:
[0063] Add image noise, select at least one of Gaussian noise, salt and pepper noise, and Poisson noise to change different signal-to-noise ratios to generate data.
[0064] S1(o)=S(i)+N(θ)
[0065] Where S1(o) is the enhanced image, S(i) is the original image, N(θ) is the noise, and θ is the noise parameter.
[0066] Image blurring: select at least one of mean filtering, Gaussian filtering, motion blur, and contrast enhancement filtering, and set different parameters to obtain the image after the filter.
[0067] S2(o)=F(S(i)|φ)
[0068] Where S2(o) is the enhanced image, F(·) is the filter, and φ is the filter parameter.
[0069] Change the brightness of the image, select different brightness ratios: 20%, 50%, 80%, and transform the brightness value of the original image.
[0070] S3(o)=f(S(i))
[0071] Where S3(o) is the enhanced image and f(·) is the brightness change function.
[0072] Image quality adjustment: reduce the quality of jpeg images according to jpeg encoding specifications, and obtain images with two different qualities of 75% and 90%.
[0073] S4(o)=M(S(i))
[0074] Where S4(o) is the enhanced image and M(·) is the jpeg encoding quality adjustment function.
[0075] Of course, image enhancement processing can also include rotation and mirror transformation.
[0076] By performing image enhancement processing on the billet images, the training samples are greatly expanded.
[0077] Defects in the billet image and enhanced image are marked. Preferably, the defects in each image are finely marked using the graphic image annotation tool Labelme. The marked images are made into a continuous casting billet surface defect data set, from which a part of the data is selected as a training set, a part of the data is selected as a validation set, and the remaining data is selected as a test set, that is, the continuous casting billet surface defect data set is divided into a training set, a validation set, and a test set. Preferably, the ratio of the number of images in the training set, the validation set, and the test set is 8:1:1.
[0078] Step 3. Improve the Unet network and use the Leaky Relu function as the activation function in the Conv structure to improve the network's feature extraction performance. Send the feature map after the convolution module in the encoding structure to the BAM attention module, and concatenate the feature map output by the BAM attention module with the feature map of the same dimension after the deconvolution operation, thereby improving the network's anti-interference ability and its ability to accurately locate defect areas.
[0079] Step 4. Use the training set to train the improved Unet network model. During training, set the epoch to the range of 200-300. Then fine-tune the parameters of the Unet network model to complete the continuous casting billet defect segmentation model based on the improved Unet.
[0080] The validation set is used to validate the continuous casting billet defect segmentation model and perform parameter optimization.
[0081] The optimized continuous casting billet defect segmentation model was tested using the test set. By comparing with the real background image, the accuracy, recall rate, precision and mIoU segmentation index of the continuous casting billet defect segmentation model were calculated. The performance of the continuous casting billet defect segmentation model was verified (verified by mIoU), and the optimal parameters were determined to obtain the defect detection model.
[0082] Step 5. Use the defect detection model to detect the image of the billet to be detected, obtain the defect mask area generated according to the detection area, perform statistics on the defect mask area to obtain the statistical ratio of the defect area to the billet area, and evaluate the defect level of the billet to be detected based on the statistical ratio.
[0083] according to Figure 3 and Figure 4It can be seen that after adding the BAM module to improve the Unet network model, the detection accuracy has been improved, and MioU has increased from 0.86 to 0.92. The statistical proportion of the defect area to the ingot area can be obtained by counting the masks generated by the model detection.
[0084] According to the case diagram given in the standard "YB / T 4002-2013 Continuous Cast Steel Billet Macrostructure Defect Rating Diagram", the diagram is marked and divided, and the threshold ratio is added by interpolation method. The classification method is as follows:
[0085] The ratio of the defect area to the ingot area is 0.01%-1.95%, and the content is 1.95%, corresponding to the segregation grade of 0.5;
[0086] The ratio of the defect area to the ingot area is 1.96%-3.01%, and the content is 3.01%, corresponding to the segregation grade of 1;
[0087] The ratio of the defect area to the ingot area is 3.02%-5.62%, containing 5.62%, corresponding to the segregation grade of 1.5;
[0088] The ratio of the defect area to the ingot area is 5.63%-7.96%, containing 7.96%, corresponding to the segregation grade of 2;
[0089] The ratio of the defect area to the ingot area is 7.97%-11.58%, containing 11.58%, corresponding to a segregation grade of 2.5;
[0090] The ratio of the defect area to the ingot area is 11.59%-14.15%, containing 14.15%, corresponding to the segregation grade of 3;
[0091] The ratio of the defect area to the ingot area is 14.16%-19.59%, containing 19.59%, corresponding to a segregation grade of 3.5;
[0092] When the ratio of the detected defect area to the ingot area is higher than 19.60%, the corresponding segregation grade is 4.
[0093] A continuous casting billet defect detection system based on Unet, comprising:
[0094] An acquisition module, used to acquire a billet image of the billet sample after being etched and cleaned according to the standard;
[0095] The enhancement module is used to perform image enhancement processing on the billet image to obtain an enhanced image, annotate the defects in the billet image and the enhanced image, and produce a continuous casting billet surface defect dataset, which is divided into a training set, a validation set, and a test set;
[0096] Unet improvement module, used to improve the Unet network, use the Leaky Relu function as the activation function in the Conv structure, send the feature map after the convolution module in the encoding structure to the BAM attention module, and concatenate the feature map output by the BAM attention module with the feature map of the same dimension obtained after the deconvolution operation;
[0097] The training module is used to train the improved Unet network model using the training set. During the training, the epoch is set in the range of 200-300, and then the parameters of the Unet network model are fine-tuned to complete the continuous casting billet defect segmentation model based on the improved Unet; the continuous casting billet defect segmentation model is verified using the validation set, and the parameters are optimized; the optimized continuous casting billet defect segmentation model is tested using the test set, and the accuracy, recall rate, precision and mIoU segmentation index of the continuous casting billet defect segmentation model are calculated to verify the performance of the continuous casting billet defect segmentation model, and determine the optimal parameters to obtain the defect detection model;
[0098] The detection module is used to use the defect detection model to detect the image of the billet to be detected, obtain the defect mask area generated according to the detection area, perform statistics on the defect mask area to obtain the statistical ratio of the defect area to the billet area, and evaluate the defect level of the billet to be detected according to the statistical ratio.
[0099] A computer device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the above-mentioned continuous casting billet defect detection method based on Unet is implemented.
[0100] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the above-mentioned continuous casting billet defect detection method based on Unet.
[0101] The above are only preferred embodiments of the present invention. It should be pointed out that for those skilled in the art, several modifications and improvements can be made without departing from the structure of the present invention, which will not affect the effect of the implementation of the present invention and the practicality of the patent.
Claims
1. A continuous casting billet defect detection method based on Unet, characterized in that: The following steps are involved: Step 1. Obtaining a billet image of a billet sample after etching and cleaning according to the standard; Step 2. Perform image enhancement processing on the billet image to obtain an enhanced image, annotate the defects in the billet image and the enhanced image, and prepare a continuous casting billet surface defect dataset, and divide the continuous casting billet surface defect dataset into a training set, a verification set and a test set; Step 3. Improve the Unet network, use the Leaky Relu function as the activation function in the Conv structure, send the feature map after the convolution module in the encoding structure to the BAM attention module, and concatenate the feature map output by the BAM attention module with the feature map of the same dimension obtained after the deconvolution operation; Step 4. Use the training set to train the improved Unet network model, set the epoch in the range of 200-300 during training, and then fine-tune the parameters of the Unet network model to complete the continuous casting billet defect segmentation model based on the improved Unet; Using the verification set to verify the continuous casting billet defect segmentation model and perform parameter optimization; The optimized continuous casting billet defect segmentation model is tested using the test set, the accuracy, recall rate, precision and mIoU segmentation index of the continuous casting billet defect segmentation model are calculated, the performance of the continuous casting billet defect segmentation model is verified, and the optimal parameters are determined to obtain a defect detection model; Step 5. Use the defect detection model to detect the image of the billet to be detected, obtain a defect mask area generated according to the detection area, perform statistics on the defect mask area to obtain a statistical ratio of the defect area to the billet area, and evaluate the defect level of the billet to be detected according to the statistical ratio.
2. The continuous casting billet defect detection method based on Unet according to claim 1, characterized in that: The billet samples are collected from an industrial production line; and the billet samples are etched and cleaned according to the processing requirements in the standard "YB / T 4002-2013 Continuous Cast Steel Billet Macrostructure Defect Rating Diagram".
3. The continuous casting billet defect detection method based on Unet according to claim 1, characterized in that: The billet image requires that the billet be completely photographed and the billet surface be clean, and there should not be any area with excessive lighting differences on the billet surface.
4. The continuous casting billet defect detection method based on Unet according to claim 1, characterized in that: The image enhancement process comprises: Add image noise, select at least one of Gaussian noise, salt and pepper noise, and Poisson noise to change the signal-to-noise ratio to generate data. S1(o)=S(i)+N(θ) Where S1(o) is the enhanced image, S(i) is the original image, N(θ) is the noise, and θ is the noise parameter; Image blurring: select at least one of mean filtering, Gaussian filtering, motion blur, and contrast enhancement filtering, and set different parameters to obtain the image after the filter. S2(o)=F(S(i)|φ) Where S2(o) is the enhanced image, F(·) is the filter, and φ is the filter parameter; Change the brightness of the image, select different brightness ratios: 20%, 50%, 80%, and transform the brightness value of the original image. S3(o)=f(S(i)) Where S3(o) is the enhanced image, and f(·) is the brightness change function; Image quality adjustment: reduce the quality of jpeg images according to jpeg encoding specifications, and obtain images with two different qualities of 75% and 90%. S4(o)=M(S(i)) Where S4(o) is the enhanced image and M(·) is the jpeg encoding quality adjustment function.
5. The continuous casting billet defect detection method based on Unet according to claim 1, characterized in that: The defects in each image were annotated using the graphic image annotation tool Labelme.
6. The continuous casting billet defect detection method based on Unet according to claim 1, characterized in that: The ratio of the number of images in the training set, validation set, and test set is 8:1:
1.
7. The continuous casting billet defect detection method based on Unet according to claim 1, characterized in that: According to the case diagram given in the standard "YB / T 4002-2013 Continuous Cast Steel Billet Macrostructure Defect Rating Diagram", the diagram is marked and divided, and the threshold ratio is added by interpolation method. The classification method is as follows: The ratio of the defect area to the ingot area is 0.01%-1.95%, and the content is 1.95%, corresponding to the segregation grade of 0.5; The ratio of the defect area to the ingot area is 1.96%-3.01%, and the content is 3.01%, corresponding to the segregation grade of 1; The ratio of the defect area to the ingot area is 3.02%-5.62%, containing 5.62%, corresponding to the segregation grade of 1.5; The ratio of the defect area to the ingot area is 5.63%-7.96%, containing 7.96%, corresponding to the segregation grade of 2; The ratio of the defect area to the ingot area is 7.97%-11.58%, containing 11.58%, corresponding to a segregation grade of 2.5; The ratio of the defect area to the ingot area is 11.59%-14.15%, containing 14.15%, corresponding to the segregation grade of 3; The ratio of the defect area to the ingot area is 14.16%-19.59%, containing 19.59%, corresponding to a segregation grade of 3.5; When the ratio of the detected defect area to the ingot area is higher than 19.60%, the corresponding segregation grade is 4.
8. A continuous casting billet defect detection system based on Unet, characterized in that: include: An acquisition module, used to acquire a billet image of the billet sample after being etched and cleaned according to the standard; an enhancement module, configured to perform image enhancement processing on the billet image to obtain an enhanced image, annotate the defects in the billet image and the enhanced image, and prepare a continuous casting billet surface defect dataset, and divide the continuous casting billet surface defect dataset into a training set, a validation set, and a test set; Unet improvement module, used to improve the Unet network, use the Leaky Relu function as the activation function in the Conv structure, send the feature map after the convolution module in the encoding structure to the BAM attention module, and concatenate the feature map output by the BAM attention module with the feature map of the same dimension obtained after the deconvolution operation; A training module, used to train the improved Unet network model using the training set, setting the epoch in the range of 200-300 during training, and then fine-tuning the parameters of the Unet network model to complete the continuous casting billet defect segmentation model based on the improved Unet; The continuous casting billet defect segmentation model is verified using the verification set, and parameters are optimized; the optimized continuous casting billet defect segmentation model is tested using the test set, and the accuracy, recall rate, precision and mIoU segmentation index of the continuous casting billet defect segmentation model are calculated to verify the performance of the continuous casting billet defect segmentation model, and determine the optimal parameters to obtain a defect detection model; The detection module is used to use the defect detection model to detect the image of the square billet to be detected, obtain a defect mask area generated according to the detection area, perform statistics on the defect mask area to obtain a statistical ratio of the defect area to the billet area, and evaluate the defect level of the square billet to be detected according to the statistical ratio.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the Unet-based continuous casting billet defect detection method described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for detecting defects in continuous casting billets based on Unet as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Image acquisition method and system for improving macroscopic center segregation rating precision of continuous casting billet
CN110705539A
Biomarker prediction system, method and equipment based on Unet model
CN114121226A
Method for detecting and rating internal defects of continuous casting billet based on improved YOLOv5
CN116452505A
Road crack detection method and system based on improved UNet
CN117975427A
