Detection Method for Precast Tunnel Segment Embedded Sleeves Based on Target Detection Algorithm
By using a target detection algorithm-based method for detecting pre-embedded sleeves in prefabricated tunnel segments, and employing the KAN-DETR model for image processing and feature fusion, the method solves the problems of low efficiency and insufficient accuracy of manual visual inspection, and achieves efficient and accurate detection of the number of pre-embedded sleeves.
Patent Information
- Application Number
- CN202411949247.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2044-12-27
AI Technical Summary
The existing manual visual inspection method for detecting the number of embedded sleeves is labor-intensive, inefficient, and prone to errors in environments with obstructed vision, making it difficult to meet the dual requirements of accuracy and speed.
A method for detecting pre-embedded sleeves in prefabricated tunnel segments based on target detection algorithms is adopted. The method uses a panoramic camera to acquire images and the KAN-DETR target detection model to detect the number of pre-embedded sleeves. The method includes image preprocessing, data augmentation, feature extraction and model training. The method combines multi-scale feature fusion and decoder to generate bounding boxes to improve detection accuracy and speed.
It achieves efficient and accurate detection of the number of pre-embedded sleeves, with a recall rate of no less than 98% and an accuracy of 98%, meeting real-time requirements and reducing the possibility of human error and missed detection.
Smart Images

