A subway tunnel inspection scene detection method and system

By constructing an end-to-end network model that integrates tunnel scene feature enhancement, morphological perception hybrid attention weighted fusion, and detection head feature refinement, the problem of high missed detection and false detection rates in subway tunnel inspection is solved. This enables high-precision detection of targets of multiple sizes and categories, improving the accuracy and automation level of inspection.

CN121937885BActive Publication Date: 2026-06-02EAST CHINA JIAOTONG UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-03-31
Publication Date
2026-06-02

Smart Images

  • Figure CN121937885B_ABST
    Figure CN121937885B_ABST
Patent Text Reader

Abstract

The application discloses a subway tunnel inspection scene detection method and system, the method comprises the following steps: collecting and preprocessing tunnel images to construct a dataset; training a detection network containing a tunnel scene feature enhancement module, a shape perception hybrid attention weighted multi-scale fusion module and a detection head feature refining pre-module based on the dataset; using the trained model to detect real-time scanned images and output the results of eight types of targets such as water seepage, cracks and falling blocks; optionally, the result images are enhanced by a physical perception reconstruction module that integrates straightness loss and illumination consistency loss. The application adapts to the target shape through deformable convolution, realizes accurate multi-scale feature fusion by using hybrid attention and dynamic weight, and refines the features before detection, effectively overcoming the problem of multi-size target detection in complex tunnel environments, and significantly improving the accuracy, robustness and efficiency of the inspection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision and image processing technology, and in particular relates to a method and system for detecting scenes in subway tunnel inspection. Background Technology

[0002] As a crucial urban transportation infrastructure, the structural safety of subway tunnels is of paramount importance. Traditional manual inspection methods have many limitations: they must be conducted during nighttime windows when the subway is not in operation (such as 2:00 AM to 4:00 AM), resulting in short working hours; inspection personnel must enter the tunnel on foot, facing safety risks such as electric shock and mechanical injury; and relying on human experience, the accuracy of identifying minor defects (such as micro-cracks and initial water seepage) is unstable and easily affected by fatigue and subjective judgment. Although automated data acquisition equipment such as vehicle-mounted cameras and laser scanners have emerged in recent years, the problem of "emphasizing data acquisition but neglecting analysis" still exists. The massive amounts of data collected still require manual verification afterward, making real-time detection and closed-loop management impossible, leading to delays in defect detection and repair response.

[0003] While existing deep learning-based automated detection methods have made some progress in tunnel inspection, they remain insufficient when facing the unique challenges of the tunnel environment. The tunnel environment has the following characteristics: 1) enclosed space and uneven lighting, relying on artificial illumination; 2) complex background with numerous fixed structures (such as lining joints and equipment enclosures) that can be easily confused with actual defects; 3) vastly different target sizes, ranging from millimeter-level cracks to meters-sized debris coexisting with large equipment; and 4) dynamic interference, such as dust, water vapor atomization, and motion blur. Traditional target detection models (such as early YOLO and Faster R-CNN) typically use convolution with a fixed sampling grid and simple feature pyramid fusion, which struggles to adapt to irregular target shapes and performs poorly in small target feature extraction, multi-scale feature fusion, and complex background suppression, resulting in high false negative and false positive rates in tunnel scenarios.

[0004] Therefore, there is an urgent need for a method that can adapt to the complex physical environment of tunnels, effectively integrate multi-scale features, and perform refined detection on targets of different sizes and types, so as to improve the accuracy, efficiency and safety of intelligent inspection of subway tunnels. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of existing technologies and provide a method and system for detecting subway tunnel inspection scenes. This method significantly improves the detection accuracy and robustness for multi-size, multi-category targets in complex tunnel environments by constructing an end-to-end network model that integrates tunnel scene feature enhancement, morphological perception-based hybrid attention-weighted fusion, detection head feature refinement, and physical perception image reconstruction.

[0006] In a first aspect, the present invention provides a detection method for subway tunnel inspection scenarios, comprising:

[0007] The original images collected at equal intervals inside the subway tunnel are acquired, and the original images are subjected to size unification processing and annotation to construct a dataset containing image files, label files and category lists.

[0008] Based on the dataset, a preset image feature enhancement hybrid attention mechanism network is trained to obtain a tunnel defect detection model. The image feature enhancement hybrid attention mechanism network includes a tunnel scene feature enhancement module, a weighted multi-scale fusion module under the morphological perception hybrid attention mechanism, a detection head feature refinement pre-module, and a detection head module.

[0009] A real-time scanned image of a subway tunnel is acquired, and the real-time scanned image is input into the tunnel defect detection model. The tunnel defect detection model outputs the detection result corresponding to the real-time scanned image.

[0010] Secondly, the present invention provides a subway tunnel inspection scene detection system, comprising:

[0011] The acquisition module is configured to acquire raw images collected at equal intervals inside the subway tunnel, perform size unification processing and annotation on the raw images, and construct a dataset containing image files, label files and category lists;

