Lane line identification method under strong light and weak light backgrounds based on YOLO v9
By judging the lighting scene in the lane line recognition method and performing targeted pre-processing, combined with the improved YOLO v9 model and attention mechanism, the problem of low lane line recognition accuracy in strong and low light environments is solved, and higher recognition accuracy is achieved under multiple scales.
Patent Information
- Application Number
- CN202510583762.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2045-05-07
AI Technical Summary
The existing lane line recognition methods are insufficient in high and low light environments, especially the YOLO v9 model cannot effectively utilize multi-scale features, resulting in a reduced lane line recognition accuracy.
By judging the lighting scene of the image data during the vehicle's autonomous driving process, different preprocessing methods (such as strong light suppression and low light enhancement) are used to process the image data, and lane line recognition is used to use the improved YOLO v9 model to introduce the channel attention mechanism and the spatial attention mechanism to weighted fusion of feature data.
Improve the accuracy of lane line recognition under complex lighting conditions, dynamically adjust image features to adapt to different lighting conditions, and improve the accuracy of target detection.
Smart Images

Figure CN120472413A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition technology, and in particular to a lane line recognition method under strong light and weak light backgrounds based on YOLO v9. Background Art
[0002] Lane recognition is a core function in autonomous driving and advanced driver assistance systems (ADAS). The accuracy of the recognition results is directly related to vehicle safety, driving reliability, and the stability of the autonomous driving system. In actual driving environments, lane detection faces complex and changing lighting challenges. When the vehicle is in a strong light environment, it is very easy to cause image overexposure and loss of lane line details. When the vehicle is in a low-light environment, the signal-to-noise ratio of the image captured by the camera is low, and the contrast between the lane line and the background is poor. Complex lighting conditions result in poor quality of the collected image data to be recognized, requiring preprocessing of the image data to be recognized. Existing preprocessing methods have significant shortcomings. In existing preprocessing methods, whether in strong or low light conditions, they all rely on a fixed image enhancement strategy called histogram equalization. This results in poor preprocessing of the image data to be recognized, affecting the accuracy of lane recognition.
[0003] In addition, the lane recognition model built based on the YOLO v9 model shows certain advantages in improving lane recognition accuracy. However, faced with the slender and continuous structural characteristics of lane lines, the existing YOLO v9 model cannot fully utilize multi-scale features and has difficulty in simultaneously capturing the global structural information and local detail information of lane lines, which significantly reduces the model's lane recognition accuracy under complex lighting conditions.
[0004] It can be seen that how to improve the accuracy of lane line recognition has become a technical problem that needs to be solved urgently by those skilled in the art. Summary of the Invention
[0005] The present invention provides a lane line recognition method, system, device and medium based on YOLO v9 in strong light and weak light backgrounds to solve the technical problem of how to improve the accuracy of lane line recognition and achieve the effect of improving the accuracy of lane line recognition.
[0006] In a first aspect, the present invention provides a lane line recognition method under strong light and weak light backgrounds based on YOLO v9, the method comprising:
[0007] During the automatic driving process of the vehicle, first image data to be recognized and light intensity data are collected at the same time, and scene judgment is performed on the first image data to be recognized based on the light intensity data to obtain the scene to which the first image data to be recognized belongs, where the scene includes at least a strong light scene and a weak light scene;
[0008] Determining a corresponding preprocessing method based on the scene to which it belongs, so as to preprocess the first image data to be recognized to obtain second image data to be recognized, wherein the preprocessing is set to perform a strong light suppression process on the first image data to be recognized belonging to the strong light scene, and perform a weak light enhancement process on the first image data to be recognized belonging to the weak light scene;
[0009] According to the illumination intensity data, a pre-trained lane line recognition model is used to perform lane line recognition on the second image data to be recognized to obtain a lane line recognition result of the first image data to be recognized. The lane line recognition model is constructed using an improved YOLO v9 model. The neck network of the improved YOLO v9 model is set to perform channel attention mechanism processing and spatial attention mechanism processing on the combined feature data composed of illumination feature data and image feature data, respectively, and obtain corresponding channel weights and spatial weights, and based on the channel weights and the spatial weights, the illumination feature data and the image feature data are weightedly fused to obtain a fused feature map. The fused feature map is used to input the detection head. The illumination feature data is extracted from the illumination intensity data, and the image feature data is extracted from the second image data to be recognized.
[0010] Preferably, performing scene judgment on the first image data to be identified based on the light intensity data to obtain the scene to which the first image data to be identified belongs includes:
[0011] Setting a light intensity calibration threshold according to the light intensity data, wherein the light intensity calibration threshold includes a maximum light intensity calibration threshold and a minimum light intensity calibration threshold;
[0012] Performing brightness statistical analysis on the first image data to be identified to obtain a brightness mean and a brightness variance;
[0013] If the brightness mean is greater than or equal to the maximum light intensity calibration threshold, and the brightness variance is greater than or equal to a preset brightness variance calibration threshold, determining the scene to which the first image data to be identified belongs as a high-light scene;
[0014] If the brightness mean is less than the minimum light intensity calibration threshold, and the brightness variance is less than the brightness variance calibration threshold, the scene to which the first image data to be identified belongs is determined to be a low-light scene.
[0015] Preferably, determining a corresponding preprocessing method according to the scene to which it belongs, so as to preprocess the first image data to be identified to obtain the second image data to be identified, includes:
[0016] If the first image data to be identified belongs to the strong light scene, performing strong light suppression processing on the first image data to be identified using an improved limited contrast adaptive histogram equalization algorithm to obtain strong light suppressed image data;
[0017] If the first image data to be identified belongs to the low-light scene, performing low-light enhancement processing on the first image data to be identified using an improved Retinex network model to obtain low-light enhanced image data;
[0018] The strong-light suppressed image data or the weak-light enhanced image data is determined as second image data to be identified.
[0019] Preferably, the step of performing strong light suppression processing on the first image data to be identified using an improved limited contrast adaptive histogram equalization algorithm to obtain strong light suppressed image data comprises:
[0020] Adaptively dividing the first image data to be identified into regions according to the brightness variance of the first image data to be identified to obtain a plurality of sub-image data;
[0021] An adaptive local contrast limiting threshold is set according to the brightness mean of the first image data to be identified, and histogram equalization processing is performed on each of the sub-image data according to the adaptive local contrast limiting threshold to obtain image data after strong light suppression.
[0022] Preferably, the setting formula of the adaptive local contrast limit threshold is:
[0023] Clip Limit=2.0+0.1×(I avg -128)
[0024] Among them, Clip Limit represents the adaptive local contrast limit threshold, I avg Represents the average brightness value of the first image data to be identified.
[0025] Preferably, the step of performing low-light enhancement processing on the first image data to be identified using an improved Retinex network model to obtain low-light enhanced image data includes:
[0026] Decomposing the first image data to be recognized to obtain an illumination layer and a reflection layer;
[0027] The reflective layer is adaptively gamma corrected and then fused with the illumination layer to obtain weak-light enhanced image data.
[0028] Preferably, the combined feature data composed of the illumination feature data and the image feature data are processed by a channel attention mechanism and a spatial attention mechanism respectively, and the channel weight and the spatial weight are obtained respectively, including:
[0029] Mapping the illumination feature data to a high-dimensional vector space to obtain illumination high-dimensional feature data;
[0030] Using a spatial broadcasting algorithm, spatially aligning the illumination high-dimensional feature data and the image feature data to obtain combined feature data;
[0031] Performing channel attention mechanism processing on the combined feature data to obtain channel weights;
[0032] The combined feature data is processed using a spatial attention mechanism to obtain a spatial weight.
[0033] In a second aspect, the present invention further provides a lane line recognition system based on YOLO v9 in strong light and weak light backgrounds, which implements the above-mentioned lane line recognition method based on YOLO v9 in strong light and weak light backgrounds. The system includes: a scene confirmation unit, a preprocessing unit, and a lane line recognition unit;
[0034] The scene confirmation unit is configured to collect first image data to be identified and light intensity data at the same time during the automatic driving process of the vehicle, and perform scene judgment on the first image data to be identified based on the light intensity data to obtain the scene to which the first image data to be identified belongs, wherein the scene includes at least a strong light scene and a weak light scene;
[0035] The preprocessing unit is configured to determine a corresponding preprocessing method according to the scene to which it belongs, so as to preprocess the first image data to be recognized to obtain second image data to be recognized, wherein the preprocessing method is configured to perform a strong light suppression process on the first image data to be recognized belonging to the strong light scene, and to perform a weak light enhancement process on the first image data to be recognized belonging to the weak light scene;
[0036] The lane line recognition unit is used to perform lane line recognition on the second image data to be recognized based on the illumination intensity data using a pre-trained lane line recognition model to obtain a lane line recognition result of the first image data to be recognized. The lane line recognition model is constructed using an improved YOLO v9 model. The neck network of the improved YOLO v9 model is set to perform channel attention mechanism processing and spatial attention mechanism processing on the combined feature data composed of illumination feature data and image feature data, respectively, to obtain corresponding channel weights and spatial weights, and based on the channel weights and the spatial weights, perform weighted fusion on the illumination feature data and the image feature data to obtain a fused feature map. The fused feature map is used to input the detection head. The illumination feature data is extracted from the illumination intensity data, and the image feature data is extracted from the second image data to be recognized.
[0037] In a third aspect, the present invention also provides a computer device, comprising a memory, a processor, and a transceiver, which are connected via a bus; the memory is used to store a set of computer program instructions and data, and transmit the stored data to the processor, and the processor executes the program instructions stored in the memory to execute the above-mentioned YOLOv9-based lane line recognition method under strong light and weak light backgrounds.
[0038] In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium. When the computer program is executed, the above-mentioned lane line recognition method under strong light and weak light backgrounds based on YOLO v9 is implemented.
[0039] This application provides a lane line recognition method based on YOLO v9 in strong light and weak light backgrounds. Compared with the existing technology, it has the following beneficial effects:
[0040] The present application discloses a lane line recognition method under strong light and weak light backgrounds based on YOLO v9. By judging the scene to which the first image data to be recognized belongs, if it belongs to a strong light scene, the first image data to be recognized is subjected to strong light suppression processing; if it belongs to a weak light scene, the first image data to be recognized is subjected to weak light enhancement processing. This method can optimize the image quality in a variety of complex lighting conditions and improve the accuracy of lane line recognition. The channel attention mechanism and the spatial attention mechanism act together in the processing process of the feature map, so that the lane line recognition model can automatically select the optimal image feature data according to the lighting feature data at multiple scales, and appropriately enhance the image feature data under different lighting conditions to achieve dynamic lighting perception adjustment. It can effectively fuse and optimize image features from different scales at multiple scales, effectively improving the accuracy of target detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 This is a schematic diagram of the steps of a lane line recognition method under strong light and weak light backgrounds based on YOLO v9 provided by a preferred embodiment of the present invention;
[0042] Figure 2 This is a schematic diagram of the structure of a lane line recognition system under strong light and weak light backgrounds based on YOLO v9, provided by a preferred embodiment of the present invention;
[0043] Figure 3 1 is a diagram showing the internal structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0044] The following is a detailed explanation of the embodiments of the present invention in conjunction with the accompanying drawings. The embodiments are provided for illustrative purposes only and cannot be understood as limitations on the present invention. The accompanying drawings are for reference and illustration purposes only and do not constitute a limitation on the scope of patent protection of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. In the description of the present invention, the terms "first", "second", "third", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first", "second", "third", etc. may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, the meaning of "multiple" is two or more.
[0045] In the description of the present invention, it should be noted that, unless otherwise expressly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or an indirect connection through an intermediate medium, or it can be a communication between the two components. The terms "vertical", "horizontal", "left", "right", "up", "down" and similar expressions used herein are for illustrative purposes only, and do not indicate or imply that the device or component referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0046] In describing the present invention, it should be noted that, unless otherwise defined, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art. The terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. Those skilled in the art will understand the specific meanings of the above terms in the present invention in specific circumstances.
[0047] See also Figure 1 In an embodiment of the present invention, a lane line recognition method under strong light and weak light backgrounds based on YOLO v9 is provided, the method comprising:
[0048] S1. During the automatic driving process of the vehicle, the first image data to be identified and the light intensity data are collected at the same time, and based on the light intensity data, the scene judgment is performed on the first image data to be identified to obtain the scene to which the first image data to be identified belongs, and the scene includes at least a strong light scene and a weak light scene; in a preferred embodiment of the present application, the first image data to be identified and the light intensity data of the vehicle's environment are collected at the same time, and the first image data to be identified needs to be further preprocessed before it can be used for lane line recognition. In a preferred embodiment of the present application, before preprocessing the image, it is necessary to judge the scene to which the first image data to be identified belongs, and select a corresponding preprocessing method based on the scene judgment result. Among them, the scenes include at least strong light scenes, weak light scenes and balanced lighting scenes, and different preprocessing methods need to be adopted for different scenes.
[0049] In a preferred embodiment of the present application, scene judgment is performed on the first image data to be identified based on the light intensity data, and a specific implementation method for obtaining the scene to which the first image data to be identified belongs is: setting a light intensity calibration threshold according to the light intensity data, and the light intensity calibration threshold includes a maximum light intensity calibration threshold and a minimum light intensity calibration threshold. In a preferred embodiment of the present application, the maximum light intensity calibration threshold is:
[0050] T high =0.7L sensor
[0051] Among them, T high Indicates the maximum light intensity calibration threshold, L sensor Indicates light intensity.
[0052] The minimum light intensity calibration threshold is:
[0053] T low =0.3L sensor
[0054] Among them, T low Indicates the minimum light intensity calibration threshold.
[0055] A brightness statistical analysis is performed on the first image data to be identified to obtain the brightness mean and brightness variance of the first image data to be identified. Furthermore, the brightness variance calibration threshold is set to 50, and scene judgment is performed on the first image data to be identified based on the light intensity calibration threshold and the brightness variance calibration threshold. If the brightness mean of the first image data to be identified is greater than or equal to the highest light intensity calibration threshold, and the brightness variance is greater than or equal to the pre-set brightness variance calibration threshold, the scene to which the first image data to be identified belongs is determined to be a strong light scene; if the brightness mean of the first image data to be identified is less than the lowest light intensity calibration threshold, and the brightness variance is less than the brightness variance calibration threshold, the scene to which the first image data to be identified belongs is determined to be a weak light scene.
[0056] For the first image data to be identified that belongs to neither a strong light scene nor a weak light scene, the scene to which it belongs is determined to be a balanced lighting scene. Accordingly, the first image data to be identified that belongs to the balanced lighting scene does not need to be preprocessed and can be directly used for lane line recognition.
[0057] In a preferred embodiment of the present application, the first image data to be identified is dynamically divided into scenes based on the light intensity data of the vehicle's own environment to obtain accurate scene division results. A targeted preprocessing method can be further used on the first image data to be identified based on the scene division results to improve the preprocessing effect, obtain high-quality image data to be identified, and effectively improve the accuracy of subsequent lane line recognition.
[0058] S2. Determine a corresponding preprocessing method according to the scene to which it belongs, so as to preprocess the first image data to be identified to obtain second image data to be identified, wherein the preprocessing is set to perform strong light suppression processing on the first image data to be identified belonging to the strong light scene, and perform weak light enhancement processing on the first image data to be identified belonging to the weak light scene; in a preferred embodiment of the present application, targeted preprocessing methods are selected for different scenes, and an improved limited contrast adaptive histogram equalization algorithm is used to perform strong light suppression processing on the first image data to be identified belonging to the strong light scene, and corresponding image data after strong light suppression is obtained; and an improved Retinex network model is used to perform weak light enhancement processing on the first image data to be identified belonging to the weak light scene, and corresponding image data after weak light enhancement is obtained.
[0059] The contrast-limited adaptive histogram equalization algorithm is a technique used for image enhancement. Traditional histogram equalization algorithms perform a global histogram equalization adjustment on the entire image, enhancing contrast by mapping the image's grayscale value distribution to a more uniform range. However, this approach can over-amplify noise in the image and has limited effectiveness in enhancing local contrast. The contrast-limited adaptive histogram equalization algorithm divides the image into many small blocks and performs histogram equalization on each block separately to better adapt to local contrast variations in the image and avoid the over-enhancement or detail loss that can result from global equalization. Furthermore, to prevent excessive contrast enhancement from causing noise amplification, a contrast limit threshold is pre-set. When the frequency of a grayscale level exceeds the contrast limit threshold, it is cropped, and the excess is evenly distributed across other grayscale levels before the histogram equalization operation is performed again.
[0060] In the preferred embodiment of the present application, a dynamic block strategy is proposed. First, a global variance calculation is performed on the brightness channel of the first image data to be identified to obtain the brightness variance. Further, the block size is determined, and according to σ 2 The block size is dynamically adjusted, with the block size as the window size and sliding in steps of 1 / 2 the block size to generate multiple overlapping sub-image data. Areas that cannot be fully covered at the edge of the image are mirrored to ensure that all pixels are covered. Adaptive region division is performed on the first image data to be identified based on its brightness variance, generating multiple sub-image data. This provides more precise division of high-brightness areas and avoids edge artifacts caused by fixed block division.
[0061] Furthermore, histogram equalization is performed on each sub-image data according to the set adaptive local contrast limiting threshold. In the preferred embodiment of the present application, the setting formula of the adaptive local contrast limiting threshold is:
[0062] Clip Limit=2.0+0.1×(I avg -128)
[0063] Among them, Clip Limit represents the adaptive local contrast limit threshold, I avg Represents the average brightness value of the first image data to be identified.
[0064] Histogram equalization is performed on the sub-image data whose brightness value is greater than the adaptive local contrast limit threshold to limit the contrast enhancement amplitude. The brightness of the sub-image data after histogram equalization is expressed as:
[0065] I output (i,j)=min(I(i,j),220+0.5×(I(i,j)-220))
[0066] Among them, I output (i, j) represents the brightness data of the sub-image data after histogram equalization, I(i, j) represents the original brightness data of the sub-image data, and min represents the minimum value.
[0067] After obtaining the equalized sub-image data, bilinear interpolation is used to eliminate the differences between blocks to obtain the image data after strong light suppression.
[0068] The improved contrast-limited adaptive histogram equalization algorithm in this application performs fine-grained image processing based on the light intensity of different areas. While preserving the lane line texture, it effectively suppresses overexposed areas in the image, thereby reducing visual interference caused by strong light and ensuring that key structures such as lane lines are clearly visible.
[0069] The Retinex network model is a model used for image enhancement and color constancy processing. It is based on the human visual system's color perception and believes that an object's color is primarily determined by its reflective properties, rather than the color and intensity of the illuminating light. The Retinex network model decomposes the image formation process into reflective and illumination components. In other words, an image can be represented as the product of reflective and illumination components. The reflective component reflects the inherent properties of an object's surface and is related to its color and texture. The illumination component represents the lighting conditions in a scene and may cause problems such as uneven lighting and color deviation in the image.
[0070] In a preferred embodiment of the present application, depthwise separable convolution is used to extract illumination features and reflection features from the first image data to be identified, and then a 1×1 convolution is used to integrate channel information to obtain illumination layers and reflection layers, with the number of channels compressed to 128. Adaptive gamma correction is performed on the reflection layer, and the adaptive gamma value is corrected using the following formula:
[0071] R enhanced =R 1 / γ
[0072] γ=1+0.5(1-I avg )
[0073] Among them, R enhanced represents the enhanced reflection layer data after gamma correction, R represents the original reflection layer data, and γ represents the adaptive gamma value, which is used to control the correction intensity.
[0074] In a preferred embodiment of the present application, the γ parameter is automatically adjusted according to the average brightness of the first image data to be identified, thereby adaptively adjusting the gamma value of the reflective layer and optimizing the contrast of the reflective layer.
[0075] The adaptive gamma-corrected reflection layer and illumination layer are multiplied pixel by pixel to obtain the low-light enhanced image data.
[0076] The improved Retinex network model in this application can enhance the reflective component and effectively constrain the smoothness of the illumination layer, thereby improving the brightness and contrast of the image, avoiding overfitting of noise, and reducing computational overhead.
[0077] Furthermore, the image data after strong light suppression or the image data after weak light enhancement is determined as the second image data to be identified. If the first image data to be identified belongs to a strong light scene, the image data after strong light suppression is determined as the second image data to be identified; if the first image data to be identified belongs to a weak light scene, the image data after weak light enhancement is determined as the second image data to be identified; if the first image data to be identified belongs to a balanced lighting scene, the first image data to be identified can be directly determined as the second image data to be identified.
[0078] In a preferred embodiment of the present application, by judging the scene to which the first image data to be identified belongs and selecting a corresponding image preprocessing method based on the scene judgment result, it is possible to optimize the image quality in a targeted manner under various complex lighting conditions and improve the accuracy of lane line recognition.
[0079] S3. According to the illumination intensity data, a pre-trained lane line recognition model is used to perform lane line recognition on the second image data to be recognized to obtain a lane line recognition result of the first image data to be recognized. The lane line recognition model is constructed using an improved YOLO v9 model. The neck network of the improved YOLO v9 model is set to perform channel attention mechanism processing and spatial attention mechanism processing on the combined feature data composed of illumination feature data and image feature data, respectively, and obtain channel weights and spatial weights respectively. Based on the channel weights and the spatial weights, the illumination feature data and the image feature data are weightedly fused to obtain a fused feature map. The fused feature map is used to input a detection head. The illumination feature data is extracted from the illumination intensity data, and the image feature data is extracted from the second image data to be recognized. In a preferred embodiment of the present application, a YOLO v9 model is selected to construct a lane line recognition model. The YOLO v9 model includes a backbone network, a neck network and a detection head. The backbone network is used to extract features of different scales on the input illumination intensity data and the second image data to be recognized to obtain feature map data of different scales. The neck network further processes and fuses the feature map data output by the backbone network. Through a series of convolution, upsampling, and downsampling operations, it combines feature map data at different scales, providing the detection head with richer and more representative feature information. The detection head then performs classification and object recognition based on this fused feature information from the neck network, ultimately outputting lane detection results.
[0080] In a preferred embodiment of the present application, in order to introduce the perception of light intensity data, the neck network of the YOLO v9 model is improved, and the channel attention mechanism and the spatial attention mechanism are introduced into the neck network to dynamically adjust the weights of the light-sensitive areas in the feature map under different lighting conditions, thereby improving the adaptability of the lane line recognition model to lighting changes and the accuracy of lane line recognition.
[0081] After training the improved YOLO v9 model, a lane recognition model is obtained. During actual autonomous driving, before inputting the illumination intensity data and the second image data to be identified into the lane recognition model, a learnable fully connected layer is used to map the illumination feature data into a high-dimensional vector space to obtain high-dimensional illumination feature data. The dimension setting is consistent with the number of feature channels in the backbone network. This converts the illumination intensity data into a high-level feature representation that can be combined with the second image data to be identified, thereby injecting illumination-related information into the second image data to be identified. Furthermore, a spatial broadcasting algorithm is used to expand the high-dimensional illumination feature data into a tensor of the same size as the second image data to be identified. The high-dimensional illumination feature data is spatially aligned with the second image data to ensure that the illumination features of each pixel can be effectively combined with the image features at the corresponding position to obtain combined feature data.
[0082] Furthermore, the combined feature data is processed using a channel attention mechanism and a spatial attention mechanism, respectively, to obtain corresponding channel weights and spatial weights. During the channel attention mechanism, the spatially aligned combined feature data is sequentially subjected to channel-by-channel multiplication, global average pooling, fully connected layer weight compression, and function activation to obtain channel weights. The channel attention mechanism calculates the response strength of each channel of the first feature map after channel-by-channel multiplication to assess which channels are most important for lane line detection under current lighting conditions. By introducing lighting features, it can automatically adjust the weights of each channel, allowing the lane line recognition model to pay more attention to feature channels that are more affected by lighting, thereby improving the accuracy of lane line recognition.
[0083] During the spatial attention mechanism, the spatially aligned combined feature data undergoes channel concatenation, 3×3 convolution, and function activation to obtain spatial weights. During the spatial attention mechanism, the high-dimensional illumination feature data and image feature data are fine-tuned in the spatial dimension. By calculating the response importance of each position in the second feature map after channel concatenation, the spatial attention mechanism adjusts the weights of different regions of the second image to be identified based on local illumination characteristics. This is particularly true in areas with large illumination variations, such as shadows, overexposure, or reflections. This allows the lane recognition model to more intelligently focus on and enhance the features of illumination-sensitive areas in the second image to be identified, ensuring that details in these areas are not lost due to illumination variations.
[0084] Finally, based on the channel weights and spatial weights, the illumination feature data and image feature data are weighted and fused to obtain a fused feature map. The channel weights are used as the weights of the first feature map after channel-by-channel multiplication, and the spatial weights are used as the weights of the second feature map after channel concatenation. These two features are then added channel by channel to perform a weighted fusion of the illumination feature data and image feature data. This fused feature map is then input into the detection head for lane recognition, resulting in the lane recognition result.
[0085] In a preferred embodiment of the present application, the channel attention mechanism and the spatial attention mechanism work together in the feature map processing process, so that the lane line recognition model can automatically select the optimal image feature data based on the illumination feature data at multiple scales, and appropriately enhance the image feature data under different illumination conditions to achieve dynamic illumination perception adjustment, so that the improved neck network can effectively fuse and optimize image features from different scales at multiple scales, provide more accurate and robust feature representation for subsequent detection tasks, and effectively improve the accuracy of target detection.
[0086] In a preferred embodiment of the present invention, during the automatic driving process of the vehicle, first image data to be identified and light intensity data are collected at the same time, and based on the light intensity data, scene judgment is performed on the first image data to be identified to obtain the scene to which the first image data to be identified belongs, and the scene at least includes a strong light scene and a weak light scene; based on the scene to which it belongs, a corresponding preprocessing method is determined to preprocess the first image data to be identified to obtain second image data to be identified, and the preprocessing is set to perform strong light suppression processing on the first image data to be identified belonging to the strong light scene, and perform weak light enhancement processing on the first image data to be identified belonging to the weak light scene; based on the light intensity data, a pre-trained lane line recognition model is used to perform lane line recognition on the second image data to be identified to obtain the lane line recognition result of the first image data to be identified, and the lane line recognition model is constructed using an improved YOLO v9 model, and the improved YOLO The neck network of the v9 model is set to perform channel attention mechanism processing and spatial attention mechanism processing on the combined feature data composed of illumination feature data and image feature data, respectively, and obtain channel weights and spatial weights respectively. Based on the channel weights and spatial weights, the illumination feature data and image feature data are weightedly fused to obtain a fused feature map. The fused feature map is used to input the detection head. The illumination feature data is extracted from the illumination intensity data, and the image feature data is extracted from the second image data to be identified. The lane line recognition method under strong light and weak light backgrounds based on YOLO v9 disclosed in this application determines the scene to which the first image data to be recognized belongs. If it belongs to a strong light scene, the first image data to be recognized is subjected to strong light suppression processing; if it belongs to a weak light scene, the first image data to be recognized is subjected to weak light enhancement processing. This method can optimize the image quality under various complex lighting conditions and improve the accuracy of lane line recognition. The channel attention mechanism and the spatial attention mechanism work together in the processing of the feature map, so that the lane line recognition model can automatically select the optimal image feature data according to the lighting feature data at multiple scales, and appropriately enhance the image feature data under different lighting conditions to achieve dynamic lighting perception adjustment. It can effectively fuse and optimize image features from different scales at multiple scales, effectively improving the accuracy of target detection.
[0087] Accordingly, if Figure 2 As shown, according to a lane line recognition method under strong light and weak light backgrounds based on YOLO v9, an embodiment of the present invention further provides a lane line recognition system under strong light and weak light backgrounds based on YOLO v9, which implements the lane line recognition method under strong light and weak light backgrounds based on YOLO v9 disclosed in an embodiment of the present invention. The system includes: a scene confirmation unit, a preprocessing unit, and a lane line recognition unit;
[0088] The scene confirmation unit is configured to collect first image data to be identified and light intensity data at the same time during the automatic driving process of the vehicle, and perform scene judgment on the first image data to be identified based on the light intensity data to obtain the scene to which the first image data to be identified belongs, wherein the scene includes at least a strong light scene and a weak light scene;
[0089] The preprocessing unit is configured to determine a corresponding preprocessing method according to the scene to which it belongs, so as to preprocess the first image data to be recognized to obtain second image data to be recognized, wherein the preprocessing method is configured to perform a strong light suppression process on the first image data to be recognized belonging to the strong light scene, and to perform a weak light enhancement process on the first image data to be recognized belonging to the weak light scene;
[0090] The lane line recognition unit is used to perform lane line recognition on the second image data to be recognized based on the illumination intensity data using a pre-trained lane line recognition model to obtain a lane line recognition result of the first image data to be recognized. The lane line recognition model is constructed using an improved YOLO v9 model. The neck network of the improved YOLO v9 model is set to perform channel attention mechanism processing and spatial attention mechanism processing on the combined feature data composed of illumination feature data and image feature data, respectively, to obtain corresponding channel weights and spatial weights, and based on the channel weights and the spatial weights, perform weighted fusion on the illumination feature data and the image feature data to obtain a fused feature map. The fused feature map is used to input the detection head. The illumination feature data is extracted from the illumination intensity data, and the image feature data is extracted from the second image data to be recognized.
[0091] For the specific definition of a lane line recognition system under strong light and weak light backgrounds based on YOLO v9, please refer to the above-mentioned definition of a lane line recognition method under strong light and weak light backgrounds based on YOLO v9, which will not be repeated here. Those of ordinary skill in the art will appreciate that the various modules and steps described in conjunction with the embodiments disclosed in the present invention can be implemented in hardware, software, or a combination of both. 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 the present invention.
[0092] like Figure 3As shown, an embodiment of the present invention provides a computer device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the steps in the above-mentioned embodiment of the lane line recognition method under strong light and weak light backgrounds based on YOLO v9 are implemented, for example Figure 1 Steps S1 to S3 described in .
[0093] Those skilled in the art will understand that the schematic Figure 3 These are merely examples of computer devices and do not constitute limitations on the computer device. The computer device may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the computer device may also include input and output devices, network access devices, buses, etc.
[0094] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the computer device, connecting various parts of the entire computer device using various interfaces and lines.
[0095] The memory can be used to store the computer programs and / or modules, and the processor implements various functions of the computer device by running or executing the computer programs and / or modules stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created based on the use of the mobile phone (such as audio data, a phone book, etc.). In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage device.
[0096] Wherein, if the module integrated in the computer device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0097] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through a computer program. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0098] Accordingly, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to perform the steps of the lane line recognition method under strong light and weak light backgrounds based on YOLO v9 in the above embodiment, for example Figure 1 Steps S1 to S3 described in .
[0099] In summary, the embodiments of the present application provide a method, system, device and medium for lane line recognition under strong light and weak light backgrounds based on YOLO v9, which solves the technical problem of how to improve the accuracy of lane line recognition. The method includes: during the automatic driving of the vehicle, collecting the first image data to be recognized and the light intensity data at the same time, and performing scene judgment on the first image data to be recognized based on the light intensity data to obtain the scene to which the first image data to be recognized belongs, and the scene includes at least a strong light scene and a weak light scene; according to the scene to which it belongs, determining the corresponding preprocessing method to preprocess the first image data to be recognized to obtain the second image data to be recognized, and the preprocessing is set to perform strong light suppression processing on the first image data to be recognized belonging to the strong light scene, and perform weak light enhancement processing on the first image data to be recognized belonging to the weak light scene; according to the light intensity data, using the pre-trained lane line recognition model to perform lane line recognition on the second image data to be recognized to obtain the lane line recognition result of the first image data to be recognized, and the lane line recognition model is constructed using the improved YOLO v9 model. The neck network of the v9 model is set to perform channel attention mechanism processing and spatial attention mechanism processing on the combined feature data composed of illumination feature data and image feature data, respectively, and obtain channel weights and spatial weights respectively. Based on the channel weights and spatial weights, the illumination feature data and image feature data are weightedly fused to obtain a fused feature map. The fused feature map is used to input the detection head. The illumination feature data is extracted from the illumination intensity data, and the image feature data is extracted from the second image data to be identified. The lane line recognition method under strong light and weak light backgrounds based on YOLO v9 disclosed in this application determines the scene to which the first image data to be recognized belongs. If it belongs to a strong light scene, the first image data to be recognized is subjected to strong light suppression processing; if it belongs to a weak light scene, the first image data to be recognized is subjected to weak light enhancement processing. This method can optimize the image quality under various complex lighting conditions and improve the accuracy of lane line recognition. The channel attention mechanism and the spatial attention mechanism work together in the processing of the feature map, so that the lane line recognition model can automatically select the optimal image feature data according to the lighting feature data at multiple scales, and appropriately enhance the image feature data under different lighting conditions to achieve dynamic lighting perception adjustment. It can effectively fuse and optimize image features from different scales at multiple scales, effectively improving the accuracy of target detection.
[0100] Each embodiment in this specification is described in a progressive manner, and the same or similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. It should be noted that the various technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the various technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0101] The above-described embodiments merely represent several preferred implementations of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that a person skilled in the art could make several improvements and substitutions without departing from the technical principles of the present application, and such improvements and substitutions should also be considered within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be based on the scope of protection of the claims.
Claims
1. A lane line recognition method under strong light and weak light background based on YOLO v9, characterized by: The method comprises: During the automatic driving process of the vehicle, first image data to be recognized and light intensity data are collected at the same time, and scene judgment is performed on the first image data to be recognized based on the light intensity data to obtain the scene to which the first image data to be recognized belongs, where the scene includes at least a strong light scene and a weak light scene; Determining a corresponding preprocessing method based on the scene to which it belongs, so as to preprocess the first image data to be recognized to obtain second image data to be recognized, wherein the preprocessing is set to perform a strong light suppression process on the first image data to be recognized belonging to the strong light scene, and perform a weak light enhancement process on the first image data to be recognized belonging to the weak light scene; According to the illumination intensity data, a pre-trained lane line recognition model is used to perform lane line recognition on the second image data to be recognized to obtain a lane line recognition result of the first image data to be recognized. The lane line recognition model is constructed using an improved YOLO v9 model. The neck network of the improved YOLO v9 model is set to perform channel attention mechanism processing and spatial attention mechanism processing on the combined feature data composed of illumination feature data and image feature data, respectively, and obtain corresponding channel weights and spatial weights, and based on the channel weights and the spatial weights, the illumination feature data and the image feature data are weightedly fused to obtain a fused feature map. The fused feature map is used to input the detection head. The illumination feature data is extracted from the illumination intensity data, and the image feature data is extracted from the second image data to be recognized.
2. The lane line recognition method based on YOLO v9 in strong light and weak light backgrounds as claimed in claim 1, characterized in that The step of performing scene judgment on the first image data to be identified based on the light intensity data to obtain the scene to which the first image data to be identified belongs includes: Setting a light intensity calibration threshold according to the light intensity data, wherein the light intensity calibration threshold includes a maximum light intensity calibration threshold and a minimum light intensity calibration threshold; Performing brightness statistical analysis on the first image data to be identified to obtain a brightness mean and a brightness variance; If the brightness mean is greater than or equal to the maximum light intensity calibration threshold, and the brightness variance is greater than or equal to a preset brightness variance calibration threshold, determining the scene to which the first image data to be identified belongs as a high-light scene; If the brightness mean is less than the minimum light intensity calibration threshold, and the brightness variance is less than the brightness variance calibration threshold, the scene to which the first image data to be identified belongs is determined to be a low-light scene.
3. The lane line recognition method based on YOLO v9 under strong light and weak light backgrounds as claimed in claim 2, characterized in that The determining a corresponding preprocessing method according to the scene to preprocess the first image data to be identified to obtain second image data to be identified includes: If the first image data to be identified belongs to the strong light scene, performing strong light suppression processing on the first image data to be identified using an improved limited contrast adaptive histogram equalization algorithm to obtain strong light suppressed image data; If the first image data to be identified belongs to the low-light scene, performing low-light enhancement processing on the first image data to be identified using an improved Retinex network model to obtain low-light enhanced image data; The strong-light suppressed image data or the weak-light enhanced image data is determined as second image data to be identified.
4. The lane line recognition method based on YOLO v9 under strong light and weak light backgrounds as claimed in claim 3, characterized in that The step of performing strong light suppression processing on the first image data to be identified by using an improved limited contrast adaptive histogram equalization algorithm to obtain strong light suppressed image data includes: Adaptively dividing the first image data to be identified into regions according to the brightness variance of the first image data to be identified to obtain a plurality of sub-image data; An adaptive local contrast limiting threshold is set according to the brightness mean of the first image data to be identified, and histogram equalization processing is performed on each of the sub-image data according to the adaptive local contrast limiting threshold to obtain image data after strong light suppression.
5. The lane line recognition method based on YOLO v9 under strong light and weak light backgrounds as claimed in claim 4, characterized in that: The setting formula of the adaptive local contrast limit threshold is: Clip Limit=2.0+0.1×(I avg -128) Among them, Clip Limit represents the adaptive local contrast limit threshold, I avg Represents the average brightness value of the first image data to be identified.
6. The lane line recognition method based on YOLO v9 under strong light and weak light backgrounds as claimed in claim 3, characterized in that The step of performing low-light enhancement processing on the first image data to be identified using the improved Retinex network model to obtain low-light enhanced image data includes: Decomposing the first image data to be recognized to obtain an illumination layer and a reflection layer; The reflective layer is adaptively gamma corrected and then fused with the illumination layer to obtain weak-light enhanced image data.
7. The lane line recognition method based on YOLO v9 under strong light and weak light backgrounds as claimed in claim 1, characterized in that The combined feature data composed of the illumination feature data and the image feature data are processed by the channel attention mechanism and the spatial attention mechanism respectively, and the channel weight and the spatial weight are obtained respectively, including: Mapping the illumination feature data to a high-dimensional vector space to obtain illumination high-dimensional feature data; Using a spatial broadcasting algorithm, spatially aligning the illumination high-dimensional feature data and the image feature data to obtain combined feature data; Performing channel attention mechanism processing on the combined feature data to obtain channel weights; The combined feature data is processed using a spatial attention mechanism to obtain a spatial weight.
8. A lane line recognition system based on YOLO v9 in strong light and weak light backgrounds, used to implement the lane line recognition method based on YOLO v9 in strong light and weak light backgrounds according to any one of claims 1 to 7, characterized in that: The system includes: a scene confirmation unit, a pre-processing unit and a lane line recognition unit; The scene confirmation unit is configured to collect first image data to be identified and light intensity data at the same time during the automatic driving process of the vehicle, and perform scene judgment on the first image data to be identified based on the light intensity data to obtain the scene to which the first image data to be identified belongs, wherein the scene includes at least a strong light scene and a weak light scene; The preprocessing unit is configured to determine a corresponding preprocessing method according to the scene to which it belongs, so as to preprocess the first image data to be recognized to obtain second image data to be recognized, wherein the preprocessing method is configured to perform a strong light suppression process on the first image data to be recognized belonging to the strong light scene, and to perform a weak light enhancement process on the first image data to be recognized belonging to the weak light scene; The lane line recognition unit is used to perform lane line recognition on the second image data to be recognized based on the illumination intensity data using a pre-trained lane line recognition model to obtain a lane line recognition result of the first image data to be recognized. The lane line recognition model is constructed using an improved YOLO v9 model. The neck network of the improved YOLO v9 model is set to perform channel attention mechanism processing and spatial attention mechanism processing on the combined feature data composed of illumination feature data and image feature data, respectively, to obtain corresponding channel weights and spatial weights, and based on the channel weights and the spatial weights, perform weighted fusion on the illumination feature data and the image feature data to obtain a fused feature map. The fused feature map is used to input the detection head. The illumination feature data is extracted from the illumination intensity data, and the image feature data is extracted from the second image data to be recognized.
9. A computer device, characterized in that: The computer device includes a memory, a processor, and a transceiver, which are connected via a bus; the memory is used to store a set of computer program instructions and data, and transmit the stored data to the processor, and the processor executes the program instructions stored in the memory to perform a lane line recognition method in strong light and weak light backgrounds based on YOLO v9 as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method for lane line recognition in strong light and weak light backgrounds based on YOLO v9 is implemented as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for detecting lane line in weak light environment based on deep neural network
CN112766056A
Road environment perception algorithm in dark scene
CN117636286A
Method and apparatus for obstacle detection in complex weather
WO2024051296A1
Cited By
Visual following method and device, equipment, storage medium and program product
CN122138053A