Road post number detection method and device based on deep learning, electronic equipment and program product
Patent Information
- Application Number
- CN202611023783.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-10
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2046-07-10
AI Technical Summary
然而,在实际道路场景中,道路桩号不仅存在大量远距离小目标,而且目标与背景之间的区分度偏低,易导致检测准确度偏低
[0014]第四方面,本申请提供了一种计算机可读存储介质,上述计算机可读存储介质存储有计算机程序,上述计算机程序被处理器执行时实现如上述第一方面中任一项的方法的步骤。
Smart Images

Figure CN122530987B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of image processing technology, and in particular relates to a road mileage detection method, road mileage detection device, electronic equipment and computer program product based on deep learning. Background Technology
[0002] With the continuous development of smart cities, intelligent transportation, and autonomous driving technologies, road environment perception technology based on vehicle-mounted cameras has been widely applied. Road markers, as an important component of road infrastructure, are used to identify road mileage information and have significant application value in scenarios such as road inspection, asset management, emergency response, vehicle positioning, and autonomous driving. Therefore, utilizing vehicle-mounted cameras to achieve automatic detection of road markers has become one of the important research directions in the field of intelligent transportation.
[0003] Currently, road marker detection mainly employs deep learning-based target detection methods, which analyze road images captured by vehicles to detect the markers. However, in real-world road scenarios, road markers not only contain numerous small, distant targets, but also exhibit low differentiation between the targets and the background, easily leading to low detection accuracy. Summary of the Invention
[0004] This application provides a road station detection method, device, electronic device, and computer program product based on deep learning. This method can effectively improve the accuracy of long-distance, small-scale road station detection and, in complex road scenarios, effectively enhance the ability to distinguish between the target and the low-discrimination background, thereby improving the robustness of the detection.
[0005] Firstly, this application provides a road marker detection method based on deep learning, including: The first input feature is mapped to low-level detail features and high-level semantic features; the first input feature is extracted based on the image to be detected; the image to be detected includes road markers; Perform interactive enhancement and fusion operations on low-level detail features and high-level semantic features to obtain fused and enhanced features; Based on the fusion enhancement feature, attention enhancement and fusion operations are performed on low-level detail features and high-level semantic features to obtain the first output feature corresponding to the first input feature; Image features are obtained based on the first output features; Perform a fusion operation on the image features to obtain the target fused features; Based on the target fusion features, the road station detection results corresponding to the image to be detected are output; interactive enhancement and fusion operations are performed on low-level detail features and high-level semantic features to obtain fused enhanced features, including: A first attention weight is generated based on low-level detail features to characterize the saliency of low-level detail features, and a second attention weight is generated based on high-level semantic features to characterize the saliency of high-level semantic features. The low-level detail features are weighted by the second attention weight to obtain the first interactive enhancement feature; the first interactive enhancement feature is used to characterize the low-level detail features enhanced under the guidance of the saliency of the high-level semantic features. The high-level semantic features are weighted by the first attention weight to obtain the second interactive enhancement feature; the second interactive enhancement feature is used to characterize the high-level semantic features enhanced under the guidance of the saliency of low-level detail features. A fusion operation is performed on the first and second interactive enhancement features to obtain the fused enhancement features.
[0006] Optionally, attention enhancement is performed on low-level detail features and high-level semantic features based on the fused enhancement features, including: Perform a direction-aware attention operation on the fused enhanced features to obtain global enhanced features; Enhancement operations are performed on the low-level detail features and the high-level semantic features respectively to obtain the enhanced low-level detail features and the enhanced high-level semantic features; Perform the following steps on the low-level detail features and the enhanced high-level semantic features respectively; The enhanced low-level detail features are fused with the detail space enhancement features to obtain the detail fused features; The enhanced high-level semantic features are fused with the semantic space enhanced features to obtain semantic fusion features; Based on the global enhancement features, the detail fusion features and semantic fusion features are modulated separately to obtain detail modulation features and semantic modulation features; A fusion operation is performed on the detail modulation features and semantic modulation features to obtain the first output feature.
[0007] Optionally, a direction-aware attention operation is performed on the fused enhanced features to obtain global enhanced features, including: Global information aggregation operations are performed on the fused and enhanced features along the horizontal and vertical directions, respectively, to obtain horizontal and vertical encoded features. A fusion operation is performed on the horizontal and vertical encoded features to obtain directional fused features; Generate directional attention weights based on directional fusion features; Global enhanced features are obtained by performing a weighted operation on the fused enhanced features using directional attention weights.
[0008] Optionally, a fusion operation is performed on the image features to obtain the target fused features, including: A grouped convolution operation is performed on the second input feature to obtain multiple grouped features; the second input feature is determined based on image features. For each group feature, the group feature is divided into a first sub-feature and a second sub-feature; the first sub-feature and the second sub-feature each include different channel features; a channel attention enhancement operation is performed based on the first sub-feature to obtain a channel-enhanced feature; a spatial attention enhancement operation is performed based on the second sub-feature to obtain a spatial-enhanced feature; a fusion operation is performed on the channel-enhanced feature and the spatial-enhanced feature, and a channel rearrangement operation is performed to obtain the group output feature corresponding to the group feature; An aggregation operation is performed on multiple grouped output features to obtain the second output feature corresponding to the second input feature. The second output feature is used to determine the target fusion feature.
[0009] Optionally, a channel attention enhancement operation is performed based on the first sub-feature to obtain channel-enhanced features, including: Perform multi-scale pooling on the first sub-feature to obtain statistical features for multiple channels; Perform a fusion operation on the statistical features of multiple channels to generate channel attention weights; The channel-enhanced features are obtained by weighting the first sub-feature using channel attention weights.
[0010] Optionally, a spatial attention enhancement operation is performed based on the second sub-feature to obtain spatially enhanced features, including: Perform a hybrid pooling operation on the second sub-feature to obtain the spatial description feature; By using convolutional kernels with different receptive fields, feature extraction is performed on the spatial description features to obtain the corresponding feature extraction results; Spatial attention weights are generated based on the feature extraction results. The spatially enhanced features are obtained by performing a weighted operation on the second sub-feature using spatial attention weights.
[0011] Optionally, the road station detection method is implemented based on a pre-trained road station detection model. The loss function for training the road station detection model is obtained by weighted summation of classification loss, regression loss, and consistency loss. Among them, the classification loss term constructs a category discrimination boundary by introducing angular intervals into the feature angles corresponding to the target category; the regression loss term determines the bounding box regression weights based on the scale of the detected target; and the consistency loss term constructs consistency constraints based on the correspondence between classification confidence and localization quality. Secondly, this application provides a road mileage detection device based on deep learning, which is used to perform the steps of the method described in any of the first aspects above.
[0012] Thirdly, this application provides a road mileage detection device based on deep learning, wherein the road mileage detection is used to perform the steps of the method as described in any of the first aspects above.
[0013] Thirdly, this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method as described in any of the first aspects above.
[0014] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method as described in any of the first aspects above.
[0015] Fifthly, this application provides a computer program product comprising a computer program that, when executed by one or more processors, implements the steps of the method as described in any of the first aspects above.
[0016] The first aspect of this application has the following advantages compared with the prior art: In order to improve the accuracy and robustness of road station detection, the first input features obtained from the image to be detected can be divided into low-level detail features and high-level semantic features. A bidirectional attention interaction fusion mechanism is constructed, which enhances the low-level detail features through the attention weights corresponding to the high-level semantic features to improve the target relevance of detail expression; it also enhances the high-level semantic features through the attention weights corresponding to the low-level detail features to improve the spatial localization ability of semantic features; further, the two types of enhanced features are fused, so that the low-level texture information and the high-level semantic information can achieve complementary expression in the feature space, forming a fusion enhancement feature with stronger structural consistency, thereby improving the representation ability of road station at a long distance and small scale, and improving the accuracy and stability of road station detection in complex backgrounds.
[0017] Based on this, attention enhancement and fusion operations are introduced based on fusion enhancement features, which can adaptively strengthen and redistribute key response regions in different levels of features. That is, it can enhance the response intensity of the target region where the road station is located in the first output feature, thereby enhancing the separability between the target region and the background region.
[0018] Subsequently, image features are generated through the first output features, and the image features are fused to obtain target fusion features. These target fusion features have the ability to jointly express local detail information and global semantic information, which can effectively improve the comprehensive differentiation ability of road station numbers with significant scale changes and similar appearance structures.
[0019] Finally, based on the target fusion features, the detection process is performed to output the category and location information of the road station number. This can effectively improve the accuracy of long-distance, small-scale road station number detection and enhance the ability to distinguish between the target and the low-discrimination background in complex road scenarios, thereby improving the robustness of the detection.
[0020] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a flowchart illustrating the road station detection method based on deep learning provided in the embodiments of this application; Figure 2 This is a schematic diagram of the network structure of the BCFFE module provided in the embodiments of this application; Figure 3 This is a schematic diagram of the network structure of the MCSSA module provided in the embodiments of this application; Figure 4 This is a schematic diagram of the network structure of the road station detection model provided in the embodiments of this application; Figure 5 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0023] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0024] Currently, road marker detection mainly employs deep learning-based target detection methods, analyzing road images captured by vehicles to detect markers. However, in real-world road scenarios, road markers often contain numerous small, distant targets with low contrast to the background. Traditional feature extraction methods are prone to losing crucial location information during downsampling or weakening detail boundaries in high-level semantics, leading to low detection accuracy.
[0025] To address the above issues, this application proposes a deep learning-based road marker detection method. To improve the accuracy and robustness of road marker detection, this method first divides the first input features obtained from the image to be detected into low-level detail features and high-level semantic features. An interactive enhancement mechanism is then used to achieve complementary fusion of these two features, resulting in a fused enhanced feature, which enhances the representational ability of small-scale road marker features in the image to be detected. Then, based on the fused enhanced feature, attention enhancement and fusion operations are introduced to adaptively recalibrate key regions, obtaining the first output feature corresponding to the first input feature. This extraction method can improve the response intensity of the target region where the road marker is located in the first output feature, increasing the distinguishability between small-scale road markers and the background. Furthermore, target fused features are obtained through feature fusion, enabling the features to simultaneously possess the joint expressive ability of detail information and semantic information, thereby improving the distinguishability of small-scale road markers. Finally, based on the target fusion features, the detection process is performed to output the category and location information of the road station number. This can effectively improve the accuracy of long-distance, small-scale road station number detection and enhance the ability to distinguish between the target and the low-discrimination background in complex road scenarios, thereby improving the robustness of the detection.
[0026] The road marker detection method based on deep learning provided in this application can be applied to electronic devices such as drones, mobile phones, tablets, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), and edge computing devices. This application does not impose any restrictions on the specific type of electronic device.
[0027] To illustrate the technical solutions proposed in this application, the following description will use an electronic device as the execution subject to illustrate various embodiments.
[0028] Figure 1 A schematic flowchart of the deep learning-based road marker detection method provided in this application is shown. The deep learning-based road marker detection method includes: Step 110: The electronic device maps the first input features into low-level detail features and high-level semantic features.
[0029] The image to be detected can be a video frame or a still image containing road markers, acquired by terminal devices such as surveillance cameras, drones, vehicle-mounted cameras, mobile terminal cameras, or robot vision devices, or it can be an image frame extracted from a video stream.
[0030] Road markers include kilometer markers, 100-meter markers, kilometer signs, and 100-meter signs. Kilometer markers are used to indicate road mileage in kilometers, 100-meter markers are used to indicate finer-grained mileage in 100-meter units, kilometer signs are usually placed along the road to indicate whole-kilometer mileage information, and 100-meter signs are usually used to indicate mileage information in 100-meter units.
[0031] Different types of mileage markers exhibit significant scale differences in road space, with kilometer markers being relatively large, while 100-meter markers and stakes are generally smaller. In actual data collection, 2793 kilometer markers, 5838 100-meter markers, 630 kilometer stakes, and 1166 100-meter stakes were collected within a certain area. Statistical analysis revealed that small-scale targets, especially 100-meter markers and stakes under long-distance imaging conditions, constituted a high proportion of these road mileage markers, indicating a clear dominance of small targets in the overall distribution. Furthermore, long-distance mileage markers, due to decreased imaging resolution and increased background interference, are more prone to weakened target details and insufficient distinguishable features, further exacerbating the difficulty of small target detection. To address the issues of small targets and low contrast between targets and the background in road mileage markers, electronic devices can modify feature extraction methods.
[0032] Specifically, during feature extraction, the electronic device maps the first input feature to different feature spaces, forming a hierarchical representation structure within each feature space. This structure is divided into two levels of features with different information emphases: low-level detail features and high-level semantic features. The low-level detail features represent high-resolution information such as the edges, textures, and local structures of road markers, while the high-level semantic features represent low-resolution semantic information such as the target's category semantics, overall structure, and contours. This mapping division allows the same input feature to express fine-grained information and abstract semantic information at different semantic levels, thus providing a foundational feature source for subsequent cross-layer interactive fusion.
[0033] The first input feature can be an initial feature extracted from the image to be detected by a convolutional neural network, or an intermediate feature obtained by passing the initial feature through a feature pyramid network, a residual network, or a multi-layer convolutional coding. In this application, its specific source is not limited.
[0034] The mapping process can be implemented through channel partitioning, convolution transformation, or feature reparameterization, etc. No specific implementation method is limited here.
[0035] Step 120: The electronic device performs interactive enhancement and fusion operations on low-level detail features and high-level semantic features to obtain fused enhanced features.
[0036] After obtaining low-level detail features and high-level semantic features, the electronic device can perform information enhancement processing on the low-level detail features and high-level semantic features respectively, thereby strengthening their respective effective responses and improving the ability to express station edge details and semantic structures. Based on this, by constructing corresponding weights using the enhanced low-level detail features and enhanced high-level semantic features respectively, the features at different levels can reflect differentiated contributions during the fusion process, and achieve mutual guidance and supplementation of cross-layer information to realize interactive enhancement.
[0037] Then, the electronic device can perform a fusion operation on the weighted low-level detail features and the weighted high-level semantic features to achieve cross-layer coupling expression of detail information and semantic information, promote bidirectional information interaction and supplementation, and obtain fusion-enhanced features that have both local detail sensitivity and global semantic discrimination ability.
[0038] For example, weights can be generated through global pooling, convolutional mapping, or multi-scale statistical methods, such as using max pooling, average pooling, or a combination thereof to obtain the feature response distribution. Specific implementations of other weight generation methods will not be elaborated further if they are similar.
[0039] For example, the fusion operation can be implemented by convolution mapping after channel concatenation, or by element-wise summation. Other specific implementation methods for fusion operations will not be elaborated further if they are similar.
[0040] Step 130: The electronic device performs attention enhancement and fusion operations on low-level detail features and high-level semantic features based on the fusion enhancement features to obtain the first output feature corresponding to the first input feature.
[0041] After obtaining the fused and enhanced features, the electronic device can introduce an attention mechanism to further recalibrate the low-level detail features and high-level semantic features, so as to enhance the response of the areas related to road station numbers in the low-level detail features and high-level semantic features, while reducing the feature activation intensity of the background area.
[0042] Specifically, by processing the fused enhanced features through attention enhancement operations, the electronic device obtains corresponding attention weights. These attention weights are then used to weight and fuse low-level detail features with high-level semantic features. The electronic device can adaptively adjust the response intensity of different dimensions based on the fused global context information. After attention weighting, the adjusted features are then fused to form an enhanced representation of the first input feature, resulting in the first output feature corresponding to the first input feature.
[0043] For example, attention may include channel attention, spatial attention, and hybrid attention used to describe the joint dependency between channels and space. Channel attention is used to adaptively adjust the response intensity of different feature channels to enhance the semantic channel representation ability related to road station numbers; spatial attention is used to model the salience of different spatial locations in the feature map to highlight the area where the station number is located and suppress interference from complex backgrounds; hybrid attention mechanisms, such as a combination of channel attention and spatial attention, can establish a joint weight relationship between the channel dimension and the spatial dimension, enabling channel information and spatial location information to collaboratively participate in feature recalibration, adaptively adjusting the response intensity of different spatial locations and channel dimensions, thereby improving the representation and differentiation capabilities for small-scale and low-contrast road station numbers. In other words, different attention methods have different advantages, and the specific attention method selected can be determined according to the actual situation, and is not limited in this embodiment.
[0044] Step 140: The electronic device obtains image features based on the first output features.
[0045] After obtaining the first output feature, the electronic device can perform feature integration processing on the first output feature to form a unified expression in the spatial and semantic dimensions, thereby obtaining the image feature representation for subsequent detection stages.
[0046] For example, the feature integration process may include simple feature concatenation or element-wise summation to achieve direct fusion of features from different channels or different levels; it may also include further feature compression and recoding based on convolutional mapping, which re-expresses the fused features through local receptive fields to enhance the stable expressive ability of structural features; it may also include cross-scale alignment processing, that is, upsampling or downsampling alignment between feature maps of different resolutions before fusion, so that responses at different scales can correspond in the same spatial coordinate system.
[0047] In addition, in some implementations, steps 110 to 140 can be executed at different scales to form multi-scale parallel feature extraction branches, and the image features output by branches at different scales can be integrated in this stage to obtain the final image feature representation used in the detection stage.
[0048] In this way, the generation of image features no longer depends on the feature extraction results of a single path. Instead, through multi-scale, multi-resolution parallel modeling and unified fusion, the detail response and semantic response at different scales can complement and enhance each other in the same feature representation space, thereby improving the adaptability to road station numbers at different scales and the overall detection stability.
[0049] Step 150: The electronic device performs a fusion operation on the image features to obtain the target fused features.
[0050] After obtaining image features, electronic devices can perform multi-scale or multi-level fusion processing on these features, enabling the feature information formed under different receptive fields to be integrated and expressed within a unified feature space. This achieves a collaborative modeling capability that balances local detail information with global semantic information. Through this fusion processing, the structural information of small-scale road markers and the semantic information of the overall road scene can be jointly represented to obtain the target fusion features.
[0051] Step 160: The electronic device outputs the road station detection result corresponding to the image to be detected based on the target fusion features.
[0052] Finally, by analyzing the category and location responses in the target fusion features, the electronic device can determine the category and spatial location information of the road station number, thereby outputting the road station number detection result corresponding to the image to be detected, and realizing accurate detection and positioning of road station numbers of different scales and types.
[0053] In this embodiment, during feature extraction, the electronic device first divides the input features into low-level detail features and high-level semantic features, which can retain local texture edge information and global semantic structure information respectively, avoiding the problem of limited expressive power of single-scale features. Then, through interaction enhancement and attention mechanisms, cross-layer information is adaptively weighted to strengthen the response of key areas and suppress background interference. Next, the image features determined by the first output features are uniformly reconstructed, cross-scale aligned and multi-branch fused to obtain target fusion features, which enables features under different resolutions and receptive fields to achieve collaborative modeling in the same expression space, thereby taking into account both fine-grained target detection capabilities and robustness in complex scenes. Finally, at the detection level, the category and location of road markers are jointly inferred based on the target fusion features to obtain road marker detection results, thereby improving the robustness of detecting distant small targets and low-contrast targets as a whole.
[0054] In some embodiments, interactive enhancement and fusion operations are performed on low-level detail features and high-level semantic features to obtain fused enhanced features, including: Step A1: The electronic device generates a first attention weight based on low-level detail features and a second attention weight based on high-level semantic features.
[0055] Low-level detail features focus on expressing edge, texture, and local structural information, while high-level semantic features focus on expressing target category semantics and overall contour information. Electronic devices can generate weights using lightweight attention modules, such as using global average pooling combined with fully connected mapping to generate channel weights, or using convolutional windows to statistically generate spatial weights. This yields first attention weights to characterize the saliency of low-level detail features and second attention weights to characterize the saliency of high-level semantic features. This weight modeling allows for the description of feature saliency at different semantic levels, providing a basis for adjustment in subsequent cross-layer interactions.
[0056] For example, for the hierarchical features to be processed (such as low-level detail features or high-level semantic features), the features can be aggregated and compressed through multiple sets of convolution operations to obtain enhanced intermediate features; then, the corresponding attention weights are generated based on the intermediate features, and the hierarchical features are weighted using the attention weights to highlight key information and suppress redundant information.
[0057] Step A2: The electronic device performs a weighted operation on the low-level detail features through the second attention weight to obtain the first interaction enhancement feature.
[0058] To transform low-level detail features from non-selective representation to semantically constrained detail representation, thereby improving the separability and detectability of small target station numbers, electronic devices can apply the second attention weight corresponding to the high-level semantic features to the low-level detail features, resulting in low-level detail features enhanced under the guidance of the saliency of the high-level semantic features, namely the first interactive enhancement feature, to achieve semantically guided detail enhancement.
[0059] For example, an electronic device can recalibrate a low-level feature map by weighting it channel by channel, thereby amplifying the local texture response associated with road markers while suppressing the response of the background region.
[0060] Step A3: The electronic device performs a weighted operation on the high-level semantic features through the first attention weight to obtain the second interaction enhancement feature.
[0061] Corresponding to A2, in order to transform semantic features from a global abstract expression to a structure-aware enhanced expression, electronic devices can use the first attention weight generated by low-level detail features to refine and enhance high-level semantic features, resulting in high-level semantic features enhanced under the guidance of the saliency of low-level detail features, namely the second interactive enhanced features, so as to achieve semantic enhancement guided by details.
[0062] For example, the semantic feature map can be weighted position by position based on spatial attention, so that the originally more abstract semantic response is enhanced in the edge region and structural region, thereby making the high-level semantic features more spatially sensitive.
[0063] Step A4: The electronic device performs a fusion operation on the first interaction enhancement feature and the second interaction enhancement feature to obtain the fused enhancement feature.
[0064] After both low-level detail features and high-level semantic features are interactively enhanced through complementary attention weights, electronic devices can integrate the information of the two types of interactive enhancement features to form a unified feature representation structure.
[0065] Specifically, electronic devices can re-encode features by concatenating channel dimensions followed by convolutional mapping to reorganize cross-channel information; alternatively, they can use element-wise summation or weighted summation to achieve response superposition and consistency alignment within the same spatial coordinate system. Through these fusion methods, semantically guided detail enhancement information and detail-guided semantic enhancement information achieve complementary coupling and collaborative expression within the same feature space. This constructs a fused enhancement feature that simultaneously possesses local structural sensitivity and global semantic discriminative ability, providing more stable and robust feature inputs for subsequent detection processes.
[0066] In this embodiment, the electronic device constructs a bidirectional attention interaction fusion mechanism to achieve mutual guidance and synergistic enhancement between low-level detail features and high-level semantic features: on the one hand, it uses semantic weights to strengthen the target relevance of detail expressions, and on the other hand, it uses detail weights to improve the spatial positioning capability of semantic features, and achieves bidirectional information complementarity in the fusion stage, thereby significantly improving the detection accuracy and stability of road station numbers of small targets at long distances in complex backgrounds.
[0067] In some embodiments, attention enhancement is performed on low-level detail features and high-level semantic features based on fused enhancement features, including: Step B1: The electronic device performs a direction-aware attention operation on the fused enhanced features to obtain global enhanced features.
[0068] To further model long-range spatial dependencies, electronic devices introduce a coordinate attention mechanism to process fused enhanced features. This mechanism explicitly encodes dependencies across spatial locations based on the response distribution of fused enhanced features in two preset directions (e.g., horizontal and vertical), while preserving location information and channel semantic information, thus enhancing the ability to consistently model the continuous distribution features of road station numbers along the road direction.
[0069] In a practical implementation, the electronic device can perform global pooling operations in the horizontal and vertical directions respectively to extract statistical response features on the corresponding coordinate axes, and generate direction-sensitive attention weights through a shared or branched mapping network.
[0070] For example, directional convolution (such as horizontal, vertical and diagonal convolution kernels) or response modeling based on gradient direction distribution can be combined to weighted aggregate feature intensities in different spatial directions, thereby strengthening the structural response consistent with the road direction while suppressing background texture and unstructured interference information.
[0071] Through the above processing, the fused enhanced features can form a global dependency expression with coordinate constraints in the spatial dimension, resulting in global enhanced features with spatial structure consistency and long-range correlation capabilities, providing a stable global semantic constraint basis for subsequent hierarchical feature modulation.
[0072] Step B2: The electronic device performs enhancement operations on the low-level detail features and the high-level semantic features respectively to obtain the enhanced low-level detail features and the enhanced high-level semantic features.
[0073] Step B3: The electronic device performs operations on the low-level detail features and the enhanced high-level semantic features respectively to obtain detail space enhancement features and semantic space enhancement features.
[0074] The enhancement operation here is consistent with the enhancement operations performed on the two levels of features in step 120. Both can be implemented based on feature mapping methods calculated by convolution, such as weighted calculation based on convolution kernel weights, combined with normalization and nonlinear activation to recalibrate the feature responses, thereby obtaining the corresponding enhanced level features. This enhancement operation can improve the response intensity of target-related features, suppress interference from complex backgrounds and redundant information, and improve the consistency of feature representation under different imaging conditions, enabling subsequent spatial attention operations to be processed based on higher-quality feature foundations.
[0075] Building upon this foundation, spatial attention is introduced to enhance the spatial saliency of target region features in the image being processed. Specifically, spatial weights can be generated through two-dimensional convolution, or the spatial response can be normalized to highlight the relative response intensity of key regions, thereby strengthening the expressive power of the spatial location of road markers. For the enhanced low-level detail features, this spatial attention is used to enhance the feature intensity of edge responses and texture-dense regions, making fine-grained structures clearer; for the enhanced high-level semantic features, it is used to enhance the semantic response of target contours and structurally consistent regions, thereby improving the semantic localization capability of the detection method, thus obtaining spatially selective detail spatial enhancement features and semantic spatial enhancement features, respectively.
[0076] Step B4: The electronic device fuses the enhanced low-level detail features with the detail space enhancement features to obtain the detail fused features.
[0077] This step is achieved using a residual connection method, which involves superimposing the corresponding enhancement results (i.e., spatial enhancement features) on the original low-level detail features. This allows the enhancement information introduced based on spatial attention to be injected into the original detail representation in the form of residuals, thereby enhancing spatial saliency while preserving the original structural information and obtaining detail fusion features.
[0078] Step B5: The electronic device fuses the enhanced high-level semantic features with the semantic space enhancement features to obtain semantic fusion features.
[0079] Similarly, this step uses residual connection to fuse the original high-level semantic features with their corresponding semantic space enhancement features, so that the spatial attention adjustment of semantic features is incrementally integrated into the original semantic expression, thereby enhancing the consistency of target space localization while maintaining semantic discrimination ability, and obtaining semantic fusion features.
[0080] Step B6: The electronic device modulates the detail fusion feature and the semantic fusion feature based on the global enhancement feature to obtain the detail modulation feature and the semantic modulation feature.
[0081] Based on the consistency of the overall spatial structure represented by global enhancement features, electronic devices conditionally modulate detail fusion features and semantic fusion features, so that the local feature representation is uniformly constrained by global information. In this process, global enhancement features not only provide prior knowledge of the overall structure, but also further explicitly enhance key areas, giving them higher response weights in spatial distribution, thereby highlighting the core area where the road marker is located and its structural extension direction.
[0082] For example, to achieve better modulation results, electronic devices can map global enhancement features to channel-wise or position-wise scaling and offset coefficients, adaptively adjusting detail fusion features and semantic fusion features. This enhances the feature responses of key regions while suppressing the responses of background regions. Through this modulation process, detail fusion features and semantic fusion features achieve synergistic expression under the joint constraints of global structural consistency and key region enhancement, thereby improving the detection method's stable response capability and discrimination consistency for road station numbers.
[0083] Step B7: The electronic device performs a fusion operation on the detail modulation features and semantic modulation features to obtain the first output feature.
[0084] After obtaining the two modulation features, the electronic device can perform a final fusion process based on the detailed modulation features and semantic modulation features, under the constraint of global structural consistency, to form a unified feature representation. For example, an element-wise summation method can be used to achieve direct superposition of structural and semantic responses under the premise of spatial alignment; alternatively, a channel-dimensional concatenation combined with mapping transformation can be used to reorganize and re-encode features from different sources, thereby achieving deep fusion of structural and semantic information. Through this fusion process, the structural sensitivity represented by the detailed fusion features and the category discrimination ability represented by the semantic fusion features can work synergistically in the same feature space, thus obtaining the first output feature.
[0085] In this embodiment, the electronic device employs a progressive processing mechanism—including orientation-aware global modeling, hierarchical spatial attention enhancement, dual-path local fusion, global conditional modulation, and cross-layer unified integration—to introduce spatial saliency information and global structural constraints into the feature expression process via a stepwise residual approach without altering the core feature representations of the two levels. This ensures that the features maintain structural continuity and detail integrity at the local level, enhance the response concentration of the target region at the spatial level, and introduce structural consistency constraints and key region enhancement mechanisms at the global level. This results in a feature expression system that combines local structure preservation, spatial localization enhancement, and global semantic consistency, yielding a first output feature. This first output feature simultaneously integrates fine-grained structural information and high-level semantic information, possessing stronger expressive capabilities in both spatial and directional dimensions. This achieves a balance between spatial consistency, semantic discriminativeness, and local detail representation capabilities, thereby improving the stability and accuracy of detecting small targets at long distances in complex backgrounds.
[0086] In some embodiments, a direction-aware attention operation is performed on the fused enhanced features to obtain global enhanced features, including: Step B11: The electronic device performs global information aggregation operations on the fusion enhancement features along the horizontal and vertical directions respectively to obtain horizontal coding features and vertical coding features.
[0087] Since road markers are usually set perpendicular to the road direction, they exhibit a spatial structure distribution with significant directionality in the imaging plane. That is, they have strong spatial extension along the horizontal direction, while showing more obvious structural changes along the vertical direction.
[0088] Therefore, based on the distribution characteristics of the fused and enhanced features in two-dimensional space, the electronic device performs global information aggregation along both the horizontal and vertical axes to obtain structural statistical representations in different directions. For example, global pooling can be performed on each row of features in the horizontal direction and on each column of features in the vertical direction, thereby obtaining horizontal and vertical encoded features respectively. The resulting features will carry global response information of road station numbers in both the horizontal extension and vertical distribution, thus providing a foundation for subsequent directional relationship modeling.
[0089] Step B12: The electronic device performs a fusion operation on the horizontal and vertical encoded features to obtain directional fusion features.
[0090] After obtaining the encoding results in both directions, the electronic device can perform information alignment and joint representation, i.e., perform a fusion operation, to describe the correlation between spatial directions. For example, a channel concatenation and mapping transformation method can be used to jointly encode the horizontal and vertical encoded features, or an element-wise weighted fusion method can be used to superimpose the two types of directional information. Through this fusion process, the global responses in the horizontal and vertical directions can form complementary representations in the same feature space, thereby obtaining directional fusion features.
[0091] Step B13: The electronic device generates directional attention weights based on directional fusion features.
[0092] Subsequently, the electronic device models the directional consistency of the spatial structure based on directional fusion features to generate directional attention weights for recalibration. This modeling can be achieved through fully connected mapping or convolutional mapping, converting the directional fusion features into normalized weights to ensure the distinguishability of response intensity across different spatial directions. These directional attention weights can characterize the saliency distribution of road station numbers along a specific spatial orientation, thereby enhancing the feature response in directions consistent with the road structure.
[0093] Step B14: The electronic device performs a weighted operation on the fused enhancement features through directional attention weights to obtain global enhancement features.
[0094] After obtaining the directional attention weights, the electronic device performs positional or channel-by-channel weighted adjustments on the fused enhancement features to ensure that their spatial distribution conforms to directional consistency constraints. For example, the fused enhancement features can be recalibrated using element-wise multiplication to enhance responses along the main road direction while suppressing responses in unstructured background regions, thus enabling the obtained global enhancement features to have directional consistency across the entire scope.
[0095] In this embodiment, when the electronic device performs global structural modeling of the fused and enhanced features, it introduces a coordinate attention mechanism to encode the long-range dependencies in the horizontal and vertical directions respectively, so that the features simultaneously possess the ability to perceive directions in two-dimensional space, thereby more fully capturing the continuous distribution pattern and spatial arrangement consistency of road station numbers along the road direction. On this basis, the spatial response is adaptively adjusted based on the directional attention weight, which can strengthen and recalibrate key areas to enhance the response consistent with the road structure and suppress complex backgrounds, thereby improving the detection method's ability to stably express the structural features of long-distance, small-sized road station numbers and its detection robustness in complex backgrounds.
[0096] In addition to containing a large number of small targets at long distances and having low distinguishability from complex backgrounds, road markers typically also exhibit significant scale variations, sparse spatial distribution, and susceptibility to interference from complex backgrounds in road scenes. For these characteristics, using a traditional Neck structure for fusion can easily introduce non-target-related redundant information during multi-scale feature fusion, diluting the effective feature response and weakening the ability to focus on key target regions and express discriminative power.
[0097] In some embodiments, to address the above-mentioned problems, the electronic device performs a fusion operation on image features to obtain target fused features, including: Step C1: The electronic device performs a grouped convolution operation on the second input feature to obtain multiple grouped features.
[0098] Grouped convolution enables lightweight decomposition of the original features in computation, while forming a set of features in multiple subspaces in representation, providing a foundation for subsequent fine-grained recalibration.
[0099] During feature fusion, electronic devices can group the second input features along the channel dimension and perform convolution calculations within each group, thereby splitting the overall features into multiple relatively independent sub-feature representations. For example, the input features can be divided into several groups uniformly or non-uniformly according to channels, and convolution operations can be applied to each group, so that different groups focus on different types of local features, such as texture edges, structural contours, or semantic responses.
[0100] It is understood that the fusion operation performed in this embodiment can be a stage operation in the entire image fusion process, or a further processing of the preliminary fusion result in the image fusion process. Therefore, the second input feature can be an initial feature obtained directly based on image features, or an intermediate fusion feature after previous feature fusion or feature encoding processing.
[0101] With this setting, subsequent operations such as grouped convolution, attention enhancement, and feature aggregation performed on the second input features can be applied to both the original feature layer and the intermediate feature layer that already has a certain fusion expression capability, thereby enhancing the adaptability and versatility of the fusion method in different network stages.
[0102] Step C2: For each group feature, the electronic device divides the group feature into a first sub-feature and a second sub-feature; performs a channel attention enhancement operation based on the first sub-feature to obtain a channel enhanced feature; performs a spatial attention enhancement operation based on the second sub-feature to obtain a spatial enhanced feature; performs a fusion operation on the channel enhanced feature and the spatial enhanced feature, and performs a channel rearrangement operation to obtain the group output feature corresponding to the group feature.
[0103] To extract feature representations corresponding to different group features, the electronic device can process all group features one by one in a preset order. That is, it uses a loop to select each group feature sequentially and execute the same processing flow on it until all group features have been traversed and processed. Through this group-by-group loop processing mechanism, the electronic device can achieve independent modeling and progressive enhancement of each group feature, enabling each group feature to complete feature representation optimization under unified processing rules. The processing flow of a single group feature will be explained below as an example; the operation for each other group feature follows the same principle.
[0104] For the currently processed grouped features, the electronic device first segments them along the channel dimension, dividing them into two independent features: a first sub-feature and a second sub-feature. This achieves parallel decoupling of features at the low-level structure. Based on this, subsequent differentiated computational paths guide these two sub-features to stand out in feature representations of different dimensions.
[0105] Specifically, the electronic device inputs the first sub-feature into the channel attention enhancement branch, compresses its spatial dimension through global pooling, thereby eliminating spatial redundancy and focusing the first sub-feature on the global statistical information and semantic relevance between channels. This achieves channel-dimensional related feature expression, resulting in channel-enhanced features. Simultaneously, the electronic device inputs the second sub-feature into the spatial attention enhancement branch, using two-dimensional convolution to capture local structure and contextual location information at the full-image spatial scale. This allows the branch to accurately locate key target regions and suppress background noise, achieving spatial-dimensional related feature expression, resulting in spatial-enhanced features. This collaborative design, which structurally segments channels and functionally focuses on multiple dimensions, significantly reduces computational complexity while achieving complementary and enhanced capabilities for both channel and spatial feature representation.
[0106] Subsequently, a fusion operation will be performed on the channel enhancement features and spatial enhancement features to jointly express the two types of enhancement features. Then, a channel rearrangement operation will be performed to reorganize and interact along the channel dimension, so that the information association between different channels is more complete, thereby obtaining the group output features corresponding to the current group features.
[0107] Among them, channel rearrangement operation refers to the processing method of rearranging and reorganizing the fused features in the channel dimension, so that the channel features originally arranged in a grouping method or fixed order can interact and exchange positions across channels, thereby changing the correspondence between channels and enhancing the information interaction capability and expression synergy between different channels.
[0108] Specifically, the channel rearrangement operation can adjust the channel order based on preset rules or permutation rules. For example, channels in different groups can be rearranged in an interleaved manner, so that channels that originally belonged to different groups can be recombined in the channel dimension; or the channel blocks can be exchanged and reorganized to achieve cross-group information mixing; or the channel order can be reconstructed based on fixed mapping relationships or random permutation methods to achieve different degrees of channel interaction effects.
[0109] This channel rearrangement operation allows channel features that were previously relatively independent during grouping or local processing to interact and merge, breaking the static grouping constraints between channels and redistributing feature information from different sources along the channel dimension. This improves the overall consistency of feature representation and the efficiency of information utilization. Simultaneously, this operation helps enhance the fusion between channel semantic information and spatial structural information, improving the robustness of features to complex backgrounds, scale variations, and small target scenarios.
[0110] In this step, the electronic device can independently model and enhance the features of each group through this group-by-group cyclic processing, so that the output features of each group can maintain the expression of local differences while having the ability to synergistically express channel semantic information and spatial structural information.
[0111] Step C3: The electronic device performs an aggregation operation on multiple grouped output features to obtain the second output feature corresponding to the second input feature. The second output feature is used to determine the target fusion feature.
[0112] Electronic devices integrate multiple grouped output features to reconstruct a consistent feature expression from previously scattered local responses, thus obtaining a second output feature. This feature retains both the local discriminative ability of multiple groups and global semantic consistency, and serves as the basic input for constructing subsequent target fusion features.
[0113] In this embodiment, the electronic device introduces a decoupling enhancement mechanism of grouped convolution, channel attention, and spatial attention. Combined with channel rearrangement and cross-group aggregation operations, it can reduce the overall computational complexity while achieving full interaction and information recombination between features from different channels and groups. This makes the feature representation more complete and improves the structural stability and semantic discriminative ability of features in complex backgrounds. Specifically, through independent enhancement at the group level and unified aggregation at the global level, it can strengthen fine-grained structural responses at the local level, highlight the saliency of target regions at the spatial level, and enhance semantic information interaction capabilities at the channel level, thereby effectively improving the feature's adaptability to complex backgrounds, scale changes, and low-contrast targets.
[0114] For targets like road markers that have regular structures but subtle differences between categories, this processing mechanism can enhance the expression of key structural features and suppress irrelevant background interference through the synergistic effect of multi-path attention enhancement and channel rearrangement mechanism. This significantly improves the detection accuracy and robustness of the model in complex road scenes, especially in small target detection and similar category differentiation.
[0115] In some embodiments, a channel attention enhancement operation is performed based on the first sub-feature to obtain channel-enhanced features, including: Step C211: The electronic device performs multi-scale pooling on the first sub-feature to obtain multiple channel statistical features.
[0116] Step C212: The electronic device performs a fusion operation on the statistical features of multiple channels to generate channel attention weights.
[0117] Electronic devices extract channel statistical information from different receptive field scales based on the response distribution of the first sub-feature along the channel dimension to obtain a multi-level global contextual representation. For example, the electronic device can perform multi-scale adaptive average pooling on the first sub-feature separately, or combine multi-scale adaptive average pooling and max pooling operations to statistically converge the channel responses in different spatial ranges, thereby obtaining the corresponding multi-scale channel statistical features. Multi-scale average pooling can be achieved by setting pooling windows of different scales, such as using pooling kernels of different scales like 1×1, 2×2, and 4×4, to correspond to local fine-grained, mesoscale structure, and global statistical modeling, respectively, thus enabling the channel statistical features to simultaneously possess local structural response and global contextual representation capabilities.
[0118] Through this multi-scale pooling process, electronic devices can enable each channel to not only contain global overall response information, but also reflect the structural response differences in different local regions, thereby forming a hierarchical channel description.
[0119] Based on this, the channel statistical features obtained at different scales are fused to generate a more discriminative comprehensive channel statistical representation, which provides a multi-level statistical basis for the subsequent generation of channel attention weights, thereby improving the sensitivity and stability of the detection method to the expression of fine-grained structural features of road station numbers.
[0120] After obtaining the fused channel statistical features, the electronic device can generate channel attention weights through nonlinear mapping. These weights are used to describe the contribution of different channels to the target representation, giving higher response weights to key channels related to road station numbers.
[0121] For example, this nonlinear mapping can be implemented using a lightweight multilayer perceptron, such as a structure consisting of operations like channel-wise dimensionality reduction, nonlinear activation, and channel-wise dimensionality increase for mapping transformation; or by cascading one-dimensional convolution and nonlinear activation functions to model the nonlinear relationship between channels; or by combining pointwise convolution with normalization and activation functions to achieve feature recalibration in the channel dimension; or by using a gating mechanism to adaptively modulate the fused channel statistical features to generate channel attention weights.
[0122] Step C213: The electronic device performs a weighting operation on the first sub-feature through channel attention weights to obtain channel-enhanced features.
[0123] After generating channel attention weights, the electronic device can recalibrate each channel of the first sub-feature channel by channel to apply the weights to the corresponding channel features, achieving adaptive adjustment of the channel response intensity. Thus, the electronic device can enhance important semantic channels while suppressing redundant or background-related channel responses, resulting in channel-enhanced features. These features have stronger discriminative power in the channel dimension, helping to highlight the semantic structure related to road station numbers and improve the separability of targets in complex backgrounds.
[0124] In this embodiment, the electronic device obtains multi-level channel response information by performing channel statistical modeling on the first sub-feature at different receptive field scales, and fuses the statistical results at different scales to form a unified channel description representation. Based on this, channel attention weights are generated based on the fused channel statistical information, and these weights are used to perform channel-by-channel weighting and labeling of the first sub-feature, thereby achieving adaptive adjustment of the channel response. Through this fusion method, the feature response can express global semantics in the channel dimension and provide differentiated descriptions of local structures, thereby improving the discriminativeness and expression stability of the channel features, and enhancing its representational ability of key features in small target detection tasks in complex road scenarios.
[0125] In some embodiments, a spatial attention enhancement operation is performed based on the second sub-feature to obtain spatially enhanced features, including: Step C221: The electronic device performs a hybrid pooling operation on the second sub-feature to obtain the spatial description feature.
[0126] Electronic devices can perform different types of pooling operations on the second sub-features in the spatial dimension. For example, they can use average pooling and max pooling in parallel to enhance the expressive power of local salient response regions while preserving the overall response trend. Alternatively, they can combine pooling operations with different pooling window scales to aggregate structural information at different spatial scales, thereby obtaining spatial descriptive features that combine global and local structural information, providing a foundation for subsequent spatial structure modeling.
[0127] Step C222: The electronic device performs feature extraction on the spatial description features through convolution kernels with different receptive fields, and obtains the corresponding feature extraction results.
[0128] To improve the stability of road station detection at varying scales, electronic devices can employ convolutional kernels with different receptive field sizes to perform convolutional calculations on spatial description features. For example, 3×3, 5×5, and 7×7 convolutional kernels can be used, or three cascaded 3×3 convolutions can be used for feature extraction. This allows for the capture of local detailed structures, mesoscale morphological features, and broader contextual structural information, resulting in multi-scale feature extraction results. The resulting spatial description features can explicitly express structural responses within different receptive fields, improving the detection method's ability to capture the structure of road station numbers at different scales and under complex background conditions.
[0129] Step C223: The electronic device generates spatial attention weights based on the feature extraction results.
[0130] The electronic device fuses the feature extraction results obtained from different receptive fields and further generates spatial attention weights through nonlinear mapping. These spatial attention weights characterize the importance distribution of each location in the spatial dimension, giving higher weight responses to spatial regions related to road station numbers, while suppressing the responses of background regions, thereby achieving adaptive emphasis on key areas.
[0131] Step C224: The electronic device performs a weighting operation on the second sub-feature using spatial attention weights to obtain spatially enhanced features.
[0132] Electronic devices apply spatial attention weights to the spatial dimension of the second sub-feature, recalibrating the feature responses at different spatial locations. This enhances the responses in key areas while suppressing those in non-key areas, resulting in spatially enhanced features. These features exhibit stronger target-focusing capabilities in spatial structure representation, improving the separability of road station numbers under complex backgrounds, scale variations, and low-contrast conditions.
[0133] In this embodiment, the electronic device performs hybrid pooling on the second sub-feature to obtain spatial descriptive features that simultaneously contain global statistical information and local salient responses. Furthermore, it performs multi-scale feature extraction on the spatial descriptive features based on convolutional kernels with different receptive fields to obtain spatial structural response results at different scales. Then, it fuses the feature extraction results at each scale to generate spatial attention weights. Finally, based on these spatial attention weights, it performs weighted labeling on the second sub-features at each spatial location, thereby enhancing the feature response of the target region while suppressing the response of the background region. This adaptively enhances the second sub-features in the spatial dimension. The resulting spatially enhanced features possess both global contextual expression capabilities and local structural expression capabilities, which helps improve the discriminative ability of spatial representation and the ability to focus on target regions. It also enhances the robustness and stability of the detection method under complex road scenes and small target detection conditions.
[0134] The road marker detection methods in the above embodiments can be implemented based on a pre-trained road marker detection model. In the training of general target detection models, the loss function is typically optimized using a combination of cross-entropy loss and GIoU loss. Although this combination of losses can achieve good results in most general detection scenarios, it still has several limitations, such as the lack of explicit inter-class discrimination constraints, the regression loss not being adapted to the characteristics of small target scales, the lack of a strong coupling mechanism between the classification branch and the regression branch, and the lack of explicit constraints between classification consistency and localization quality.
[0135] Furthermore, in road mileage detection scenarios, the target itself has the following typical characteristics: 1) High category similarity: Different station numbers have little difference in appearance, font shape and local texture, which makes it difficult to distinguish between categories, thus increasing the difficulty of classification.
[0136] 2) The proportion of small targets is high, especially under long-distance imaging conditions, the scale of the station number is significantly reduced, making the regression error more sensitive to the final positioning result.
[0137] 3) The quality of localization has a direct impact on the classification results. When the bounding box is not accurately localized, the extracted feature regions are prone to background interference, which can lead to the classification results being shifted or distorted.
[0138] These characteristics make it difficult for traditional detection methods based on general loss design to simultaneously achieve both classification discriminativeness and localization stability in this type of task.
[0139] In some embodiments, to address the aforementioned issues, the loss function for training the road marker detection model is jointly modeled by classification discrimination constraints, scale-aware regression constraints, and classification-localization consistency constraints. This allows the model to simultaneously improve class separability and target localization accuracy during optimization, and enhance the collaborative optimization relationship between the classification and regression branches. Specifically, by introducing an angle-interval-based classification mechanism to strengthen the discriminative boundary between classes, by adaptively amplifying the regression error of small targets through scale weights, and by explicitly linking classification confidence and localization quality through consistency constraints, the detection model exhibits superior convergence stability and detection reliability in road marker detection scenarios characterized by high class similarity, a high proportion of small targets, and strong localization sensitivity.
[0140] In some embodiments, the loss function optimization method based on angle interval discrimination and scale-aware constraints includes the following process.
[0141] The input image is The model outputs the first... The feature vector of each query is ,in The corresponding predicted bounding boxes and ground truth bounding boxes are as follows: The electronic device first normalizes the feature vectors and class weights to construct alignment relationships in angle space:
[0142] Angular similarity between features and categories is calculated based on the normalization results: Building upon this, an angular interval mechanism is introduced to enhance the discrimination boundary of the target category:
[0143] And the classification probability is calculated using the Sigmoid function:
[0144] Simultaneously, quality labels are calculated based on the IoU between the predicted bounding box and the ground truth bounding box:
[0145] Based on the above results, an angle-interval discrimination classification loss is constructed:
[0146] Further define the target scale-related weighting mechanism, where the target area is:
[0147] The scale weights are:
[0148] Based on this, a scale-aware regression loss is constructed:
[0149] Simultaneously, classification confidence is explicitly correlated with positioning quality to construct a consistency constraint loss:
[0150] The final loss function is expressed as:
[0151] In this embodiment, the electronic device enhances the separation capability between categories by introducing an angular interval discrimination mechanism in the classification branch, improves the positioning accuracy of small targets by introducing a scale weight mechanism in the regression branch, and establishes an explicit correlation between classification confidence and positioning quality through consistency constraints. This enables the classification and regression tasks to form a synergistic constraint relationship during the optimization process, thereby effectively improving the overall accuracy, robustness and convergence stability of the model in the road station detection task.
[0152] In some embodiments, to more accurately describe the actual data distribution characteristics of the road marker detection task, a dedicated dataset for road markers from a vehicle-mounted perspective, named RMPD (Road Mileage Pile Detection Dataset), was constructed. The samples in this dataset were acquired through vehicle-mounted cameras in real road environments, covering various urban road types and complex traffic scenarios, thus ensuring the authenticity of the data source and the diversity of the scenarios.
[0153] The RMPD dataset contains four typical road marker categories: kilometer markers, 100-meter markers, kilometer markers, and 100-meter markers. The dataset exhibits a significant imbalance in category distribution, and the targets show substantial variations in spatial scale, with a high proportion of small, distant targets, resulting in a typical dense distribution of small targets. Furthermore, the different categories of markers share high similarities in appearance and textual representation, further increasing the difficulty of category differentiation and target detection.
[0154] Meanwhile, the data acquisition process covers a variety of complex environmental factors, including changes in lighting, partial occlusion, and background interference, which cause problems such as reduced contrast and blurred boundaries in the target during imaging, thus making it closer to the actual vehicle vision application scenario.
[0155] The RMPD dataset is mainly used for automatic detection and localization of road markers in vehicle vision systems. It can also be applied to scenarios such as urban road facility inspection, road mileage information collection, and intelligent traffic management, providing a data foundation for the training and performance evaluation of related detection algorithms.
[0156] For example, to intuitively reflect the distribution characteristics and quantity differences of samples in each category, statistical analysis can be performed on each category of targets and visualized in the form of charts. This statistical result not only reflects the differences in frequency and proportion of different categories in the dataset, but also allows for strategy design, category weight setting, and data augmentation selection during subsequent model training, thus providing data support for the optimization of the detection algorithm.
[0157] In some embodiments, the proposed road station detection model can be built and optimized using the PyTorch deep learning framework to enable road station detection.
[0158] During the data preparation phase, electronic devices organize and clean the collected raw dataset, removing samples with labeling errors or that do not meet quality requirements, and converting the labeling information into a unified data format required for model training. Subsequently, the dataset is divided into training and validation sets in an 8:2 ratio for model parameter learning and generalization performance evaluation, thereby ensuring the model's stable performance on unseen data.
[0159] Before model training, electronic devices perform data augmentation on the input images to improve the model's adaptability to complex scenes. This includes random scaling, random noise perturbation, and simulation of different weather conditions, enabling the model to cover a wider range of road imaging variations, thereby enhancing its robustness and generalization ability.
[0160] During training, the electronic device uses stochastic gradient descent to iteratively optimize the model parameters. By continuously calculating the loss function and backpropagating to update the parameters, the model gradually converges to the optimal state in terms of feature representation and target prediction ability, thereby achieving accurate positioning and classification learning of road station numbers.
[0161] After the model converges, the electronic device saves the trained network structure and its corresponding weight parameters to form a complete model file, which can be directly loaded and used in the subsequent actual deployment stage to realize real-time detection of road markers in the vehicle environment.
[0162] By constructing the entire process from data preprocessing, data augmentation, model training to model storage, the model can learn stable and generalizable feature representations in complex road environments, thereby improving overall detection performance and reliability in engineering applications.
[0163] In some embodiments, to comprehensively evaluate the detection performance of the road station detection model, this experiment selected four metrics: F1-Score, mean average precision (mAP), number of parameters (parameters), and gross computational cost (GFLOPs). The F1-Score combines precision and recall to measure the overall performance and stability of the model. Mean precision (AP) is calculated by measuring the area under the precision-recall curve, while mAP is the average of AP across all categories. The number of parameters reflects the complexity of the model, and gross computational cost measures the computational complexity of the model. The calculation process of these metrics will be described in detail below.
[0164]
[0165]
[0166]
[0167]
[0168]
[0169] TP, FP, and FN represent the number of correctly predicted, misjudged, and missed positive samples, respectively.
[0170] In some embodiments, the model runtime environment includes an Intel Xeon Platinum 8255C processor, 314 GB of memory, an NVIDIA Tesla V100 32GB graphics card, and a CentOS 8.5.2 (64-bit) operating system. The deep neural network is built based on the PyTorch framework, with input image scales of [640, 640], and a multi-scale training strategy is employed. The experimental setup includes a batch size of 64, training for 200 epochs, using the SDG optimizer with an initial learning rate of 0.01, and optimization using a cosine decay strategy.
[0171] In some embodiments, the road station number detection model can be implemented based on YOLO series networks or Transformer architecture. The model typically includes a backbone network for feature extraction from the input image to be detected, a neck network for feature fusion of the extracted image features, and a detection network or Transformer decoding network for decoding and detecting the target fused features, ultimately outputting the road station number detection result. The backbone network includes a Bi-directional Cross-Attention Fusion Enhancement (BCFFE) module, with the specific structure as shown below. Figure 2As shown, the steps for implementing steps 110 to 140 and their related steps are described.
[0172] Assume the first input feature is a feature map extracted from the image to be detected via a backbone network or feature pyramid network. Where B is the batch size, C is the number of channels, and H and W are the spatial resolutions, the process executed by the electronic device based on the BCFFE module can be represented as: First, the BCFFE module performs feature mapping on the first input features. This is achieved by mapping the first input features using two independent convolutional computation modules, resulting in low-level detail features. With high-level semantic features This achieves the decoupled representation of low-level detail features and high-level semantic features in step 110:
[0173] After obtaining two levels of features, the electronic device targets the low-level detail features separately. With high-level semantic features A single-channel spatial weight map is generated to describe the saliency distribution of each branch in the spatial dimension. This includes low-level detail features. By performing convolutional transformations and nonlinear mappings, high-level semantic weights (i.e., first attention weights) are obtained. ; for high-level semantic features Isomorphic processing is performed to obtain low-level semantic weights (second attention weights). This provides a foundation for subsequent bidirectional cross-modulation.
[0174]
[0175] The electronic device then performs a bidirectional cross-weighting operation (i.e., interaction enhancement), which uses high-level semantic weights to spatially recalibrate low-level detail features to obtain the first interaction enhancement feature. Simultaneously, the low-level structural weights are used to back-modulate the high-level semantic features to obtain the first interactive enhancement feature. This enables cross-layer information interaction and complementary enhancement, which corresponds to the interaction enhancement mechanism in step 120.
[0176]
[0177]
[0178] After cross-weighting, the electronic device performs a fusion operation on the two features, concatenating them along the channel dimension to obtain the fused enhanced features. To compress and re-represent the fused enhanced features, a feedforward mapping is used to fuse the enhanced features, thereby obtaining the corresponding fused features. ,
[0179]
[0180] Subsequently, the electronic device, in order to further model the spatial orientation consistency of the road structure, fused features. Perform coordinate attention modeling operations: encode global information along the horizontal and vertical directions respectively, obtain directional description features through directional pooling, and generate attention weights along the coordinate axis directions, thereby realizing the modeling of long-range spatial dependencies and enabling features to have directional awareness.
[0181] Specifically, pooling operations are performed along the horizontal and vertical directions respectively to obtain horizontal and vertical encoded features;
[0182]
[0183] Then, the horizontal and vertical encoded features are concatenated and fused, and the result is subjected to channel compression to obtain the directional fusion feature. :
[0184]
[0185] Split back in two directions:
[0186]
[0187] Generate directional attention weights along the coordinate axes, i.e. and :
[0188]
[0189] Broadcast fusion is performed on the fusion enhancement features using directional attention weights:
[0190] The spatial attention mechanism, taking low-level detail feature processing as an example, first performs residual summation between the enhanced low-level detail features processed by two convolutional computation modules and the initial low-level detail features to obtain the detail fusion feature. :
[0191] Then, the detail fusion feature... Perform average pooling and max pooling respectively:
[0192]
[0193] splicing:
[0194] Generate attention weights:
[0195] Fusion output detail space enhancement features :
[0196] Similarly, semantic space enhancement features can be obtained:
[0197] The electronic device further utilizes directional attention to globally modulate the spatially enhanced bi-branch features (fused enhanced features), so that the feature response is simultaneously constrained by local spatial saliency and global structural consistency, thereby improving the stable representation of road station numbers under complex background and scale variation conditions:
[0198]
[0199] Finally, the electronic device concatenates the modulated low-level and high-level features along the channel dimension and fuses them uniformly through convolutional mapping to output the first output feature. :
[0200] In this embodiment, the BCFFE module employs a dual-branch feature decoupling mechanism. One branch focuses on modeling fine-grained structural information, such as the edge contours and stroke features of road station numbers, while the other branch emphasizes high-level semantic information expression, such as the overall numerical shape and category semantics. This allows for the construction of a structural and semantic collaborative representation system within a single-layer feature layer. Simultaneously, a spatial attention mechanism is introduced to effectively suppress redundant interference areas in the road background (such as road surface textures, shadows, and stains), enhancing the model's response strength to the road station area and making subsequent feature expressions more focused and discriminative.
[0201] Furthermore, the BCFFE module enhances the interaction between low-level structural information and high-level semantic information through a bidirectional cross-attention mechanism: high-level semantics guides low-level features to focus on key regions, while low-level structural information conversely constrains the spatial distribution of high-level features, thereby improving spatial localization capabilities while ensuring semantic consistency. In addition, by modeling long-range dependencies in the horizontal and vertical directions through a coordinate attention mechanism, the model can capture the spatially continuous distribution pattern of road markers along the road direction, thus improving detection robustness in complex scenarios.
[0202] In some embodiments, the neck network is provided with a bidirectional cross-feature fusion enhanced multi-scale channel-spatial shock attention (MCSSA) module, used to implement feature fusion in steps C1 to C3 and related steps, such as... Figure 3 As shown.
[0203] The MCSSA module receives the second input feature from the Feature Pyramid Network and first partitions and rearranges it into groups along the channel dimension, dividing the input feature into G group features. Each group is further divided into two sub-features, each processed based on a branch for channel modeling and spatial modeling respectively, thus achieving multi-scale collaborative representation within a single input feature. Assume the input feature is... First, the features are grouped using grouped convolution to obtain G grouped features. :
[0204] This refers to the convolution kernel corresponding to the grouped convolution.
[0205] The electronic device then performs cyclic processing on each group feature one by one, that is, it repeats the same enhancement process on each group feature in turn, thereby achieving independent modeling and feature enhancement on a group-by-group basis.
[0206] Based on the grouping features being processed The electronic device is divided along the channel dimension, resulting in two sub-features. .in Used for channel attention branch modeling Used for spatial attention branch modeling:
[0207] In the channel attention branch, the electronic device targets Multi-scale channel statistical operations are performed to obtain channel response information under different receptive fields. Specifically, channel statistical features are obtained through max pooling and multi-scale adaptive average pooling, including:
[0208]
[0209]
[0210]
[0211] The electronic device fuses the aforementioned multi-scale channel statistical features and generates channel attention weights using learnable parameters. This allows for adaptive recalibration of the importance of the channel dimension.
[0212] Subsequently, the electronic device uses channel attention weights to... By performing a weighted operation, the channel enhancement features are obtained:
[0213] In the spatial attention branch, electronic devices... Perform spatial description modeling operations. Specifically, statistically aggregate the features of each channel, calculate the average and maximum responses, and concatenate the channel dimensions to obtain the spatially enhanced feature Q:
[0214]
[0215]
[0216] Electronic devices perform multi-scale feature extraction and fusion on Q based on convolutional kernels with different receptive fields to generate spatial attention weights. This enhances salient spatial regions.
[0217] Electronic devices use spatial attention weights Performing weighted operations yields spatially augmented features:
[0218] In obtaining channel enhancement features Spatial Enhancement Features Subsequently, the electronic device concatenates the two along the channel dimension to perform channel rearrangement on the concatenated result, thereby achieving cross-channel information interaction and obtaining the output features of the current group. :
[0219] The electronic device repeats the above processing procedure for all grouped features and aggregates the outputs of each group to obtain the second output feature of the MCSSA module:
[0220] In road marker detection tasks, targets typically exhibit significant scale differences, sparse distribution, and susceptibility to complex background interference. Traditional neck networks, during multi-scale feature fusion, easily introduce redundant information and weaken the response of key targets. The MCSSA module, through grouping and channel rearrangement mechanisms, enhances cross-channel information interaction capabilities while reducing computational complexity. Furthermore, it captures both global semantic information and local structural details through a dual-branch modeling approach combining channel and spatial elements. Specifically, multi-scale channel attention enhances the semantic response of distant, small targets, while spatial attention improves target region localization accuracy and suppresses background interference. This significantly improves the model's detection accuracy and robustness in complex road scenarios, particularly in small target detection and similarity category differentiation tasks.
[0221] In some embodiments, Figure 4 The diagram illustrates the structure of a road station detection model based on the Transformer architecture. This model primarily consists of a backbone network, a neck network, and a Transformer decoding structure working together. Through layer-by-layer optimization in three stages—feature extraction, feature fusion, and end-to-end decoding—it achieves accurate detection of road station numbers in complex road scenarios.
[0222] In the feature extraction stage of the backbone network, the input image to be detected, with a scale of 3×640×640, first undergoes initial feature extraction through the Stem module, and then enters a cascaded structure consisting of alternating downsampling layers and bidirectional cross-feature fusion enhancement modules. This structure progressively constructs feature pyramids with various resolutions and channel numbers, including 64×160×160, 128×80×80, 256×40×40, and 512×20×20. During this process, the bidirectional cross-feature fusion enhancement module decouples features to construct a dual-branch representation, combining spatial attention and cross-branch guidance mechanisms for interactive modeling, achieving bidirectional complementary enhancement of fine-grained structural information and high-level semantic information. Simultaneously, this module utilizes coordinate attention to model direction-dependent long-range dependencies, significantly improving the model's ability to represent and capture distant, ultra-small-scale road markers and complex-shaped targets. At the end of the backbone network, a Transformer encoding structure is integrated to further capture global contextual information.
[0223] In the neck network feature fusion stage, the architecture adopts a bidirectional path aggregation network structure with bottom-up and top-down fusion. Channel alignment and adjustment are achieved through 1×1 2D convolutions, spatial scale is matched using upsampling and downsampling operations, and shallow high-resolution fine-grained features are fused with deep high-semantic features through cascaded nodes. After multi-level feature cascading, a multi-scale channel spatial rearrangement attention module is introduced for feature enhancement. This module is deployed at key nodes of feature cascading and scale transformation, constructing joint attention between channels and space through multi-scale pooling and multi-scale convolutions, and combining channel rearrangement mechanisms for cross-channel information interaction. This enables grouping and modeling of multi-level features and spatial saliency enhancement, guiding the model to accurately focus on key target areas of station numbers, while effectively suppressing noise interference from trees, road surfaces, guardrails, etc., in complex road backgrounds.
[0224] In the Transformer decoding and loss function optimization stage, the feature maps fused by the neck network undergo reshaping and stitching operations, and a top-K selection mechanism is used to select feature anchors of size 300×256. These anchors are then fed into the decoding layer, which consists of a multi-head self-attention mechanism and a feedforward neural network. Combined with positional encoding, target query and alignment are performed, ultimately outputting high-precision road post number detection results. To ensure training effectiveness, the network employs a joint loss function based on angular interval discrimination and scale awareness. The angular interval mechanism increases the inter-class distance between different post number categories in the feature space, effectively solving the problem of confusion and false detection between highly similar categories. Simultaneously, scale weights are used to increase the constraint on the regression of small targets, and combined with classification and localization consistency penalties, ensuring the localization accuracy and detection box stability of small post numbers at long distances.
[0225] In summary, through systematic and coordinated improvements at multiple levels, including feature representation, attention focus, and discrimination boundary, this model exhibits extremely high robustness, detection rate, and generalization performance under various lighting changes, background interference, and scale transformation conditions. It can more accurately locate road station numbers and has good engineering application value and promotion prospects.
[0226] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0227] Corresponding to the deep learning-based road marker detection method in the above embodiments, the deep learning-based road marker detection device provided in this application is used to implement the following deep learning-based road marker detection method: The first input feature is mapped to low-level detail features and high-level semantic features; the first input feature is extracted based on the image to be detected; the image to be detected includes road markers; Perform interactive enhancement and fusion operations on low-level detail features and high-level semantic features to obtain fused and enhanced features; Based on the fusion enhancement feature, attention enhancement and fusion operations are performed on low-level detail features and high-level semantic features to obtain the first output feature corresponding to the first input feature; Image features are obtained based on the first output features; Perform a fusion operation on the image features to obtain the target fused features; The target fusion features are used to output the road station detection results corresponding to the image to be detected.
[0228] Optionally, interactive enhancement and fusion operations are performed on low-level detail features and high-level semantic features to obtain fused enhanced features, including: The first attention weight is generated based on low-level detailed features, and the second attention weight is generated based on high-level semantic features. The first interaction enhancement feature is obtained by performing a weighted operation on the low-level detail features using the second attention weight; The second interaction enhancement feature is obtained by performing a weighted operation on the high-level semantic features using the first attention weight; A fusion operation is performed on the first and second interactive enhancement features to obtain the fused enhancement features.
[0229] Optionally, attention enhancement is performed on low-level detail features and high-level semantic features based on the fused enhancement features, including: Perform a direction-aware attention operation on the fused enhanced features to obtain global enhanced features; Enhancement operations are performed on the low-level detail features and the high-level semantic features respectively to obtain the enhanced low-level detail features and the enhanced high-level semantic features; Perform the following steps on the low-level detail features and the enhanced high-level semantic features respectively; The enhanced low-level detail features are fused with the detail space enhancement features to obtain the detail fused features; The enhanced high-level semantic features are fused with the semantic space enhanced features to obtain semantic fusion features; Based on the global enhancement features, the detail fusion features and semantic fusion features are modulated separately to obtain detail modulation features and semantic modulation features; A fusion operation is performed on the detail modulation features and semantic modulation features to obtain the first output feature.
[0230] Optionally, a direction-aware attention operation is performed on the fused enhanced features to obtain global enhanced features, including: Global information aggregation operations are performed on the fused and enhanced features along the horizontal and vertical directions, respectively, to obtain horizontal and vertical encoded features. A fusion operation is performed on the horizontal and vertical encoded features to obtain directional fused features; Generate directional attention weights based on directional fusion features; Global enhanced features are obtained by performing a weighted operation on the fused enhanced features using directional attention weights.
[0231] Optionally, a fusion operation is performed on the image features to obtain the target fused features, including: A grouped convolution operation is performed on the second input feature to obtain multiple grouped features; the second input feature is determined based on image features. For each group feature, the group feature is divided into a first sub-feature and a second sub-feature; the first sub-feature and the second sub-feature each include different channel features; a channel attention enhancement operation is performed based on the first sub-feature to obtain a channel-enhanced feature; a spatial attention enhancement operation is performed based on the second sub-feature to obtain a spatial-enhanced feature; a fusion operation is performed on the channel-enhanced feature and the spatial-enhanced feature, and a channel rearrangement operation is performed to obtain the group output feature corresponding to the group feature; An aggregation operation is performed on multiple grouped output features to obtain the second output feature corresponding to the second input feature. The second output feature is used to determine the target fusion feature.
[0232] Optionally, a channel attention enhancement operation is performed based on the first sub-feature to obtain channel-enhanced features, including: Perform multi-scale pooling on the first sub-feature to obtain statistical features for multiple channels; Perform a fusion operation on the statistical features of multiple channels to generate channel attention weights; The channel-enhanced features are obtained by weighting the first sub-feature using channel attention weights.
[0233] Optionally, a spatial attention enhancement operation is performed based on the second sub-feature to obtain spatially enhanced features, including: Perform a hybrid pooling operation on the second sub-feature to obtain the spatial description feature; By using convolutional kernels with different receptive fields, feature extraction is performed on the spatial description features to obtain the corresponding feature extraction results; Spatial attention weights are generated based on the feature extraction results. The spatially enhanced features are obtained by performing a weighted operation on the second sub-feature using spatial attention weights.
[0234] Optionally, the road station detection method is implemented based on a pre-trained road station detection model. The loss function for training the road station detection model is obtained by weighted summation of classification loss, regression loss, and consistency loss. Among them, the classification loss term constructs a category discrimination boundary by introducing angular intervals into the feature angles corresponding to the target category; the regression loss term determines the bounding box regression weights based on the scale of the detected target; and the consistency loss term constructs consistency constraints based on the correspondence between classification confidence and localization quality. Secondly, this application provides a road mileage detection device based on deep learning, which is used to perform the steps of the method as described in any of the above embodiments.
[0235] Figure 5 This is a schematic diagram of the physical layer structure of an electronic device provided in an embodiment of this application. Figure 5 As shown, the electronic device 5 of this embodiment includes: at least one processor 50 ( Figure 5 The diagram shows only one processor, memory 51, and a computer program 52 stored in memory 51 that can run on at least one processor 50. When processor 50 executes computer program 52, it implements the steps in any of the above embodiments of the deep learning-based road marker detection method, for example... Figure 1 Steps 110-160 are shown.
[0236] The processor 50 can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0237] In some embodiments, memory 51 may be an internal storage unit of electronic device 5, such as a hard disk or memory of electronic device 5. In other embodiments, memory 51 may also be an external storage device of electronic device 5, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. equipped on electronic device 5.
[0238] Furthermore, the memory 51 may include both internal storage units and external storage devices of the electronic device 5. The memory 51 is used to store operating devices, application programs, bootloaders, data, and other programs, such as program code for computer programs. The memory 51 can also be used to temporarily store data that has been output or will be output.
[0239] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the above device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0240] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.
[0241] This application provides a computer program product that, when run on an electronic device, enables the electronic device to perform the steps described in the various method embodiments above.
[0242] If the integrated unit is implemented as 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, all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to a photographic device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, such as a USB flash drive, a portable hard drive, a magnetic disk, or an optical disk.
[0243] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0244] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0245] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For instance, the division of modules or units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0246] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0247] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A road station number detection method based on deep learning, characterized in that, include: The first input feature is mapped to low-level detail features and high-level semantic features; the first input feature is extracted based on the image to be detected; the image to be detected includes road markers; Perform interactive enhancement and fusion operations on the low-level detail features and the high-level semantic features to obtain fused enhanced features; Based on the fusion enhancement feature, attention enhancement operation and fusion operation are performed on the low-level detail feature and the high-level semantic feature to obtain the first output feature corresponding to the first input feature; Image features are obtained based on the first output features; Perform a fusion operation on the image features to obtain the target fused features; Based on the target fusion features, the road station detection result corresponding to the image to be detected is output; The step of performing interactive enhancement and fusion operations on the low-level detail features and the high-level semantic features to obtain fused enhanced features includes: A first attention weight is generated based on the low-level detail features to characterize the saliency of the low-level detail features, and a second attention weight is generated based on the high-level semantic features to characterize the saliency of the high-level semantic features. The low-level detail features are weighted by the second attention weight to obtain the first interaction enhancement feature; the first interaction enhancement feature is used to characterize the low-level detail features enhanced under the guidance of the saliency of high-level semantic features. The high-level semantic features are weighted by the first attention weight to obtain the second interactive enhancement feature; the second interactive enhancement feature is used to characterize the high-level semantic features enhanced under the guidance of the saliency of low-level detail features. A fusion operation is performed on the first interaction enhancement feature and the second interaction enhancement feature to obtain a fused enhancement feature.
2. The road station detection method as described in claim 1, characterized in that, The attention enhancement performed on the low-level detail features and the high-level semantic features based on the fused enhancement features includes: Perform a direction-aware attention operation on the fused enhanced features to obtain global enhanced features; Enhancement operations are performed on the low-level detail features and the high-level semantic features respectively to obtain the enhanced low-level detail features and the enhanced high-level semantic features; Spatial attention operations are performed on the low-level detail features and the enhanced high-level semantic features respectively to obtain the detail space-enhanced features and the semantic space-enhanced features; The enhanced low-level detail features are fused with the detail space enhancement features to obtain the detail fusion features; The enhanced high-level semantic features are fused with the semantic space enhancement features to obtain semantic fusion features; Based on the global enhancement features, the detail fusion features and the semantic fusion features are modulated respectively to obtain detail modulation features and semantic modulation features; A fusion operation is performed on the detail modulation feature and the semantic modulation feature to obtain the first output feature.
3. The road station detection method as described in claim 2, characterized in that, The step of performing a direction-aware attention operation on the fused enhanced features to obtain global enhanced features includes: Global information aggregation operations are performed on the fused and enhanced features along the horizontal and vertical directions, respectively, to obtain horizontal encoded features and vertical encoded features; A fusion operation is performed on the horizontal and vertical encoded features to obtain directional fusion features; Generate directional attention weights based on the directional fusion features; The global enhanced features are obtained by performing a weighted operation on the fused enhanced features using the directional attention weights.
4. The road station detection method as described in any one of claims 1 to 3, characterized in that, The step of performing a fusion operation on the image features to obtain target fused features includes: A grouped convolution operation is performed on the second input feature to obtain multiple grouped features; the second input feature is determined based on the image features. For each grouping feature, the grouping feature is divided into a first sub-feature and a second sub-feature; the first sub-feature and the second sub-feature each include different channel features; Based on the first sub-feature, perform channel attention enhancement operation to obtain channel enhanced features; Based on the second sub-feature, a spatial attention enhancement operation is performed to obtain the spatially enhanced feature; A fusion operation is performed on the channel enhancement features and the spatial enhancement features, and a channel rearrangement operation is performed to obtain the grouped output features corresponding to the grouping features; An aggregation operation is performed on multiple grouped output features to obtain a second output feature corresponding to the second input feature, and the second output feature is used to determine the target fusion feature.
5. The road station detection method as described in claim 4, characterized in that, The process of performing channel attention enhancement operation based on the first sub-feature to obtain channel enhancement features includes: Perform multi-scale pooling on the first sub-feature to obtain multiple channel statistical features; A fusion operation is performed on multiple channel statistical features to generate channel attention weights; The channel-enhanced feature is obtained by performing a weighting operation on the first sub-feature using the channel attention weights.
6. The road station detection method as described in claim 4, characterized in that, The spatial attention enhancement operation based on the second sub-feature to obtain spatially enhanced features includes: Perform a hybrid pooling operation on the second sub-feature to obtain the spatial description feature; Feature extraction is performed on the spatial description features using convolution kernels with different receptive fields to obtain the corresponding feature extraction results; Spatial attention weights are generated based on the feature extraction results described above. The spatially enhanced feature is obtained by performing a weighting operation on the second sub-feature using the spatial attention weights.
7. The road station detection method as described in any one of claims 1 to 3, characterized in that, The road marker detection method is based on a pre-trained road marker detection model. The loss function for training the road marker detection model is obtained by weighted summation of classification loss, regression loss, and consistency loss. The classification loss term constructs a category discrimination boundary by introducing angular intervals into the feature angles corresponding to the target category; the regression loss term determines the bounding box regression weights based on the scale of the detected target; and the consistency loss term constructs consistency constraints based on the correspondence between classification confidence and localization quality.
8. A road station detection device based on deep learning, characterized in that, The road mileage detection is used to perform the deep learning-based road mileage detection method as described in any one of claims 1 to 7.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the deep learning-based road station detection method as described in any one of claims 1 to 7.
10. A computer program product, the computer program product comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the deep learning-based road station detection method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Method and system for generating attention remote sensing image description based on high-low layer feature fusion
CN111860235A
Passive domain eye fundus image segmentation method based on multi-scale features and step attention
CN121169938A