[0012] The training module is configured to train a preset image feature enhancement hybrid attention mechanism network based on the dataset to obtain a tunnel defect detection model. The image feature enhancement hybrid attention mechanism network includes a tunnel scene feature enhancement module, a weighted multi-scale fusion module under the morphological perception hybrid attention mechanism, a detection head feature refinement pre-module, and a detection head module.

[0013] The output module is configured to acquire real-time scanned images of the subway tunnel, input the real-time scanned images into the tunnel defect detection model, and output the detection results corresponding to the real-time scanned images.

[0014] Thirdly, an electronic device is provided, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the steps of the subway tunnel inspection scene detection method according to any embodiment of the present invention.

[0015] Fourthly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein when the program instructions are executed by a processor, the processor performs the steps of the subway tunnel inspection scene detection method according to any embodiment of the present invention.

[0016] The subway tunnel inspection scene detection method and system of this application collects and preprocesses tunnel images to construct a dataset; based on the dataset, a detection network is trained, which includes a tunnel scene feature enhancement module, a morphological perception hybrid attention weighted multi-scale fusion module, and a detection head feature refinement pre-module; the trained model is used to detect real-time scanned images and output results for eight types of targets, such as water seepage, cracks, and falling blocks; optionally, the result image is enhanced by a physical perception reconstruction module that incorporates straightness loss and illumination consistency loss, deformable convolution is used to adapt the target shape, and hybrid attention and dynamic weights are used to achieve accurate multi-scale feature fusion, and feature refinement is performed before detection, which effectively overcomes the problem of multi-size target detection in the complex environment of tunnels and significantly improves the accuracy, robustness and efficiency of inspection. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A flowchart of a subway tunnel inspection scene detection method provided in an embodiment of the present invention;

[0019] Figure 2 This is a structural block diagram of a subway tunnel inspection scene detection system provided in one embodiment of the present invention;

[0020] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, 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.

[0022] Please see Figure 1 The diagram shows a flowchart of a subway tunnel inspection scenario detection method according to this application.

[0023] like Figure 1 As shown, the detection method for subway tunnel inspection scenarios specifically includes the following steps:

[0024] Step S101: Obtain original images collected at equal intervals inside the subway tunnel, perform size unification processing and annotation on the original images, and construct a dataset containing image files, label files and category lists.

[0025] In this step, a multi-component imaging system is used to acquire panoramic images of the tunnel interior at equal intervals (e.g., every 5 meters) inside the subway tunnel. The acquired raw images are then processed to a fixed resolution (e.g., 640x640). The images are named according to a predefined naming convention (e.g., "serial number_year / month / day_location"). Annotation tools (e.g., X-AnyLabeling) are used to label the images, including eight categories: water seepage, cracks, spalling, PIS (Picture Injection System), signal lights, LTE (LTE), axle counter boxes, and cable sealing boxes. A .txt tag file with the same name as the images, an image folder, and a classes.txt category file are generated, collectively forming the dataset.

[0026] Step S102: Based on the dataset, train the preset image feature enhancement hybrid attention mechanism network to obtain the tunnel defect detection model. The image feature enhancement hybrid attention mechanism network includes a tunnel scene feature enhancement module, a weighted multi-scale fusion module under the morphological perception hybrid attention mechanism, a detection head feature refinement pre-module, and a detection head module.

[0027] In this step, the tunnel scene feature enhancement module includes a series of cascaded small target detail enhancement units, a lightweight deformable convolutional shape adaptation unit, and a large target contour enhancement unit.

[0028] The small target detail enhancement unit is an improved C3K2 structure, and the processing includes:

[0029] Batch normalization of the input feature maps yields features with a stable distribution.

[0030] The activated features are obtained by performing a nonlinear transformation on the normalized features using an activation function, wherein the activation function still has a non-zero output when the input is negative;

[0031] The activation features are convolved using convolution kernels to extract edge and texture features, resulting in a detail feature map.

[0032] The detailed feature map and the input feature map are added pixel by pixel through residual connection to obtain the enhanced detailed feature map, which serves as the first output feature map of the small target detail enhancement unit.

[0033] The processing steps of the lightweight deformable convolutional shape adaptation unit include:

[0034] The first output feature map from the small target detail enhancement unit is input into a lightweight branch consisting of a 1×1 convolutional layer, a batch normalization layer, and a SiLU activation function connected in sequence, to predict the offset of the convolutional kernel sampling point corresponding to each spatial location.

[0035] Based on the offset of the convolution kernel sampling points, the regular sampling grid of the standard convolution kernel is adjusted to generate a dynamic non-integer coordinate sampling grid;

[0036] At each non-integer coordinate position of the non-integer coordinate sampling grid, a bilinear interpolation strategy is employed. Based on the feature values ​​of the surrounding integer coordinate positions in the output feature map of the small target detail enhancement unit, the feature values ​​of the non-integer coordinate positions are calculated, thereby determining the dynamic sampling point feature map. The expression for calculating the feature values ​​of the non-integer coordinate positions is as follows:

[0037] ,

[0038] ,

[0039] ,

