A method and system for detecting straight thread parameters of reinforcing bars based on Mask SD R-CNN
Patent Information
- Application Number
- CN202611264831.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-19
- Publication Date
- 2026-10-13
AI Technical Summary
[0003]但是,现有自动化检测方法仍存在明显短板:传统深度学习模型难以有效融合浅层细粒度定位信息与深层高阶语义信息,导致对螺纹边缘像素的预测质量不足;部分模型(如原始Mask R-CNN、Mask Scoring R-CNN)的分割质量评估分支设计不够完善,在复杂背景下的均交并比、平均精度均值等关键指标有待提升,无法精准量化钢筋直螺纹的直径、螺距、丝头长度等核心合格性参数,难以完全满足现代化建筑工程对检测精度与稳定性的严苛要求
[0015]经由上述的技术方案可知,与现有技术相比,本发明公开提供了一种基于Mask SDR-CNN的钢筋直螺纹参数检测方法及系统,Mask SD R-CNN模型对现有Mask Scoring R-CNN模型进行针对性优化,特别采用DeepLabV3+网络结构重构掩膜交并比分支,通过引入空洞卷积扩大感受野以捕获全局上下文信息,并结合特征级联实现浅层细节与深层语义的高效融合,从而显著提升螺纹分割掩膜的边缘精度与质量评分可靠性。首先通过Mask SD R-CNN模型输出高精度的实例分割结果,进而自动提取螺纹轮廓并转换至物理坐标系,最终计算出直径、螺距及丝头长度等关键几何参数,依据标准公差范围完成合格性自动判定。本发明为钢筋连接件的质量检验提供了一种高效、客观、可靠的自动化解决方案,具有重要的工程应用价值。
Smart Images

