Tunnel obstacle detection method and system based on YOLO
Through the tunnel obstacle detection method based on the YOLOv5 model, combined with lighting features and geometric feature extraction, the image brightness and contrast are dynamically adjusted, the problem of insufficient independent obstacle avoidance capabilities of tunnel robots is solved, and high-precision and efficient obstacle detection are achieved.
Patent Information
- Application Number
- CN202510133368.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-06
- Publication Date
- 2025-05-09
AI Technical Summary
The existing tunnel robots have low self-avoiding ability, resulting in low obstacle avoidance reliability and working efficiency, and high-precision obstacle recognition and detection are needed.
Using the tunnel obstacle detection method based on the YOLOv5 model, by extracting the lighting characteristics of the image and the geometric characteristics of the tunnel, combining the Swin-EnlightenGAN algorithm and the Swin Transformer network, the brightness and contrast of the image are dynamically adjusted, and a tunnel environment model is constructed to assist in object detection.
It improves the accuracy and speed of tunnel obstacle detection, enhances the model's perception ability in complex lighting environments, and meets the efficient and accurate identification and detection requirements of obstacles in tunnel scenarios.
Smart Images

Figure CN119964126A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a tunnel obstacle detection method and system based on YOLO. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] The tunnel construction environment is relatively harsh. Using robots to replace workers to perform dangerous and difficult construction tasks in the tunnel environment can effectively improve work efficiency and ensure the safety of workers' lives.
[0004] The current tunnel robot has low autonomy, which results in low obstacle avoidance reliability and work efficiency. Therefore, the robot needs to have the function of autonomous obstacle avoidance, and the premise of autonomous obstacle avoidance is to perform high-precision identification and detection of obstacles in front of the robot. Summary of the invention
[0005] In order to solve the above problems, the present invention proposes a tunnel obstacle detection method and system based on YOLO. Based on the YOLOv5 model, and aiming at the particularity of tunnel construction scenes, a series of adaptive improvements are made to the YOLOv5 model, which improves the detection accuracy of tunnel obstacles and can identify and detect targets faster.
[0006] In order to achieve the above object, the present invention adopts the following technical solution:
[0007] In a first aspect, the present invention provides a tunnel obstacle detection method based on YOLO, comprising the following steps:
[0008] Collect image data in tunnel construction scenes and annotate the image datasets;
[0009] Extracting illumination features of the image to obtain an illumination feature map, calculating illumination distribution of the image based on the illumination feature map, dynamically adjusting brightness and contrast of the image according to the illumination distribution of the image to obtain a first image, and performing feature extraction on the first image to obtain a first feature map;
[0010] Extracting geometric features of the tunnel, obtaining a tunnel position distribution map based on the geometric features of the tunnel, fusing the tunnel position distribution map with the first feature map to obtain a joint feature map, and using the joint feature map to detect tunnel obstacles;
[0011] Define the loss function, optimize the model parameters, and obtain the trained tunnel obstacle detection model;
[0012] The trained tunnel obstacle detection model is used to detect the image to be detected.
[0013] As an optional implementation, the method further includes preprocessing the collected image data in the tunnel construction scene, specifically:
[0014] The image is mirror-flipped, and the Swin-EnlightenGAN algorithm is used to enhance the brightness of the darker image. Finally, the image is randomly divided into training set, validation set and test set.
[0015] As an optional implementation, Swin-UNet is used to replace the UNet architecture in the EnlightenGAN generator network to obtain the Swin-EnlightenGAN algorithm.
[0016] As an optional implementation, a Swin Transformer network is used to extract the illumination features of an image. The Swin Transformer network introduces a multi-scale attention mechanism at a specific level to capture illumination changes in different spatial ranges. The Swin Transformer network has a sliding window mechanism to process images at different resolutions in a hierarchical manner.
[0017] As an optional implementation, a tunnel location distribution map is obtained based on the geometric characteristics of the tunnel, specifically:
[0018] The geometric features of the tunnel are extracted through a convolutional neural network to obtain a geometric structure diagram. Based on the geometric structure diagram and the position distribution information of obstacles, the tunnel position distribution map is obtained, and the probability area where objects appear in the tunnel is displayed.
[0019] As an optional implementation, the loss function is defined as FocalLoss, and the parameters in the FocalLoss loss function are modified according to the data set to enhance the model's detection capability for dim images.
[0020] In a second aspect, the present invention provides a tunnel obstacle detection system based on YOLO, comprising:
[0021] The data acquisition module is configured to: collect image data in the tunnel construction scene and annotate the image data set;
[0022] The feature extraction module is configured to: extract illumination features of the image to obtain an illumination feature map, calculate illumination distribution of the image based on the illumination feature map, dynamically adjust brightness and contrast of the image according to the illumination distribution of the image to obtain a first image, and perform feature extraction on the first image to obtain a first feature map;
[0023] The environmental feature auxiliary module is configured to: extract the geometric features of the tunnel, obtain a tunnel position distribution map based on the geometric features of the tunnel, fuse the tunnel position distribution map with the first feature map to obtain a joint feature map, and use the joint feature map to detect tunnel obstacles;
[0024] The model training module is configured to: define a loss function, optimize model parameters, and obtain a trained tunnel obstacle detection model;
[0025] The output module is configured to detect the image to be detected using the trained tunnel obstacle detection model.
[0026] In a third aspect, the present invention provides an electronic device comprising a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method described in the first aspect is completed.
[0027] In a fourth aspect, the present invention provides a computer-readable storage medium for storing computer instructions, wherein when the computer instructions are executed by a processor, the method described in the first aspect is performed.
[0028] In a fifth aspect, the present invention provides a computer program product, comprising a computer program, which, when executed by a processor, implements the method described in the first aspect.
[0029] Compared with the prior art, the present invention has the following beneficial effects:
[0030] The present invention discloses a tunnel obstacle detection method and system based on YOLO, which uses an improved Swin-EnlightenGAN algorithm to enhance low-light images, improves the contrast of dim images, extracts the illumination features of images through the SwinTransforme network, and combines the illumination features at different scales into the YOLOv5 backbone network to enhance the perception ability of the model in complex illumination environments. According to the global illumination information of the image, the brightness and contrast of the image are dynamically adjusted to eliminate the illumination unevenness in the tunnel environment. Through the above operations, the brightness and contrast of the image will be adjusted to the desired state, so that the image features are more easily extracted in the tunnel environment. A tunnel environment model is constructed, and the environmental features are used to assist target detection, and the loss function of the YOLOv5 model is modified for dim scenes. By making a series of adaptive improvements to the YOLOv5 model, the model can directly give the category probability and position of the object, and at the same time, the original model is lightweighted, so that the model can recognize and detect the target faster while maintaining a high accuracy, meeting the efficient and accurate recognition and detection requirements of obstacles in tunnel scenes.
[0031] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0033] Figure 1 A flowchart of a tunnel obstacle detection method based on YOLO provided in Example 1 of the present invention;
[0034] Figure 2 A data set label distribution diagram of a tunnel obstacle detection method based on YOLO provided in Example 1 of the present invention;
[0035] Figure 3 This is a diagram of a detection example using a YOLO-based tunnel obstacle detection method provided in Example 1 of the present invention. DETAILED DESCRIPTION
[0036] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0037] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0038] It should be noted that the terms used herein are only for describing specific embodiments, and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "include" and "have" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0039] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0040] Example 1
[0041] like Figure 1 As shown, this embodiment provides a tunnel obstacle detection method based on YOLO, comprising the following steps:
[0042] S1 collects image data in the tunnel construction scene and annotates the image data set;
[0043] S2 extracts illumination features of the image to obtain an illumination feature map, calculates illumination distribution of the image based on the illumination feature map, dynamically adjusts brightness and contrast of the image according to the illumination distribution of the image to obtain a first image, and extracts features from the first image to obtain a first feature map;
[0044] S3 extracts geometric features of the tunnel, obtains a tunnel position distribution map based on the geometric features of the tunnel, fuses the tunnel position distribution map with the first feature map to obtain a joint feature map, and uses the joint feature map to detect tunnel obstacles;
[0045] S4 defines the loss function, optimizes the model parameters, and obtains a trained tunnel obstacle detection model;
[0046] S5 uses the trained tunnel obstacle detection model to detect the image to be detected.
[0047] The process also includes S6 preprocessing the collected image data in the tunnel construction scene, specifically:
[0048] The image is mirror-flipped, and the Swin-EnlightenGAN algorithm is used to enhance the brightness of the darker image. Finally, the image is randomly divided into training set, validation set and test set.
[0049] Among them, Swin-UNet is used to replace the UNet architecture in the EnlightenGAN generator network to obtain the Swin-EnlightenGAN algorithm.
[0050] First, obstacle image data in tunnel scenes are collected. Obstacles include construction workers, construction vehicles, and traffic cones that may hinder the robot’s movement. About 3,000 images are collected to build a tunnel obstacle dataset.
[0051] Secondly, the Swin-EnlightenGAN algorithm is used to perform low-light enhancement processing on the dim images in the obstacle dataset to improve the contrast of the dim images. The specific steps are as follows:
[0052] A. Collect images of the same scene under normal lighting and low lighting conditions, name the corresponding images with the same name, and place them in different folders to build the required low-light enhanced image dataset. This classification storage method can help the model better learn the mapping relationship from low light to normal light.
[0053] B. After configuring the low-light enhancement training set, keep the default hyperparameter settings and iteratively train the low-light enhancement model. After the training is completed, a model that can enhance low-light images is obtained. After calling the model and inputting a low-light image, the model can generate an enhanced high-contrast image through the generator.
[0054] Then, all images are mirrored and flipped to expand the dataset.
[0055] Finally, the preprocessed image data is divided and labeled. The specific steps are as follows:
[0056] A. All images are randomly divided into training set, validation set and test set in a ratio of 8:1:1 to ensure that the images in the test set and validation set are somewhat different from those in the training set to reduce overfitting of the model.
[0057] B. Use annotation tools to annotate obstacle images and divide them into 6 categories, such as Figure 2 As shown, the labels are people, excavator, mixer truck, muck truck, shovel car and traffic cone, and the annotation results are saved as a txt file suitable for YOLOv5 model training. In this embodiment, the final training set contains 5200 images, the validation set contains 400 images, and the test set contains 400 images.
[0058] Through the above operations, the required data set is obtained.
[0059] Improve the YOLOv5 model: This paper selects YOLOv5 as the basic model and makes a series of improvements. The specific improvements are as follows:
[0060] A tunnel lighting adaptive module is proposed and added to the YOLOv5 model. The module includes three core parts: lighting feature extraction, adaptive lighting normalization and environmental feature assisted detection.
[0061] Among them, the illumination feature extraction part:
[0062] In the feature extraction network of YOLOv5, a small sub-network based on Swin Transformer is added to extract illumination-related features. This sub-network introduces a multi-scale attention mechanism at a specific level to capture illumination changes in different spatial ranges.
[0063] Using the sliding window mechanism of Swin Transformer, images are processed at different resolutions in a hierarchical manner. The multi-head self-attention mechanism within each window can capture the details of local illumination changes, while the interaction between windows helps the model understand the illumination patterns in a larger range.
[0064] After the output of Swin Transformer, a feature pyramid is constructed to combine the illumination features at different scales into the YOLOv5 backbone network to enhance the model's perception ability in complex lighting environments.
[0065] Adaptive lighting normalization part:
[0066] After the input layer of YOLOv5, an illumination analysis module is added to count the illumination distribution of the input image using the brightness histogram of the image. This module can extract illumination features using a convolutional neural network (CNN) and count the brightness histogram of the image based on these features. In addition, the illumination mean and variance of the image are calculated through the global pooling layer and the fully connected layer to help further analyze the illumination conditions of the image.
[0067] According to the illumination statistics of the image, an adaptive normalization layer is designed. This layer can dynamically adjust the brightness and contrast of the image according to the global illumination information of the image, thereby eliminating the illumination unevenness in the tunnel environment. The specific method is as follows:
[0068] Illumination mean calculation: Use a convolutional neural network to extract features from the input image I and generate an illumination feature map. This step can be achieved through a lightweight convolutional layer, which outputs a low-dimensional feature map representing the brightness information of each area in the image.
[0069] Use the global pooling layer to pool the illumination feature map to obtain the illumination mean μ of the entire image. This mean can represent the overall brightness level of the image. The formula is as follows:
[0070]
[0071] Where N is the number of pixels in the image, I i is the brightness value of the i-th pixel.
[0072] Contrast calculation: The contrast of the image is quantified by calculating the standard deviation σ of the image brightness. The larger the standard deviation, the higher the contrast of the image. The formula is as follows:
[0073]
[0074] Among them, I i is the brightness value of the i-th pixel, and μ is the mean illumination value.
[0075] The brightness and contrast of the image are dynamically adjusted through linear transformation. The formula is as follows:
[0076] I′=α·(I-μ)+β
[0077] Where I′ is the adjusted image, I is the original input image, μ is the illumination mean, α and β are adaptively calculated scaling and offset parameters, respectively. These parameters are calculated by analyzing the illumination histogram and contrast of the image.
[0078] Through this transformation, the brightness and contrast of the image will be adjusted to the desired state, making it easier to extract image features in the tunnel environment.
[0079] In order to deal with the problem of local uneven illumination, the input image is divided into blocks of 32×32 size. For each block area, the illumination information such as brightness and contrast of the area is counted, and the illumination feature value of each area is calculated.
[0080] According to the local illumination analysis results, the normalization parameters of the area are calculated to adjust the brightness and contrast of the image in the area. The formula is as follows:
[0081] I i ′=α i ·(I i -μ i )+β i
[0082] Among them, I i ′ is the adjusted block region image, I i is the original block region image, μ i is the average brightness of the block area, α i and β i are the scaling and offset parameters of the region respectively.
[0083] Local normalization is performed using a linear transformation by applying the calculated normalization parameters to the image. After all the tiles have been normalized, they are reassembled to form the final global image.
[0084] Environmental feature assisted detection:
[0085] Tunnel environment model construction: Collect a large amount of image data of tunnel scenes, especially covering tunnel geometric structures of different shapes and sizes, such as arches, straight segments, ramps, etc., and extract the geometric features of the tunnel through a convolutional neural network.
[0086] By annotating and training the collected tunnel scene geometric structure diagrams, a tunnel geometric structure prediction model based on deep learning is constructed. Through the prediction model, it is possible to input tunnel scene images and output the corresponding geometric structure diagram, indicating the geometric layout of the tunnel and potential target locations.
[0087] The location distribution information of obstacles is collected by using the annotation information in the obstacle dataset constructed by this method.
[0088] These position distributions are modeled using convolutional neural networks. The model inputs a tunnel image and outputs a position distribution map that displays the probability area where objects appear in the tunnel.
[0089] Fusion of environmental information and target detection: Before the detection head of the YOLOv5 model, the output of the tunnel environment model is fused with the feature map extracted by YOLOv5.
[0090] Through the channel splicing operation, the environment feature map is spliced with the feature map of YOLOv5 to form a joint feature map with more information.
[0091] The detection head of YOLOv5 takes the fused feature map as input, and completes the final detection and classification of the target through subsequent convolutional layers, regression layers, and classification layers.
[0092] In addition to the above model improvements, this application improves the loss function of the YOLOv5 model for dim environments.
[0093] The loss function is changed to FocalLoss, and the parameters in the FocalLoss loss function are modified according to the data set to enhance the model's detection ability for dim images.
[0094] The formula of FocalLoss loss function is as follows:
[0095] FL(p t )=-α t (1-p t ) γ log(p t )
[0096] Among them, p t is the model’s predicted probability for the target category, α t It is used to coordinate the balance between positive and negative samples, and γ is used to reduce the weight of simple samples.
[0097] The data set used in this disclosure includes six detection categories, and there is a certain difference in the number of labels in each category, which leads to an imbalance in the number of samples. Therefore, the weight in the FocalLoss loss function is modified from the original 0.25 to 0.5 to adjust the balance between samples and improve the model's detection ability for dim targets.
[0098] Since the detection scene is dimly lit and the collected images are blurry, making it difficult to identify the target, the γ value in the FocalLoss loss function is adjusted to 4 to make the model more focused on difficult samples, which helps the network pay more attention to difficult-to-identify targets and improves the detection performance of the model in dim scenes.
[0099] The obstacle detection model disclosed in the present invention also includes a brightness detection module corresponding to the Swin-EnlightenGAN low-light enhancement module. In the brightness detection module, the image brightness threshold is set to 20. Before detecting the image, the brightness of the image is first calculated and then compared with the brightness threshold. If the brightness is lower than the threshold, the image is enhanced before detection, otherwise the original image is directly used for detection.
[0100] Use the data set to train the improved model and obtain the weight file. The specific steps are as follows:
[0101] Set the initial parameters of the training model: the maximum number of iterations is set to 100; the batch size is set to 32; the pre-trained weights are not used for training; other hyperparameters are kept as default, that is, the initial learning rate is 0.01, the weight decay coefficient is 0.0005, the learning rate momentum is 0.937, and the stochastic gradient descent method is used as the optimizer.
[0102] Put the processed training set, validation set and test set into the improved model for training to obtain the weight file.
[0103] Use the trained weight file to test and verify the image. The test results are as follows Figure 3 As shown in the figure, the detection model can accurately and efficiently detect different categories of tunnel obstacle targets and meet the detection requirements of application scenarios.
[0104] Example 2
[0105] This embodiment provides a tunnel obstacle detection system based on YOLO, including:
[0106] The data acquisition module is configured to: collect image data in the tunnel construction scene and annotate the image data set;
[0107] The feature extraction module is configured to: extract illumination features of the image to obtain an illumination feature map, calculate illumination distribution of the image based on the illumination feature map, dynamically adjust brightness and contrast of the image according to the illumination distribution of the image to obtain a first image, and perform feature extraction on the first image to obtain a first feature map;
[0108] The environmental feature auxiliary module is configured to: extract the geometric features of the tunnel, obtain a tunnel position distribution map based on the geometric features of the tunnel, fuse the tunnel position distribution map with the first feature map to obtain a joint feature map, and use the joint feature map to detect tunnel obstacles;
[0109] The model training module is configured to: define a loss function, optimize model parameters, and obtain a trained tunnel obstacle detection model;
[0110] The output module is configured to detect the image to be detected using the trained tunnel obstacle detection model.
[0111] It should be noted that the above modules correspond to the steps described in Example 1, and the examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above Example 1. It should be noted that the above modules, as part of the system, can be executed in a computer system such as a set of computer executable instructions.
[0112] In further embodiments, there is also provided:
[0113] An electronic device includes a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method described in Embodiment 1 is performed. For the sake of brevity, it will not be described in detail here.
[0114] It should be understood that in this embodiment, the processor may be a central processing unit CPU, and the processor may also be other general-purpose processors, digital signal processors DSP, application-specific integrated circuits ASIC, off-the-shelf programmable gate arrays FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0115] The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.
[0116] A computer-readable storage medium is used to store computer instructions, and when the computer instructions are executed by a processor, the method described in Example 1 is completed.
[0117] The method in Example 1 can be directly embodied as a hardware processor, or a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it is not described in detail here.
[0118] A computer program product includes a computer program, and when the computer program is executed by a processor, the method described in embodiment 1 is implemented.
[0119] The present invention also provides at least one computer program product tangibly stored on a non-transitory computer-readable storage medium. The computer program product includes computer executable instructions, such as instructions included in a program module, which are executed in a device on a real or virtual processor of the target to perform the process / method as described above. Typically, program modules include routines, programs, libraries, objects, classes, components, data structures, etc. that perform specific tasks or implement specific abstract data types. In various embodiments, the functions of program modules can be combined or divided between program modules as needed. Machine executable instructions for program modules can be executed in local or distributed devices. In distributed devices, program modules can be located in local and remote storage media.
[0120] The computer program code for implementing the method of the present invention can be written in one or more programming languages. These computer program codes can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the computer or other programmable data processing device, causes the function / operation specified in the flow chart and / or block diagram to be implemented. The program code can be executed completely on a computer, partially on a computer, as an independent software package, partially on a computer and partially on a remote computer or completely on a remote computer or server.
[0121] In the context of the present invention, computer program codes or related data may be carried by any appropriate carrier to enable a device, apparatus or processor to perform the various processes and operations described above. Examples of carriers include signals, computer readable media, and the like. Examples of signals may include electrical, optical, radio, acoustic or other forms of propagation signals, such as carrier waves, infrared signals, and the like.
[0122] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with this embodiment can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0123] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. A tunnel obstacle detection method based on YOLO, characterized in that: The following steps are involved: Collect image data in tunnel construction scenes and annotate the image datasets; Extracting illumination features of the image to obtain an illumination feature map, calculating illumination distribution of the image based on the illumination feature map, dynamically adjusting brightness and contrast of the image according to the illumination distribution of the image to obtain a first image, and performing feature extraction on the first image to obtain a first feature map; Extracting geometric features of the tunnel, obtaining a tunnel position distribution map based on the geometric features of the tunnel, fusing the tunnel position distribution map with the first feature map to obtain a joint feature map, and using the joint feature map to detect tunnel obstacles; Define the loss function, optimize the model parameters, and obtain the trained tunnel obstacle detection model; The trained tunnel obstacle detection model is used to detect the image to be detected.
2. The tunnel obstacle detection method based on YOLO as claimed in claim 1, characterized in that: It also includes preprocessing the collected image data in the tunnel construction scene, specifically: The image is mirror-flipped, and the Swin-EnlightenGAN algorithm is used to enhance the brightness of the darker image. Finally, the image is randomly divided into training set, validation set and test set.
3. A tunnel obstacle detection method based on YOLO as claimed in claim 2, characterized in that: The Swin-EnlightenGAN algorithm is obtained by replacing the UNet architecture in the EnlightenGAN generator network with Swin-UNet.
4. The tunnel obstacle detection method based on YOLO as claimed in claim 1, characterized in that: The Swin Transformer network is used to extract the illumination features of the image. The Swin Transformer network introduces a multi-scale attention mechanism at a specific level to capture illumination changes in different spatial ranges. The Swin Transformer network has a sliding window mechanism to process images at different resolutions in a hierarchical manner.
5. The tunnel obstacle detection method based on YOLO as claimed in claim 1, characterized in that: The tunnel location distribution map is obtained based on the geometric characteristics of the tunnel, specifically: The geometric features of the tunnel are extracted through a convolutional neural network to obtain a geometric structure diagram. Based on the geometric structure diagram and the position distribution information of obstacles, the tunnel position distribution map is obtained, and the probability area where objects appear in the tunnel is displayed.
6. The tunnel obstacle detection method based on YOLO as claimed in claim 4, characterized in that: The loss function is defined as FocalLoss, and the parameters in the FocalLoss loss function are modified according to the data set to enhance the model's detection ability for dim images.
7. A tunnel obstacle detection system based on YOLO, characterized in that: include: The data acquisition module is configured to: collect image data in the tunnel construction scene and annotate the image data set; The feature extraction module is configured to: extract illumination features of the image to obtain an illumination feature map, calculate illumination distribution of the image based on the illumination feature map, dynamically adjust brightness and contrast of the image according to the illumination distribution of the image to obtain a first image, and perform feature extraction on the first image to obtain a first feature map; The environmental feature auxiliary module is configured to: extract the geometric features of the tunnel, obtain a tunnel position distribution map based on the geometric features of the tunnel, fuse the tunnel position distribution map with the first feature map to obtain a joint feature map, and use the joint feature map to detect tunnel obstacles; The model training module is configured to: define a loss function, optimize model parameters, and obtain a trained tunnel obstacle detection model; The output module is configured to detect the image to be detected using the trained tunnel obstacle detection model.
8. An electronic device, characterized in that: The method comprises a memory and a processor and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method according to any one of claims 1 to 6 is completed.
9. A computer-readable storage medium, characterized in that: Used to store computer instructions, which, when executed by a processor, complete the method described in any one of claims 1 to 6.
10. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.