[0040] In the formula, Deformable convolution at feature map location Output feature value at, For deformable convolution kernels at fixed sampling positions The weighting coefficient at the location, To sample the basic feature map at dynamic sampling locations The feature values ​​obtained by bilinear interpolation sampling at the location, The first-level output is a detail-enhancing feature map, while the input to the deformable convolution is the base feature map. To output the row coordinates on the feature map, The row offset of the sampling points is fixed for the convolution kernel. For in position At this point, the row direction offset of the convolution kernel sampling point is output by the lightweight offset prediction branch. To output the column coordinates on the feature map, The column offset of the sampling points is fixed for the convolution kernel. For in position At this point, the column direction offset of the convolution kernel sampling point is output by the lightweight offset prediction branch. In feature map non-integer The sampled feature values ​​obtained by bilinear interpolation are located at the given location. The row index (0 or 1) of the bilinear interpolation neighborhood. The column index (0 or 1) for the bilinear interpolation neighborhood. The weighting coefficients for bilinear interpolation are determined by the distance between the sampling point and the integer coordinates of its neighborhood. For feature map In the neighborhood integer coordinates The original feature value at that location, Row coordinates of sampling points Round down to the integer part. Column coordinates of sampling points Round down to the nearest integer part.

[0041] The dynamic sampling point feature map is weighted and summed using deformable convolution kernels to output a second output feature map with adapted shape.

[0042] The processing steps of the large target contour enhancement unit include:

[0043] The second output feature map from the lightweight deformable convolutional shape adaptation unit is obtained, and dilated max pooling operations with kernel sizes of k1, k2 and k3 are performed in parallel to obtain multi-scale pooling feature maps with three different receptive fields.

[0044] The three multi-scale pooling feature maps are concatenated along the channel dimension to obtain the aggregated feature map;

[0045] The aggregated feature map is subjected to global average pooling and compressed into a one-dimensional channel feature vector; the one-dimensional channel feature vector is input into a lightweight multilayer perceptron to generate a channel attention weight vector.

[0046] The channel attention weight vector is multiplied with the aggregated feature map by the channel dimension to enhance the key semantic channels, and the enhanced single-scale feature map is output as the third output feature map of the large target contour enhancement unit.

[0047] The weighted multi-scale fusion module under the morphological perception hybrid attention mechanism includes a morphological perception hybrid attention unit and a weighted multi-scale fusion unit:

[0048] The morphology-aware hybrid attention unit is used to receive the first output feature map output by the small target detail enhancement unit, the second output feature map output by the lightweight deformable convolutional morphology adaptation unit, and the third output feature map of the large target contour enhancement unit.

[0049] Global average pooling is performed on the first output feature map, the second output feature map, and the third output feature map respectively. Then, through 1×1 convolution and the Sigmoid activation function, a first channel attention weight corresponding to the first output feature map, a second channel attention weight corresponding to the second output feature map, and a third channel attention weight corresponding to the third output feature map are generated.

[0050] After performing global average pooling and global max pooling on the first output feature map, the second output feature map, and the third output feature map respectively, the corresponding features are concatenated in the channel dimension and then passed through 7×7 convolution and Sigmoid activation function to generate a first spatial attention mask corresponding to the first output feature map, a second spatial attention mask corresponding to the second output feature map, and a third spatial attention mask corresponding to the third output feature map.

[0051] The third spatial attention mask is upsampled for the first time so that the spatial size of the third output feature map is consistent with the spatial size of the first output feature map, thereby obtaining the first cross-scale guidance weight corresponding to the first output feature map. The third spatial attention mask is upsampled for the second time so that the spatial size of the third output feature map is consistent with the spatial size of the second output feature map, thereby obtaining the second cross-scale guidance weight corresponding to the second output feature map.

[0052] The first channel attention weight, the first spatial attention mask, and the first cross-scale guidance weight are multiplied element-wise to obtain the first hybrid attention weight. The first hybrid attention weight is then multiplied pixel-wise with the first output feature map to obtain the first attention enhancement feature map corresponding to the first output feature map.

[0053] The second channel attention weight, the second spatial attention mask, and the second cross-scale guidance weight are multiplied element-wise to obtain the second hybrid attention weight. The second hybrid attention weight is then multiplied pixel-wise with the second output feature map to obtain the second attention enhancement feature map corresponding to the second output feature map.

[0054] The third channel attention weight and the third spatial attention mask are multiplied element-wise to obtain the third hybrid attention weight. The third hybrid attention weight is then multiplied pixel-wise with the third output feature map to obtain the third attention enhancement feature map corresponding to the third output feature map.

[0055] The weighted multi-scale fusion unit is used to perform weighted multi-scale fusion on the first attention-enhanced feature map, the second attention-enhanced feature map, and the third attention-enhanced feature map output by the morphology-aware hybrid attention unit. The specific steps are as follows:

[0056] The second attention enhancement feature map and the third attention enhancement feature map are upsampled so that the spatial size of the second attention enhancement feature map and the spatial size of the third attention enhancement feature map are the same as the spatial size of the first attention enhancement feature map.