Figure CN122906475A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of building engineering quality inspection technology, and more specifically to a method and system for detecting straight thread parameters of reinforcing bars based on Mask SD R-CNN. Background Technology
[0002] Currently, the technology of rolling straight thread on reinforcing bars is a core practical technology in construction projects such as hydropower stations. With its significant advantages such as simplified procedures, shortened construction periods, and reduced construction costs and labor intensity, it occupies an important position in engineering construction. The quality control of the straight threaded sleeves for reinforcing bars is directly related to the overall safety and stability of the project. To address the pain points of low efficiency, poor accuracy, and strong subjectivity in traditional manual inspection tools, automated inspection methods based on computer vision have emerged. Among them, deep learning technologies (such as the R-CNN series and YOLO series) achieve automatic extraction of thread features and parameter measurement through an end-to-end inspection framework, which improves inspection efficiency and objectivity to a certain extent.
[0003] However, existing automated detection methods still have significant shortcomings: traditional deep learning models struggle to effectively integrate shallow, fine-grained localization information with deep, high-order semantic information, resulting in insufficient prediction quality for thread edge pixels; the segmentation quality evaluation branch design of some models (such as the original Mask R-CNN and Mask Scoring R-CNN) is not perfect, and key indicators such as the average intersection-union ratio and average precision in complex backgrounds need improvement, making it impossible to accurately quantify core qualification parameters such as the diameter, pitch, and thread length of straight threads on reinforcing bars, thus failing to fully meet the stringent requirements of modern construction engineering for detection accuracy and stability.
[0004] Therefore, how to propose a method and system for detecting straight thread parameters of reinforcing bars based on Mask SD R-CNN, optimize the edge prediction and segmentation quality assessment effect, and improve the accuracy, repeatability and stability of parameter detection is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] In view of this, the present invention provides a method and system for detecting straight thread parameters of reinforcing bars based on Mask SDR-CNN, which improves the boundary accuracy and quality assessment reliability of the thread segmentation mask.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: On the one hand, this invention proposes a method for detecting straight thread parameters of reinforcing bars based on Mask SD R-CNN, including the following steps: Acquire and preprocess the surface image of the straight thread end of the steel bar to be inspected; A Mask SD R-CNN model is constructed, which includes a feature extraction module, a candidate region generation module, a ROI normalization processing module, and a multi-branch prediction module connected in sequence. The multi-branch prediction module includes a classification branch, a bounding box regression branch, a mask branch, and a mask intersection-over-union branch set in parallel. The preprocessed surface image is input into the Mask SDR-CNN model, which outputs instance segmentation results. Based on the segmentation results of the instance, the edge contour of the straight thread of the rebar is extracted, and the pixel coordinates are converted into physical coordinates according to the camera calibration parameters; Calculate the geometric parameters of the straight thread of the steel bar based on the edge profile in physical coordinates; The geometric parameters are compared with the preset qualified standard range to complete the qualification determination of the straight thread of the steel bar.
[0007] Preferably, the feature extraction module is used to perform multi-scale convolution and feature fusion on the preprocessed image of the straight thread end of the steel bar, and output a multi-scale feature map containing shallow positioning information and deep semantic information. The candidate region generation module scans and generates candidate regions containing the straight thread ends of steel bars based on the multi-scale feature map; The ROI normalization processing module converts candidate regions of different sizes into feature maps of a fixed size. In the multi-branch prediction module, each branch completes feature processing based on the fixed-size feature map.
[0008] Preferably, the fixed-size feature map is simultaneously input into the classification branch, bounding box regression branch, mask branch, and mask intersection-over-union branch for parallel processing; The classification branch is processed by a fully connected layer and a normalized exponential function to output the classification confidence score. The bounding box regression branch is processed based on the Smooth L1 loss function and outputs optimized bounding box parameters; The mask branch is processed using a fully convolutional network to output a pixel-level segmentation mask; The mask cross-union branch is processed by an encoder-decoder architecture based on DeepLabV3+ to output the mask cross-union score.
[0009] Preferably, the final mask quality score is calculated based on the classification confidence level and the mask cross-union score. The segmentation results generated based on the candidate regions are filtered according to the final mask quality score to obtain the filtered segmentation results. For each of the filtered segmentation results, the corresponding optimized bounding box parameters are combined with the pixel-level segmentation mask to output the segmentation result of the straight thread instance of the rebar.
[0010] Preferably, in the mask cross-union branch, the encoder extracts deep features through downsampling, the decoder recovers spatial details through upsampling, and features of different depths are cascaded and fused in between to output the mask cross-union score.
[0011] Preferably, the Mask SDR-CNN model is trained based on a total loss function, wherein the total loss function is... as follows: ; In the formula, Indicates the regional candidate network loss; This represents the loss across multiple branches.
[0012] Preferably, the region candidate network loss The calculation formula is as follows: ; In the formula: Indicates the number of anchor frames; This is the weighting coefficient for the bounding box regression loss, used to balance the magnitudes of the classification loss and the bounding box regression loss. Indicates classification loss; This represents the bounding box regression loss; This represents the probability that the output result of the i-th anchor box is positive. This represents the regression parameters of the i-th anchor box; This represents the true category label corresponding to the i-th anchor box. The value is 1 when the anchor box is a positive sample target and 0 when it is a negative sample. This represents the regression target parameters of the true bounding box corresponding to the i-th anchor box; This indicates the number of valid anchor boxes involved in the bounding box regression loss calculation.
[0013] Preferably, the multi-branch loss The calculation formula is as follows: ; In the formula, Indicates the number of samples involved in the calculation of multi-branch classification loss; This indicates the number of valid samples participating in the calculation of the multi-branch bounding box regression loss. This indicates the number of valid positive samples used in the mask loss calculation. This is the weighting coefficient for the bounding box regression loss, used to balance the magnitudes of the classification loss and the bounding box regression loss in a multi-branch structure. This is the mask branch loss weighting coefficient, used to balance the magnitude of the mask loss and other loss terms; The mask loss is represented by the following formula: ; The cross-union ratio loss of the mask is expressed by the following formula: ; and Let represent the predicted mask matrix and the true mask matrix of the i-th sample, respectively.
[0014] On the other hand, this invention also proposes a rebar straight thread parameter detection system based on Mask SD R-CNN, comprising: The data processing module is used to acquire and preprocess the surface image of the straight thread end of the steel bar to be inspected; The model building module is used to build the Mask SD R-CNN model. The Mask SD R-CNN model includes a feature extraction module, a candidate region generation module, a ROI normalization processing module, and a multi-branch prediction module connected in sequence. The multi-branch prediction module includes a classification branch, a bounding box regression branch, a mask branch, and a mask intersection-over-union branch set in parallel. The model prediction module is used to input the preprocessed surface image into the Mask SDR-CNN model and output the instance segmentation result; The contour extraction module extracts the edge contour of the straight thread of the steel bar based on the instance segmentation result, and converts the pixel coordinates into physical coordinates according to the camera calibration parameters; The geometric parameter acquisition module calculates the geometric parameters of the straight thread of the steel bar based on the edge profile in physical coordinates; The qualification determination module is used to compare the geometric parameters with the preset qualification standard range to complete the qualification determination of the straight thread of the steel bar. The model training module is used to train the Mask SDR-CNN model based on the total loss function, wherein the total loss function is... as follows: ; In the formula, Indicates the regional candidate network loss; This represents the loss across multiple branches.
[0015] As can be seen from the above technical solution, compared with the prior art, this invention discloses a method and system for detecting straight thread parameters of reinforcing bars based on Mask SDR-CNN. The Mask SDR-CNN model is specifically optimized from the existing Mask Scoring R-CNN model, and in particular, it adopts the DeepLabV3+ network structure to reconstruct the mask intersection-over-union branch. By introducing dilated convolution to expand the receptive field to capture global contextual information, and combining feature concatenation to achieve efficient fusion of shallow details and deep semantics, it significantly improves the edge accuracy and quality scoring reliability of the thread segmentation mask. First, the Mask SDR-CNN model outputs high-precision instance segmentation results, then automatically extracts the thread contour and transforms it to the physical coordinate system, and finally calculates key geometric parameters such as diameter, pitch, and thread length, and completes automatic qualification judgment based on standard tolerance range. This invention provides an efficient, objective, and reliable automated solution for the quality inspection of reinforcing bar connectors, and has important engineering application value. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0017] Figure 1 A flowchart of the method provided by the present invention; Figure 2 This is a schematic diagram of the Mask SD R-CNN model structure provided by the present invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] On the one hand, this invention proposes a method for detecting straight thread parameters of reinforcing bars based on Mask SD R-CNN, such as... Figure 1 As shown, it includes the following steps: S1. Acquire and preprocess the surface image of the straight thread end of the steel bar to be inspected.
[0020] S2. Construct the Mask SD R-CNN model, refer to... Figure 2The Mask SDR-CNN model includes a feature extraction module, a candidate region generation module, a ROI normalization processing module, and a multi-branch prediction module connected in sequence. The multi-branch prediction module includes a classification branch, a bounding box regression branch, a mask branch, and a mask intersection-over-union branch set in parallel.
[0021] The feature extraction module performs multi-scale convolution and feature fusion on the preprocessed image of the straight threaded end of the rebar, outputting a multi-scale feature map containing shallow localization information and deep semantic information. In this embodiment, ResNet-FPN is used as the backbone for feature extraction.
[0022] The candidate region generation module scans and generates candidate regions containing the straight thread ends of rebars based on multi-scale feature map scanning. Specifically, it uses RPN (Region Proposal Network) to obtain the ROIs in the multi-scale feature map.
[0023] The ROI normalization module uses RIO pooling to uniformly convert candidate regions of different sizes into feature maps of a fixed size.
[0024] In the multi-branch prediction module, each branch performs feature processing based on a fixed-size feature map, including: The fixed-size feature maps are simultaneously input into the classification branch, bounding box regression branch, mask branch, and mask intersection-union branch for parallel processing. The classification branch is processed by a fully connected layer and a normalized exponential function to output the classification confidence score. The bounding box regression branch is based on the Smooth L1 loss function and outputs optimized bounding box parameters; the position of the candidate region is adjusted by minimizing the absolute error to make it closer to the true bounding box.
[0025] The mask branch is processed using a fully convolutional network to output a pixel-level segmentation mask.
[0026] The mask cross-union branch is processed through an encoder-decoder architecture based on DeepLabV3+, and outputs the mask cross-union score.
[0027] like Figure 2As shown, in the reconstructed mask intersection-over-union branch, the convolutional layer adopts an encoder-decoder structure with added feature concatenation, including an encoder (downsampling) for feature extraction and a decoder (upsampling) for spatial information recovery. In the convolutional layer, dilated convolution increases the receptive field to obtain global contextual information. Feature concatenation acts as a bridge in the branch; the high-resolution information provided by shallow features helps with accurate localization, while the semantic information provided by deep features enhances the understanding of image content. When segmenting complex targets such as forest fires, combining the two improves the mask quality and segmentation confidence, thereby accurately evaluating the quality of target segmentation.
[0028] The Mask SD R-CNN model is trained based on the total loss function. as follows: ; In the formula, Indicates the regional candidate network loss; This represents the loss across multiple branches.
[0029] Preferably, the regional candidate network loss The calculation formula is as follows: ; In the formula: Indicates the number of anchor frames; This is the weighting coefficient for the bounding box regression loss, used to balance the magnitudes of the classification loss and the bounding box regression loss. Indicates classification loss; This represents the bounding box regression loss; This represents the probability that the output result of the i-th anchor box is positive. This represents the regression parameters of the i-th anchor box; This represents the true category label corresponding to the i-th anchor box. The value is 1 when the anchor box is a positive sample target and 0 when it is a negative sample. This represents the regression target parameters of the true bounding box corresponding to the i-th anchor box; This indicates the number of valid anchor boxes involved in the bounding box regression loss calculation.
[0030] The formulas for calculating classification loss and bounding box regression loss are as follows: ; ; In the formula: when hour, ,otherwise, ); , representing the error between the predicted bounding box regression parameters and the true bounding box regression parameters.
[0031] If the intersection-union ratio (IU) between a region of interest and the ground truth label is greater than 0.5, it is considered a positive class; otherwise, it is a negative class. Furthermore, the mask loss and mask IU loss are defined only for positive classes.
[0032] Preferred, multi-branch loss The calculation formula is as follows: ; In the formula, Indicates the number of samples involved in the calculation of multi-branch classification loss; This indicates the number of valid samples participating in the calculation of the multi-branch bounding box regression loss. This indicates the number of valid positive samples used in the mask loss calculation. This is the weighting coefficient for the bounding box regression loss, used to balance the magnitudes of the classification loss and the bounding box regression loss in a multi-branch structure. This is the mask branch loss weighting coefficient, used to balance the magnitude of the mask loss and other loss terms; The mask loss is represented by the following formula: ; The cross-union ratio loss of the mask is expressed by the following formula: ; and Let represent the predicted mask matrix and the true mask matrix of the i-th sample, respectively.
[0033] S3. Input the preprocessed surface image into the Mask SD R-CNN model and output the instance segmentation result.
[0034] The surface image of the straight threaded end of the rebar, after preprocessing such as noise reduction and grayscale adjustment, is input into the constructed Mask SDR-CNN model. The model first extracts multi-scale feature maps through the ResNet-FPN backbone network, and then generates candidate regions (ROIs) containing the straight thread through the Region Proposal Network (RPN). The ROI Align technique is used to standardize candidate regions of different sizes into fixed-size feature maps. Subsequently, the multi-branch prediction module works in parallel: the classification branch outputs the classification confidence of the candidate regions, the bounding box regression branch outputs the optimized bounding box parameters (x, y, w, h), the mask branch outputs the pixel-level segmentation mask, and the reconstructed MaskIoU branch outputs the mask intersection-union score.
[0035] Based on classification confidence Intersection with mask and score The final mask quality score is calculated. The calculation formula is: ; Based on the comparison between the final mask quality score and the preset score threshold, the segmentation results generated based on the candidate regions are filtered to obtain the filtered segmentation results.
[0036] For each filtered segmentation result, the corresponding optimized bounding box parameters are combined with the pixel-level segmentation mask to output the segmentation result of the straight thread instance of the rebar.
[0037] For each high-quality segmentation result retained after filtering, its corresponding optimized bounding box parameters are first extracted. These parameters, output by the model's bounding box regression branch, include the center coordinates (x, y) and width and height dimensions (w, h) of the target region, accurately locating the specific position and overall range of the straight thread in the image. Next, the corresponding pixel-level segmentation mask is extracted, which is a binary image matrix (a pixel value of 1 represents a straight thread pixel, and 0 represents a background pixel), completely presenting the pixel-level outline of the straight thread. The two are then combined, with the optimized bounding box defining the effective range of the segmentation mask, eliminating irrelevant background pixels outside the bounding box. The final output is a segmentation result of a straight thread instance with both accurate positioning and clear outline information. This result can be directly used as the core input data for subsequent edge contour extraction and pixel coordinate to physical coordinate transformation.
[0038] S4. Extract the edge contour of the straight thread of the steel bar based on the instance segmentation results, and convert the pixel coordinates into physical coordinates according to the camera calibration parameters.
[0039] Based on the output instance segmentation results, the pixel-level segmentation mask is first processed: background noise pixels in the mask are removed by morphological opening operations, and then the boundary pixels of the mask are extracted using the Canny edge detection algorithm. Combined with a contour finding algorithm, continuous valid contours are selected. After removing short, interfering contour segments, a smooth and complete straight thread edge contour of the rebar is obtained through polynomial fitting or line / circle fitting optimization. This contour is presented in pixel coordinates. Simultaneously, using pre-completed camera calibration parameters (including camera intrinsic and extrinsic parameters and distortion coefficients), a mapping relationship between image pixels and actual physical dimensions is established. The pixel coordinates of each pixel on the edge contour are converted one by one into corresponding physical coordinates (unit: mm), providing a data foundation for the accurate calculation of subsequent geometric parameters.
[0040] S5. Calculate the geometric parameters of the straight thread of the steel bar based on the edge profile in physical coordinates, including the basic major diameter, basic minor diameter, basic pitch diameter, pitch, and thread length.
[0041] S6. Compare the geometric parameters with the preset qualified standard range to complete the qualification judgment of the straight thread of the steel bar.
[0042] Ablation experiments were conducted in this embodiment. As shown in Table 1, comparisons with recent methods such as QueryInst, PatchDCT, FastIns, and TurboInst revealed that, compared to the best-performing TurboInst, the Mask SD R-CNN model proposed in this embodiment improved detection accuracy (precision, recall, and F1 score) by 0.20, 0.13, and 0.17 percentage points, respectively; and segmentation accuracy (moU and mAP) by 1.24 and 1.21 percentage points, respectively. This further confirms that the network reconstructed using the MaskloU branch with DeepLabv3+ is highly effective for instance segmentation.
[0043] Table 1 Performance Comparison Results of Different Models
[0044] On the other hand, this invention also proposes a rebar straight thread parameter detection system based on Mask SD R-CNN, comprising: The data processing module is used to acquire and preprocess the surface image of the straight thread end of the steel bar to be inspected; The model building module is used to build the Mask SD R-CNN model. The Mask SD R-CNN model includes a feature extraction module, a candidate region generation module, a ROI normalization processing module, and a multi-branch prediction module connected in sequence. The multi-branch prediction module includes a classification branch, a bounding box regression branch, a mask branch, and a mask intersection-over-union branch set in parallel. The model prediction module is used to input the preprocessed surface image into the Mask SDR-CNN model and output the instance segmentation result; The contour extraction module extracts the edge contour of the straight thread of the steel bar based on the instance segmentation results, and converts the pixel coordinates into physical coordinates according to the camera calibration parameters; The geometric parameter acquisition module calculates the geometric parameters of the straight thread of the steel bar based on the edge profile in physical coordinates; The qualification judgment module is used to compare the geometric parameters with the preset qualification standard range to complete the qualification judgment of the straight thread of the steel bar. The model training module is used to train the Mask SDR-CNN model based on the total loss function. as follows: ; In the formula, Indicates the regional candidate network loss; This represents the loss across multiple branches.
[0045] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0046] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting straight thread parameters of reinforcing bars based on Mask SD R-CNN, characterized in that, Includes the following steps: Acquire and preprocess the surface image of the straight thread end of the steel bar to be inspected; A Mask SD R-CNN model is constructed, which includes a feature extraction module, a candidate region generation module, a ROI normalization processing module, and a multi-branch prediction module connected in sequence. The multi-branch prediction module includes a classification branch, a bounding box regression branch, a mask branch, and a mask intersection-over-union branch set in parallel. The preprocessed surface image is input into the Mask SDR-CNN model, which outputs instance segmentation results. Based on the segmentation results of the instance, the edge contour of the straight thread of the rebar is extracted, and the pixel coordinates are converted into physical coordinates according to the camera calibration parameters; Calculate the geometric parameters of the straight thread of the steel bar based on the edge profile in physical coordinates; The geometric parameters are compared with the preset qualified standard range to complete the qualification determination of the straight thread of the steel bar.
2. The method for detecting straight thread parameters of reinforcing bars based on Mask SDR-CNN according to claim 1, characterized in that, The feature extraction module is used to perform multi-scale convolution and feature fusion on the preprocessed image of the straight thread end of the steel bar, and output a multi-scale feature map containing shallow positioning information and deep semantic information. The candidate region generation module scans and generates candidate regions containing the straight thread ends of steel bars based on the multi-scale feature map; The ROI normalization processing module converts candidate regions of different sizes into feature maps of a fixed size. In the multi-branch prediction module, each branch completes feature processing based on the fixed-size feature map.
3. The method for detecting straight thread parameters of reinforcing bars based on Mask SDR-CNN according to claim 2, characterized in that, The fixed-size feature map is simultaneously input into the classification branch, bounding box regression branch, mask branch, and mask intersection-over-union branch for parallel processing. The classification branch is processed by a fully connected layer and a normalized exponential function to output the classification confidence score. The bounding box regression branch is processed based on the Smooth L1 loss function and outputs optimized bounding box parameters; The mask branch is processed using a fully convolutional network to output a pixel-level segmentation mask; The mask cross-union branch is processed by an encoder-decoder architecture based on DeepLabV3+ to output the mask cross-union score.
4. The method for detecting straight thread parameters of reinforcing bars based on Mask SDR-CNN according to claim 3, characterized in that, The final mask quality score is calculated based on the classification confidence score and the mask cross-union score. The segmentation results generated based on the candidate regions are filtered according to the final mask quality score to obtain the filtered segmentation results. For each of the filtered segmentation results, the corresponding optimized bounding box parameters are combined with the pixel-level segmentation mask to output the segmentation result of the straight thread instance of the rebar.
5. The method for detecting straight thread parameters of reinforcing bars based on Mask SDR-CNN according to claim 3, characterized in that, In the mask cross-union branch, the encoder extracts deep features through downsampling, the decoder recovers spatial details through upsampling, and features of different depths are cascaded and fused in between to output the mask cross-union score.
6. The method for detecting straight thread parameters of reinforcing bars based on Mask SDR-CNN according to claim 1, characterized in that, The Mask SDR-CNN model is trained based on the total loss function, where the total loss function is... as follows: ; In the formula, Indicates the regional candidate network loss; This represents the loss across multiple branches.
7. The method for detecting straight thread parameters of reinforcing bars based on Mask SDR-CNN according to claim 6, characterized in that, The regional candidate network loss The calculation formula is as follows: ; In the formula: Indicates the number of anchor frames; This is the weighting coefficient for the bounding box regression loss, used to balance the magnitudes of the classification loss and the bounding box regression loss. Indicates classification loss; This represents the bounding box regression loss; This represents the probability that the output result of the i-th anchor box is positive. This represents the regression parameters of the i-th anchor box; This represents the true category label corresponding to the i-th anchor box. The value is 1 when the anchor box is a positive sample target and 0 when it is a negative sample. This represents the regression target parameters of the true bounding box corresponding to the i-th anchor box; This indicates the number of valid anchor boxes involved in the bounding box regression loss calculation.
8. The method for detecting straight thread parameters of reinforcing bars based on Mask SDR-CNN according to claim 7, characterized in that, The multi-branch loss The calculation formula is as follows: ; In the formula, Indicates the number of samples involved in the calculation of multi-branch classification loss; This indicates the number of valid samples participating in the calculation of the multi-branch bounding box regression loss. This indicates the number of valid positive samples used in the mask loss calculation. This is the weighting coefficient for the bounding box regression loss, used to balance the magnitudes of the classification loss and the bounding box regression loss in a multi-branch structure. This is the mask branch loss weighting coefficient, used to balance the magnitude of the mask loss and other loss terms; The mask loss is represented by the following formula: ; The cross-union ratio loss of the mask is expressed by the following formula: ; and Let represent the predicted mask matrix and the true mask matrix of the i-th sample, respectively.
9. A rebar straight thread parameter detection system based on Mask SD R-CNN, characterized in that, include: The data processing module is used to acquire and preprocess the surface image of the straight thread end of the steel bar to be inspected; The model building module is used to build the Mask SD R-CNN model. The Mask SD R-CNN model includes a feature extraction module, a candidate region generation module, a ROI normalization processing module, and a multi-branch prediction module connected in sequence. The multi-branch prediction module includes a classification branch, a bounding box regression branch, a mask branch, and a mask intersection-over-union branch set in parallel. The model prediction module is used to input the preprocessed surface image into the Mask SDR-CNN model and output the instance segmentation result; The contour extraction module extracts the edge contour of the straight thread of the steel bar based on the instance segmentation result, and converts the pixel coordinates into physical coordinates according to the camera calibration parameters; The geometric parameter acquisition module calculates the geometric parameters of the straight thread of the steel bar based on the edge profile in physical coordinates; The qualification determination module is used to compare the geometric parameters with the preset qualification standard range to complete the qualification determination of the straight thread of the steel bar.
10. A rebar straight thread parameter detection system based on Mask SD R-CNN according to claim 9, characterized in that, It also includes a model training module for training the Mask SDR-CNN model based on a total loss function, wherein the total loss function is... as follows: ; In the formula, Indicates the regional candidate network loss; This represents the loss across multiple branches.