CN-122024000-A - Improved Faster R-CNN underground drainage pipeline defect detection model
Abstract
The invention discloses an improved fast R-CNN underground drainage pipeline defect detection model, which particularly relates to the field of target detection, and comprises the steps of firstly constructing a defect image data set, extracting a defect-containing image from pipeline detection images, dividing the defect-containing image into a training set, a verification set and a test set according to preset proportions after validity screening and defect category marking, secondly improving the detection model, replacing a traditional area proposal module with an anchor-free detection head, embedding an attention module at a high layer of a backbone network, simultaneously introducing a characteristic pyramid network to generate multi-scale characteristics, then executing multi-image spliced data enhancement on the training set, adopting an optimizer and two-stage loss function training, combining an early stop strategy to store optimal weights, finally evaluating the model, inputting the test set to acquire detection results, counting related detection data and calculating accuracy indexes, comparing the accuracy indexes with preset thresholds to judge whether the model meets the standards, and the method has high detection accuracy and strong suitability and meets the pipeline defect detection requirements.
Inventors
- WU QIANJIAO
- ZHANG TING
- XIE HUAMING
- XIE LIHANG
- WANG JIUHUI
- ZHAI MENGYU
- DAI ZHIGUO
Assignees
- 安徽建筑大学
Dates
- Publication Date
- 20260512
- Application Date
- 20251028
Claims (9)
- 1. An improved Faster R-CNN underground drainage and sewage pipeline defect detection model is characterized by comprising the following steps: the method comprises the steps of S1, constructing a pipeline defect image data set, namely extracting images containing defects from a pipeline detection video, screening and removing invalid images, marking the screened images in defect categories, and dividing the images into a training set, a verification set and a test set according to a preset proportion in a layering manner, wherein the training set, the verification set and the test set are respectively used for model parameter learning, super parameter adjustment and generalization capability assessment; S2, improving Fcos FR-CNN model, namely building backbone network based on standard Faster R-CNN model, replacing traditional RPN structure with FcosHead without anchor frame containing three parallel branches of classification, regression and centrality, embedding CBAM attention module at high-level characteristic output end of backbone network, strengthening defect characteristic by channel dimension characteristic weighting and space dimension characteristic weighting in sequence, introducing FPN characteristic pyramid network, generating multi-scale characteristic pyramid by fusing multi-level characteristic of backbone network, and adapting to defect detection of different sizes; S3, training the improved model, namely performing Mosaic data enhancement on the training set image, and synchronously adjusting corresponding defect labels, and training the model based on the enhanced training set image and the corresponding label frame; And S4, evaluating the performance of the model, namely loading the weight of the optimal model obtained by training, inputting an unreinforced test set image into the model, carrying out feature extraction, frame generation and filtering, defect finishing, outputting a detection result, counting true positive, false positive and false negative detection results, calculating the precision, recall ratio, single-class average precision and average precision mean value, and judging that the model meets the standard when the preset precision threshold value is met.
- 2. The improved Faster R-CNN subsurface drainage and sewer pipeline defect detection model of claim 1, wherein said constructing a pipeline defect image dataset comprises: Extracting image frames from a pipeline detection video according to fixed intervals to obtain original image data, screening the images according to definition quantization indexes, reserving gradient variance standard-reaching images to eliminate fuzzy frames, eliminating images with no defects or defects with the proportion lower than a preset value, removing repeated images through a hash algorithm, finally uniformly scaling the screened images to a fixed size, defining multiple types of defects according to pipeline defect standards, randomly extracting marking data to carry out cross check on defect marking types and boundary frame information in the screened images, correcting the problems of wrong marking, missing marking and boundary frame offset, and dividing the marked data according to a hierarchical sampling method according to the proportion of 8:1:1 to ensure that the defect type distribution of each subset is consistent with the total data set to form a training set, a verification set and a test set.
- 3. The improved Faster R-CNN underground drainage and sewage pipeline defect detection model according to claim 1, wherein FcosHead of the anchor-free frame replaces a traditional RPN structure, and the model comprises the following steps: in a basic two-stage detection framework, building FcosHead of an anchor-free frame based on characteristics output by a backbone network and a multi-scale characteristic diagram generated by FPN to replace a traditional regional proposal network RPN; FcosHead setting three parallel branches, namely extracting characteristics by convolution of a classification branch, predicting defect type probability of each pixel of a characteristic image by adopting a preset loss function, predicting the distance from the pixel to a defect boundary frame by adopting the preset loss function by a regression branch, evaluating whether the pixel is positioned in a defect center area by adopting the preset loss function by a centrality branch, and filtering a boundary low-quality proposal frame; and (3) adjusting model training and test configuration, enabling the proposal frame generated by FcosHead to be directly input into the ROI head of the frame, and executing region-of-interest clipping, feature pooling, classification and regression refinement on the proposal frame by the ROI head to form a two-stage collaborative detection architecture of anchor-free frame proposal and high-precision refinement.
- 4. The improved Faster R-CNN subsurface drainage and sewer pipeline defect detection model of claim 1, wherein said embedded CBAM attention module comprises: inserting CBAM a attention module at a high-level feature output end of the backbone network, wherein the module comprises a channel attention sub-module and a space attention sub-module; the channel attention sub-module respectively executes global average pooling and global maximum pooling on the input feature images to obtain two feature vectors, generates a channel weight image through shared full-connection layer weighted fusion, and performs channel dimension weighting on the feature images; The space attention sub-module performs average pooling and maximum pooling on the feature map weighted by the channel along the channel dimension to obtain two feature vectors, generates a space weight map through convolution compression after splicing, and performs space dimension weighting on the feature map; And inputting the feature map weighted by the channel and the space into a subsequent feature pyramid network, and strengthening the transmission and expression of the defect features.
- 5. The improved Faster R-CNN subsurface drainage and sewer pipeline defect detection model of claim 1, wherein said introducing a FPN feature pyramid network comprises: acquiring a multi-level feature map processed by a attention module of a backbone network, wherein the multi-level feature map comprises shallow high-resolution low-semantic features and deep low-resolution high-semantic features; The multi-stage feature map is subjected to transverse connection operation, namely the channel number of each shallow feature map is compressed to a preset unified value through convolution, and the channel number is matched with the channel number of the deep feature map after the subsequent up-sampling; Performing top-down fusion operation, namely starting from the deepest layer feature map, matching the size with the corresponding shallow layer feature map through up-sampling by 2 times, and sequentially fusing the shallow layer feature map with the shallow layer feature map subjected to transverse connection processing to generate an initial multi-scale feature map; Performing downsampling on the deepest feature map to generate an additional feature layer, and forming a pyramid structure containing multi-level features together with the initial multi-scale feature map to cover the defect detection requirements of different sizes; And performing convolution smoothing processing on each feature layer in the pyramid structure, eliminating the up-sampling aliasing effect, and respectively inputting the processed multi-scale feature images into an anchor-frame-free detection head and an ROI head.
- 6. The improved Faster R-CNN subsurface drainage and sewer pipeline defect detection model of claim 1, wherein said performing a Mosaic data enhancement on training set images comprises: The method comprises the steps of selecting a preset number of images randomly from a training set when training data are loaded in each batch, performing geometric transformation on each selected image respectively, randomly zooming according to a preset proportion range, then cutting the images to a uniform size, splicing the cut images according to preset grid arrangement to form a single composite training image, adjusting the coordinates of a defect marking frame corresponding to each original image according to the splicing position, enabling the marking frame to adapt to a composite image coordinate system, combining to obtain complete defect marking information of the composite image, and completing Mosaic enhancement to simulate a complex scene with multiple defects coexisting.
- 7. The improved Faster R-CNN subsurface drainage and sewer pipeline defect detection model according to claim 1, wherein said model is trained and comprises: Configuring training super parameters, including an optimizer, an initial learning rate and a learning rate scheduling strategy, and setting training total rounds and early-stop triggering conditions; extracting basic features through a backbone network, inputting a feature pyramid network to generate multi-scale features after strengthening by an attention module, generating an initial proposal frame by an anchor-frame-free detection head, and finally finishing the ROI head to obtain a detection result; Calculating two-stage loss, namely, classifying loss, regression loss and centrality loss of the anchor-free frame detection head form first-stage loss, classifying loss and regression loss of the ROI head form second-stage loss, and weighting and summing the two-stage loss to obtain total loss; updating all the learnable parameters of the model based on total loss through back propagation, wherein the learnable parameters comprise parameters of a backbone network, an attention module, a characteristic pyramid network, an anchor-free frame detection head and an ROI head; After each training round, the performance of the model is evaluated by using a verification set, the training loss and the index change of the verification set are monitored in real time, the training is stopped when the early-stop condition is met, and the optimal model weight is saved.
- 8. The improved Faster R-CNN underground drainage and sewer pipeline defect detection model according to claim 1, wherein the detection result comprises: loading the optimal model weight obtained by training, and inputting the test set image which is not subjected to enhancement treatment into a model; the method comprises the steps of performing feature extraction on an input image, namely acquiring basic features through a backbone network, strengthening the basic features through an attention module, inputting the basic features into a feature pyramid network, and generating a feature map covering multiple scales; The anchor-free frame detection head generates an initial proposal frame on the multi-scale feature map, and removes low-quality and overlapped proposal frames through confidence level filtering and non-maximum value inhibition; the ROI header performs region of interest feature clipping and refinement on the filtered proposed box, outputting final detection results including defect class, confidence score, and corresponding bounding box coordinates.
- 9. The improved Faster R-CNN underground drainage and sewage pipeline defect detection model according to claim 1, wherein the judging model is up to standard and comprises the following steps: comparing the detection result of the test set with the real labeling information of the defects in the image, counting the detection results of the true positive, false positive and false negative, calculating the precision, recall ratio, average precision of each defect category and average precision mean value of all categories based on the counting results, comparing the calculated precision, recall ratio and average precision mean value with a preset precision threshold, judging that the model meets the standard if the indexes meet the preset precision threshold, and having the practical performance of detecting the defects of the pipeline, and returning to the model training or improving stage for optimization adjustment if the indexes do not meet the preset precision threshold.
Description
Improved Faster R-CNN underground drainage pipeline defect detection model Technical Field The invention relates to the technical field of target detection, in particular to an improved Faster R-CNN underground drainage pipeline defect detection model. Background The drainage and sewage pipelines are important components of urban infrastructure, and the integrity of the drainage and sewage pipelines is directly related to the normal operation and environmental safety of urban drainage systems, so that pipeline defect detection is a key link for guaranteeing long-term stable service of pipelines. At present, pipeline defect detection is mainly divided into two types, namely manual detection and automatic detection. The manual detection is based on the fact that closed-circuit television equipment shoots images in the pipeline, and detection staff manually observe positions and categories of image marking defects, so that the detection method is a traditional detection mode with wider application in the industry. With the development of deep learning technology, automatic detection based on a target detection algorithm is gradually popularized, a common framework comprises a fast R-CNN and the like, and automatic identification and positioning of defects are realized by constructing a pipeline defect image data set training model. In actual detection, environmental characteristics such as uneven illumination, water stain adhesion, sludge accumulation and the like commonly exist in a pipeline, and the existing detection technology is required to develop data acquisition and model development based on such actual scenes so as to adapt to the complex detection environment in the pipeline. It still has some drawbacks in practical use, such as: 1. The manual detection requires personnel to check the detection image mark targets frame by frame, long-time operation is easy to cause missed detection due to visual fatigue, the judgment result is greatly influenced by personal experience difference, the accuracy of identifying fine targets is generally low, meanwhile, the single-batch processing amount is limited, and the dual requirements of efficiency and precision under a large-scale detection scene are difficult to meet. 2. The traditional detection model is used for generating candidate areas by depending on preset parameters, the size difference span of the detection object is large, the fixed parameter setting causes that small-size targets are easy to miss, the positioning deviation of large-size targets is obvious, the detection requirements of targets with different sizes cannot be flexibly adapted, and the overall detection suitability is poor. 3. The situations of unstable illumination intensity, adhesion of various interferents and the like often exist in an actual detection scene, an effective background suppression mechanism is lacked in the existing model, a target and background noise are difficult to distinguish clearly, a non-target area is frequently misjudged as a detection target, and the workload and time cost of subsequent manual review are greatly increased. 4. The feature extraction capability of the existing model is limited, the feature information of a single scale is relied on for detection, the enhancement of key features such as the edge and texture of a target is insufficient, the fluctuation range of the detection performance is large under different environmental conditions, the detection scene cannot be stably adapted to the diversity, and the generalization capability is weak. Disclosure of Invention In order to overcome the defects in the prior art, the invention provides an improved Faster R-CNN underground drainage pipeline defect detection model, which solves the problems in the prior art through the following scheme. In order to achieve the aim, the invention provides the following technical scheme that the improved Faster R-CNN underground drainage pipeline defect detection model comprises the following components: the method comprises the steps of S1, constructing a pipeline defect image data set, namely extracting images containing defects from a pipeline detection video, screening and removing invalid images, marking the screened images in defect categories, and dividing the images into a training set, a verification set and a test set according to a preset proportion in a layering manner, wherein the training set, the verification set and the test set are respectively used for model parameter learning, super parameter adjustment and generalization capability assessment; S2, improving Fcos FR-CNN model, namely building backbone network based on standard Faster R-CNN model, replacing traditional RPN structure with FcosHead without anchor frame containing three parallel branches of classification, regression and centrality, embedding CBAM attention module at high-level characteristic output end of backbone network, strengthening defect characteristic by channel dimension char