[0057] Global average pooling is performed on the scale-aligned first attention enhancement feature map, second attention enhancement feature map, and third attention enhancement feature map to obtain a first global semantic vector corresponding to the first attention enhancement feature map, a second global semantic vector corresponding to the second attention enhancement feature map, and a third global semantic vector corresponding to the third attention enhancement feature map.

[0058] The first global semantic vector, the second global semantic vector, and the third global semantic vector are concatenated and input into a lightweight CBS structure to predict the first dynamic fusion weight corresponding to the first global semantic vector, the second dynamic fusion weight corresponding to the second global semantic vector, and the third dynamic fusion weight corresponding to the third global semantic vector.

[0059] The first attention-enhanced feature map, the second attention-enhanced feature map, and the third attention-enhanced feature map after scale alignment are weighted and summed according to the first dynamic fusion weight, the second dynamic fusion weight, and the third dynamic fusion weight to obtain the fused feature map, expressed as:

[0060] ,

[0061] In the formula, To fuse feature maps, As the first dynamic fusion weight, This is the first attention-enhanced feature map after scale alignment. For the second dynamic fusion weight, This is the scale-aligned second attention-enhanced feature map. For the third dynamic fusion weight, This is the third attention-enhanced feature map after scale alignment.

[0062] The detection head feature refinement pre-module adopts a multi-branch parallel structure, and the processing includes:

[0063] The system receives the fused feature map from the weighted multi-scale fusion module and inputs the channel optimization branch, spatial purification branch, and residual enhancement branch in parallel to obtain the first branch output feature map, the second branch output feature map, and the third branch output feature map, respectively. In the channel optimization branch, the system is processed by a 1×1 depthwise separable convolution, a batch normalization layer, and an activation function.

[0064] In the spatial purification branch, it is processed by a 3×3 depthwise separable convolution, a batch normalization layer and an activation function;

[0065] In the residual enhancement branch, it is processed by a 1×1 convolution;

[0066] Global average pooling is performed on the first branch output feature map, the second branch output feature map, and the third branch output feature map respectively to obtain the first global semantic vector corresponding to the first branch output feature map, the second global semantic vector corresponding to the second branch output feature map, and the third global semantic vector corresponding to the third branch output feature map.

[0067] The first global semantic vector, the second global semantic vector, and the third global semantic vector are concatenated and input into a lightweight multilayer perceptron to predict the first dynamic weight corresponding to the channel optimization branch, the second dynamic weight corresponding to the spatial purification branch, and the third dynamic weight corresponding to the residual enhancement branch.

[0068] Based on the first dynamic weight, the second dynamic weight, and the third dynamic weight, the output feature maps of the first branch, the second branch, and the third branch are weighted and fused to obtain a refined feature map.

[0069] It should be noted that, during the training of the preset image feature enhancement hybrid attention mechanism network based on the aforementioned dataset, the expression for the loss function of the image feature enhancement hybrid attention mechanism network is as follows:

[0070] ,

[0071] ,

[0072] ,

[0073] ,

[0074] In the formula, The overall loss function of the hybrid attention mechanism network, used to enhance image features, measures the overall difference between the network's predictions and the true labels. As the basic loss function, it measures the mean squared error between the reconstructed image and the ground truth image at the pixel level, ensuring basic visual fidelity of the image. This is the weighting coefficient for straightness loss. This is a straightness loss function used to constrain the continuity of linear targets such as cracks and correct feature fractures caused by motion blur. This is a weighting coefficient for the illumination consistency loss, used to balance the proportion of illumination consistency constraints in the total loss. This is the illumination consistency loss function, used to correct for uneven illumination within the tunnel and improve the visual consistency of the reconstructed image. This represents the total number of feature points extracted within the target region, used to average the straightness loss. For the first A dynamic weight mask for each target feature point, with higher weights for feature points closer to the core target region, is used to strengthen the constraints on the core region. For the first The angle between a target feature point and the prior linear structure is considered. The larger the angle, the more severely the point deviates from linear continuity. The height of the image. The width of the image (number of columns). To reconstruct the spatial location of the image The brightness value at that location is used to calculate the illumination uniformity loss. To reconstruct the location in the image The average brightness value of the local area is used as a reference benchmark for the consistency of illumination in that area. The number of channels in the image. To reconstruct the spatial location of the image ,aisle Pixel value at that location, For the spatial location of the real image ,aisle The pixel value at that location.

[0075] Step S103: Obtain a real-time scanned image of the subway tunnel, input the real-time scanned image into the tunnel defect detection model, and the tunnel defect detection model outputs the detection result corresponding to the real-time scanned image.

[0076] In summary, the method of this application, through a series of innovative designs integrating tunnel scene feature enhancement, morphological perception hybrid attention weighted fusion, detection head feature refinement, and physical perception image reconstruction, achieves high-precision and robust detection of multi-size and multi-category targets in complex subway tunnel environments. It also significantly improves the automation level and reliability of inspection operations. Specific technical effects are reflected in:

[0077] First, the designed tunnel scene feature enhancement module effectively solves the problems of easy loss of small target features, misalignment of irregular target shapes, and blurring of the global outline of large targets in tunnel scenes through a three-level collaborative architecture of small target detail enhancement, deformable convolution shape adaptation, and large target contour enhancement, and significantly improves the quality of basic features.