Figure CN119963804B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of precast tunnel segment technology, and in particular to a method for detecting pre-embedded sleeves of precast tunnel segments based on a target detection algorithm. Background Technology
[0002] In the fabrication of prefabricated tunnel segments, embedded components such as embedded channels, embedded steel plates, and embedded sleeves play a crucial structural connection role. They ensure tight connections between segments, improve the overall structural stability and load-bearing capacity, and facilitate subsequent equipment installation and maintenance. Before casting tunnel segments, the quantity of embedded sleeves is typically checked manually. However, conventional manual visual inspection suffers from drawbacks such as high labor intensity, low efficiency, and inability to quickly cover large areas. Furthermore, the quality of manual visual inspection is unstable and easily affected by environmental factors. Obstructed views and other environmental factors can lead to inaccurate inspection results and difficulty in detecting hidden problems.
[0003] Compared to traditional manual visual inspection, the target detection algorithm-based detection of the number of embedded sleeves can quickly process large amounts of image data, automatically identify and count embedded sleeves, greatly improving detection efficiency. Compared to traditional manual visual inspection, this method can save a lot of manpower and time costs. Furthermore, in environments where the line of sight is obstructed during manual visual inspection, sensors can be deployed to ensure the successful identification of embedded parts, reducing the possibility of human error and missed detection.
[0004] Due to the complexity of the precast tunnel segment environment in this application, existing manual visual inspection cannot meet the dual requirements of accuracy and speed. Therefore, a method for detecting precast tunnel segment embedded sleeves based on target detection algorithm is proposed. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the above-mentioned technologies and provide a method for detecting pre-embedded sleeves of prefabricated tunnel segments based on a target detection algorithm. This method combines high discrimination speed and high discrimination accuracy and is suitable for detecting the number of pre-embedded sleeves.
[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0007] In a first aspect, the present invention provides a method for detecting the number of pre-embedded sleeves in prefabricated tunnel segments based on a target detection algorithm, the detection method comprising the following steps:
[0008] Use a panoramic camera to acquire images of tunnel segment molds with and without pre-embedded sleeves installed before pouring; convert the mold images to a standard size of 224*224 to obtain standard-sized images.
[0009] Each pixel of the acquired standard format image is multiplied by the same pixel weight to obtain a new image to highlight the embedded sleeve; the pixel weight is set to 1.25.
[0010] All new images constitute the dataset. The dataset is divided into a training set and a test set. Images containing embedded sleeves in the training set are labeled to indicate the embedded sleeves. Next, the dataset is subjected to mean filtering, and the training set is subjected to data augmentation.
[0011] Mean filtering: A 3x3 window is slid across the new image after being multiplied by pixel weights, the average value of the pixels in each window is calculated, and the pixel in the center of the window is replaced with this average value.
[0012] The data augmentation process is as follows: the image after mean filtering is rotated clockwise by 30°, 60° and 90° respectively, and then the image is randomly erased, that is, a 50*50 rectangle filled with random values is covered in the image to simulate the pre-embedded sleeve that is covered by steel, and finally the augmented dataset is formed.
[0013] A KAN-DETR target detection model is constructed, which includes a backbone network ResNet-kan, a hybrid encoder, and a decoder with an auxiliary prediction head. The image is input into the backbone network ResNet-kan, where feature extraction is performed to obtain feature maps of different scales. Then, the hybrid encoder is used to process the multi-scale features. The output of the hybrid encoder is connected to the DIoU perceptual query selection, from which a fixed number of features are selected as the initial target query of the decoder. The decoder then generates bounding boxes and confidence scores. The output of the decoder is transformed into a probability distribution through a feedforward neural network to obtain the final prediction result, and then to determine whether there is a missing pre-embedded sleeve.
[0014] The KAN-DETR target detection model was trained using the enhanced dataset to detect the number of pre-embedded sleeves in precast tunnel segments.
[0015] Furthermore, in the ResNet-kan backbone network, the input image first passes through a convolutional layer with 7x7 kernels, producing 64 output channels. Then, it passes through a 3x3 pooling layer. After pooling, the data enters four convolutional groups with different channel counts. These four convolutional groups consist of two 1x1 kernels and one 3x3 kernel. These convolutional groups are repeated a different number of times: the first type is repeated 3 times, producing 256 output channels; the second type is repeated 4 times, producing 256 output channels. The number of channels is 512. The third type of convolution group is repeated 6 times, and the number of output channels is 1024. The fourth type of convolution group is repeated 3 times, and the number of output channels is 2048. The feature image G1(x) after convolution by the four types of convolution groups is used as the input of the MultKAN module. After processing by the average pooling layer, the fully connected layer, and the activation function softmax, the output features with strides of 8, 16, and 32 are obtained, which are denoted as S3, S4, and S5 respectively. S3, S4, and S5 are used as the input features of the hybrid encoder.
[0016] Furthermore, in the MultKAN module, the feature image G1(x) enters the first 1*1 convolutional kernel with 512 kernels, reducing the number of channels to 512. Then it enters the second 3*3 convolutional kernel with a stride of 2, further reducing the dimensionality of the feature image to obtain G2(x), which then enters the MultKAN layer. The output of the MultKAN layer, MultKAN(G1(x)), is added to G2(x) to obtain the output of the MultKAN module.
[0017] Furthermore, the decoder includes a deformable attention mechanism, a normalization layer, a self-attention mechanism, a normalization layer, GR-kan, and a normalization layer connected in sequence; wherein the calculation formula for the deformable attention mechanism is:
[0018]
[0019] Where y is the output feature map, p0 is a point in the output space, and p n It is the relative position of the convolution kernel; ω(p n ) represents the weights of the convolution kernel; x represents the input feature map; Δp n It is the learned offset;
[0020] The GR-kan is calculated as follows: the internal univariate function Internal(x) maps the input real value x to an output value between 0 and 1 through the sigmoid function.
[0021] The external univariate function External(x) connects a set of known data points through a piecewise linear approximation to form a smooth curve. The calculation formula is:
[0022]
[0023] Where n1 represents the number of internal univariate functions Internal(x), c i These are the coefficients optimized during training, where P(x) and Q(x) are polynomials; the output of the GR-Kan network is F(x), calculated using the following formula:
[0024] F(x)=ω(Internal(x)+External(x))
[0025] Where ω is the weight, Internal(x) is the internal univariate function, and spline(x) is the external univariate function.
[0026] Furthermore, the feedforward neural network includes linear combination, BN normalization processing, and the ReLU activation function, ultimately obtaining the number of pre-embedded sleeves.
[0027] The formula for calculating the ReLU activation function is:
[0028]
[0029] in, It is the normalized data, when When the value is positive or zero, the ReLU function outputs the value directly. The number of non-zero features is called the sleeve; while when When the value is negative, the ReLU function outputs 0.
[0030] Secondly, this invention provides a prefabricated tunnel segment embedded sleeve quantity detection system based on a target detection algorithm, the system comprising:
[0031] The image acquisition module uses a panoramic camera to acquire images of the tunnel segment molds before pouring.
[0032] The image processing module is used to annotate and enhance the mold images from the image acquisition module;
[0033] The KAN-DETR target detection model is connected to the image processing module. The KAN-DETR target detection model is trained using the data output by the image processing module. The trained KAN-DETR target detection model is used to detect the pre-embedded sleeve and output a prediction map.
[0034] Statistics module: Used to count the number of non-zero features in the prediction image, and the number of non-zero features is used as the number of pre-embedded sleeves detected in the current image;
[0035] The early warning and feedback module compares the results output by the statistics module with the preset number of pre-embedded sleeves on the tunnel segments. If the results output by the statistics module do not match the preset number, an alarm is triggered, and staff are promptly reminded to add or reduce the number of pre-embedded sleeves.
[0036] Compared with the prior art, the beneficial effects of the present invention are:
[0037] In this invention, the image of the tunnel segment mold is used as the input for target detection. The target detection uses the KAN-DETR target detection model. The decoder generates bounding boxes and confidence scores. Finally, the output of the model is converted into specific quantities to determine whether there is a lack of pre-embedded sleeves.
[0038] This invention not only improves the model prediction speed but also the model accuracy. In the embodiment, the recall rate is not less than 98%, the FPS is 78, and the precision is 98%, which meets the accuracy and real-time requirements when counting the number of pre-embedded sleeves. Attached Figure Description
[0039] Figure 1 This is a schematic diagram of the position of the pre-embedded sleeve in a precast tunnel segment according to an embodiment of the present invention. The position indicated by the arrow in the figure is the installation position of the pre-embedded sleeve.
[0040] Figure 2 This is a schematic diagram of the structure of the KAN-DETR target detection model in this invention.
[0041] Figure 3 This is a schematic diagram of the ResNet-kan backbone network in this invention.
[0042] Figure 4 This is a flowchart of the MultKAN module in this invention.
[0043] Figure 5 This is a schematic diagram of the MultKAN layer in this invention.
[0044] Figure 6 This is a flowchart of the AIFI (Intra-Scale Feature Interaction) module in this invention.
[0045] Figure 7 This is a flowchart of the DIoU-aware query selection mechanism in this invention.
[0046] Figure 8 This is a schematic diagram of the decoder structure in this invention.
[0047] Figure 9 This is a schematic diagram of the feedforward neural network in this invention. Detailed Implementation
[0048] To more clearly describe the technical problems, technical solutions, and advantages of the present invention, a detailed description will follow with reference to the accompanying drawings and embodiments. It should be noted that these embodiments are only used to illustrate the principles and scope of the present invention and should not be considered as limitations on the invention.
[0049] Example 1
[0050] This embodiment of the method for detecting the number of prefabricated tunnel segment embedded sleeves based on target detection algorithms includes the following steps:
[0051] (1) Use the image acquisition module to obtain the image of the tunnel segment mold before pouring;
[0052] (1.1) Using a panoramic camera, images of the tunnel segment mold with and without pre-embedded sleeves are obtained respectively; the images captured by the panoramic camera can reflect the pre-embedded sleeves on each side of the tunnel segment, and the number of pre-embedded sleeves on a single image can be counted to determine whether the number of pre-embedded sleeves on the tunnel segment is qualified.
[0053] (1.2) Convert the mold image to a standard 224*224 format to obtain a standard format image;
[0054] (1.3) Highlighting the pre-embedded sleeve: Multiply each pixel of the acquired standard format image by the same pixel weight to obtain a new image. Here, the pixel weight is set to 1.25.
[0055] The quantity detection of pre-embedded sleeves for precast tunnel segments is completed in the prefabrication plant. The detection environment is relatively fixed. The pre-embedded sleeves are generally silver-white, while the steel is gray. Under the same brightness, the silver-white pre-embedded sleeves will be brighter than the gray steel. To highlight the pre-embedded sleeves, the pixel weight is set to 1.25. When the pixel weight is greater than 1, the contrast is enhanced, making the black and white of the image more obvious.
[0056] (1.4) All new images constitute a dataset, which includes images containing embedded sleeves and images without embedded sleeves. The two types of images are allocated to the training set and the test set in a 7:3 ratio, respectively. The images containing embedded sleeves in the training set are labeled to indicate the embedded sleeves. Next, the dataset is subjected to mean filtering, and the training set is subjected to data augmentation.
[0057] Mean filtering: A 3x3 window is slid across the new image after being multiplied by pixel weights, the average value of the pixels in each window is calculated, and this average value is used to replace the pixel in the center of the window; this reduces random noise in the image.
[0058] The data augmentation process is as follows: the image after mean filtering is rotated clockwise by 30°, 60° and 90° respectively. Then the image is randomly erased, that is, a 50*50 rectangle filled with random values is covered in the image to simulate the pre-embedded sleeve that is partially obscured by steel. Finally, the augmented dataset is formed, and the number of augmented datasets is 1500 images.
[0059] A KAN-DETR target detection model is constructed, which includes a backbone network ResNet-kan, a hybrid encoder, and a decoder with an auxiliary prediction head;
[0060] The stencil image, used as input to the ResNet-kan backbone network, first passes through a 7x7 convolutional layer with 64 output channels. Then, it goes through a 3x3 pooling layer. The pooled data then enters four types of convolutional groups, each consisting of two 1x1 kernels and one 3x3 kernel. These convolutional groups are repeated a different number of times: the first type is repeated 3 times, outputting 256 channels; the second type is repeated 4 times, outputting 51 channels. 2. The third type of convolution group is repeated 6 times, and the number of output channels is 1024. The fourth type of convolution group is repeated 3 times, and the number of output channels is 2048. The feature image G1(x) after convolution by the four types of convolution groups is used as the input of the MultKAN module. After processing by the average pooling layer, the fully connected layer, and the activation function softmax, the output features with strides of 8, 16, and 32 are obtained, which are denoted as S3, S4, and S5 respectively. S3, S4, and S5 are used as the input features of the hybrid encoder.
[0061] In the MultKAN module, the feature image G1(x) enters the first convolutional kernel with a size of 1*1 and a stride of 1; the number of convolutional kernels is 512, reducing the number of channels to 512. Then it enters the second 3*3 convolutional kernel with a stride of 2, and the number of convolutional kernels is also 512. Further dimensionality reduction of the feature image yields G2(x), which is then entered into the MultKAN layer.
[0062] The MultKAN layer first passes through the residual activation function. The nonlinear activation is calculated using the following formula:
[0063]
[0064] Where B(x) is a B-spline function, n is the number of B-spline functions, and the output is obtained from the residual activation function. After addition and multiplication, the residual activation function is input to the next layer. The activation functions of different layers are calculated as follows:
[0065]
[0066] Where m represents the total number of MultKAN layers, and the symbol ° represents the composition operation between functions, that is, the output of one function becomes the input of the next function.
[0067] The output MultKAN(G1(x)) of the MultKAN layer is added to the features of G2(x) to further improve the generalization ability of the ResNet-kan network.
[0068] The hybrid encoder includes an intra-scale feature interaction module (AIFI) and a multi-scale feature fusion module (CCFM). The input feature S5 is used as the input to the intra-scale feature interaction module AIFI (encoder). S5 first undergoes a multi-head self-attention mechanism to obtain a reconstructed multi-dimensional feature image. The specific transformation formula is as follows:
[0069] Q = K = V = flatten(S5)
[0070] F5 = Reshape(Attn(Q,K,V))
[0071] Here, flatten is the process of converting a multidimensional array of S5 image features into a one-dimensional array, that is, merging each row or column of S5 image features into a single sequence, which is the flattening feature operation; Attn refers to processing vectors Q, K and V through a multi-head self-attention mechanism; Reshape refers to the deformation operation, which is to reshape the result of the multi-head self-attention mechanism into a multidimensional image feature F5, that is, reconstruct the feature map.
[0072] S3, S4, and F5 serve as inputs to the multi-scale feature fusion module CCFM, performing multi-scale feature fusion. The specific process is as follows (see...). Figure 2 ):
[0073] After undergoing 1x1 convolution, BN normalization, and activation function calculation, F5, along with S4, serves as the input to fusion block 1. The fusion process yields the first fusion result of fusion block 1. The mechanism of the fusion block is as follows:
[0074] Features of different scales are used as input to the fusion block and first convolved with 1*1 kernels. Then, the features are concatenated by element-wise addition to obtain a new feature map as the output of the fusion block.
[0075] The first fusion result, after undergoing 1x1 convolution, BN normalization, and activation function processing, is combined with S3 as input to fusion block 2, yielding the output of fusion block 2, denoted as the second fusion result. The output of fusion block 2 is then processed again (3x3 convolution, BN normalization, and activation function) and used as input to fusion block 1, resulting in the second output of fusion block 1. This second output, after further image processing (3x3 convolution, BN normalization, and activation function) and combined with the result of image processing (1x1 convolution, BN normalization, and activation function) of F5, is used as input to fusion block 3, yielding its output, denoted as the third fusion result. Finally, the second output of fusion block 1, the output of fusion block 2, and the output of fusion block 3 are concatenated element-wise to obtain a new feature map, resulting in the output of the hybrid encoder, as shown in the following formula:
[0076] Output = CCFM({S3,S4,F5})
[0077] A fixed number of image features are selected from the output sequence of the hybrid encoder as the initial object query for the decoder. DIoU-aware query selection constrains the model during training to generate high classification scores for features with high DIoU scores and low classification scores for features with low DIoU scores. DIoU is calculated as follows:
[0078]
[0079] Where IOU represents the overlap between the predicted bounding box and the ground truth bounding box, c represents the center distance, and d represents the diagonal distance. The predicted bounding boxes corresponding to the top K hybrid encoder features (K is set to 300 in this embodiment) selected by the model based on the classification score have higher classification scores and higher DIoU scores. The optimization objectives are as follows:
[0080]
[0081] in y and c represent the predicted and true values, respectively, while b and c represent the category and bounding box, respectively. and These represent the predicted category and the predicted bounding box, respectively; where y and c represent the predicted and true values, respectively, while b and c represent the category and bounding box, respectively. and L represents the predicted category and the predicted bounding box, respectively; box L cls L and L represent the bounding box, category loss, and total loss, respectively.
[0082] Finally, the bounding boxes that simultaneously obtain high DIoU scores and high classification scores are fed into the decoder. Within the decoder, they sequentially pass through a deformable attention mechanism, a normalization layer, a self-attention mechanism, a normalization layer, GR-Kan, and another normalization layer to obtain the decoder's output. The calculation formula for the deformable attention mechanism is as follows:
[0083]
[0084] Where y is the output feature map, p0 is a point in the output space, and p n It represents the relative position of the convolution kernel. ω(p) n ) represents the weights of the convolution kernel. x is the input feature map, and Δp n It is the learned offset.
[0085] The formula for calculating the self-attention mechanism is as follows:
[0086]
[0087] Q, K, and V are the query, key, and value vectors, respectively, and d k It is the dimension of the key vector, used to scale the dot product and improve numerical stability.
[0088] The GR-kan is calculated as follows: The internal univariate function BNternal(x) maps the input real value x to an output value between 0 and 1 through a sigmoid function. The calculation method is as follows:
[0089] Internal(x) = x / (1+e) -x )
[0090] The external univariate function External(x) connects a set of known data points through a piecewise linear approximation to form a smooth curve. The calculation method is as follows:
[0091]
[0092] Where n1 represents the number of internal univariate functions BNternal(x), c i These are the coefficients optimized during training, and P(x) and Q(x) are polynomials. The output of the GR-Kan network is F(x), calculated as follows:
[0093] F(x)=ω(Internal(x)+External(x))
[0094] Where ω is the weight, the internal univariate function is BNternal(x), and the external univariate function is splBNe(x).
[0095] The output from the decoder serves as the input to the feedforward neural network. Within the feedforward neural network, it undergoes linear combination, normalization, and ReLU activation to obtain a prediction map. In the prediction map, 0 represents a non-embedded sleeve, and non-zero values represent embedded sleeves. Finally, the number of non-zero values in the prediction map is counted to determine the number of embedded sleeves. The linear combination involves scaling the input with weights, summing the results, and then shifting the input using a bias. The specific formula is as follows:
[0096] z = w1x1 + w2x2 + ... + w n x n +b
[0097] Where w is the weight of data x, b is the bias; z is the linear combination result; n represents the number of elements in data x (a feature output by the decoder);
[0098] The specific process of BN normalization is as follows:
[0099] 1) Calculate the batch mean μ B and variance σ 2 B
[0100]
[0101] Where m is the number of samples, x i It is sample data;
[0102] 2) Normalization
[0103]
[0104] in, This is the normalized data. ∈ is a small positive integer used to prevent numerical instability caused by a denominator of zero.
[0105] The formula for calculating the ReLU activation function is:
[0106]
[0107] Among them, when When the value is positive or zero, the ReLU function outputs the value directly. The number of non-zero features is called the sleeve; while when When the value is negative, the ReLU function outputs 0.
[0108] Example 2
[0109] This embodiment presents a method for detecting pre-embedded sleeves in prefabricated tunnel segments based on the KAN-DETR target detection algorithm. The KAN-DETR neural network consists of a ResNet-kan backbone network, a hybrid encoder, and a decoder with an auxiliary prediction head. Images are input to the ResNet-kan backbone network, and the output features with strides of 8, 16, and 32 are used as inputs to the hybrid encoder. S3, S4, and S5 are used for labeling, and S5 is used as input to the AIFI module. After inter-scale interaction, F5 is obtained. S3, S4, and F5 are then used as inputs to the CCFM module for multi-scale feature fusion. The image feature processing mechanism is as follows:
[0110] Image features are first convolved with convolutional kernels to obtain new image features. These features are then normalized using Batch Normalization (BN), and finally, a higher-level abstract feature is obtained by calculating the ReLU activation function. Image feature F5, after 1x1 convolution, normalization, and activation function calculation, along with S4, serves as the input to fusion block 1. After fusion, the first output of fusion block 1 (the first fusion result) is obtained. The mechanism of the fusion block is as follows: features of different scales are first convolved with 1x1 kernels as input to the fusion block, and then fused element-wise to obtain a new feature map, which serves as the output of the fusion block.
[0111] The first fusion result, after undergoing 1x1 convolution, BN normalization, and activation function processing, is combined with S3 as input to fusion block 2, yielding the output of fusion block 2, denoted as the second fusion result. The output of fusion block 2 is then processed again (3x3 convolution, BN normalization, and activation function) and used as input to fusion block 1, resulting in the second output of fusion block 1. This second output, after further image processing (3x3 convolution, BN normalization, and activation function) and combined with the result of F5's image processing (1x1 convolution, BN normalization, and activation function), is used as input to fusion block 3, yielding its output, denoted as the third fusion result. Finally, the second output of fusion block 1, the output of fusion block 2, and the output of fusion block 3 are concatenated element-wise to obtain a new feature map.
[0112] A fixed number of image features are selected from the output sequence of the hybrid encoder as the initial object query for the decoder. DIoU-aware query selection constrains the model during training to generate high classification scores for features with high DIoU scores and low classification scores for features with low DIoU scores. Therefore, the predicted bounding boxes corresponding to the top K hybrid encoder features selected by the model based on classification scores have high classification scores and high DIoU scores. After optimization by the constrained model, the predicted bounding boxes with high DIoU and high classification scores enter the decoder. In the decoder, the bounding boxes sequentially pass through a deformable attention mechanism, a normalization layer, a self-attention mechanism, a normalization layer, GR-Kan, and another normalization layer to obtain the decoder output: precise bounding boxes and their corresponding confidence scores. The decoder output serves as the input to a feedforward neural network. The data in the feedforward neural network is first linearly combined, then normalized, and finally non-linearly activated using the ReLU activation function. This transforms the model's output into a numerical value, resulting in the final detection result.
[0113] The hybrid encoder consists of an intra-scale feature interaction module (AIFI) and a multi-scale feature fusion module (CCFM). Intra-scale interaction is performed in the AIFI module, and multi-scale feature fusion is performed in the CCFM module.
[0114] In the decoder, the predicted bounding box after the DIOU perceptual query is input into the decoder, and then passes through the deformable attention mechanism, normalization layer, self-attention mechanism, normalization layer, GR-kan, and normalization layer in sequence to obtain the decoder output, the precise bounding box and its corresponding confidence score.
[0115] Compared to conventional manual visual inspection of the number of embedded sleeves, which is labor-intensive, inefficient, and of unstable quality, and suffers from inaccurate results due to environmental factors such as obstructed vision, the present invention, based on the KAN-DETR method for detecting the number of embedded sleeves in precast tunnel segments, greatly reduces labor costs, improves the detection rate of embedded sleeves while ensuring detection quality, and achieves high-precision quantity detection.
[0116] The labeled training set is read into the KAN-DETR object detection model. The model is trained iteratively on all images. After 40,000 iterations, the model converges, i.e., when the training gradient is close to 0 (less than 0.01 is considered close to 0). Training stops, and the optimal network parameters are extracted for prediction. If the training gradient is not close to 0, the weight parameters are adjusted. Model calibration phase: 1) The test set data is input into the KAN-DETR object detection model to obtain the detection results; 2) The actual parameters of the detected targets used in the test are compared with the preliminary detection results to obtain the calibrated KAN-DETR model. During prediction, the model first loads the trained parameters and then loads the input image from the test set. The number of pre-embedded sleeves is detected using the prediction image obtained by the trained KAN-DETR object detection model.
[0117] The model is trained using a training set and evaluated using a test set under different parameter settings to select the optimal parameter settings, which also improves the model's generalization ability. Simultaneously, the dataset is augmented by rotating and randomly erasing images, which helps identify embedded sleeves at different angles and improves the overall performance of the model.
[0118] Combining the MultKAN module with the backbone network allows the backbone network to better capture complex relationships in the data, enhancing its interpretability. Using GR-kan in the decoder improves the overall model's accuracy and speed.
[0119] Performance tests of different models were conducted using the enhanced dataset established in Example 1. The test results are shown in the table below.
[0120]
[0121] Here, Recall is the proportion of correctly identified positive samples out of all actually positive samples, measuring the model's ability to identify positive samples. Precision is the proportion of samples predicted as positive by the model that are actually positive, measuring the accuracy of the model's prediction results. FPS indicates how many frames of images the model can process per second. Compared to existing common object detection algorithms, this invention not only improves the model's prediction speed but also its accuracy. This invention has a recall of no less than 98%, an FPS of 78, and an accuracy of 98%, meeting the requirements for accuracy and real-time performance.
[0122] Example 3
[0123] This embodiment is based on the KAN-DETR precast tunnel segment embedded sleeve quantity detection system, including:
[0124] The image acquisition module uses a panoramic camera to acquire images of the tunnel segment molds before pouring.
[0125] The image processing module is used to annotate and enhance the mold images from the image acquisition module;
[0126] The KAN-DETR target detection model is connected to the image processing module. The KAN-DETR target detection model is trained using the data output by the image processing module. The trained KAN-DETR target detection model is used to detect the pre-embedded sleeve and output a prediction map.
[0127] Statistics module: Used to count the number of non-zero features in the prediction image, and the number of non-zero features is used as the number of pre-embedded sleeves detected in the current image;
[0128] The early warning and feedback module compares the results output by the statistics module with the preset number of pre-embedded sleeves on the tunnel segments. If the results output by the statistics module do not match the preset number, an alarm is triggered, and staff are promptly reminded to add or reduce the number of pre-embedded sleeves.
[0129] The training process of the KAN-DETR object detection model is as follows: Initially, the KAN-DETR network data is randomly initialized, training set images are loaded, and input into the KAN-DETR object detection model. The model predicts the images and calculates the loss function error. The training gradient is close to 0, obtaining the trained KAN-DETR object detection model network parameters. If the gradient is not close to 0, backpropagation is performed to adjust the model parameters, and the training set images are loaded again. The test set is input into the trained KAN-DETR object detection model. The trained KAN-DETR object detection model can be used to detect the number of embedded sleeves. The predicted image is obtained using the trained KAN-DETR object detection model, thus enabling the detection of the number of embedded sleeves in the mold image.
[0130] In practical use, the panoramic camera captures images of the tunnel segment mold before pouring. After standard size processing, pixel weight processing, and mean filtering, the mold images are input into the trained KAN-DETR target detection model, which outputs the corresponding prediction image.
[0131] The number of non-zero features in the statistical prediction chart is compared with the preset number of embedded sleeves on the tunnel segments. If the number of embedded sleeves is correct, the number is displayed as correct; if the number of embedded sleeves is insufficient or excessive, an alarm is issued to remind staff to add or reduce the number of embedded sleeves in a timely manner.
[0132] Example 4
[0133] The hardware used in the detection system of this embodiment includes the following components:
[0134] Image sensor: An image sensor is used to acquire images, converting optical images into electrical signals, and then forming digital images. The image sensor uses a panoramic camera to meet the needs of the scene.
[0135] Processor: As the core component of this invention, the processor is responsible for controlling and managing the operation of the entire system, including data acquisition, data processing, image recognition, and other functions. It needs sufficient computing power and parallel processing capabilities to meet real-time requirements. The processor can take different forms, such as a microcontroller, microprocessor, or computer, to meet the needs of different application scenarios.
[0136] Memory: The memory can be used to store the collected data and historical data for subsequent processing and analysis. It features high speed, high reliability and scalability to meet the requirements of long-term stable operation of the system.
[0137] Database: Use a database to store and manage information such as collected data, historical data, and analysis results;
[0138] Network interface: Used for data exchange and communication, it features high speed, high stability and high security, ensuring the reliability and security of data transmission.
[0139] The processor is configured to execute computer-executable instructions, which, when executed by the processor, implement the various steps of the method for detecting the number of pre-embedded sleeves for prefabricated tunnel segments based on KAN-DETR.
[0140] The memory stores a computer program that can be executed by a processor to implement the various steps of the method for detecting the number of pre-embedded sleeves for prefabricated tunnel segments based on KAN-DETR.
[0141] The database is configured to store and manage data from computer applications, including various data types and structures, applied to each step of the KAN-DETR-based method for detecting the number of pre-embedded sleeves in precast tunnel segments.
[0142] The network interface enables communication and data transmission between computers. This network interface can provide various communication protocols and data transmission methods to meet the communication and data transmission needs of different application scenarios and requirements. It is applied to each step of the method for detecting the number of pre-embedded sleeves of precast tunnel segments based on KAN-DETR.
[0143] This invention is mainly used to detect the number of pre-embedded sleeves in precast tunnel segments before casting. It uses a panoramic camera to automatically identify the number of pre-embedded sleeves.
[0144] This invention aims to solve the problem of slow manual detection of embedded sleeves, which affects construction progress. It utilizes the KAN-DETR target detection model to automatically identify the quantity of embedded sleeves. The target detection model can quickly identify the quantity of embedded sleeves and automatically issue an alarm, promptly reminding workers to add or remove sleeves. Compared to existing methods, this technical solution has the following advantages and application prospects: it improves the efficiency of detecting the quantity of embedded sleeves and provides the possibility for pursuing more intelligent precast tunnel segments. This is of great significance to precast tunnel segments and has broad application prospects.
[0145] In the description of this specification, the specific features, structures, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0146] It should be understood that various parts of the present invention can be implemented in hardware, software, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or hardware stored in memory and executed by a suitable instruction execution system.
[0147] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0148] Any aspects not covered in this invention are applicable to existing technologies.
Claims
1. A method for detecting the number of pre-embedded sleeves in a prefabricated tunnel segment based on a target detection algorithm, characterized in that, The detection method comprises the following steps: A panoramic camera is used to obtain images of tunnel segment molds before pouring, which have installed pre-buried sleeves and have not installed pre-buried sleeves; the size of the mold image is converted into a standard size of 224*224 to obtain a standard size image; Each pixel of the obtained standard format image is multiplied by the same pixel weight to obtain a new image to highlight the pre-buried sleeve, and the pixel weight is set to 1.25; All new images constitute a data set, the data set is divided into a training set and a test set, and the images containing pre-buried sleeves in the training set are labeled with data, and the pre-buried sleeves are marked; secondly, the data set is subjected to mean filtering, and the training set is subjected to data enhancement processing; Mean filtering: a 3*3 window is used to slide on the new image after multiplying the pixel weight, the average value of the pixels in each window is calculated, and the average value is used to replace the center pixel of the window; The process of data enhancement processing is: the image after mean filtering is respectively rotated clockwise by 30°, 60° and 90°, then the image is randomly erased, that is, a rectangular frame with a size of 50*50 filled with random values is overlaid in the image to simulate the part of the pre-buried sleeve blocked by steel, and finally the enhanced data set is formed; A KAN-DETR target detection model is constructed, the KAN-DETR target detection model comprises a backbone network ResNet-kan, a hybrid encoder and a decoder with an auxiliary prediction head, a picture is input into the backbone network ResNet-kan, feature extraction is performed to obtain multi-layer feature maps of different scales, then the hybrid encoder is used to process the multi-scale features, the output of the hybrid encoder is connected to DIoU perception query selection, a fixed number of features are selected as initial target queries of the decoder, then the decoder generates a bounding box and a confidence score, the output of the decoder is converted into a probability distribution through a feedforward neural network, so as to obtain the final prediction result, and then it is judged whether the pre-buried sleeve is missing; The KAN-DETR target detection model is trained by using the enhanced data set, and is used for detection of the number of pre-buried sleeves of a prefabricated tunnel segment. In the trunk network ResNet-kan, the input image first passes through a convolutional layer with a 7*7 convolutional kernel, and the output channel number of the convolutional layer is 64, then passes through a 3*3 pooling layer, and the data after the pooling effect enters four convolutional groups with different channel numbers, the four convolutional groups are composed of two 1*1 convolutional kernels and one 3*3 convolutional kernel, these convolutional groups are repeated different times, the first convolutional group is repeated 3 times, the output channel number is 256, the second convolutional group is repeated 4 times, the output channel number is 512, the third convolutional group is repeated 6 times, the output channel number is 1024, and the fourth convolutional group is repeated 3 times, and the output channel number is 2048; the feature image G1(x) after the convolution of the four convolutional groups is taken as the input of the MultKAN module, and then the average pooling layer, the full connection layer and the activation function softmax are processed to obtain the output features with steps of 8, 16 and 32, respectively, which are denoted as S3, S4 and S5, and S3, S4 and S5 are taken as the input features of the hybrid encoder; In the MultKAN module, the feature image G1(x) enters the first 1*1 convolutional kernel, the number of convolutional kernels is 512, the channel number is reduced to 512, then enters the second 3*3 convolutional kernel, the step is 2, and G2(x) is obtained by further reducing the dimension of the feature image, then enters the MultKAN layer, and the output MultKAN(G1(x)) of the MultKAN layer is added with G2(x) to obtain the output of the MultKAN module; The decoder comprises a deformable attention mechanism, a normalization layer, a self-attention mechanism, a normalization layer, a GR-kan and a normalization layer connected in sequence; wherein the calculation formula of the deformable attention mechanism is: where y is the output feature map, p0is a point in the output space, p n is the relative position of the convolution kernel; ω(p n ) is the weight of the convolution kernel; x is the input feature map; Δp n is the learned offset; The calculation method of the GR-kan is that the internal single-variable function Internal(x) maps the input real value x to an output value between 0 and 1 through a sigmoid function, And the external single-variable function External(x) is to connect a group of known data points through piecewise linear approximation to form a smooth curve, and the calculation formula is: where n1represents the number of internal univariate functions Internal(x), c i are coefficients optimized during training, P(x), Q(x) are polynomials; the output of the GR-Kan network is F(x), and the calculation formula is: F(x)=ω(Internal(x)+External(x)) Where ω is the weight, Internal(x) is the internal single-variable function, and External(x) is the external single-variable function.
2. The detection method according to claim 1, characterized in that, The feedforward neural network comprises a linear combination, a BN normalization processing and an activation function ReLU, and finally the number of pre-buried sleeves is obtained, The calculation formula of the ReLU activation function is: wherein, is the normalized data, when is positive or zero, the ReLU function directly outputs The number of non-zero features is counted as the sleeve; and when is negative, the ReLU function outputs 0.
3. A precast tunnel segment pre-buried sleeve quantity detection system based on target detection algorithm, based on the method of claim 1, characterized in that, The system comprises: An image acquisition module acquires a tunnel segment mold image before pouring by using a panoramic camera; An image processing module is configured to mark and enhance the mold image of the image acquisition module; A KAN-DETR target detection model is connected with the image processing module, the KAN-DETR target detection model is trained by using the data output by the image processing module, and the trained KAN-DETR target detection model is used for detecting the pre-buried sleeve and outputting a prediction map; The statistical module is used for counting the number of non-zero features in the prediction graph, and the number of non-zero features is used as the number of embedded sleeves in the current image detected; The early warning and feedback module compares the result output by the statistical module with the preset number of embedded sleeves on the tunnel segment, and if the result output by the statistical module does not match the preset number, an alarm is given, and the staff is reminded to add or reduce the embedded sleeves in time.
Citation Information
Patent Citations
Lightweight road defect detection method based on dynamic deformable attention mechanism
CN118279562A
Road inspection robot obstacle detection method and system based on RT-DETR-Sat
CN118864424A