Shield tunnel crack identification and positioning method and system based on machine vision, electronic equipment and storage medium
Through light compensation and brightness equalization processing, combined with the improved YOLOv5 model and attention mechanism, the problem of uneven light and complex background in the shield tunnel is solved, and high-precision crack identification and positioning is achieved.
Patent Information
- Application Number
- CN202510419884.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-07-18
- Estimated Expiration
- Not applicable · inactive patent
Smart Images

Figure CN120339224A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of shield tunnel crack detection in image processing and deep learning, and particularly to a method, system, electronic device and storage medium for identifying and locating shield tunnel cracks based on machine vision. Background Art
[0002] In the method for identifying and locating shield tunnel cracks, there is a unique technical problem in the image acquisition link: how to ensure that a high-resolution camera can stably and comprehensively capture the images of the inner surface of the tunnel under the complex lighting conditions inside the tunnel. The lighting inside the tunnel is usually uneven, with areas of alternating light and darkness, which can cause overexposed or underexposed parts in the images, affecting the accuracy of subsequent crack identification. In addition, the curvature structure of the tunnel makes it difficult to completely cover all areas when installing the camera, especially the blind area problems at the top and bottom of the tunnel are particularly prominent. The position adjustment of the camera needs to be accurately calculated to avoid image distortion caused by angle deviation, and at the same time, the possible equipment vibration and dust interference during the tunnel construction process also need to be considered, and these factors will have an adverse impact on the image acquisition quality.
[0003] In the image preprocessing stage, how to effectively remove noise and enhance crack features becomes another technical problem. The texture of the inner surface of the tunnel is complex, and there may be interference substances such as water stains and dirt, which are similar to the morphological features of cracks in the images and are prone to false detection. Traditional denoising methods such as frequency domain filtering and spatial domain difference can, to a certain extent, eliminate noise, but when dealing with complex backgrounds, they often lose some detailed information of the cracks. Especially when the crack width is narrow or the contrast is low, the preprocessed image may still not clearly present the complete contour of the cracks, which brings difficulties to subsequent feature extraction and identification.
[0004] In the feature extraction link, how to accurately distinguish cracks from background noise is a more complex technical problem. Traditional image processing techniques rely on manually setting parameters such as area threshold and saturation threshold, but these parameters are often difficult to adaptively adjust in the face of different lighting conditions and background textures, resulting in a high false detection rate. Although deep learning algorithms have advantages in feature extraction, training models require a large amount of labeled data, and the acquisition cost of sample data for shield tunnel cracks is high and the labeling difficulty is large, which limits the generalization ability of the model. In addition, the morphological features of cracks may vary greatly in different tunnels, and how to design an extraction algorithm that can adapt to various crack features becomes the core challenge in this link. Summary of the Invention
[0005] In order to solve the above problems, the present invention proposes a method for identifying and locating shield tunnel cracks based on machine vision, and the method specifically includes:
[0006] Step S1: Obtain the internal light distribution data of the tunnel, and through light compensation, obtain a brightness-balanced image;
[0007] Step S2: Preprocess the brightness-balanced image to obtain a preprocessed image;
[0008] Step S3: Use the improved YOLOv5 model to perform convolution and feature fusion on the preprocessed image to obtain the shield tunnel crack detection result;
[0009] Step S4: Preprocess the internal image of the tunnel to be detected and input it into the improved YOLOv5 model to obtain the shield tunnel crack recognition result, and complete the shield tunnel crack recognition and positioning based on machine vision based on the crack recognition result.
[0010] Optionally, in step S1, the process of obtaining the internal light distribution data of the tunnel and obtaining a brightness-balanced image through light compensation specifically includes:
[0011] Use a sensor to obtain the light intensity inside the tunnel and generate a light distribution map of the tunnel;
[0012] For the bright and dark areas in the light distribution map, extract the brightness values of each area block and draw a brightness change trend line;
[0013] Based on the brightness change trend line, calculate the change value of the bright and dark alternating areas, and obtain the light compensation amount based on the change value;
[0014] Obtain a brightness-balanced image based on the light compensation amount.
[0015] Optionally, the sensor uses a photoresistor array sensor, and a monitoring point is arranged every twenty meters longitudinally in the tunnel, and two monitoring points are arranged in each lane laterally to obtain complete light data inside the tunnel.
[0016] Optionally, in step S2, the preprocessing process specifically includes:
[0017] Perform Gaussian filtering on the brightness-balanced image to obtain a filtered image;
[0018] Perform image restoration on the filtered image using the Lucy-Richardson algorithm to obtain a restored image;
[0019] Gray-scale the restored image to obtain a preprocessed image.
[0020] Optionally, the improved YOLOv5 model is:
[0021] Based on the YOLOv5 basic model, introduce a same-level composite backbone network in the main backbone network tracking to extract the crack features in the preprocessed image;
[0022] Use a feature pyramid network combined with a path aggregation network to perform multi-scale fusion on the crack features;
[0023] Use the CBAM attention mechanism for adaptive adjustment to obtain the shield tunnel crack detection result.
[0024] Optionally, the peer composite backbone network is specifically:
[0025] Replace the ordinary convolution in the CBS module of the YOLOv5 model with depthwise convolution to obtain the DWBS module;
[0026] Stack a number of DWBS to obtain an auxiliary backbone network;
[0027] Combine the auxiliary backbone network with the original main backbone network Darknet to obtain a peer composite backbone network.
[0028] The present invention also discloses a shield tunnel crack recognition and positioning system based on machine vision, the system includes:
[0029] A lighting image acquisition module, used to acquire the internal tunnel lighting distribution data, and obtain a brightness balanced image through lighting compensation;
[0030] A preprocessing module, used to preprocess the brightness balanced image to obtain a preprocessed image;
[0031] A crack detection module, used to perform convolution and feature fusion on the preprocessed image using the improved YOLOv5 model to obtain the shield tunnel crack detection result;
[0032] An identification and positioning module, used to preprocess the internal tunnel image to be detected and input it into the improved YOLO v5 model to obtain the shield tunnel crack identification result, and complete the shield tunnel crack identification and positioning based on machine vision based on the crack identification result.
[0033] The present invention also discloses an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, it implements the shield tunnel crack recognition and positioning method based on machine vision.
[0034] The present invention also discloses a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed, it implements the shield tunnel crack recognition and positioning method based on machine vision.
[0035] Compared with the prior art, the beneficial effects of the present invention are:
[0036] (1) Through light compensation and brightness equalization processing, the present invention solves the problem of image quality differences caused by uneven illumination in the tunnel, making the crack features clearer. The improved YOLOv5 model introduces a same-level composite backbone network and a CBAM attention mechanism, which can extract crack features more accurately and reduce false detections and missed detections;
[0037] (2) The present invention uses a feature pyramid network combined with a path aggregation network to perform multi-scale fusion on crack features, enabling the model to better adapt to cracks of different sizes and shapes;
[0038] (3) Operations such as Gaussian filtering and image restoration in the preprocessing process of the present invention can effectively remove noise and interference, improve image quality, and thus speed up the detection speed. Description of the Drawings
[0039] To more clearly illustrate the technical solutions of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts.
[0040] Figure 1 It is a method flow chart of a shield tunnel crack identification and positioning method based on machine vision according to an embodiment of the present invention;
[0041] Figure 2 It is a schematic structural diagram of a PANet + reverse connection layer according to an embodiment of the present invention;
[0042] Figure 3 It is a schematic structural diagram of an electronic device according to an embodiment of the present invention. Description of the Drawings:
[0044] 1010. Processor; 1020. Memory; 1030. Input / Output Interface; 1040. Communication Interface; 1050. Bus. Detailed Embodiments
[0045] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the drawings and specific embodiments.
[0046] Example 1
[0047] A shield tunnel crack identification and positioning method based on machine vision, as Figure 1 shown, the method includes:
[0048] Step S1. Obtain the internal illumination distribution data of the tunnel, and through light compensation, obtain a brightness-equalized image, specifically including:
[0049] A sensor is used to obtain the light intensity values inside the tunnel and generate a light intensity distribution map of the tunnel. For the bright and dark areas in the light intensity distribution map, the brightness values of each area block are extracted, and a brightness change trend line is plotted. Based on the brightness change trend line, the change value of the bright-dark alternating area is calculated, and the light compensation amount is obtained based on the change value. A brightness equalization image is obtained based on the light compensation amount.
[0050] The sensor uses a photoresistive array sensor. One monitoring point is arranged every twenty meters longitudinally in the tunnel, and two monitoring points are arranged in each lane transversely to obtain complete light intensity data inside the tunnel.
[0051] After the light intensity data is collected, spatial interpolation is required to generate a continuous light intensity distribution map, which can be achieved by using Kriging interpolation method. The light intensity distribution map can be represented by color scales or contour lines, where warm colors represent bright areas and cold colors represent dark areas. Taking a two-way four-lane tunnel as an example, the light intensity value at the entrance section can reach 10,000 lux, while it drops to about 500 lux in the middle section, and then rises to 8,000 lux at the exit section, forming a typical "bright - dark - bright" distribution. For this distribution characteristic, it is necessary to extract the brightness values of each area block and plot the change trend line. The brightness change trend line reflects the driver's visual adaptation process, and too fast bright-dark changes will cause visual discomfort. Taking the tunnel entrance as an example, if the brightness drops from 10,000 lux to 1,000 lux within 100 meters, the change rate reaches 90 lux per meter, far exceeding the comfortable threshold of the human eye. The construction of the light compensation model needs to consider the adaptation time of the human eye. For the entrance section, the compensation amount should have a logarithmic relationship with the external brightness, so that the brightness decreases gradually. Taking the measured data of a certain tunnel as an example, the compensation value at the entrance is 70% of the original brightness, and it decreases by 10% every 20 meters until it reaches the same level as the basic lighting value. The optimized light intensity distribution should show a smooth transition. It can be set that the brightness change rate between adjacent monitoring points does not exceed 30 lux per meter as the threshold standard. Through the intelligent dimming of lighting equipment, the light intensity of each area meets the threshold requirements. If there are still violent fluctuations in a local section, the compensation coefficient of this section needs to be recalculated. The verification of the compensation model can be carried out through various channels. It can either use an illuminometer for on-site remeasurement or use virtual reality technology for driver visual adaptability testing. In actual engineering, an optimization cycle of light compensation usually requires three to four rounds of iteration to achieve the ideal effect. The optimized tunnel lighting not only improves the driving comfort but also can achieve energy conservation and consumption reduction. For example, after a certain tunnel adopts this method, it saves 20% of the power consumption while ensuring the lighting requirements.
[0052] Step S2: Preprocess the brightness equalization image to obtain a preprocessed image;
[0053] The preprocessing process specifically includes: performing Gaussian filtering on the luminance equalized image to obtain a filtered image; performing image restoration on the filtered image using the Lucy-Richardson algorithm to obtain a restored image; and performing grayscale conversion on the restored image to obtain a preprocessed image.
[0054] In the image preprocessing process, first, perform Gaussian filtering on the luminance equalized image to remove noise and smooth the image, obtaining a filtered image. The formula for Gaussian filtering is:
[0055] I filtcred (x, y) = I(x, y) * G(x, y) where I(x, y) is the input image and G(x, y) is the Gaussian kernel, which is usually expressed as:
[0056]
[0057] Here, σ is the standard deviation of the Gaussian kernel, which determines the smoothness of the filtering.
[0058] Next, perform image restoration on the filtered image using the Lucy-Richardson algorithm. This algorithm gradually repairs the blurred or missing parts in the image through an iterative method, and its iterative formula is:
[0059]
[0060] where, f (i) (x, y) is the image after the i-th iteration, g(x, y) is the grayscale value of the original image, h(x, y) is the point spread function, and ∈ is a very small value used to avoid the denominator being zero.
[0061] Finally, perform grayscale conversion on the restored image to obtain a preprocessed image. There are various methods for grayscale conversion. The formula for the common weighted average method is:
[0062] Gray(x, y) = 0.299·R(x, y) + 0.587·G(x, y) + 0.114·B(x, y)
[0063] Here, R(x, y), G(x, y), and B(x, y) are the red, green, and blue channel values of the image at the pixel position (x, y), respectively.
[0064] Through the above steps, after the image undergoes Gaussian filtering, Lucy-Richardson restoration, and grayscale conversion, a preprocessed image that can be used for subsequent analysis is finally obtained.
[0065] Step S3: Use the improved YOLOv5 model to perform convolution and feature fusion on the preprocessed image to obtain the shield tunnel crack detection result;
[0066] The improved YOLOv5 model is as follows:
[0067] Based on the YOLOv5 basic model, a same-level composite backbone network is introduced in the main backbone network tracking to extract crack features in the preprocessed image; the feature pyramid network is used in combination with the path aggregation network to perform multi-scale fusion on the crack features; the CBAM attention mechanism is used for adaptive adjustment to obtain the shield tunnel crack detection result.
[0068] The same-level composite backbone network is specifically: replacing the ordinary convolution in the CBS module of the YOLOv5 model with depthwise convolution to obtain the DWBS module; stacking several DWBS to obtain an auxiliary backbone network; combining the auxiliary backbone network with the original main backbone network Darknet to obtain the same-level composite backbone network.
[0069] The PANet architecture is mainly used to connect two FPN modules. The FPN module on the left is responsible for transmitting deep semantic information to the shallow layer, while the FPN module on the right reversely transmits shallow semantic information to the deep layer. By fusing the deep position information of M3 with the shallow texture information of other stages and transmitting the fused information to the P5 module for further feature extraction, the expression of deep instance information is finally realized in the P3 module, thereby enhancing the model's detection ability for targets of different sizes. However, this method has a significant limitation, that is, it overly relies on the aggregation of adjacent layer features, resulting in difficult effective interaction of long-distance feature information, and thus weakening the neural network's ability to express and extract small target feature information. To solve this problem, two reverse connection paths ① and ② are introduced on the basis of the PANet architecture to aggregate features between non-adjacent layers to improve the decoding end's recognition ability of shield tunnel cracks. During the model training process, paths ① and ② only need to be executed once.
[0070] Starting from this embodiment, as Figure 2 shown, the operation process of path ① is: First, M5 (with a size of 80×80×512) is processed by a convolutional layer with a convolutional kernel size of 3×3 and a stride of 2, and the feature map size is reduced to 40×40×512; then, a max-pooling operation with a stride of 2 is performed on the feature map to further reduce its size to 20×20×512; finally, the obtained feature map is added to M3 (with a size of 40×40×512). The operation process of path ② is: P3 (with a size of 20×20×1024) is first processed by a convolutional layer with a convolutional kernel size of 1×1 and a stride of 1, and the feature map size becomes 40×40×256; subsequently, the feature map size is adjusted to 80×80×256 through an upsampling operation; finally, the obtained feature map is added to P5.
[0071] In the YOLOv51 model, when using a same-level composite backbone network and a reverse connection layer simultaneously, a coupling phenomenon occurs in the neural network, resulting in a decline in network performance compared to when adding only the reverse connection layer. The fundamental reason is that the semantic information feature signals at the encoding end cannot be effectively parsed into instance features at the decoding end. To solve this problem, the CBAM attention mechanism can be adopted to weight-adjust the semantic information through channel attention and spatial attention, so that the encoded information can be parsed into instance information at the decoding end. In the YOLOv51 neural network, the SPPF module performs element-wise weighted adjustment on the feature channels through three Max-pooling operators and outputs a new feature tensor through the Concatenate operation. However, the element-wise channel attention weighted operation in the SPPF module cannot effectively maintain the efficient expression of semantic information. Therefore, introducing the CBAM attention mechanism into the SPPF module and using the CBAM composite attention algorithm to adjust the channel attention expression of the SPPF module is an effective means to improve the quality of semantic information expression in the encoding stage. By combining the SPPF module and the CBAM module to construct a new network structure and leveraging the spatial attention module in the CBAM attention mechanism to adaptively adjust the feature responses at different positions according to the importance of spatial positions in channel attention, the accuracy of crack target detection can be effectively improved.
[0072] Step S4: Preprocess the internal image of the tunnel to be detected and input it into the improved YOLOv5 model to obtain the shield tunnel crack recognition result, and complete the shield tunnel crack recognition and positioning based on machine vision based on the crack recognition result.
[0073] Embodiment 2
[0074] A shield tunnel crack recognition and positioning system based on machine vision, the system includes:
[0075] Step S1: Obtain the internal light distribution data of the tunnel, and obtain a brightness-balanced image through light compensation, specifically including:
[0076] Use a sensor to obtain the light intensity value inside the tunnel and generate a light distribution map of the tunnel; for the bright and dark areas in the light distribution map, extract the brightness values of each area block and draw a brightness change trend line; based on the brightness change trend line, calculate the change value of the bright-dark alternating area, and obtain the light compensation amount based on the change value; obtain the brightness-balanced image based on the light compensation amount.
[0077] The sensor uses a photoresistor array sensor, with a monitoring point arranged every twenty meters longitudinally in the tunnel and two monitoring points arranged in each lane transversely to obtain complete light data inside the tunnel.
[0078] After the light data is collected, spatial interpolation is required to generate a continuous light distribution map, which can be achieved by Kriging interpolation. The light distribution map can be represented by color scales or contour lines, where warm colors indicate bright areas and cold colors indicate dark areas. Taking a two-way four-lane tunnel as an example, the light value at the entrance section can reach 10,000 lux, while it drops to about 500 lux in the middle section, and then rises to 8,000 lux at the exit section, forming a typical "bright - dark - bright" distribution. In response to this distribution characteristic, it is necessary to extract the brightness values of each regional block and draw a trend line of the change. The brightness change trend line reflects the driver's visual adaptation process, and too rapid bright-dark changes will cause visual discomfort. Taking the tunnel entrance as an example, if the brightness drops from 10,000 lux to 1,000 lux within a distance of 100 meters, the change rate reaches 90 lux per meter, far exceeding the comfortable threshold of the human eye. The construction of the light compensation model needs to consider the adaptation time of the human eye. For the entrance section, the compensation amount should have a logarithmic relationship with the external brightness, so that the brightness decreases step by step. Taking the measured data of a certain tunnel as an example, the compensation value at the entrance is 70% of the original brightness, and it decreases by 10% every 20 meters until it reaches the same level as the basic lighting value. The optimized light distribution should show a smooth transition. It can be set that the brightness change rate between adjacent monitoring points does not exceed 30 lux per meter as the threshold standard. Through the intelligent dimming of lighting equipment, the light intensity of each area meets the threshold requirements. If there are still violent fluctuations in a local section, it is necessary to re-calculate the compensation coefficient of this section. The verification of the compensation model can be carried out through various channels. It can either use an illuminometer for on-site re-measurement or use virtual reality technology for driver visual adaptability testing. In actual projects, an optimization cycle of light compensation usually requires three to four rounds of iteration to achieve the ideal effect. The optimized tunnel lighting not only improves the driving comfort but also can achieve energy conservation and consumption reduction. For example, after a certain tunnel adopts this method, it saves 20% of the power consumption while ensuring the lighting requirements.
[0079] Step S2: Preprocess the brightness equalized image to obtain a preprocessed image;
[0080] The preprocessing process specifically includes: performing Gaussian filtering on the brightness equalized image to obtain a filtered image; performing image restoration on the filtered image using the Lucy-Richardson algorithm to obtain a restored image; and performing grayscale conversion on the restored image to obtain a preprocessed image.
[0081] During the image preprocessing process, first perform Gaussian filtering on the brightness equalized image to remove noise and smooth the image to obtain a filtered image. The formula for Gaussian filtering is:
[0082] I filtered (x, y) = I(x, y) * G(x, y)
[0083] Among them, I(x,y) is the input image, and G(x,y) is the Gaussian kernel, which is usually expressed as:
[0084]
[0085] Here, σ is the standard deviation of the Gaussian kernel, which determines the smoothness of the filtering.
[0086] Next, the Lucy-Richardson algorithm is used to restore the filtered image. This algorithm gradually repairs the blurred or missing parts in the image through an iterative method, and its iterative formula is:
[0087]
[0088] where f (i) (x, y) is the image after the i-th iteration, g(x, y) is the gray value of the original image, h(x, y) is the point spread function, and ∈ is a very small value used to avoid the denominator being zero.
[0089] Finally, the restored image is grayscale processed to obtain the preprocessed image. There are various methods for grayscale processing. The common weighted average method formula is:
[0090] Gray(x, y) = 0.299·R(x, y) + 0.587·G(x, y) + 0.114·B(x, y) Here, R(x, y), G(x, y), and B(x, y) are the red, green, and blue channel values of the image at the pixel position (x, y), respectively.
[0091] Through the above steps, after Gaussian filtering, Lucy-Richardson restoration, and grayscale processing of the image, a preprocessed image that can be used for subsequent analysis is finally obtained.
[0092] Step S3: Use the improved YOLOv5 model to perform convolution and feature fusion on the preprocessed image to obtain the shield tunnel crack detection result;
[0093] The improved YOLOv5 model is:
[0094] Based on the YOLOv5 basic model, a peer composite backbone network is introduced in the main backbone network tracking to extract the crack features in the preprocessed image; the feature pyramid network is used to combine with the path aggregation network to perform multi-scale fusion on the crack features; the CBAM attention mechanism is used for adaptive adjustment to obtain the shield tunnel crack detection result.
[0095] The peer composite backbone network is specifically: replace the ordinary convolution in the CBS module of the YOLOv5 model with depthwise convolution to obtain the DWBS module; stack several DWBS to obtain the auxiliary backbone network; combine the auxiliary backbone network with the original main backbone network Darknet to obtain the peer composite backbone network.
[0096] The PANet architecture is mainly used to connect two FPN modules, where the FPN module on the left is responsible for transferring deep semantic information to the shallow layer, while the FPN module on the right is responsible for transferring shallow semantic information back to the deep layer. By fusing the deep position information of M3 with the shallow texture information of other stages, and transmitting the fused information to the P5 module for further feature extraction, the deep instance information is finally expressed in the P3 module, thereby enhancing the model's detection ability for targets of different sizes. However, this method has a significant limitation, that is, it over-relies on the aggregation of features of adjacent layers, which makes it difficult for long-distance feature information to interact effectively, thereby weakening the neural network's ability to express and extract small target feature information. In order to solve this problem, two reverse connection paths ① and ② are introduced on the basis of the PANet architecture to aggregate features between non-adjacent layers to improve the decoding end's ability to recognize shield tunnel cracks. During the model training process, paths ① and ② only need to be executed once.
[0097] Based on this embodiment, Figure 2 As shown in the figure, the operation flow of path ① is as follows: first, M5 (size is 80×80×512) is processed by a convolution layer with a kernel size of 3×3 and a stride of 2, and the feature map size is reduced to 40×40×512; then, the feature map is subjected to a maximum pooling operation with a stride of 2 to further reduce its size to 20×20×512; finally, the resulting feature map is added to M3 (size is 40×40×512). The operation flow of path ② is as follows: P3 (size is 20×20×1024) is first processed by a convolution layer with a kernel size of 1×1 and a stride of 1, and the feature map size becomes 40×40×256; then, the feature map size is adjusted to 80×80×256 through upsampling; finally, the resulting feature map is added to P5.
[0098] In the YOLOv51 model, when the composite backbone network and the reverse connection layer of the same level are used at the same time, the neural network is coupled, resulting in a decrease in network performance compared to when the reverse connection layer is added alone. The fundamental reason is that the semantic information feature signal at the encoding end cannot be effectively parsed into instance features at the decoding end. To solve this problem, the CBAM attention mechanism can be used to weight the semantic information through channel attention and spatial attention, so that the encoded information can be parsed into instance information at the decoding end. In the YOLOv51 neural network, the SPPF module performs element-by-element weighted adjustment on the feature channel through three Max-pooling operators and outputs a new feature tensor through the Concatenate operation. However, the element-by-element channel attention weighted operation in the SPPF module cannot effectively maintain the efficient expression of semantic information. Therefore, introducing the CBAM attention mechanism in the SPPF module and using the CBAM composite attention algorithm to adjust the channel attention expression of the SPPF module is an effective means to improve the quality of semantic information expression in the encoding stage. By combining the SPPF module and the CBAM module to build a new network structure, and with the help of the spatial attention module in the CBAM attention mechanism, the feature responses of different positions are adaptively adjusted according to the importance of spatial positions in channel attention, thereby effectively improving the accuracy of crack target detection.
[0099] Step S4: pre-process the internal image of the tunnel to be detected and input it into the improved YOLOv5 model to obtain the shield tunnel crack recognition result, and complete the shield tunnel crack recognition and positioning based on machine vision based on the crack recognition result.
[0100] Embodiment 3
[0101] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above-mentioned embodiments of the shield tunnel crack identification and positioning method based on machine vision is implemented.
[0102] Figure 3 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.
[0103] The processor 1010 may be implemented in the form of a general - purpose CPU (Central Processing Unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0104] The memory 1020 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When implementing the technical solutions provided in the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0105] The input / output interface 1030 is used to connect to an input / output module to achieve information input and output. The input / output module may be configured as a component in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Among them, the input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0106] The communication interface 1040 is used to connect to a communication module (not shown in the figure) to achieve communication interaction between this device and other devices. Among them, the communication module may achieve communication through a wired method (such as USB (Universal Serial Bus), network cable, etc.) or through a wireless method (such as a mobile network, WIFI (Wireless Fidelity), Bluetooth, etc.).
[0107] The bus 1050 includes a path for transmitting information between various components of the device (such as the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0108] It should be noted that although the above - mentioned device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040, and the bus 1050, in the specific implementation process, this device may also include other components necessary for normal operation. In addition, those skilled in the art can understand that the above - mentioned device may also only include the components necessary to implement the solutions of the embodiments of this specification, and does not necessarily include all the components shown in the figure.
[0109] The system of the above embodiment is used to implement the corresponding machine vision-based shield tunnel crack identification and positioning method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be elaborated here.
[0110] Embodiment 4
[0111] Based on the same inventive concept, corresponding to the method of any of the above embodiments, the present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the machine vision-based shield tunnel crack identification and positioning method of any of the above embodiments.
[0112] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device.
[0113] The computer instructions stored in the storage medium of the above embodiment are used to cause the computer to execute the machine vision-based shield tunnel crack identification and positioning method of any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be elaborated here.
[0114] Those of ordinary skill in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples; under the concept of the present disclosure, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations in different aspects of the embodiments of the present disclosure as described above, which are not provided in detail for the sake of brevity.
[0115] Additionally, for simplicity of explanation and discussion, and so as not to render the embodiments of the present disclosure difficult to understand, well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Further, the devices may be shown in block diagram form in order to avoid rendering the embodiments of the present disclosure difficult to understand, and this also takes into account the fact that details regarding the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present disclosure are to be implemented (i.e., these details should be fully within the understanding of those skilled in the art). In cases where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it will be apparent to those skilled in the art that the embodiments of the present disclosure may be practiced without these specific details or with variations of these specific details. Accordingly, these descriptions should be regarded as illustrative rather than restrictive.
[0116] Although the present disclosure has been described in connection with specific embodiments thereof, many alternatives, modifications, and variations will be apparent to those of ordinary skill in the art based on the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.
[0117] The embodiments described above are only descriptions of the preferred embodiments of the present invention and do not limit the scope of the present invention. Without departing from the spirit of the design of the present invention, various deformations and improvements made by those of ordinary skill in the art to the technical solutions of the present invention shall fall within the protection scope determined by the claims of the present invention.
Claims
1. A method for identifying and locating cracks in shield tunnels based on machine vision, characterized in that The method includes: Step S1: Obtain the internal illumination distribution data of the tunnel, and through illumination compensation, obtain a brightness-balanced image; Step S2: Preprocess the brightness-balanced image to obtain a preprocessed image; Step S3: Use the improved YOLOv5 model to perform convolution and feature fusion on the preprocessed image to obtain the shield tunnel crack detection result; Step S4: Preprocess the internal tunnel image to be detected and input it into the improved YOLOv5 model to obtain the shield tunnel crack recognition result, and complete the shield tunnel crack recognition and positioning based on machine vision based on the crack recognition result.
2. The method for identifying and positioning shield tunnel cracks based on machine vision according to claim 1, wherein, In the step S1, the process of obtaining the internal illumination distribution data of the tunnel and obtaining a brightness-balanced image through illumination compensation specifically includes: Use a sensor to obtain the illumination values inside the tunnel and generate an illumination distribution map of the tunnel; For the bright and dark areas in the illumination distribution map, extract the brightness values of each area block and draw a brightness change trend line; Based on the brightness change trend line, calculate the change value of the bright-dark alternating area, and obtain the illumination compensation amount based on the change value; Obtain a brightness-balanced image based on the illumination compensation amount.
3. The method for identifying and positioning cracks in a shield tunnel based on machine vision according to claim 2, wherein The sensor uses a photoresistor array sensor, with a monitoring point arranged every twenty meters longitudinally in the tunnel and two monitoring points arranged in each lane transversely to obtain complete illumination data inside the tunnel.
4. The method for identifying and positioning cracks in a shield tunnel based on machine vision according to claim 1, wherein In the step S2, the preprocessing process specifically includes: Perform Gaussian filtering on the brightness-balanced image to obtain a filtered image; Perform image restoration on the filtered image using the Lucy-Richardson algorithm to obtain a restored image; Perform grayscale processing on the restored image to obtain a preprocessed image.
5. The method for identifying and positioning shield tunnel cracks based on machine vision according to claim 1, characterized in that, The improved YOLOv5 model is: Based on the YOLOv5 basic model, introduce a same-level composite backbone network in the main backbone network tracking to extract the crack features in the preprocessed image; Use a feature pyramid network combined with a path aggregation network to perform multi-scale fusion on the crack features; Use the CBAM attention mechanism for adaptive adjustment to obtain the shield tunnel crack detection result.
6. The method for identifying and positioning shield tunnel cracks based on machine vision according to claim 5, wherein, The same-level composite backbone network specifically is: Replace the ordinary convolution in the CBS module of the YOLOv5 model with depthwise convolution to obtain a DWBS module; Stack several DWBSs to obtain an auxiliary backbone network; Combine the auxiliary backbone network with the original main backbone network Darknet to obtain a same-level composite backbone network.
7. A shield tunnel crack identification and positioning system based on machine vision, the system being used to implement the shield tunnel crack identification and positioning method according to any one of claims 1-6, characterized in that, The system includes: An illumination image acquisition module, which is used to obtain the internal illumination distribution data of the tunnel, and through illumination compensation, obtain a brightness-balanced image; A preprocessing module, which is used to preprocess the brightness-balanced image to obtain a preprocessed image; A crack detection module, which is used to use the improved YOLOv5 model to perform convolution and feature fusion on the preprocessed image to obtain the shield tunnel crack detection result; An identification and positioning module, which is used to preprocess the internal tunnel image to be detected and input it into the improved YOLO v5 model to obtain the shield tunnel crack recognition result, and complete the shield tunnel crack recognition and positioning based on machine vision based on the crack recognition result.
8. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program which, when executed, implements the method according to any one of claims 1 to 6.
Citation Information
Cited By
Tunnel portal dynamic light and signal control system based on vision algorithm
CN120751553A
Tunnel portal dynamic light and signal control system based on visual algorithm
CN120751553B