[0078] Second, the weighted multi-scale fusion module under the form perception hybrid attention mechanism achieves adaptive and intelligent fusion of multi-scale features through deep fusion of channel and spatial attention, combined with cross-scale information calibration and dynamic weight allocation. This makes the subtle features of small-sized defects stand out and the boundaries of large-sized targets clearer, effectively reducing the false detection and false detection rates when multiple-sized targets coexist in complex backgrounds.

[0079] Third, the detection head feature refinement pre-module, through a multi-branch parallel structure and dynamic weighted fusion, performs targeted noise filtering and feature purification before the features are sent to the detection head, providing cleaner and more discriminative feature expressions for subsequent classification and localization, thereby directly improving the classification accuracy of eight types of targets, especially easily confused categories.

[0080] Fourth, a physical perception image reconstruction module is introduced. By integrating tunnel physical prior constraints such as straightness loss and illumination consistency loss, the output image not only enhances visual clarity but also better reflects the true physical form of the defect. This not only improves the visualization quality of the algorithm output but also provides a more reliable and intuitive basis for manual review and subsequent maintenance decisions.

[0081] In summary, this solution forms a complete technical loop from feature enhancement, intelligent fusion, accurate detection to result enhancement, comprehensively improving the automated detection capabilities for water seepage, cracks, spalling, and various ancillary facilities and equipment in subway tunnels. It is superior to existing methods in terms of safety, efficiency, and accuracy.

[0082] Please see Figure 2 The diagram shows a structural block diagram of a subway tunnel inspection scene detection system according to this application.

[0083] like Figure 2 As shown, the subway tunnel inspection scene detection system 200 includes an acquisition module 210, a training module 220, and an output module 230.

[0084] The acquisition module 210 is configured to acquire original images collected at equal intervals within the subway tunnel, perform size unification processing and annotation on the original images, and construct a dataset containing image files, label files, and a category list. The training module 220 is configured to train a preset image feature enhancement hybrid attention mechanism network based on the dataset to obtain a tunnel defect detection model. The image feature enhancement hybrid attention mechanism network includes a tunnel scene feature enhancement module, a weighted multi-scale fusion module under the morphological perception hybrid attention mechanism, a detection head feature refinement pre-processing module, and a detection head module. The output module 230 is configured to acquire real-time scanned images of the subway tunnel, input the real-time scanned images into the tunnel defect detection model, and output detection results corresponding to the real-time scanned images.

[0085] It should be understood that Figure 2 The modules and references described in the document Figure 1 The steps described in the text correspond to those in the method described above. Therefore, the operations, features, and corresponding technical effects described above also apply to the method described in the text. Figure 2 The various modules in the document will not be described in detail here.

[0086] In other embodiments, the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein when the program instructions are executed by a processor, the processor performs the subway tunnel inspection scene detection method in any of the above method embodiments.

[0087] In one embodiment, the computer-readable storage medium of the present invention stores computer-executable instructions, which are configured as follows:

[0088] The original images collected at equal intervals inside the subway tunnel are acquired, and the original images are subjected to size unification processing and annotation to construct a dataset containing image files, label files and category lists.

[0089] Based on the dataset, a preset image feature enhancement hybrid attention mechanism network is trained to obtain a tunnel defect detection model. The image feature enhancement hybrid attention mechanism network includes a tunnel scene feature enhancement module, a weighted multi-scale fusion module under the morphological perception hybrid attention mechanism, a detection head feature refinement pre-module, and a detection head module.

[0090] A real-time scanned image of a subway tunnel is acquired, and the real-time scanned image is input into the tunnel defect detection model. The tunnel defect detection model outputs the detection result corresponding to the real-time scanned image.

[0091] Computer-readable storage media may include a stored program area and a stored data area, wherein the stored program area may store an operating system and an application program required for at least one function; the stored data area may store data created based on the use of the subway tunnel inspection scene detection system, etc. Furthermore, the computer-readable storage medium may include high-speed random access memory, and may also include memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the computer-readable storage medium may optionally include memory remotely configured relative to a processor, and these remote memories can be connected to the subway tunnel inspection scene detection system via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0092] Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiment of the present invention, such as... Figure 3 As shown, the device includes a processor 310 and a memory 320. The electronic device may also include an input device 330 and an output device 340. The processor 310, memory 320, input device 330, and output device 340 can be connected via a bus or other means. Figure 3 Taking a bus connection as an example, the memory 320 is the computer-readable storage medium described above. The processor 310 executes various server functions and data processing by running non-volatile software programs, instructions, and modules stored in the memory 320, thereby implementing the subway tunnel inspection scene detection method described in the above embodiment. The input device 330 can receive input digital or character information and generate key signal inputs related to user settings and function control of the subway tunnel inspection scene detection system. The output device 340 may include a display screen or other display device.

[0093] The aforementioned electronic device can execute the method provided in the embodiments of the present invention, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in this embodiment can be found in the method provided in the embodiments of the present invention.

