Mandrel crack online detection method based on improved YOLO11n-seg network model
By improving the YOLO11n-seg network model to be adapted to a single channel and introducing G2L-CRM and C3K2-DWR modules, the accuracy and real-time issues in mandrel crack detection were solved, achieving pixel-level segmentation and accurate acquisition of geometric parameters, while reducing computational resource consumption and false detection rate.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-17
AI Technical Summary
Existing mandrel crack detection methods cannot accurately obtain pixel-level segmentation contours, making it difficult to quantitatively assess the geometric parameters of cracks. Furthermore, they are prone to missed detections and false detections in complex backgrounds, failing to meet the real-time requirements of online detection.
The YOLO11n-seg network model was improved to be single-channel adapted. The G2L-CRM and C3K2-DWR modules were introduced to make lightweight structural adjustments, and a training dataset suitable for mandrel cracks was constructed to achieve pixel-level segmentation and geometric parameter calculation of cracks.
It improves the accuracy and real-time performance of mandrel crack detection, reduces computational resource consumption and false detection rate, and can accurately obtain the area, length, maximum width and average width of cracks, meeting the high requirements of online detection.
Smart Images

Figure CN121883406A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of mandrel defect detection technology, specifically to an online mandrel crack detection method based on an improved YOLO11n-seg network model. Background Technology
[0002] In the hot-rolled seamless steel pipe production line, after the round billet is pierced to form a hollow shell, a mandrel needs to be inserted in the mandrel mill to continuously extend the hollow shell and thin the pipe wall. The mandrel is inserted into the inner hole of the hollow shell and plays the role of inner mold and support in the subsequent multi-stand rolling process. The outer dimensions of the mandrel determine the inner diameter and wall thickness reduction of the pipe, while the surface condition of the mandrel directly affects the forming quality and dimensional stability of the inner surface of the steel pipe. It is one of the key factors to ensure the geometric accuracy of the inner hole and the consistency of the wall thickness of the steel pipe.
[0003] In actual production, mandrels serve under harsh conditions of high temperature, strong friction, and repeated cooling for extended periods, continuously enduring complex contact stresses and thermal fatigue loads. Under these conditions, cracks are most likely to initiate and propagate on the mandrel, becoming the main failure mode affecting its service performance and lifespan. Mandrel cracks further propagate under alternating loads during subsequent rolling processes, leading to surface spalling and wear, significantly shortening the actual service life of the mandrel. Simultaneously, the geometric discontinuities at the crack edges, upon repeated contact with the inner wall of the billet, create irregular scratches and grooves on the inner surface of the steel pipe, reducing the quality of the inner surface and, in severe cases, leading to the scrapping of the seamless steel pipe product.
[0004] To address the problem of online detection of mandrel cracks, existing research has employed deep learning-based object detection network models for identification. However, these methods still suffer from the following shortcomings: First, most current mandrel crack detection methods are based on object detection frameworks, which can only output the approximate rectangular location of the crack, failing to obtain precise pixel-level segmentation contours. This makes it difficult to extract geometric parameters such as crack length, area, maximum width, and average width, thus failing to meet the practical needs for quantitative assessment and quality grade determination of mandrel cracks. Second, under the image acquisition conditions of mandrel cracks in hot-rolled seamless steel pipe production sites, the cracks are small in scale and irregular in shape, exhibiting weak texture and low contrast imaging characteristics in the acquired images, making them difficult to distinguish from the background area. Under complex background conditions, missed and false detections of mandrel cracks are prone to occur, affecting the reliability of the detection results. Third, existing YOLO series network models are generally constructed and trained based on three-channel color images, with the input layer designed according to the channel configuration of the color image. When the mandrel crack image is grayscale, continuing to use a three-channel input will introduce redundant channels, increase the computational load of the network, reduce the inference speed, and make it difficult to meet the real-time requirements of online detection while ensuring detection accuracy. Summary of the Invention
[0005] In view of the shortcomings of the prior art, the present invention provides an online detection method for mandrel cracks based on an improved YOLO11n-seg network model. The aim is to achieve fast and high-precision online detection of mandrel cracks while maintaining low model complexity, through feature enhancement, multi-scale feature extraction and model single-channel adaptation improvement. The method can accurately obtain the geometric parameters of crack area, length, maximum width and average width, providing reliable data for subsequent mandrel crack assessment and life prediction.
[0006] The technical solution of this invention is:
[0007] An online detection method for mandrel cracks based on an improved YOLO11n-seg network model, comprising the following steps:
[0008] Step 1: Acquire images of the mandrel while it is running online;
[0009] Step 2: Construct a training set based on the original mandrel images acquired in Step 1;
[0010] Step 3: Improve the existing YOLO11n-seg network model;
[0011] Step 4: Train the improved YOLO11n-seg network model using the training set to obtain the YOLO11n-FGD network model;
[0012] Step 5: Use the YOLO11n-FGD network model to detect mandrel cracks on the hot-rolled seamless steel pipe production line in real time to obtain a crack segmentation mask;
[0013] Step 6: Based on the crack segmentation mask, calculate the area, length, maximum width, and average width of each crack region online and display them in real time.
[0014] Furthermore, according to the online detection method for mandrel cracks, in step 6, the method for constructing the training set in step 2 is as follows: the original mandrel image acquired in step 1 is cropped into several sub-images according to the required size, the sub-images containing cracks are selected, and the cracks on the sub-images containing cracks are annotated at the pixel level to obtain the mandrel crack dataset. Then, a portion of the images is divided from the dataset, and this portion of the images is combined with 1.0-2.0 times the number of the portion of the images containing crack-free mandrel background images to form a training set.
[0015] Furthermore, according to the online detection method for mandrel cracks, in step 6, the improvement of the existing YOLO11n-seg network model mentioned in step 3 includes: adjusting the three-channel input structure of the YOLO11n-seg network model to a single-channel adaptive structure; adjusting the lightweight structural parameters of the YOLO11n-seg network model; encapsulating the multi-expansion rate feature enhancement unit in GL-CRM into a sub-module, then embedding the sub-module into the C2PSA structure to construct the G2L-CRM module, and replacing the C3K2 module in the eighth layer of the backbone network of the YOLO11n-seg network model with the G2L-CRM module; replacing the C2PSA module in the tenth layer of the backbone network of the YOLO11n-seg network model with the C3K2-DWR module.
[0016] Furthermore, according to the online mandrel crack detection method described above, in step 6, adjusting the three-channel input structure of the YOLO11n-seg network model to a single-channel adaptation structure includes:
[0017] During the data configuration phase, the channel dimension of the input image is set to 1. During the data loading phase, ensure that the image is read in grayscale mode. During the data preprocessing and enhancement phase, modify the image normalization and enhancement operations to support only single-channel images, and single-channel data must be used when calculating the mean and standard deviation. During the model structure configuration phase, adjust the number of input channels from 3 to 1. During the task processing phase, check and ensure that the number of input channels of the model is consistent with the channel dimension of the input image. During the training phase, ensure that the number of data channels during training is 1. During the model export phase, modify the width and height of the model input shape to 512, and change the number of channels to 1. During the inference phase, ensure that the mean and standard deviation values consistent with those used during training are used for image normalization.
[0018] Furthermore, according to the online detection method for mandrel cracks, in step 6, the parameter adjustment for the lightweight structure of the YOLO11n-seg network model includes: reducing the stacking times of all C3K2 modules in the neck network from 2 to 1; adjusting the number of output channels of the segmentation head from [32,256] to [16,192]; modifying the input scale configuration from 1024×1024 to 896×896; and in the C3K2 module of the sixth layer of the backbone network, changing the original enabled residual branch to disabled, and adding a channel compression coefficient with a maximum value of 0.25.
[0019] Furthermore, according to the online detection method for mandrel cracks, in step 6, during the training of the improved YOLO11n-seg network model, the processing flow in the G2L-CRM module includes: First, channel mapping is performed on the feature map P5 output from the seventh layer of the backbone network to generate feature map P6; then, based on P6, the following two parallel operations are performed: On the one hand, P6 is processed sequentially through a 3×3 standard convolution and a set of parallel 3×3 dilated convolutions with dilation rates of 1, 2, and 3 respectively, and the resulting feature map is fused with feature map P6. Then, the number of channels is restored to the initial number of channels of P5 through a 1×1 convolution to obtain feature map P7; On the other hand, feature map P6 and feature map P7 are concatenated and channel fusion is performed to finally generate feature map P8.
[0020] Furthermore, according to the online crack detection method for mandrels, in step 6, the crack segmentation mask obtained in real time in step 5 is represented in binary matrix form:
[0021] (1)
[0022] Where H represents the height of the mask image, i.e., the number of pixel rows; and W represents the width of the mask image, i.e., the number of pixel columns. This represents the binary image grayscale value of the mask at the i-th row and j-th column, when... When, the corresponding pixel belongs to the crack area, when At that time, the corresponding pixel belongs to the non-crack area; where The spatial coordinates of the corresponding pixels constitute the crack pixel coordinate set S:
[0023] (2)
[0024] Where S represents the set of coordinates of all pixels belonging to the crack region.
[0025] Furthermore, according to the online detection method for mandrel cracks, in step 6:
[0026] A) For each crack region, the mandrel crack area A, expressed in pixels, is calculated online according to equation (3):
[0027] (3)
[0028] B) Define the length L of the mandrel crack as the span along the column index j direction in the segmentation mask image, i.e., the horizontal direction of the segmentation mask image, and calculate the length L of the mandrel crack in terms of pixels according to Equation (4):
[0029] (4)
[0030] in, and These represent the column coordinates of the two extreme crack pixels in the crack region;
[0031] C) Define the average width of the mandrel crack as the ratio of the crack area to the crack length.
[0032] Furthermore, according to the online mandrel crack detection method described above, in step 6, based on the coordinate set of all pixels belonging to the crack region... The maximum inscribed circle diameter of the crack region defines the maximum width of the crack. Specifically, the boundary of the crack region is first represented as a set of boundary pixel coordinates. For each crack pixel The boundary from the point to the crack region is calculated according to equation (5). Find the minimum Euclidean distance, and define this minimum Euclidean distance as the pixel distance. The corresponding inscribed circle radius, in pixels;
[0033] (5)
[0034] Where k represents the index of the crack pixel, k=1,2,...n, and n is the total number of pixels; b represents the coordinates of the k-th crack pixel in set S; b represents the boundary of the crack region. The coordinates of any pixel; Represents pixels The Euclidean distance between the boundary point b;
[0035] Then, from all the crack pixels The maximum inscribed radius of the crack region is obtained by taking the maximum value among the corresponding inscribed radii. ,Right now The maximum width of the crack is represented by the number of pixels. It is twice the radius of the largest inscribed circle, that is .
[0036] Compared with the prior art, the present invention has the following beneficial effects:
[0037] (1) Improve the accuracy of mandrel crack detection and obtain pixel-level geometric parameters. This invention uses an improved YOLO11n-seg network model to extract pixel-level contours of the mandrel crack region, thereby accurately obtaining the crack boundary information. Based on the mask of the crack region, the geometric parameters of crack area, length, maximum width, and average width are further calculated. This technical improvement enables the crack detection results not only to determine whether a crack exists, but also to quantitatively assess the severity of the crack.
[0038] (2) Optimize the input structure and reduce computational resource consumption. This invention improves the YOLO11n-seg network model through single-channel adaptation from four aspects: single-channel input adaptation, model configuration and training, model derivation, and inference. Through this improvement, redundant color image channels are eliminated, significantly reducing the amount of convolution computation and memory overhead. This not only improves the inference speed of the YOLO11n-seg network model but also effectively reduces computational resource consumption, meeting the high real-time requirements of online detection while ensuring detection accuracy.
[0039] (3) Optimize dataset construction to reduce false detection rate. By adding a background image to the training dataset, this invention enables the YOLO11n-seg network model to fully learn the difference between the background and the crack, avoiding misclassification of normal textures or pseudo-crack textures as crack defects. This improvement effectively reduces the false detection rate, improves the stability of the model under complex backgrounds, and makes the online detection results more reliable.
[0040] (4) Optimization of the YOLO11n-seg network model. This invention adjusts the parameters of the lightweight structure of the YOLO11n-seg network model and introduces G2L-CRM and C3K2-DWR modules to improve the computational efficiency and accuracy of the network model. By replacing the G2L-CRM module to the eighth layer of the YOLO11n-seg network and the C3K2-DWR module to the tenth layer of the YOLO11n-seg network, the improved network model retains important features while reducing unnecessary computation, thereby reducing the complexity and memory consumption of the model. This series of structural optimizations improves the inference speed of the network model, enabling the model to better adapt to the needs of real-time online detection while maintaining high accuracy, and significantly reducing the false negative and false positive rates of mandrel crack detection. Attached Figure Description
[0041] Figure 1 This is a flowchart illustrating the online detection method for mandrel cracks based on the improved YOLO11n-seg network model in this embodiment.
[0042] Figure 2 This is a schematic diagram of the structure of the improved YOLO11n-seg network model in this embodiment;
[0043] Figure 3 This is a schematic diagram of the YOLO11n-seg single-channel adaptation improvement in this embodiment;
[0044] Figure 4 This is a schematic diagram of the G2L-CRM module in this embodiment;
[0045] Figure 5This is a schematic diagram of the C3K2-DWR module in this embodiment;
[0046] Figure 6 The figures shown are online detection results of mandrel cracks in this embodiment. Figures (a), (b), and (c) are online detection results of mandrel cracks for three different samples, respectively. Detailed Implementation
[0047] To facilitate understanding of this application, a more comprehensive description of this application will be provided below with reference to the accompanying drawings.
[0048] The core idea of this invention is as follows: First, the overall structure of the YOLO11n-seg network model is improved by changing it to a single-channel adaptive and optimized lightweight FAST structure. Simultaneously, the eighth and tenth layers of the YOLO11n-seg network backbone are replaced using G2L-CRM and C3K2-DWR modules, respectively. Second, based on online-acquired and pre-processed mandrel crack images with pixel-level annotation, the improved YOLO11n-seg network model is trained to obtain the YOLO11n-FGD network model. Then, the YOLO11n-FGD network model is applied to online detection of mandrel cracks to obtain a crack segmentation mask. Finally, the geometric parameters of the crack region's area, length, maximum width, and average width are obtained using the mask output by the YOLO11n-FGD network and displayed in real time.
[0049] Figure 1 This is a flowchart illustrating the online mandrel crack detection method based on the improved YOLO11n-seg network model in this embodiment. Figure 1 As shown, the online detection method for mandrel cracks based on the improved YOLO11n-seg network model includes the following steps:
[0050] Step 1: Acquire images of the mandrel on the hot-rolled seamless steel pipe production line;
[0051] Given the limited publicly available research on mandrel cracks in seamless steel pipe production and the lack of a unified public dataset, there is a shortage of labeled samples of mandrel cracks and non-crack background features with similar appearances. This fails to meet the requirements for data scale and diversity in online mandrel crack detection tasks. Therefore, this implementation method relies on actual production site image acquisition. Before acquisition, the actual imaging range is calculated based on the mandrel diameter, target detection area, and industrial camera field of view. The installation height between the industrial camera and the mandrel, the number of industrial cameras, and their installation positions are comprehensively determined to ensure that the field of view of each industrial camera covers or partially overlaps the cylindrical surface of the mandrel, guaranteeing that all sides of the mandrel circumference can be imaged. This establishes an image acquisition system suitable for online mandrel detection, obtaining images of the mandrel containing cracked areas and non-crack surface features with similar appearances.
[0052] In this embodiment, to address the online detection requirement for mandrel cracks on a hot-rolled seamless steel pipe production line, a line-scan industrial camera that meets the needs of large-format inspection and high-speed assembly line inspection in industrial production is selected to acquire images of the mandrel in online operation. The industrial cameras are installed at a height of 500mm above the mandrel surface, and four industrial cameras are evenly arranged around the mandrel to achieve full coverage imaging of the mandrel's circumference.
[0053] In this embodiment, the core rod parameters are shown in Table 1, and the camera parameters are shown in Table 2.
[0054] Table 1 Core Rod Parameters
[0055] Table 2 Camera Parameters
[0056] Step 2: Construct training, testing, and validation sets based on the original mandrel images acquired in Step 1;
[0057] Step 2.1: Crop the original mandrel image acquired online in Step 1 into several sub-images according to the required size, and select the sub-images containing cracks from them;
[0058] This implementation performs cropping processing on the original core image obtained in step 1 to construct a data foundation suitable for subsequent annotation and training of the improved YOLO11n-seg network model. Specifically, effective visual regions are extracted from the original image region, and the image is cropped into several core sub-images according to the required size.
[0059] In this embodiment, to balance algorithm efficiency and image accuracy, the resolution of the original mandrel image acquired in step 1 is set to 2048×2048, and it is divided into 16 sub-images with a resolution of 512×512 according to a fixed grid method; then, the images containing cracks and the background images without cracks are distinguished by manual judgment and participate in subsequent steps.
[0060] Step 2.2: Perform pixel-level annotation on the cracks in each sub-image containing cracks to obtain the mandrel crack dataset;
[0061] In order to construct a dataset for the online detection of mandrel cracks using the YOLO11n-seg network model, this step performs pixel-level annotation on the crack-containing images output in step 2.1. Specifically, closed polygonal outlines are drawn along the crack edges on the images, and label files are generated.
[0062] In this embodiment, the image annotation tool Labelme is used to annotate each of the 512×512 sub-images containing cracks obtained in step 2. Annotators click sequentially along the actual edges of the cracks, forming closed polygons to accurately delineate the crack area. The annotation software then generates a corresponding JSON format annotation file. This JSON format annotation file is subsequently converted into a TXT mask annotation format recognizable by the YOLO11n-seg network, i.e., a normalized polygon vertex coordinate representation.
[0063] Step 2.3: Divide the images in the mandrel crack dataset into two parts according to a certain ratio. Combine one part of the images with 1.0-2.0 times the number of crack-free mandrel background images in that part to form a training set. Combine the other part of the images with 1.0-2.0 times the number of crack-free mandrel background images in that part to form a validation set. Also combine the other part of the images with 5-20 times the number of crack-free mandrel background images in that part to form a test set.
[0064] In this embodiment, the mandrel crack dataset obtained in step 2.2, constructed from labeled mandrel images containing cracks, is divided to meet the needs of deep learning model training, validation, and evaluation. Specifically, the mandrel crack dataset is divided into a training set, a validation set, and a test set. The training set is used to learn the parameters of the improved YOLO11n-seg network model, the validation set is used to evaluate model performance and assist in hyperparameter tuning during training, and the test set is used to independently evaluate the model's generalization detection capability after training. In this embodiment, the dataset composed of labeled mandrel images containing cracks is divided into the training set and the validation set in an 8:2 ratio, with the same crack images used in the test set. Furthermore, background images, each 1.0 times the number of crack images, are added to the training set and the validation set, respectively, while background images, each 15 times the number of crack images, are added to the test set to construct a dataset for model training, validation, and generalization performance evaluation.
[0065] Step 3: Improve the existing YOLO11n-seg network model;
[0066] Figure 2 To improve the structure of the YOLO11n-seg network model, with layers numbered starting from 0, this implementation improves and optimizes the structure of the YOLO11n-seg network model as follows: First, the three-channel input structure of the YOLO11n-seg network model is adjusted to a single-channel adaptive structure; then, lightweight structural parameters of the YOLO11n-seg network model are adjusted; simultaneously, in the backbone network, the C3K2 module in the eighth layer is replaced with the G2L-CRM module, and the C2PSA module in the tenth layer is replaced with the C3K2-DWR module.
[0067] (A) such as Figure 3 As shown, the process of single-channel adaptation of the YOLO11n-seg network model includes:
[0068] (1) Single-channel input adaptation: In the data configuration stage, the channel dimension of the input image is set to 1 (i.e., a single-channel grayscale image) to ensure that the input data matches the subsequent model structure; in the data loading stage, the image is read in grayscale mode; in the data preprocessing and enhancement stage, the image normalization and enhancement operations are modified to support only single-channel images, and single-channel data must be used when calculating the mean and standard deviation. The mean is the average pixel value. The standard deviation is used to measure the dispersion of the data distribution.
[0069] (2) Model configuration and training: In the model structure configuration stage, the number of input channels is adjusted from 3 to 1; in the task processing stage, check and ensure that the number of input channels of the model is consistent with the channel dimension of the input image; in the training stage, ensure that the number of data channels during the training process is 1.
[0070] (3) Model export: During the model export stage, the width and height of the model input shape are modified to 512, and the number of channels is changed to 1. During the pre-export check, the input shape is confirmed to be (batch,1,512,512), where batch is the batch size. In this embodiment, batch=16, 1 represents a single channel, and 512 is the height and width of the image.
[0071] (4) Model Inference: During the inference phase, ensure that the mean and standard deviation are consistent with those used during training for image normalization. Normalization refers to converting the pixel values of the image to a standard range by subtracting the mean and dividing by the standard deviation. During validation, check the format, number of channels, and normalization parameters of the input image to ensure consistency with those used during training.
[0072] (B) Parameter adjustments to the lightweight structure of the YOLO11n-seg network model's backbone, neck network, and segmentation head include: reducing the stacking times of all C3K2 modules in the neck network from 2 to 1; adjusting the number of output channels in the segmentation head from [32,256] to [16,192]; changing the input scale configuration from 1024×1024 to 896×896; and disabling the residual branch in the C3K2 module of the sixth layer of the backbone network, and adding a channel compression coefficient with a maximum value of 0.25, i.e., compressing it to a maximum of one-quarter of the original number of channels. The residual branch refers to a bypass structure that adds the input features of this layer to the output of the convolutional branch after applying an identity mapping or linear transformation, used to alleviate gradient vanishing and improve the stability of network training. Based on the above improved YOLO11n-seg network model, it is named the Lightweight FAST architecture.
[0073] (C) This implementation method draws on the idea of multi-dilation rate convolution in the Global-to-Local Controllable Receptive Module (GL-CRM), such as... Figure 4 As shown, the multi-expansion rate feature enhancement unit in GL-CRM is encapsulated as a sub-module, and then the sub-module is embedded into the C2PSA structure to construct a global to local controllable receptive field module, denoted as G2L-CRM module. The eighth layer C3K2 module of the YOLO11n-seg backbone network is replaced by the G2L-CRM module.
[0074] (D) Replace the C2PSA module in the tenth layer of the backbone network of the YOLO11n-seg network model with the C3K2-DWR module: e.g. Figure 5 As shown, this invention employs the C3K2-DWR module in the backbone network to enhance the characterization capability of multi-scale textures in mandrel cracks. Specifically, the C3K2-DWR uses a dual-branch feature aggregation and splicing fusion architecture, and replaces the original bottleneck sub-modules in the backbone branches with Dilation-Wise Residual Units (DWRs) divided according to the expansion rate.
[0075] Step 4: Train the improved YOLO11n-seg network model using the training set to obtain the YOLO11n-FGD network model;
[0076] In this embodiment, when training the improved YOLO11n-seg network model using the training set, the training epochs are set to 200, the input image size is 512×512, the number of channels is 1, the batch size is 16, and no pre-trained weights are loaded.
[0077] During the training of the improved YOLO11n-seg network model, the P5 feature map output from the seventh layer of the backbone network was used as the input to the G2L-CRM module. The P5 feature map was obtained by sequentially downsampling the 512×512×1 core image of the input improved YOLO11n-seg network model through five convolutions with a stride of 2, compressing the spatial size to 16×16 and the number of channels to 1024.
[0078] like Figure 4 As shown, during the training of the improved YOLO11n-seg network model, the processing flow in the G2L-CRM module includes: First, the input P5 feature map is channel-mapped using a 1×1 convolutional channel rearrangement unit, changing the number of channels from 1024 to 2048, resulting in feature map P6; subsequently, the following two parallel operations are performed based on P6:
[0079] On one hand, feature map P6 is first processed through a 3×3 standard convolution, and then the processed feature map is input into a dilated bottleneck unit. In this unit, three different dilation rates of 1, 2, and 3 are used to perform parallel convolution operations on the input feature map. The dilation rates are denoted as follows: =1、 =2 and =3. Wherein, the expansion ratio... For a smaller receptive field, the focus is more on depicting fine cracks and local textures on the mandrel surface; expansion rate Corresponding to a medium receptive field, it is used to characterize crack segments and their surrounding context within a certain range; expansion rate A larger receptive field is beneficial for capturing global structural features and background change information on the mandrel surface. The feature map output by the dilated convolution bottleneck unit is then fused with feature map P6 through a feature fusion unit, and then restored to 1024 channels through a 1×1 convolutional channel mapping unit to obtain feature map P7.
[0080] On the other hand, after concatenating feature maps P6 and P7 in the feature concatenation unit, the number of channels is 3072. Finally, channel fusion is completed through a 1×1 convolutional fusion unit, reducing the number of channels to 1024, resulting in feature map P8. Thus, the multi-dilation rate feature enhancement unit of GL-CRM is naturally embedded into the C2PSA structure of the YOLO11n-seg backbone network to form the G2L-CRM module.
[0081] like Figure 5 As shown, in the training process of the improved YOLO11n-seg network, the processing flow in the C3K2-DWR module includes: the input feature map P9 first passes through a 1×1 convolutional channel mapping unit to complete channel mapping, resulting in feature map P10; subsequently, P10 serves as the input to the multi-branch dilated convolutional enhancement unit DWR, undergoing multi-branch dilated convolution and residual fusion to obtain an enhanced feature map, which then participates in subsequent feature concatenation. DWR employs a residual structure, consisting of a transformation branch and an identity branch: in the transformation branch, the input feature map first passes through a 3×3 convolutional dimensionality reduction unit to compress the channel dimensions, and then enters in parallel three 3×3 convolutional branches with different dilation rates of 1, 3, and 5, respectively, to construct a multi-scale receptive field. The branch with a dilation rate of 1 focuses on characterizing fine cracks and local texture information, the branch with a dilation rate of 3 is used to capture medium-scale crack fragments and their neighborhood structures, while the branch with a dilation rate of 5 helps to perceive a wider range of background changes and macroscopic morphological features. In the DWR transform branch, features from different dilation rate branches are concatenated along the channel dimension in the multi-scale feature concatenation unit, and channel integration is completed by a 1×1 convolutional fusion unit. In the identity branch, the input feature map is directly retained without undergoing the above convolutional calculation. Finally, the residual addition unit adds the enhanced fused features of the transform branch to the input features of the identity branch element-wise, obtaining the output feature map of the DWR multi-branch dilated convolutional enhancement unit. Ultimately, feature map P10 and the output feature map of the DWR multi-branch dilated convolutional enhancement unit are concatenated in the multi-path feature concatenation unit, and feature fusion and mapping are completed by a 1×1 convolutional fusion mapping unit, outputting the final enhanced feature map. Through this design, the C3K2-DWR module achieves multi-dilation rate feature enhancement and multi-path information fusion while maintaining structural efficiency, effectively improving the modeling ability of high-level features for complex crack morphology and multi-scale contextual information.
[0082] Step 5: Use the YOLO11n-FGD network model to detect mandrel cracks on the hot-rolled seamless steel pipe production line in real time to obtain a crack segmentation mask;
[0083] In this embodiment, the YOLO11n-FGD network model is specifically deployed on a production line inspection computer that is paired with an industrial camera. The inspection computer sends each received frame of image to the YOLO11n-FGD network model for inspection, and the YOLO11n-FGD network model outputs the bounding rectangle of the crack and a pixel-level segmentation mask.
[0084] Step 6: Based on the obtained crack segmentation mask, calculate the area, length, maximum width and average width of the corresponding crack for each crack region online and display them in real time.
[0085] This implementation performs geometric analysis on the crack segmentation mask region output by the YOLO11n-FGD network model to extract the crack area, length, maximum width, and average width. Specifically:
[0086] First, the obtained crack segmentation mask, i.e., the binary mask, is... Represented in binary matrix form:
[0087] (1)
[0088] Where H represents the height of the mask image, i.e., the number of pixel rows; and W represents the width of the mask image, i.e., the number of pixel columns. This represents the binary image grayscale value of the mask at the i-th row and j-th column, where i is the row index (vertically increasing from top to bottom) and j is the column index (horizontally increasing from left to right). When, the corresponding pixel belongs to the crack area, when At that time, the corresponding pixel belongs to the non-crack area;
[0089] Then, a connected component analysis is performed on the binary mask M, and the set of crack pixel coordinates S shown in equation (2) is constructed based on the spatial coordinates of the pixels with a value of 1 in the mask:
[0090] (2)
[0091] Where S represents the set of coordinates of all pixels belonging to the crack region; the definitions of i,j in equation (2) are consistent with those in equation (1).
[0092] Then, based on the binary mask M and the corresponding crack pixel coordinate set S obtained from the above definition, a geometric analysis is further performed on the crack region to calculate the area, length, maximum width, and average width of the mandrel crack, specifically:
[0093] In this embodiment, the area A of the mandrel crack is defined as the number of crack pixels in the binary mask M, i.e., the number of pixels with a value of 1. According to equation (3), by... The area A of the mandrel crack, expressed as the number of pixels, can be obtained by summing the pixels:
[0094] (3)
[0095] In this embodiment, the length L of the mandrel crack is defined as the span along the column index j direction in the segmentation mask image, that is, the horizontal direction of the segmentation mask image. The length L of the mandrel crack, expressed in terms of the number of pixels, can be calculated according to equation (4):
[0096] (4)
[0097] in, Represents the column coordinates of the rightmost crack pixel in the crack region; This represents the column coordinates of the leftmost crack pixel in the crack region.
[0098] This implementation method calculates the maximum width of the mandrel crack. The process includes: obtaining the set of pixel coordinates corresponding to the crack connected region. Then, the maximum width of the crack is defined based on the diameter of the largest inscribed circle in the region. Specifically, the boundary of the crack region is represented as a set of boundary pixel coordinates. For each crack pixel The boundary from the point to the crack region is calculated according to equation (5). Find the minimum Euclidean distance, and define this minimum Euclidean distance as the pixel distance. The corresponding inscribed circle radius, in pixels;
[0099] (5)
[0100] Where k represents the index of the crack pixel, k=1,2,...n, and n is the total number of pixels; b represents the coordinates of the k-th crack pixel in set S; b represents the boundary of the crack region. The coordinates of any pixel; Represents pixels The Euclidean distance between the boundary point b; The set of pixel coordinates representing the boundary of the crack region; min represents the minimum value;
[0101] Then, from all the crack pixels The maximum inscribed radius of the crack region is obtained by taking the maximum value among the corresponding inscribed radii. ,Right now The maximum width of the crack is represented by the number of pixels. Defined as twice the radius of the largest inscribed circle, i.e. ;
[0102] The crack is elongated in shape, and its area can be approximated as the product of its length and average width. The crack area has already been determined. With crack length Based on this, the average width of the mandrel crack is represented by the number of pixels. Defined as the ratio of the area to the length of the crack.
[0103] The aforementioned geometric parameters, combined with the segmentation results of this invention, enable a quantitative assessment of the area, length, maximum width, and average width morphological characteristics of the mandrel crack. For example... Figure 6 As shown, Figures (a), (b), and (c) are the detection results for three different samples. It should be noted that... Figure 6 The physical unit is obtained by multiplying the number of pixels by the physical size corresponding to each pixel.
[0104] To verify the effectiveness and accuracy of the YOLO11n-FGD network model in online mandrel crack detection, multiple metrics were selected to evaluate the model performance, including:
[0105] 1. Four accuracy metrics, mAP@0.5(bbox), mAP@0.5(mask), mAP@0.5:0.95(bbox), and mAP@0.5:0.95(mask), were used to evaluate the detection and segmentation performance. mAP is the average average of the average precision for each category at a given Intersection over Union (IoU) threshold. When the IoU threshold between the foreground and ground truth bounding boxes is set to 0.5, the average precision calculated using the bounding boxes is denoted as mAP@0.5 (bbox). Under the same threshold, the average precision calculated using the segmentation mask is denoted as mAP@0.5(mask). The accuracy of the crack region segmentation results is reflected by comparing the overlap between the predicted mask and the labeled mask. Furthermore, within the IoU range of 0.5 to 0.95, multiple thresholds were sequentially selected with a step size of 0.05 (0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95). The mAP of the bounding box or mask was calculated at each threshold, and then these values were averaged to obtain mAP@0.5:0.95, which are mAP@0.5:0.95(bbox) and mAP@0.5:0.95(mask) in this paper. This set of metrics is used to comprehensively evaluate the overall performance of the model in object detection and region segmentation under different overlap requirements and different levels of strictness.
[0106] 2. The scale of the network and the overhead of the model in terms of storage and deployment are characterized by Parameters (M), which is the total number of trainable parameters of the model (in millions).
[0107] 3. The GFLOPs (giga floating-point operations) required for the model to complete one forward inference are used to quantify the computational complexity of the model and its hardware computing power requirements.
[0108] 4. The FPR (False Positive Rate) index, calculated as Equation (6), is used to reflect the false alarm level of the model on the mandrel background image. The lower the value, the fewer false alarms.
[0109] (6)
[0110] FP (False Positive) represents the number of images that are incorrectly identified as having cracks when they do not contain cracks, and TN (True Negative) represents the number of images that are correctly identified as having no cracks.
[0111] 5. The FNR (False Negative Rate) index, calculated as Equation (7), is used to characterize the model's failure to detect real cracks. The lower the value, the fewer the failures.
[0112] (7)
[0113] Here, FN (False Negative) represents the number of images containing cracks that are misclassified as not containing cracks, and TP (TruePositive) represents the number of images that are correctly detected as containing cracks.
[0114] 6. The FPS (Frames Per Second) index, calculated as Equation (8), is used to characterize the real-time processing capability that the model can achieve in practical applications. The larger the value, the better the real-time performance.
[0115] (8)
[0116] This represents the number of image frames the model can process per second under the current hardware conditions and inference configuration. Speed is the average time, in milliseconds, for the model to complete one forward inference for a single image under the same hardware environment.
[0117] This implementation method is based on the dataset and the training strategy determined in step 4. The experiment is conducted in a Windows operating system environment. The computing platform used supports CUDA parallel computing. The hardware platform is configured with a 13th Gen Intel Core i9-13900K processor, 128GB of physical memory, and an NVIDIA GeForce RTX 4080 graphics card.
[0118] Under the aforementioned experimental environment and training configuration, comparative experiments were conducted on various network models to verify the effectiveness and performance advantages of the proposed YOLO11n-FGD network model in mandrel crack detection. The comparative experiments mainly included: the original three-channel input YOLO11n-seg network model, the YOLO11n-seg network model adapted to a single channel, and the YOLO11n-FGD network model. The original three-channel input YOLO11n-seg network model corresponds to YOLO11n(3ch) in Tables 3 and 4, while the YOLO11n-seg network model adapted to a single channel corresponds to YOLO11n(1ch) in Tables 3 and 4.
[0119] Table 3 Comparative Experiment Results 1
[0120] Table 4 Comparative Experiment Results II
[0121] As shown in Tables 3 and 4, although the false positive rate (FPR) of the YOLO11n-FGD network model is slightly higher than that of the original YOLO11n-seg network model based on three-channel input, YOLO11n-FGD outperforms the original YOLO11n-seg network model in all other metrics, and its inference speed (FPS) reaches 195.45, demonstrating higher online real-time inference capability. Compared to other models, YOLO11n-FGD achieves a better balance between the accuracy of mandrel crack detection and the inference speed of online detection. Therefore, while maintaining a low false positive rate, the method of this invention effectively improves the online detection speed and accuracy of mandrel cracks by reducing the number of model parameters and computational overhead, significantly reducing the false negative rate, and balancing high accuracy and high real-time performance.
Claims
1. A method for on-line detection of a core rod crack based on an improved YOLO11n-seg network model, characterized in that, The method includes the following steps: Step 1: Acquire images of the mandrel while it is running online; Step 2: Construct a training set based on the original mandrel images acquired in Step 1; Step 3: Improve the existing YOLO11n-seg network model; Step 4: Train the improved YOLO11n-seg network model using the training set to obtain the YOLO11n-FGD network model; Step 5: Use the YOLO11n-FGD network model to detect mandrel cracks on the hot-rolled seamless steel pipe production line in real time and obtain a crack segmentation mask; Step 6: Based on the crack segmentation mask, calculate the area, length, maximum width, and average width of each crack region online and display them in real time.
2. The method of claim 1, wherein The method for constructing the training set in step 2 is as follows: the original mandrel image collected in step 1 is cropped into several sub-images according to the required size, the sub-images containing cracks are selected, and the cracks on the sub-images containing cracks are annotated at the pixel level to obtain the mandrel crack dataset. Then, a portion of the images is divided from this dataset, and this portion of the images is combined with 1.0-2.0 times the number of the portion of the images of the mandrel background images without cracks to form the training set.
3. The method of claim 1, wherein Step 3 describes the improvement of the existing YOLO11n-seg network model, including: adjusting the three-channel input structure of the YOLO11n-seg network model to a single-channel adaptive structure; adjusting the lightweight structural parameters of the YOLO11n-seg network model; encapsulating the multi-expansion rate feature enhancement unit in GL-CRM into a sub-module, then embedding this sub-module into the C2PSA structure to construct the G2L-CRM module, and replacing the C3K2 module in the eighth layer of the backbone network of the YOLO11n-seg network model with the G2L-CRM module; and replacing the C2PSA module in the tenth layer of the backbone network of the YOLO11n-seg network model with the C3K2-DWR module.
4. The method of claim 3, wherein The adjustment of the three-channel input structure of the YOLO11n-seg network model to a single-channel adaptation structure includes: During the data configuration phase, the channel dimension of the input image is set to 1. During the data loading phase, ensure that the image is read in grayscale mode. During the data preprocessing and enhancement phase, modify the image normalization and enhancement operations to support only single-channel images, and single-channel data must be used when calculating the mean and standard deviation. During the model structure configuration phase, adjust the number of input channels from 3 to 1. During the task processing phase, check and ensure that the number of input channels of the model is consistent with the channel dimension of the input image. During the training phase, ensure that the number of data channels during training is 1. During the model export phase, modify the width and height of the model input shape to 512, and change the number of channels to 1. During the inference phase, ensure that the mean and standard deviation values consistent with those used during training are used for image normalization.
5. The method of claim 3, wherein the step of detecting the crack in the mandrel is performed by using a laser. The lightweight structural parameter adjustments to the YOLO11n-seg network model include: reducing the stacking times of all C3K2 modules in the neck network from 2 to 1; adjusting the number of output channels of the segmentation head from [32,256] to [16,192]; changing the input scale configuration from 1024×1024 to 896×896; and disabling the residual branch in the C3K2 module of the sixth layer of the backbone network, and adding a channel compression coefficient with a maximum value of 0.
25.
6. The method of claim 3, wherein the step of detecting the crack in the mandrel is performed by using a laser. During the training of the improved YOLO11n-seg network model, the processing flow in the G2L-CRM module includes: First, channel mapping is performed on the feature map P5 output from the seventh layer of the backbone network to generate feature map P6; then, based on P6, the following two parallel operations are performed: On the one hand, P6 is processed sequentially through a 3×3 standard convolution and a set of parallel 3×3 dilated convolutions with dilation rates of 1, 2, and 3 respectively. After fusing the resulting feature map with feature map P6, the number of channels is restored to the initial number of channels of P5 through a 1×1 convolution to obtain feature map P7; on the other hand, feature map P6 and feature map P7 are concatenated and channel fusion is performed to finally generate feature map P8.
7. The method of claim 1, wherein The crack segmentation mask obtained from real-time detection in step 5 is represented in binary matrix form: (1) Wherein, H represents the height of the mask image, that is, the number of pixel rows; W represents the width of the mask image, that is, the number of pixel columns; represents the binary image gray value of the mask at the i-th row and the j-th column, when the corresponding pixel belongs to the crack region, when the corresponding pixel belongs to the non-crack region; wherein The spatial coordinates of the corresponding pixel points form a crack pixel coordinate set S: (2) Where S represents the set of coordinates of all pixels belonging to the crack region.
8. The method of claim 7, wherein the step of detecting the crack in the mandrel is performed on-line. In step 6: A) For each crack region, the mandrel crack area A, expressed in pixels, is calculated online according to equation (3): (3) B) Define the length L of the mandrel crack as the span along the column index j direction in the segmentation mask image, i.e., the horizontal direction of the segmentation mask image, and calculate the length L of the mandrel crack in terms of pixels according to Equation (4): (4) wherein, and respectively represent the column coordinates of the two extreme crack pixel points in the crack region. C) Define the average width of the mandrel crack as the ratio of the crack area to the crack length.
9. The online detection method for mandrel cracks according to claim 7, characterized in that, In step 6, the maximum inscribed circle diameter of the crack region is defined as the maximum width of the crack, specifically, the boundary of the crack region is first expressed as a set composed of boundary pixel coordinates The maximum inscribed circle diameter of the crack region is defined as the maximum width of the crack, specifically, the boundary of the crack region is first expressed as a set composed of boundary pixel coordinates For each crack pixel point , the minimum Euclidean distance of the point to the boundary of the crack region is calculated according to formula (5) , and the minimum Euclidean distance is defined as the corresponding inscribed circle radius of the pixel point , in units of pixel numbers; (5) Where k represents the index of the crack pixel, k=1,2,...n, and n is the total number of pixels; b represents the coordinates of the k-th crack pixel in set S; b represents the boundary of the crack region. The coordinates of any pixel; Represents pixels The Euclidean distance between the boundary point b; Then, from all the crack pixels The maximum inscribed radius of the crack region is obtained by taking the maximum value among the corresponding inscribed radii. ,Right now The maximum width of the crack is represented by the number of pixels. It is twice the radius of the largest inscribed circle, that is .