[0094] In one implementation, the above-described electronic device is applied to a subway tunnel inspection scene detection system as a client, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:

[0095] The original images collected at equal intervals inside the subway tunnel are acquired, and the original images are subjected to size unification processing and annotation to construct a dataset containing image files, label files and category lists.

[0096] Based on the dataset, a preset image feature enhancement hybrid attention mechanism network is trained to obtain a tunnel defect detection model. The image feature enhancement hybrid attention mechanism network includes a tunnel scene feature enhancement module, a weighted multi-scale fusion module under the morphological perception hybrid attention mechanism, a detection head feature refinement pre-module, and a detection head module.

[0097] A real-time scanned image of a subway tunnel is acquired, and the real-time scanned image is input into the tunnel defect detection model. The tunnel defect detection model outputs the detection result corresponding to the real-time scanned image.

[0098] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.

[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A detection method for subway tunnel inspection scenarios, characterized in that, include: The original images collected at equal intervals inside the subway tunnel are acquired, and the original images are subjected to size unification processing and annotation to construct a dataset containing image files, label files and category lists. Based on the dataset, a preset image feature enhancement hybrid attention mechanism network is trained to obtain a tunnel defect detection model. The image feature enhancement hybrid attention mechanism network includes a tunnel scene feature enhancement module, a weighted multi-scale fusion module under the morphological perception hybrid attention mechanism, a detection head feature refinement pre-module, and a detection head module. The tunnel scene feature enhancement module includes a small target detail enhancement unit, a lightweight deformable convolutional morphological adaptation unit, and a large target contour enhancement unit, which are cascaded in sequence. The small target detail enhancement unit is an improved C3K2 structure, and the processing includes: Batch normalization of the input feature maps yields features with a stable distribution. The activated features are obtained by performing a nonlinear transformation on the normalized features using an activation function, wherein the activation function still has a non-zero output when the input is negative; The activation features are convolved using convolution kernels to extract edge and texture features, resulting in a detail feature map. The detailed feature map and the input feature map are added pixel by pixel through residual connection to obtain the enhanced detailed feature map, which serves as the first output feature map of the small target detail enhancement unit. The processing steps of the large target contour enhancement unit include: The second output feature map from the lightweight deformable convolutional shape adaptation unit is obtained, and dilated max pooling operations with kernel sizes of k1, k2 and k3 are performed in parallel to obtain multi-scale pooling feature maps with three different receptive fields. The three multi-scale pooling feature maps are concatenated along the channel dimension to obtain the aggregated feature map; The aggregated feature map is subjected to global average pooling and compressed into a one-dimensional channel feature vector; The one-dimensional channel feature vector is input into a lightweight multilayer perceptron to generate a channel attention weight vector; The channel attention weight vector is multiplied with the aggregated feature map by the channel dimension to enhance the key semantic channels, and the enhanced single-scale feature map is output as the third output feature map of the large target contour enhancement unit. A real-time scanned image of a subway tunnel is acquired, and the real-time scanned image is input into the tunnel defect detection model. The tunnel defect detection model outputs the detection result corresponding to the real-time scanned image.

2. The detection method for a subway tunnel inspection scenario according to claim 1, characterized in that, The processing steps of the lightweight deformable convolutional shape adaptation unit include: The first output feature map from the small target detail enhancement unit is input into a lightweight branch consisting of a 1×1 convolutional layer, a batch normalization layer, and a SiLU activation function connected in sequence, to predict the offset of the convolutional kernel sampling point corresponding to each spatial location. Based on the offset of the convolution kernel sampling points, the regular sampling grid of the standard convolution kernel is adjusted to generate a dynamic non-integer coordinate sampling grid; At each non-integer coordinate position of the non-integer coordinate sampling grid, a bilinear interpolation strategy is employed. Based on the feature values ​​of the surrounding integer coordinate positions in the output feature map of the small target detail enhancement unit, the feature values ​​of the non-integer coordinate positions are calculated, thereby determining the dynamic sampling point feature map. The expression for calculating the feature values ​​of the non-integer coordinate positions is as follows: , , , In the formula, Deformable convolution at feature map location Output feature value at, For deformable convolution kernels at fixed sampling positions The weighting coefficient at the location, To sample the basic feature map at dynamic sampling locations The feature values ​​obtained by bilinear interpolation sampling at the location, The first-level output is a detail-enhancing feature map, while the input to the deformable convolution is the base feature map. To output the row coordinates on the feature map, The row offset of the sampling points is fixed for the convolution kernel. For in position At this point, the row direction offset of the convolution kernel sampling point is output by the lightweight offset prediction branch. To output the column coordinates on the feature map, The column offset of the sampling points is fixed for the convolution kernel. For in position At this point, the column direction offset of the convolution kernel sampling point is output by the lightweight offset prediction branch. In feature map non-integer The sampled feature values ​​obtained by bilinear interpolation are located at the given location. For the row index of the bilinear interpolation neighborhood, For the column index of the bilinear interpolation neighborhood, The weighting coefficients for bilinear interpolation are determined by the distance between the sampling point and the integer coordinates of its neighborhood. For feature map In the neighborhood integer coordinates The original feature value at that location, Row coordinates of sampling points Round down to the nearest integer part. Column coordinates of sampling points Round down to the nearest integer part; The dynamic sampling point feature map is weighted and summed using deformable convolution kernels to output a second output feature map with adapted shape.

3. The detection method for a subway tunnel inspection scenario according to claim 1, characterized in that, The weighted multi-scale fusion module under the morphological perception hybrid attention mechanism includes a morphological perception hybrid attention unit and a weighted multi-scale fusion unit: The morphology-aware hybrid attention unit is used to receive the first output feature map output by the small target detail enhancement unit, the second output feature map output by the lightweight deformable convolutional morphology adaptation unit, and the third output feature map of the large target contour enhancement unit. Global average pooling is performed on the first output feature map, the second output feature map, and the third output feature map respectively. Then, through 1×1 convolution and the Sigmoid activation function, a first channel attention weight corresponding to the first output feature map, a second channel attention weight corresponding to the second output feature map, and a third channel attention weight corresponding to the third output feature map are generated. After performing global average pooling and global max pooling on the first output feature map, the second output feature map, and the third output feature map respectively, the corresponding features are concatenated in the channel dimension and then passed through 7×7 convolution and Sigmoid activation function to generate a first spatial attention mask corresponding to the first output feature map, a second spatial attention mask corresponding to the second output feature map, and a third spatial attention mask corresponding to the third output feature map. The third spatial attention mask is upsampled for the first time so that the spatial size of the third output feature map is consistent with the spatial size of the first output feature map, thereby obtaining the first cross-scale guidance weight corresponding to the first output feature map. The third spatial attention mask is upsampled for the second time so that the spatial size of the third output feature map is consistent with the spatial size of the second output feature map, thereby obtaining the second cross-scale guidance weight corresponding to the second output feature map. The first channel attention weight, the first spatial attention mask, and the first cross-scale guidance weight are multiplied element-wise to obtain the first hybrid attention weight. The first hybrid attention weight is then multiplied pixel-wise with the first output feature map to obtain the first attention enhancement feature map corresponding to the first output feature map. The second channel attention weight, the second spatial attention mask, and the second cross-scale guidance weight are multiplied element-wise to obtain the second hybrid attention weight. The second hybrid attention weight is then multiplied pixel-wise with the second output feature map to obtain the second attention enhancement feature map corresponding to the second output feature map. The third channel attention weight and the third spatial attention mask are multiplied element-wise to obtain the third hybrid attention weight. The third hybrid attention weight is then multiplied pixel-wise with the third output feature map to obtain the third attention enhancement feature map corresponding to the third output feature map.

4. The detection method for a subway tunnel inspection scenario according to claim 3, characterized in that, The weighted multi-scale fusion unit is used to perform weighted multi-scale fusion on the first attention-enhanced feature map, the second attention-enhanced feature map, and the third attention-enhanced feature map output by the morphology-aware hybrid attention unit. The specific steps are as follows: The second attention enhancement feature map and the third attention enhancement feature map are upsampled so that the spatial size of the second attention enhancement feature map and the spatial size of the third attention enhancement feature map are the same as the spatial size of the first attention enhancement feature map. Global average pooling is performed on the scale-aligned first attention enhancement feature map, second attention enhancement feature map, and third attention enhancement feature map to obtain a first global semantic vector corresponding to the first attention enhancement feature map, a second global semantic vector corresponding to the second attention enhancement feature map, and a third global semantic vector corresponding to the third attention enhancement feature map. The first global semantic vector, the second global semantic vector, and the third global semantic vector are concatenated and input into a lightweight CBS structure to predict the first dynamic fusion weight corresponding to the first global semantic vector, the second dynamic fusion weight corresponding to the second global semantic vector, and the third dynamic fusion weight corresponding to the third global semantic vector. The first attention-enhanced feature map, the second attention-enhanced feature map, and the third attention-enhanced feature map after scale alignment are weighted and summed according to the first dynamic fusion weight, the second dynamic fusion weight, and the third dynamic fusion weight to obtain the fused feature map, expressed as: , In the formula, To fuse feature maps, As the first dynamic fusion weight, This is the first attention-enhanced feature map after scale alignment. For the second dynamic fusion weight, This is the scale-aligned second attention-enhanced feature map. For the third dynamic fusion weight, This is the third attention-enhanced feature map after scale alignment.

5. A method for detecting subway tunnel inspection scenarios according to claim 1, characterized in that, The detection head feature refinement pre-module adopts a multi-branch parallel structure, and the processing includes: The system receives the fused feature map from the weighted multi-scale fusion module and inputs the channel optimization branch, spatial purification branch, and residual enhancement branch in parallel to obtain the first branch output feature map, the second branch output feature map, and the third branch output feature map, respectively. In the channel optimization branch, the system is processed by a 1×1 depthwise separable convolution, a batch normalization layer, and an activation function. In the spatial purification branch, it is processed by a 3×3 depthwise separable convolution, a batch normalization layer and an activation function; In the residual enhancement branch, it is processed by a 1×1 convolution; Global average pooling is performed on the first branch output feature map, the second branch output feature map, and the third branch output feature map respectively to obtain the first global semantic vector corresponding to the first branch output feature map, the second global semantic vector corresponding to the second branch output feature map, and the third global semantic vector corresponding to the third branch output feature map. The first global semantic vector, the second global semantic vector, and the third global semantic vector are concatenated and input into a lightweight multilayer perceptron to predict the first dynamic weight corresponding to the channel optimization branch, the second dynamic weight corresponding to the spatial purification branch, and the third dynamic weight corresponding to the residual enhancement branch. Based on the first dynamic weight, the second dynamic weight, and the third dynamic weight, the output feature maps of the first branch, the second branch, and the third branch are weighted and fused to obtain a refined feature map.

6. The detection method for a subway tunnel inspection scenario according to claim 1, characterized in that, During the training of the preset image feature enhancement hybrid attention mechanism network based on the dataset, the expression for the loss function of the image feature enhancement hybrid attention mechanism network is as follows: , , , , In the formula, The overall loss function of the hybrid attention mechanism network, used to enhance image features, measures the overall difference between the network's predictions and the true labels. As the basic loss function, it measures the mean squared error between the reconstructed image and the ground truth image at the pixel level, ensuring basic visual fidelity of the image. The weighting coefficients for straightness loss are... This is a straightness loss function used to constrain the continuity of linear targets such as cracks and correct feature fractures caused by motion blur. This is a weighting coefficient for the illumination consistency loss, used to balance the proportion of illumination consistency constraints in the total loss. This is the illumination consistency loss function, used to correct for uneven illumination within the tunnel and improve the visual consistency of the reconstructed image. This represents the total number of feature points extracted within the target region, used to average the straightness loss. For the first A dynamic weight mask for each target feature point, with higher weights for feature points closer to the core target region, is used to strengthen the constraints on the core region. For the first The angle between the target feature point and the prior direction of the linear structure is larger, indicating that the th target feature point is the th target feature point. The more severe the deviation of a target feature point from linear continuity, the better. The height of the image. The width of the image. To reconstruct the spatial location of the image The brightness value at that location is used to calculate the illumination uniformity loss. To reconstruct the location in the image The average brightness value of the local area is used as the location in the reconstructed image. A reference standard for the consistency of illumination in a local area. The number of channels in the image. To reconstruct the spatial location of the image ,aisle Pixel value at that location, For the spatial location of the real image ,aisle The pixel value at that location.

7. A subway tunnel inspection scene detection system, characterized in that, include: The acquisition module is configured to acquire raw images collected at equal intervals inside the subway tunnel, perform size unification processing and annotation on the raw images, and construct a dataset containing image files, label files and category lists; The training module is configured to train a preset image feature enhancement hybrid attention mechanism network based on the dataset to obtain a tunnel defect detection model. The image feature enhancement hybrid attention mechanism network includes a tunnel scene feature enhancement module, a weighted multi-scale fusion module under the morphological perception hybrid attention mechanism, a detection head feature refinement pre-module, and a detection head module. The tunnel scene feature enhancement module includes a small target detail enhancement unit, a lightweight deformable convolutional morphological adaptation unit, and a large target contour enhancement unit, which are cascaded in sequence. The small target detail enhancement unit is an improved C3K2 structure, and the processing includes: Batch normalization of the input feature maps yields features with a stable distribution. The activated features are obtained by performing a nonlinear transformation on the normalized features using an activation function, wherein the activation function still has a non-zero output when the input is negative; The activation features are convolved using convolution kernels to extract edge and texture features, resulting in a detail feature map. The detailed feature map and the input feature map are added pixel by pixel through residual connection to obtain the enhanced detailed feature map, which serves as the first output feature map of the small target detail enhancement unit. The processing steps of the large target contour enhancement unit include: The second output feature map from the lightweight deformable convolutional shape adaptation unit is obtained, and dilated max pooling operations with kernel sizes of k1, k2 and k3 are performed in parallel to obtain multi-scale pooling feature maps with three different receptive fields. The three multi-scale pooling feature maps are concatenated along the channel dimension to obtain the aggregated feature map; The aggregated feature map is subjected to global average pooling and compressed into a one-dimensional channel feature vector; the one-dimensional channel feature vector is input into a lightweight multilayer perceptron to generate a channel attention weight vector. The channel attention weight vector is multiplied with the aggregated feature map by the channel dimension to enhance the key semantic channels, and the enhanced single-scale feature map is output as the third output feature map of the large target contour enhancement unit. The output module is configured to acquire real-time scanned images of the subway tunnel, input the real-time scanned images into the tunnel defect detection model, and output the detection results corresponding to the real-time scanned images.

Citation Information

Patent Citations

  • Method for detecting water seepage and cracks of tunnel

    CN118154516A

  • Drainage pipeline defect detection system and method based on multi-scale feature fusion and shielding perception

    CN121505335A