Barcode feature fusion method and device based on attention cooperation, equipment and medium

CN122967029APending Publication Date: 2026-10-23BEIJING QIANHAI YANXIANG ELECTRONIC TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611116737.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-27
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

但是条码具有条空交替特性,在反光、污损和运动模糊等复杂场景下,会导致反射率和信号变化剧烈,严重影响检测精度

Benefits of technology

[0015]本申请提供的基于注意力协同的条码特征融合方法、装置、设备及介质,对目标条码进行特征提取,得到初始特征;对初始特征进行频域增强处理,得到融合高频特征;对初始特征进行空间注意力加权处理,得到空间加权特征;根据初始特征、融合高频特征和空间加权特征进行特征融合,得到目标融合特征。本申请通过频域增强处理提取条码的高频有效特征,并针对条码进行空间注意力加权处理,实现对条码区域的精准聚焦与背景抑制,再进行多分支特征融合得到目标融合特征用于条码检测,从而能够显著提升条码检测的准确性与鲁棒性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122967029A_ABST
    Figure CN122967029A_ABST
Patent Text Reader

Abstract

The application provides a barcode feature fusion method and device based on attention cooperation, equipment and medium, relating to the technical field of target detection, which comprises the following steps: performing feature extraction on a target barcode to obtain initial features; performing frequency domain enhancement processing on the initial features to obtain fused high-frequency features; performing spatial attention weighting processing on the initial features to obtain spatial weighted features; and performing feature fusion according to the initial features, the fused high-frequency features and the spatial weighted features to obtain target fusion features. The application extracts high-frequency effective features of the barcode through frequency domain enhancement processing, and performs spatial attention weighting processing on the barcode to realize accurate focusing on the barcode area and background suppression, and then performs multi-branch feature fusion to obtain target fusion features for barcode detection, so that the accuracy and robustness of barcode detection can be significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of target detection technology, specifically to a barcode feature fusion method, apparatus, device, and medium based on attention collaboration. Background Technology

[0002] Barcodes, as a core carrier of information storage and traceability, are currently widely used in product manufacturing, warehousing management, and logistics distribution. Barcode detection needs to achieve rapid and accurate positioning and identification in complex environments to support subsequent decoding and information traceability. Its detection performance directly affects industrial production efficiency and the accuracy of logistics flow.

[0003] With the rise of deep learning, object detection algorithms based on convolutional neural networks have been widely applied to barcode detection. However, barcodes have alternating bar and space characteristics, which can lead to drastic changes in reflectivity and signal in complex scenarios such as glare, dirt, and motion blur, severely affecting detection accuracy. Therefore, it is urgent to solve the problem of insufficient accuracy in barcode detection. Summary of the Invention In view of the above-mentioned shortcomings of related technologies, this application provides a barcode feature fusion method, apparatus, device and medium based on attention collaboration, which effectively improves the accuracy and robustness of barcode detection.

[0004] Firstly, this application provides a barcode feature fusion method based on attention collaboration, comprising: Feature extraction is performed on the target barcode to obtain initial features; The initial features are subjected to frequency domain enhancement processing to obtain fused high-frequency features; The initial features are subjected to spatial attention weighting to obtain spatially weighted features; The target fused feature is obtained by performing feature fusion based on the initial feature, the fused high-frequency feature, and the spatial weighted feature.

[0005] The step of performing frequency domain enhancement processing on the initial features to obtain fused high-frequency features includes: The initial features are subjected to frequency domain decomposition and adaptive weight fusion to obtain frequency domain fused features; The initial features are subjected to spatial multi-scale fusion to obtain spatial fused features; Based on the initial features, the frequency domain fusion features, and the spatial domain fusion features, feature fusion is performed to obtain the initial fused high-frequency features; The core texture region of the initial fused high-frequency feature is weighted and enhanced to obtain the fused high-frequency feature.

[0006] In an optional implementation, the step of performing frequency domain decomposition and adaptive weight fusion on the initial features to obtain frequency domain fused features includes: The initial features are convolved in at least two frequency band channels to obtain at least two target frequency band features; Adaptive weight fusion is performed on the at least two target frequency band features to obtain the frequency domain fused features.

[0007] In an optional implementation, the step of performing a convolution operation on the initial features in at least two frequency band channels to obtain at least two target frequency band features includes: The initial features are processed by Laplacian convolution in the first frequency band channel to obtain high-frequency features; The initial features are processed by dilated Laplacian convolution in the second frequency band channel to obtain mid-to-high frequency features. The initial features are processed by convolution and activation function in the third frequency band channel to obtain low-frequency suppressed features.

[0008] In an optional implementation, the step of performing spatial multi-scale fusion on the initial features to obtain spatial fused features includes: The initial features are subjected to dilated convolution with multiple different receptive fields to obtain multiple spatial texture features; Based on the aforementioned spatial texture features, feature splicing is performed to obtain spatial splicing features; The spatial domain splicing features are convolutionally processed to obtain the spatial domain fusion features.

[0009] In an optional implementation, the step of weighting and enhancing the core texture region of the initial fused high-frequency features to obtain the fused high-frequency features includes: The core texture region is determined based on the gradient value of the initial fused high-frequency features; Based on the core texture region, the initial fused high-frequency features are weighted to obtain texture weight features; Texture features are enhanced based on the initial fused high-frequency features and the texture weight features to obtain high-frequency enhanced features; The high-frequency enhancement features are integrated to obtain the fused high-frequency features.

[0010] In an optional implementation, the spatial attention weighting process applied to the initial features to obtain spatially weighted features includes: The initial features are subjected to global average pooling and channel dimensionality reduction to obtain compressed features; The spatial attention is obtained by performing nonlinear spatial attention learning on the compressed features; The spatial attention is mapped to the spatial dimension of the initial feature to generate spatial weight features; The spatial weighted features are obtained by performing spatial weighted fusion based on the initial features and the spatial weighted features.

[0011] In an optional implementation, the step of performing feature fusion based on the initial features, the fused high-frequency features, and the spatially weighted features to obtain the target fused features includes: Channel splicing is performed based on the initial features, the fused high-frequency features, and the spatial weighted features to obtain the target splicing features; The target splicing features are subjected to deformable convolution and convolution dimensionality reduction processing to obtain the target compressed features; Spatial feature integration is performed on the target compressed features to obtain the target fused features.

[0012] Secondly, this application provides a barcode feature fusion device based on attention collaboration, comprising: The feature extraction module is used to extract features from the target barcode to obtain initial features; The frequency domain enhancement module is used to perform frequency domain enhancement processing on the initial features to obtain fused high-frequency features; The spatial weighting module is used to perform spatial attention weighting processing on the initial features to obtain spatially weighted features; The feature fusion module is used to perform feature fusion based on the initial features, the fused high-frequency features, and the spatially weighted features to obtain the target fused features.

[0013] Thirdly, this application provides a barcode feature fusion device based on attention collaboration, including a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the computer program to implement the barcode feature fusion method based on attention collaboration as described in the first aspect of this application.

[0014] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the attention-based collaborative barcode feature fusion method as described in the first aspect of this application.

[0015] This application provides a barcode feature fusion method, apparatus, device, and medium based on attention collaboration. The method extracts features from a target barcode to obtain initial features; performs frequency domain enhancement processing on the initial features to obtain fused high-frequency features; performs spatial attention weighting processing on the initial features to obtain spatially weighted features; and performs feature fusion based on the initial features, fused high-frequency features, and spatially weighted features to obtain the target fused features. This application extracts the effective high-frequency features of the barcode through frequency domain enhancement processing and performs spatial attention weighting processing on the barcode to achieve precise focusing and background suppression of the barcode region. Then, multi-branch feature fusion is performed to obtain the target fused features for barcode detection, thereby significantly improving the accuracy and robustness of barcode detection. Attached Figure Description

[0016] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a schematic diagram of the barcode feature fusion method based on attention collaboration provided in the embodiments of this application; Figure 2 This is a schematic diagram of the frequency domain enhancement processing flow provided in the embodiments of this application; Figure 3 This is a schematic diagram of the frequency domain decomposition and adaptive weight fusion process in an embodiment of this application; Figure 4 This is a schematic diagram of the spatial multi-scale fusion process in an embodiment of this application; Figure 5 This is a schematic diagram of the process for enhancing the core texture region in an embodiment of this application; Figure 6 This is a schematic diagram of the spatial attention weighting process in the embodiments of this application; Figure 7 This is a schematic diagram of the structure of the FSA-FPN module provided in the embodiments of this application; Figure 8 This is a schematic diagram of an improved YOLOv8 cross-scale fusion process provided in an embodiment of this application; Figure 9 This is a schematic diagram of the barcode feature fusion device based on attention collaboration provided in the embodiments of this application; Figure 10 This is a schematic diagram of the hardware structure of a barcode feature fusion device based on attention collaboration provided in an embodiment of this application.

[0018] Explanation of key component symbols: 1000, Barcode Feature Fusion Device Based on Attention Collaboration; 910, Feature Extraction Module; 920, Frequency Domain Enhancement Module; 930, Spatial Weighting Module; 940, Feature Fusion Module; 1000, Barcode Feature Fusion Equipment Based on Attention Collaboration; 1010, Processor; 1020, Communication Interface; 1030, Memory; 1040, Communication Bus. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be further described clearly and completely below with reference to the accompanying drawings of the embodiments. It should be noted that the described embodiments are merely some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0020] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of this application.

[0022] With the rise of deep learning, barcode detection has gradually evolved from traditional image processing techniques to deep learning technologies. Early traditional edge detection, morphological operations, and support vector machine classification methods relied on manually designed features. Although simple to implement, they were weak in resisting interference in complex environments, making it difficult to cope with scenarios such as barcode damage and mixed background textures. Furthermore, their adaptability was limited, failing to meet the detection needs of barcodes of various sizes and types.

[0023] Currently, object detection algorithms based on convolutional neural networks are widely used in barcode detection. However, the frequent alternation of barcode bars and spaces easily generates high-frequency signals, which appear as obvious textures in images. Furthermore, barcodes of various sizes and types exhibit significant variations in bar width. These characteristics, under complex scenarios such as reflection, dirt, large-angle tilt, and motion blur, can lead to drastic changes in reflectivity and signal, severely impacting detection accuracy. Therefore, there is an urgent need to address the problem of insufficient accuracy in barcode detection.

[0024] To address the aforementioned problems in related technologies, embodiments of this application provide an attention-based collaborative barcode feature fusion method, which effectively improves the accuracy and robustness of barcode detection. The attention-based collaborative barcode feature fusion method provided in this application can be applied to electronic devices, such as computers or other terminal devices, or servers. Figure 1 This is a flowchart illustrating the attention-based collaborative barcode feature fusion method provided in this application embodiment, as shown below. Figure 1 As shown, the method may include the following steps S110 to S140.

[0025] S110. Extract features from the target barcode to obtain initial features.

[0026] In this embodiment, the target barcode can be any type of barcode to be detected, including one-dimensional barcodes (such as EAN codes, UPC codes, and Code 128 codes), two-dimensional barcodes (such as QR codes, Data Matrix codes, and PDF417 codes), and stacked barcodes. The target barcode can be acquired using image acquisition devices such as industrial cameras, barcode scanners, and mobile terminal cameras.

[0027] Feature extraction of the target barcode involves using deep learning networks to perform hierarchical feature extraction on the barcode image, obtaining feature representations at different scales. For example, the backbone network of the YOLO series of real-time object detection networks can be used to extract features from the target barcode image. The backbone network typically includes multiple convolutional layers, batch normalization layers, and activation function layers. Through layer-by-layer processing, hierarchical feature representations, ranging from low-level texture features to high-level semantic features, are extracted from the target barcode image, yielding initial features. F_c .

[0028] It is understandable that the initial features mentioned above can be a feature map of an intermediate layer output by the backbone network, or a combination of multiple intermediate layer feature maps. Specifically, the initial features can be at least one of the C3, C4, or C5 feature layers output by the backbone network of the YOLO series networks. Among them, the C3 feature layer is a shallow feature with high spatial resolution and contains rich fine-grained texture information, such as barcode edges and bar / space boundaries; the C4 feature layer is a medium-level feature with moderate spatial resolution, balancing texture and semantic information; and the C5 feature layer is a deep feature with lower spatial resolution and contains rich global semantic information, such as barcode category and overall outline.

[0029] For example, in a barcode inspection scenario on an industrial production line, an industrial camera captures a product image containing a one-dimensional barcode. This product image is then input into the YOLOv8 backbone network. After multi-layer convolutional processing, a barcode of size [value missing] is extracted from the middle layers of the network. H×W×CThe initial feature map, where H For feature map height, W The width of the feature map. C This represents the number of channels in the feature map.

[0030] S120. Perform frequency domain enhancement processing on the initial features to obtain fused high-frequency features.

[0031] In this embodiment of the application, frequency domain enhancement processing refers to separating and extracting features of different frequency bands during spatial convolution by simulating frequency domain filtering, thereby effectively enhancing the high-frequency texture features of the barcode, such as black and white bar boundaries and dot matrix edges, while suppressing low-frequency background noise, such as paper background color and slight reflection.

[0032] It should be noted that the recognizability of barcodes comes from the strong black-and-white contrast of the bar and space boundaries and the dot matrix structure. These features belong to high-frequency signals with abrupt changes in pixel values ​​in the frequency domain, while the background such as the paper color, slight reflections, and messy patterns belong to low-frequency noise with smooth pixel values.

[0033] Optionally, frequency domain enhancement processing can employ methods such as frequency domain decomposition and adaptive weight fusion, spatial multi-scale fusion, and texture attention enhancement to obtain fused high-frequency features.

[0034] The frequency domain decomposition and adaptive weight fusion mentioned above refer to the direct separation and extraction of features of different frequency bands during the spatial domain convolution process by initializing convolution kernels with different frequency domain responses, without the need for explicit conversion between the spatial and frequency domains, thereby extracting high-frequency edges and mid-to-high-frequency structures in parallel while suppressing low-frequency noise.

[0035] Among them, the above-mentioned spatial multi-scale fusion refers to the parallel processing of initial features through dilated convolution of multiple different receptive fields, extracting spatial texture features of different scales, and then splicing and dimensionality reduction fusion to make up for the shortcomings of frequency domain feature extraction in terms of scale adaptability and supplement the texture details of barcodes of different sizes.

[0036] The aforementioned texture attention enhancement refers to locating core texture regions such as the black and white bar boundaries of a barcode by calculating the gradient magnitude of the feature map, then assigning high weights to these regions and low weights to textureless regions, thereby further amplifying the response of effective features.

[0037] Therefore, by progressively enhancing the frequency domain, the high-frequency texture of the barcode can be effectively separated from the low-frequency noise of the background, accurately capturing the core texture features of the barcode, preventing the loss of high-frequency features, and providing highly recognizable basic features for subsequent fusion and detection.

[0038] S130. Perform spatial attention weighting on the initial features to obtain spatially weighted features.

[0039] In this embodiment, spatial attention weighting refers to generating a barcode-specific spatial weight map through channel aggregation and nonlinear learning, thereby achieving precise focusing on the barcode area and effective suppression of background interference.

[0040] Specifically, spatial attention weighted processing accurately locates the spatial position of the barcode, generating a spatial weight map with high weight for the barcode area and low weight for the background area. Through weighted operations, barcode features are enhanced and background interference is suppressed, forming a complementary combination of position focusing and texture enhancement with the aforementioned frequency domain enhancement processing.

[0041] It should be noted that barcodes exhibit concentrated feature responses in localized areas of the feature map. Compared to a cluttered background, the features of the barcode region show a coordinated high response across multiple channels; for example, the boundary between black and white bars shows strong signals in both edge detection and structure detection channels. Therefore, the core logic of barcode spatial attention weighted processing is as follows: First, channel aggregation is performed on the initial features, condensing the response information of multi-channel features into a single-channel spatial attention map; then, the difference between the barcode and the background is learned through nonlinear transformation, generating precise spatial weight features representing the 0-1 interval; finally, the spatial weight features are weighted and fused with the initial features, allowing the network to focus only on the spatial region where the barcode is located, filtering out redundant interference from the background.

[0042] Therefore, by using barcode spatial attention weighting processing, it is possible to achieve accurate positioning of the barcode spatial location, enhance barcode area features, suppress background interference, improve spatial positioning capabilities, and reduce background false detection rate.

[0043] S140. Based on the initial features, fused high-frequency features, and spatially weighted features, feature fusion is performed to obtain the target fused features.

[0044] In this embodiment of the application, feature fusion refers to integrating features from three sources—initial features, fused high-frequency features, and spatially weighted features—to obtain the final target fused features.

[0045] For example, feature fusion can effectively integrate multiple features using methods such as channel concatenation, deformable convolution, and feature integration. Channel concatenation stacks different feature maps along the channel dimension to obtain a concatenated feature map, fully preserving all complementary information from multiple branch outputs. Deformable convolution processes the concatenated features, dynamically adjusting the sampling position by learning offsets to solve the spatial misalignment problem between features of different scales, achieving precise spatial alignment between shallow fine textures and deep strong semantic features. Convolutional dimensionality reduction compresses the concatenated features through convolution, reducing computational cost while integrating redundant information between channels.

[0046] Understandably, fusing independent features that are completely orthogonal across three information dimensions along the channel dimension can fully preserve all complementary information. By comprehensively utilizing the advantages of initial features, high-frequency features, and spatially weighted features, spatial alignment can be achieved while preserving rich texture information, providing rich input support for subsequent object detection.

[0047] Based on this, the barcode feature fusion method based on attention collaboration provided in this application effectively extracts and enhances the high-frequency texture features of the barcode through frequency domain enhancement processing, achieves precise focusing and background suppression of the barcode area through barcode spatial attention weighting processing, and achieves spatial alignment and adaptive integration of cross-scale features through feature fusion, thereby significantly improving the accuracy and robustness of barcode detection.

[0048] In some implementations, frequency domain enhancement processing includes frequency domain decomposition and adaptive weighted fusion, spatial multi-scale fusion, and texture attention enhancement. Figure 2 This is a schematic diagram of the frequency domain enhancement processing flow provided in the embodiments of this application, as shown below. Figure 2 As shown, performing frequency domain enhancement processing on the initial features to obtain fused high-frequency features may include the following steps S210 to S240.

[0049] S210. Perform frequency domain decomposition and adaptive weight fusion on the initial features to obtain frequency domain fused features.

[0050] In the embodiments of this application, frequency domain decomposition refers to the direct separation and extraction of features of different frequency bands during the spatial domain convolution process by initializing a convolution kernel with a specific frequency domain response.

[0051] It should be noted that, according to the convolution theorem, spatial convolution is equivalent to frequency domain multiplication. That is, the effect of a spatial convolution kernel is equivalent to multiplying the frequency domain response function of the kernel with the frequency domain representation of the input features in the frequency domain. When the frequency domain response of the convolution kernel has high gain in the high-frequency region and low gain in the low-frequency region, the kernel acts like a high-pass filter, extracting high-frequency features; conversely, when the frequency domain response of the convolution kernel has high gain in the low-frequency region and low gain in the high-frequency region, the kernel acts like a low-pass filter, extracting low-frequency features.

[0052] Therefore, frequency domain decomposition can complete frequency band separation in a single spatial domain convolution by initializing convolution kernels with different frequency domain responses, without the need for explicit conversion between the spatial and frequency domains, such as the fast Fourier transform and its inverse transform. While ensuring the accuracy of frequency domain feature extraction, it significantly reduces the amount of computation and adapts to the deployment requirements of devices such as barcode readers.

[0053] Optionally, frequency domain decomposition can employ multi-band convolution to transform the initial features Simultaneously, three independent parallel frequency band convolution channels are fed in, outputting high-frequency features, mid-to-high-frequency features, and low-frequency suppressed features, respectively. The features output from the three channels are then adaptively weighted and fused to obtain the frequency domain fused features. F_freq In this case, the output size of each of the three parallel frequency band convolution channels is consistent with the initial features of the input, i.e., .

[0054] The aforementioned adaptive weight fusion involves assigning learnable weight parameters to the output features of the three parallel frequency band convolutional channels, normalizing the weights using an activation function so that the sum of the three weights is 1, and then performing a weighted sum of the three output features according to their weights. These adaptive weights are automatically updated through backpropagation during training, and can adaptively adjust the contribution of each frequency band according to the feature distribution of the barcode in different scenarios. For example, in scenarios with many damaged barcodes, the weight of high-frequency band features can be automatically increased, making edge features more important.

[0055] S220. Perform spatial multi-scale fusion on the initial features to obtain spatial fused features.

[0056] In this embodiment, spatial multi-scale fusion refers to processing initial features in parallel using dilated convolutions with multiple receptive fields to extract spatial texture features at different scales, followed by stitching and dimensionality reduction fusion. Frequency domain feature extraction mainly focuses on the abrupt changes in pixel characteristics, but it cannot fully capture the spatial texture distribution of barcodes of different sizes. Spatial multi-scale fusion extracts multi-scale spatial textures in parallel using convolutions with different dilation rates, thus compensating for the scale limitations of frequency domain features.

[0057] It's important to note that barcode spatial textures exhibit significant scale differences. Small barcodes require small receptive field convolutions to capture fine textures, such as 1-2 pixel wide bars and spaces; large barcodes require large receptive field convolutions to capture the overall texture structure, such as positioning patterns and the regularity of bar and space arrangement; damaged or deformed barcodes require complementary textures of different scales to compensate for missing features, such as blurred bars and spaces in a certain area, which needs to be filled in with textures of adjacent scales. The parallel design of multiple dilated convolutions with different receptive fields can simultaneously cover these differences without significantly increasing computational cost.

[0058] Specifically, each convolution has a different receptive field, which can capture fine texture, medium texture and coarse texture respectively. After feature concatenation, dimensionality reduction and fusion are performed so that the final spatial features contain effective information of different scales at the same time, avoiding the failure or miscapture of textures by single-scale convolution.

[0059] For example, three dilated convolutions with different kernel sizes and dilation rates can be used in parallel to process the initial features, capturing fine, medium, and coarse texture information respectively. Then, the feature maps output by the three dilated convolutions are concatenated along the channel dimension to preserve texture features at all scales to the greatest extent possible. Finally, dimensionality reduction is performed using a 1×1 convolution to unify the number of channels, resulting in spatially fused features. F_space .

[0060] S230. Based on the initial features, frequency domain fusion features, and spatial domain fusion features, feature fusion is performed to obtain the initial fused high-frequency features.

[0061] In this embodiment of the application, feature fusion refers to combining initial features F_c Frequency domain fusion characteristics F_freq and airspace integration features F_space Features from three different sources are integrated to obtain the initial fused high-frequency features. F_hC The three features can be concatenated along the channel dimension, fused by adding them element-wise, or adaptively fused using an attention mechanism.

[0062] For example, frequency domain fusion features can be used. F_freq and airspace integration features F_space The features are concatenated along the channel dimension and then dimensionality-reducing and integrated through convolution to obtain the initial fused features. F_hybrid Then the initial fusion features F_hybrid With initial features F_c Channel-dimensional splicing is performed to obtain the initial fused high-frequency features. F_hC The initial fusion high-frequency characteristics F_hC It retains the global information of the initial features, and also includes frequency-domain enhanced high-frequency texture information and spatial multi-scale detail information.

[0063] S240. The core texture region of the initial fused high-frequency features is weighted and enhanced to obtain the fused high-frequency features.

[0064] In this embodiment, the core texture region refers to the area with a large abrupt change in grayscale value in the barcode feature map, i.e., the key parts such as the black and white bar boundaries and dot matrix edges of the barcode. These areas appear as texture regions with large gradient values ​​on the feature map and are the core source of the barcode's recognizability. Conversely, the grayscale values ​​of the background and noise areas are flat, i.e., areas with small gradient values.

[0065] Weight amplification enhancement refers to locating core texture regions by calculating the gradient magnitude of the feature map, then assigning high weights to these regions and low weights to background or noisy regions without texture, thereby further amplifying the response of effective features while weakening background interference.

[0066] For example, texture attention enhancement can be achieved by calculating gradients to identify core texture regions with large gradient values ​​in the initial fused high-frequency features. These core texture regions are then assigned high weights, while textureless regions with small gradient values ​​are assigned low weights, generating texture weight features. An additive enhancement mode using a 1+weight map is then applied, multiplying the texture weight features element-wise with the initial fused high-frequency features. This preserves the original features while amplifying the response of the texture regions according to their weights, achieving texture enhancement while weakening the background. Finally, the enhanced features are integrated using depthwise separable convolutions, batch normalization layers, and activation functions to obtain the fused high-frequency features. F_ 1.

[0067] Based on this, by using progressive processing of multiple stages such as frequency domain decomposition and adaptive weight fusion, spatial domain multi-scale fusion, feature fusion and core texture region weight amplification, the high-frequency texture of the barcode can be effectively separated from the low-frequency noise of the background, accurately capturing the core texture features of the barcode and improving the detection accuracy of the barcode in complex scenarios such as reflection and dirt.

[0068] In some implementations, the initial features can be frequency domain decomposed and adaptively weighted by constructing a multi-band convolution module. Figure 3 This is a flowchart illustrating the frequency domain decomposition and adaptive weight fusion process in an embodiment of this application, as shown below. Figure 3 As shown, the initial features are decomposed in the frequency domain and fused with adaptive weights to obtain frequency domain fused features, which may include the following steps S310 to S320.

[0069] S310. Perform convolution operations on the initial features in at least two frequency band channels to obtain at least two target frequency band features.

[0070] In this embodiment, a frequency band channel refers to an independent convolutional branch designed for a specific frequency range, such as a high-frequency channel, a mid-to-high-frequency channel, or a low-frequency suppression channel. Each channel extracts corresponding frequency band information through differentiated convolutional kernels. The target frequency band feature is the feature map output by each frequency band channel, with the same size as the input, representing the response components of the image at different frequency scales, such as detail edges, texture structure, or background suppression results. Therefore, the initial features can be... F_c At least two frequency band channels are fed in parallel to perform multi-band convolution operations to achieve frequency domain decomposition and obtain multiple target frequency band features.

[0071] Optionally, three independent convolutional channels can be set to extract high-frequency features, mid-to-high-frequency features, and suppress low-frequency information to obtain low-frequency suppressed features. For the high-frequency feature channel, a convolutional kernel with a smaller receptive field can be used to capture details such as edges and corners with drastic gray-level changes in the initial features. For the mid-to-high-frequency feature channel, the receptive field is expanded while maintaining the number of parameters to extract mid-to-high-frequency components containing some texture and structure. For the low-frequency suppressed channel, a convolutional structure can be used to suppress the uniform illumination component in the background region and highlight foreground variations.

[0072] S320. Adaptive weight fusion is performed on at least two target frequency band features to obtain frequency domain fusion features.

[0073] In this embodiment, adaptive weight fusion is used to adaptively allocate the contribution of features from different frequency bands according to the needs of the scenario, thereby avoiding the limitations of features from a single frequency band.

[0074] As an optional implementation, for the high-frequency features, mid-to-high-frequency features, and low-frequency suppressed features obtained from the three independent convolutional channels, adaptive weight fusion may include: setting three learnable one-dimensional parameters. w 1. w 2 and w 3. Initial values ​​are all 1 / 3; then the Softmax function is used to process the three parameters to ensure that the sum of the three parameters is 1; finally, the high-frequency features, mid-high-frequency features, and low-frequency suppressed features are weighted and summed to obtain the frequency domain fusion features as follows: F_freq = w 1 ×F_h+w 2 ×F_mh+w 3 ×F_suppress In the above formula, F_h、F_mh and F_suppress These represent high-frequency features, mid-to-high-frequency features, and low-frequency suppressed features, respectively, with three learnable parameters. w 1. w 2 and w 3. Automatic updates during training. During training, the network model automatically adjusts the values ​​of three parameters based on the barcode detection loss, which may include bounding box regression loss and classification loss, through backpropagation.

[0075] For example, when there are many damaged barcodes in the dataset, the network model can automatically increase its size. w The value of 1 makes high-frequency edge features more important; when there are many large barcodes in the dataset, the model can automatically increase the value. wThe value of 2 makes mid-to-high frequency structural features more important. Thus, the adaptive weight fusion mechanism can automatically find the optimal combination of frequency band weights based on the feature distribution of different datasets, thereby improving the generalization ability of the network model.

[0076] Based on this, by using parallel processing of multi-band convolution and adaptive weight fusion, the high-frequency texture of the barcode can be effectively separated from the low-frequency noise of the background, accurately capturing the effective features of the barcode in different frequency bands and avoiding the loss of high-frequency features. At the same time, the adaptive weight fusion mechanism ensures the network model's adaptability to different scenarios.

[0077] In some implementations, such as Figure 3 As shown, convolution operations are performed on the initial features in at least two frequency band channels to obtain at least two target frequency band features, which may include the following: The initial features are processed by Laplacian convolution in the first frequency band channel to obtain high-frequency features.

[0078] In this embodiment, the first frequency band channel is used to extract the fine edge high-frequency features of the barcode. The black and white bar boundaries and dot matrix edges of the barcode are local high-frequency features, so it is necessary to accurately capture the fine edges with a width of 1 to 2 pixels.

[0079] As an optional implementation, the first frequency band channel can use a 3×3 Laplacian convolution kernel to convolve the initial features to extract high-frequency features. The Laplacian convolution kernel is a second-order differential operator, mathematically calculating the sum of the differences between a pixel and its neighboring pixels. For the black-and-white boundaries of a barcode, the difference between the center pixel and its four neighboring pixels (top, bottom, left, and right) is the largest, resulting in the highest response value from the Laplacian convolution kernel, thus accurately locating and extracting high-frequency features from fine edges. Simultaneously, the sampling of the 3×3 standard convolution is continuous, fully capturing continuous grayscale changes at edges, such as black-and-white transition boundaries.

[0080] Understandably, the Laplacian convolution kernel, as a second-order differential operator, exhibits high gain in the high-frequency region and low gain in the low-frequency region in its frequency domain response. Therefore, it possesses the characteristics of a high-pass filter and can effectively extract high-frequency features. The initialization parameters of the Laplacian convolution kernel can be set as follows: the center position has a value of 4, the four neighboring positions (top, bottom, left, and right) have values ​​of -1, and the remaining four corner positions have values ​​of 0. For example, a typical 3×3 Laplacian convolution kernel can be set as follows:

[0081] By assigning the aforementioned fixed Laplacian high-pass filter values ​​as initial parameters to the nine parameters of the 3×3 convolution kernel, the network can be guided to learn and extract high-frequency features of the edges, rather than being allowed to randomly explore from scratch. This initialization method improves training efficiency and ensures that the initial orientation aligns with the edge characteristics of the barcode. The black and white bar boundaries of the barcode are typical high-frequency edges, avoiding the feature extraction deviation that might occur in the early stages of training due to random initialization, and allowing the network model to converge faster. Furthermore, the initialization of the Laplacian convolution kernel does not change the structure of the kernel; it remains a standard 3×3 convolution, without increasing computational cost, and is fully compatible with the deployment requirements of devices such as barcode readers.

[0082] Therefore, for each channel of the initial features, a 3×3 Laplacian convolution kernel can be used for convolution. No bias term is added after convolution to avoid introducing additional low-frequency offsets and output high-frequency features. F_h∈R ^{H×W×C} The value of each pixel reflects the intensity of the high-frequency edge at that location.

[0083] The initial features are processed by dilated Laplacian convolution in the second frequency band channel to obtain mid-to-high frequency features.

[0084] In this embodiment, the second frequency band channel is used to extract the high-frequency features of the coarse structure of the barcode. The structural features of the barcode are high-frequency features that combine local and global characteristics, such as the positioning pattern of the QR code and the continuous bar-space sequence of the 1D barcode, which require a receptive field larger than 3×3 to cover.

[0085] As an optional implementation, the second frequency band channel can use a 5×5 dilated Laplacian convolution kernel to convolve the initial features and extract mid-to-high frequency features. By introducing dilated convolution, the cross-pixel correlation of the barcode structure can be captured, while maintaining the computational cost of a standard convolution kernel.

[0086] For example, an improved eight-neighbor Laplacian convolution kernel is used, and dilated convolution is introduced with a dilation rate of 2, a stride of 1, and padding of 4, outputting mid-to-high frequency features. F_mh ∈ R ^{H×W×C} The receptive field of a standard 5×5 convolution is 5×5, while a dilated 5×5 convolution with a dilation rate of 2 can achieve a receptive field of 9×9, equivalent to the coverage of a standard 9×9 convolution. This allows it to capture cross-pixel relationships in barcode structures, such as the cross structure of QR code positioning blocks and the global regularity of continuous bar and space arrangements in 1D barcodes. By using interval sampling, dilated convolution expands the receptive field while maintaining the computational cost of a standard 5×5 convolution, perfectly adapting to the computing power limitations of devices such as barcode readers.

[0087] The initial features are processed by convolution and activation function in the third frequency band channel to obtain low-frequency suppressed features.

[0088] In this embodiment, the third frequency band channel is used to filter low-frequency background noise, where the low-frequency noise is a globally uniformly distributed feature and does not require a spatial receptive field.

[0089] As an optional implementation, the third frequency band channel can use 1×1 convolution combined with a Sigmoid activation function to suppress low frequencies, obtaining low-frequency suppressed features. F_suppress∈R ^{H×W×C} The 1×1 convolution, without spatial sampling, performs calculations only on the channel dimension of a single pixel, enabling it to quickly capture low-frequency information differences between channels. For example, the channel grayscale values ​​in the background area are very similar, while the channel values ​​in the barcode area vary greatly. The core of low-frequency suppression is fast channel compression and noise filtering. The number of parameters in the 1×1 convolution is only 1 / 9 that of the 3×3 convolution, resulting in extremely low computational cost, allowing low-frequency suppression to be achieved without slowing down the process. The Sigmoid activation function compresses the output to the 0-1 range, forming a gating mechanism that effectively suppresses the transmission of low-frequency information in the background.

[0090] Based on this, the first frequency band channel sharpens edge details, the second frequency band channel enhances texture structure, and the third frequency band channel effectively filters out redundant background interference caused by uneven lighting. This allows the network model to dynamically emphasize effective frequency band information according to different scenes, significantly improving the network model's ability to represent complex textures and blurred boundaries and its generalization robustness.

[0091] In some implementations, multi-scale spatial textures are extracted in parallel through convolutions with different dilation rates to compensate for the scale limitations of frequency domain features. Figure 4 This is a schematic diagram of the spatial multi-scale fusion process in an embodiment of this application, as shown below. Figure 4 As shown, performing spatial multi-scale fusion on the initial features to obtain spatial fused features may include the following steps S410 to S430.

[0092] S410. Perform dilated convolution on the initial features with multiple receptive fields to obtain multiple spatial texture features.

[0093] In the embodiments of this application, dilated convolution with multiple receptive fields refers to using two or more convolution kernels with different dilation rates to process the initial features in parallel.

[0094] As an optional implementation, the initial features can be processed in parallel using three dilated convolutions: a 3×3 convolution with a dilation of 1, a 5×5 convolution with a dilation of 2, and a 7×7 convolution with a dilation of 3. The 3×3 convolution with a dilation of 1 has a receptive field of 3×3, focusing on capturing fine-grained texture information, such as subtle changes in the barcode edges; the 5×5 convolution with a dilation of 2 has an actual receptive field of 9×9, focusing on capturing medium-scale structural information, such as the positioning pattern of the QR code; and the 7×7 convolution with a dilation of 3 has an actual receptive field of 15×15, focusing on capturing large-scale global structural information, such as the overall outline and arrangement pattern of the barcode.

[0095] Furthermore, each dilated convolution can be followed by a batch normalization layer and an activation function layer to enhance the expressive power of the features and accelerate model convergence. The outputs of the three dilated convolutions correspond to three spatial texture features, each with the same size as the initial features. H×W×C However, the scale of the textures captured is different.

[0096] S420. Based on the spatial texture features of each region, feature splicing is performed to obtain spatial splicing features.

[0097] As can be understood, feature concatenation refers to stacking multiple spatial texture features along the channel dimension. For example, concatenating the spatial texture features output by three dilated convolutions along the channel dimension yields a result of size [size missing]. H×W× 3 C The spatial domain stitching feature can preserve texture features at all scales to the greatest extent, so that fine edges and coarse structures are preserved in the spatial domain stitching feature at the same time, avoiding the problem of missing or mis-capturing textures in single-scale convolution.

[0098] S430. Perform convolution processing on the spatial splicing features to obtain the spatial fusion features.

[0099] As an optional implementation, convolution processing can reduce the dimensionality of the spatial splicing features using 1×1 convolution, compressing the number of channels from 3C to C, resulting in a size of H×W×C The spatial domain fusion features are achieved through 1×1 convolution, which, while reducing dimensionality, integrates complementary information between texture features at different scales, ensuring that the final spatial domain fusion features simultaneously contain effective information at different scales. Furthermore, 1×1 convolution has low computational cost, does not significantly increase computational overhead, and is suitable for the deployment requirements of devices such as barcode readers.

[0100] Based on this, by using multi-scale dilated convolution parallel processing, feature concatenation, and convolution dimensionality reduction, we can effectively capture the spatial texture information of barcodes of different sizes, make up for the shortcomings of frequency domain feature extraction in terms of scale adaptability, avoid the problem of insufficient full-size barcode detection capability due to fixed convolution kernel size, and improve the detection capability of barcodes of different sizes such as very small barcodes and large barcodes.

[0101] In some implementations, core texture regions can be enhanced based on the initial fused high-frequency features. Figure 5 This is a schematic diagram of the process for enhancing the core texture region in an embodiment of this application, as shown below. Figure 5 As shown, the core texture region of the initial fused high-frequency features is weighted and enhanced to obtain fused high-frequency features, which may include the following steps S510 to S540.

[0102] S510. Determine the core texture region based on the gradient value of the initial fused high-frequency features.

[0103] In this embodiment, the gradient value refers to the initial fused high-frequency feature. F_hC The intensity of feature changes at each pixel location. The core recognizability of a barcode comes from the high-contrast texture boundaries, which appear as abrupt changes in grayscale values ​​(large gradient values) on the feature map. Conversely, the grayscale values ​​of background and noise areas are flat (small gradient values). Therefore, the core texture regions of the barcode can be located by calculating the gradient magnitude of the feature map.

[0104] As an optional implementation, the Sobel operator can be used to calculate the initial fused high-frequency features. F_hC The gradient value. The Sobel operator includes two convolutional kernels, one horizontal and one vertical, which respectively calculate the initial fused high-frequency features. F_hC The gradient components in the horizontal and vertical directions are calculated, and the gradient magnitude is obtained by taking the square root of the sum of their squares. Regions with larger gradient magnitudes correspond to core texture areas such as the black and white bar boundaries and dot matrix edges of the barcode, while regions with smaller gradient magnitudes correspond to background or noise areas.

[0105] S520. Based on the core texture region, the initial fused high-frequency features are weighted to obtain texture weight features.

[0106] In this embodiment of the application, weight allocation refers to fusing high-frequency features based on the gradient magnitude as the initial value. F_hC Each pixel position is assigned a weight value.

[0107] Optionally, the gradient magnitude can be converted into a texture weight map using a 1×1 convolution, and then processed by a Sigmoid activation function to compress the weight values ​​to the range of 0 to 1, thus obtaining the texture weight features. F_wThe higher the output value of the Sigmoid activation function, the more critical the texture at that location.

[0108] For example, at the pixel position of the black and white boundary of the barcode, the gradient magnitude is large, and after processing by 1×1 convolution and Sigmoid activation function, the corresponding weight value is close to 1. At the pixel position of the background area, the gradient magnitude is small, and the corresponding weight value is close to 0.

[0109] S530. Based on the initial fused high-frequency features and texture weight features, texture features are enhanced to obtain high-frequency enhanced features.

[0110] In this embodiment of the application, texture feature enhancement refers to enhancing texture weight features. F_w High-frequency features of initial fusion F_hC Element-wise multiplication is performed to amplify the response of the texture region according to weights.

[0111] As an optional implementation, an additive enhancement mode can be used on top of element-wise multiplication to obtain high-frequency enhanced features. F_texture as follows: F_texture = F_hC ×(1+Sigmoid( F_w )) Among them, 1 ensures that the original feature information is not lost, Sigmoid( F_w Output texture importance weights ranging from 0 to 1, and sum these weights with the initial high-frequency features. F_hC Multiplication preserves the overall features while amplifying the response of key areas such as the black-and-white borders and dot matrix textures of the barcode according to weights.

[0112] For example, in a textured region with a weight of 0.8, the enhanced feature response is 1.8 times that of the original feature, and in a non-textured region with a weight of 0.1, the enhanced feature response is 1.1 times that of the original feature.

[0113] This effectively highlights the core texture features of the barcode while avoiding excessive suppression of background information that could lead to feature loss.

[0114] S540. The high-frequency enhancement features are integrated to obtain the fused high-frequency features.

[0115] As an optional implementation, the integration process can integrate high-frequency enhanced features using depthwise separable convolutions, batch normalization layers, and the LeakyReLU activation function. Depthwise separable convolutions decompose standard convolutions into depthwise convolutions and pointwise convolutions, significantly reducing the number of parameters and computational cost, thus adapting to the deployment requirements of devices such as barcode readers. Batch normalization layers normalize the features, accelerating network model convergence and enhancing generalization ability. The LeakyReLU activation function introduces nonlinearity while retaining some negative information, avoiding neuron death issues.

[0116] Based on this, by locating the core texture region through gradient calculation, weight allocation, texture feature enhancement and integration processing, the core texture region of the barcode can be accurately located. The feature response of these regions can be enhanced by weight amplification, while the background and noise regions without texture are weakened, making the final output fused high-frequency features more focused and more resistant to interference, and preventing the weak features of the barcode from being easily submerged by noise.

[0117] In some implementations, to prevent insufficient background suppression, active focusing of the barcode area is achieved through channel aggregation and nonlinear learning space attention weighting. Figure 6 This is a schematic diagram of the spatial attention weighting process in an embodiment of this application, such as... Figure 6 As shown, spatial attention weighting is applied to the initial features to obtain spatially weighted features, which may include the following steps S610 to S640.

[0118] S610. Perform global average pooling and channel dimensionality reduction on the initial features to obtain compressed features.

[0119] In this embodiment of the application, global average pooling refers to pooling the initial features across each channel. H × W The average of the pixel values ​​is compressed into a single value, thus reducing the size to [value missing]. H×W×C The initial features are compressed into 1×1×C The feature vectors. Global average pooling can effectively aggregate the global response information of the barcode in the spatial dimension to generate channel descriptors.

[0120] It should be noted that barcodes have the characteristic of concentrated feature responses in local areas of the feature map. Compared with a cluttered background, the features of the barcode area will show a high collaborative response in multiple channels. For example, the black and white bar boundary has a strong signal in both the edge detection channel and the structure detection channel. Global average pooling can condense this collaborative response information into channel statistics.

[0121] Furthermore, channel dimensionality reduction is performed by compressing the number of channels from C to C / 4 using 1×1 convolutions, resulting in a size of 1×1×( C / 4) compression features. Channel dimensionality reduction can reduce subsequent computation and force the network to learn compressed representations between channels, extracting the most discriminative channel association information.

[0122] It should be noted that compressing the number of channels to C The 4 / 4 ratio, instead of a fixed 0, strikes a balance between computational efficiency and information preservation: if the compression ratio is too large (e.g., ...), it will cause problems. C / 16) will result in severe information loss if the compression ratio is too small (e.g., C / 2) would involve a higher computational load. C A compression ratio of 4 / 4 can significantly reduce parameters while retaining sufficient channel information.

[0123] S620. Perform nonlinear spatial attention learning on the compressed features to obtain spatial attention.

[0124] In this embodiment, nonlinear spatial attention learning refers to performing nonlinear transformation on compressed features through a multilayer perceptron structure to learn the difference between the barcode and the background and generate spatial attention.

[0125] As an optional implementation, nonlinear spatial attention learning can adopt a structure of two 1×1 convolution layers combined with an intermediate ReLU activation function: the first 1×1 convolution layer integrates channel association information, the ReLU activation function filters negative noise and introduces nonlinear factors, and the second 1×1 convolution layer maps the features to 1×1×1 spatial attention single values, learning the nonlinear differences between the barcode and the background.

[0126] It should be noted that the minimalist structure of two 1×1 convolutional layers combined with an intermediate ReLU activation function avoids excessive smoothing of spatial information, accurately preserving barcode boundary information. The ReLU activation function filters out negative noise from the background, adapting to the sparsity of barcode features while significantly reducing computational cost. Since the barcode region occupies a relatively small portion of the feature map, the ReLU activation function effectively filters out negative noise from the background.

[0127] S630. Map spatial attention to the spatial dimension of the initial feature to generate spatial weight features.

[0128] As an optional implementation, a single spatial attention value of size 1×1×1 can be broadcast to via mapping. H × W A size of ×1 is then further broadcast and expanded to the same number of channels as the initial feature. H × W × C Then, after processing by the Sigmoid activation function, the weight values ​​are compressed to the range of 0 to 1, generating spatial weight features.

[0129] The aforementioned broadcast operation ensures that the spatial weight map and the input feature map have a perfect spatial size match, enabling subsequent element-wise multiplication operations to be executed correctly. The Sigmoid activation function converts spatial attention into weight values ​​in the range of 0 to 1, with higher weight values ​​for the barcode region (approximately 0.7 to 1) and lower weight values ​​for the background region (approximately 0 to 0.3).

[0130] S640. Perform spatial weighted fusion based on the initial features and spatial weight features to obtain spatial weighted features.

[0131] In this embodiment, spatial weighted fusion refers to multiplying the spatial weight features element-wise with the initial features to enhance the barcode region feature response and suppress background interference, thereby obtaining spatial weighted features. F _2. In spatial weighted features, the feature response of the barcode area is amplified, while the feature response of the background area is suppressed, thereby achieving precise focusing on the barcode area.

[0132] Based on this, by using global average pooling and channel dimensionality reduction, nonlinear spatial attention learning, spatial weight map generation and spatial weighted fusion, the spatial location of the barcode can be accurately located, and a spatial weight map with high weight in the barcode area and low weight in the background area can be generated. The weighted operation strengthens the barcode features and suppresses background interference, forming a complement to the frequency domain enhancement processing in terms of position focusing and texture enhancement.

[0133] In some implementations, feature fusion is performed based on initial features, fused high-frequency features, and spatially weighted features to obtain target fused features, which may include the following steps S710 to S730.

[0134] S710. Based on the initial features, fused high-frequency features and spatially weighted features, channel splicing is performed to obtain the target splicing features.

[0135] In this embodiment, channel stitching can stack three feature maps—initial feature, fused high-frequency feature, and spatially weighted feature—in the channel dimension to obtain a target stitched feature with a size of H×W×3C.

[0136] It is understandable that feature concatenation can completely preserve all complementary information from the three branches. The initial features preserve the original semantic information of the backbone network, the fused high-frequency features preserve the frequency-domain enhanced texture details, and the spatially weighted features preserve the spatial attention focus location information.

[0137] S720. Perform deformable convolution processing and convolution dimensionality reduction processing on the target splicing features to obtain the target compressed features.

[0138] As an optional implementation, deformable convolution processing can employ 3×3 deformable convolutions in the DCNv2 deformable convolutional network to process the target splicing features. DCNv2 learns the offset of the sampling position through an additional offset branch, dynamically adjusting the sampling position of the convolution kernel to solve the spatial misalignment problem between features of different scales. For example, when upsampling deep features and fusing them with shallow features, the barcode positioning pattern may shift; when downsampling shallow features and fusing them with deep features, the edge positions may deviate. Deformable convolution dynamically corrects these spatial misalignments by learning the offset, achieving precise spatial alignment between shallow fine textures and deep strong semantic features.

[0139] Meanwhile, DCNv2 also introduces a modulation coefficient mechanism, which can learn a weight coefficient for each sampling position, suppress the contribution of background sampling positions, and further enhance the focus on the barcode area.

[0140] Optionally, convolutional dimensionality reduction can be achieved by using a 1×1 convolution to reduce the dimensionality of the deformable convolutional features to 3x3. C Channel compression to C The channel is obtained with a size of H×W×C The target compression feature is achieved through 1×1 convolution, which, while reducing dimensionality, integrates redundant information between channels, significantly reducing computational cost.

[0141] S730. Spatial feature integration is performed on the target compression features to obtain the target fusion features.

[0142] As an optional implementation, spatial feature integration can process the target compressed features through 3×3 standard convolutions, strengthening the correlation between features at different scales. For example, it can bind shallow edge details with deep semantic categories, making the features more compact and discriminative. Simultaneously, batch normalization layers and activation function layers follow the 3×3 convolutions to further enhance the expressive power of the features.

[0143] The final output target fusion feature is directly fed into the subsequent path aggregation network and object detection network for further processing. This target fusion feature retains rich texture details, possesses accurate semantic category information, and also has spatial alignment properties, providing high-quality input features for subsequent object detection.

[0144] Based on this, by means of channel splicing, deformable convolution spatial alignment, convolution dimensionality reduction and spatial feature integration, the initial features, fused high-frequency features and spatially weighted features can be deeply fused to prevent cross-scale feature spatial misalignment and insufficient multi-scale information fusion, thereby achieving efficient feature fusion of full-size barcodes and improving the accuracy and robustness of barcode detection.

[0145] To facilitate understanding of the attention-based collaborative barcode feature fusion method described in this application, the method will be explained in detail below in conjunction with specific application scenarios.

[0146] In specific application scenarios, the barcode feature fusion method based on attention collaboration provided in this application embodiment can be embedded in relevant deep learning networks to obtain target fusion features and provide high-quality input features for barcode detection.

[0147] As an exemplary implementation of this application, the barcode feature fusion method based on attention collaboration provided in this application can construct a frequency domain-spatial domain attention-enhanced feature pyramid network (FSA-FPN) module, embedding the neck network of the YOLOv8 network to replace the original feature pyramid network module, and seamlessly compatible with the backbone network, path aggregation network module, and detection head. Figure 7 This is a schematic diagram of the structure of the FSA-FPN module provided in the embodiments of this application, as shown below. Figure 7 As shown, the core architecture of this FSA-FPN module consists of three main functional units: a frequency domain enhancement unit, a spatial weighting unit, and a cross-scale fusion unit. The overall architecture flow is as follows: the C3, C4, and C5 feature layers output from the YOLOv8 backbone network are input in parallel to the frequency domain enhancement unit and the spatial weighting unit, which then output fused high-frequency features. F _1 and spatial weighted features F 2. Next, high-frequency features are fused. F _1 and spatial weighted features F The C3, C4, and C5 feature layers output from the backbone network are input into the cross-scale fusion unit. After spatial alignment and multi-scale fusion, the corresponding target fusion features M3, M4, and M5 are output and sent to the path aggregation network module of YOLOv8 and the detection head for barcode detection.

[0148] The frequency domain enhancement unit separates the high-frequency effective features of the barcode from the low-frequency noise in the background through multi-band convolution, and then supplements the texture details of barcodes of different sizes by combining spatial multi-scale fusion. The frequency domain enhancement unit is the core unit of the FSA-FPN module. Its core principle is to amplify the high-frequency effective features of the barcode, such as the edges and structure, through a three-layer progressive approach of spatial frequency domain feature extraction based on frequency domain characteristic convolution kernels, spatial multi-scale supplementation, and precise texture enhancement, while filtering out low-frequency noise in the background.

[0149] For example, the C3, C4, and C5 feature layers output from the YOLOv8 backbone network can be used as input and processed through the following steps: First, multi-band convolution processing is performed: the initial features are... F_c∈R ^{H×W×C} Simultaneously, three independent parallel convolution channels are fed in, where the initial features... F_ cIt can be any feature map from the C3, C4, and C5 feature layers.

[0150] In the first frequency band channel, a 3×3 Laplacian convolution kernel is used to extract high-frequency features. F_h The Laplacian convolution kernel is initialized with a value of 4 at the center, -1 at the four neighboring positions (top, bottom, left, and right), and 0 at the four corner positions. Furthermore, no bias term is added after convolution to avoid introducing additional low-frequency offsets.

[0151] In the second frequency band channel, a 5×5 dilated Laplacian convolution kernel is used to extract mid-to-high frequency features. F_mh The convolution has a dilation rate of 2, a stride of 1, and padding of 4. The actual receptive field of this convolution is 9×9, which is sufficient to capture cross-pixel relationships within the barcode structure.

[0152] In the third frequency band channel, a 1×1 convolution combined with a sigmoid activation function is used to extract low-frequency suppressed features. F_ suppress The number of parameters in a 1×1 convolution is only 1 / 9 that of a 3×3 convolution, resulting in extremely low computational cost.

[0153] Set three learnable one-dimensional parameters w 1. w 2. w 3. The initial values ​​are all 1 / 3. After processing with Softmax, the values ​​are summed according to the weights to obtain the frequency domain fusion features. F_freq=w 1 ×F_h+w 2 ×F_mh+w 3 ×F_suppress .

[0154] Then, spatial multi-scale fusion processing is performed: three dilated convolutions (3×3 with dilation=1, 5×5 with dilation=2, and 7×7 with dilation=3) are used in parallel to process the original input features. The feature maps output by the three convolutions are concatenated according to the channel dimension, and then dimensionality is reduced using a 1×1 convolution to obtain the spatial fusion features. F_ space .

[0155] Then perform feature fusion: fuse the frequency domain features. F_freq and airspace integration features F_space Perform fusion, for example, by concatenating channels and then performing 1×1 convolutional dimensionality reduction, and then combining it with the initial features. F _ c Element-by-element addition is performed to obtain the initial fused high-frequency features. F_ hC .

[0156] Finally, texture attention enhancement is performed: the Sobel operator is used to calculate the initial fused high-frequency features. F_hC The gradient magnitude is converted into texture weight features through a 1×1 convolution. After Sigmoid activation, the gradient magnitude is enhanced by adding the texture weight features to the initial high-frequency features. F_hC Element-wise multiplication is performed, and finally, the results are integrated through depthwise separable convolution, batch normalization layers, and the LeakyReLU activation function to output fused high-frequency features. F_ 1.

[0157] Spatial weighted units accurately locate the spatial position of the barcode, enhancing barcode region features and suppressing background interference. The core principle of spatial weighted units is to generate spatial weight features with high weight for the barcode region and low weight for the background region by accurately locating the barcode's spatial position. For example, for the initial input features... F _ c The C3, C4, and C5 feature layers are processed as follows: First, global average pooling and dimensionality compression are performed on the initial features: F _ c Perform global average pooling, and then pool the values ​​of each channel. H × W A pixel is condensed into a single value, resulting in a 1×1× C The feature vectors; then, the number of channels is reduced from... by a 1×1 convolution. C Compress to C / 4, output 1×1×( C Compression features of / 4).

[0158] Then, nonlinear spatial attention learning: the compressed features are processed by the first layer of 1×1 convolution, ReLU activation function, and the second layer of 1×1 convolution to map the features into 1×1×1 spatial attention single values.

[0159] In generating spatial weight features: broadcasting single values ​​of spatial attention to... H × W The size is ×1, then expanded to H×W×C, and compressed to the 0 to 1 range after Sigmoid activation to form a spatial weight feature, in which the weight of the barcode area is about 0.7 to 1, and the weight of the background area is about 0 to 0.3.

[0160] Finally, spatial weighted fusion is performed: the spatial weight features are combined with the initial features. F _ c Element-wise multiplication yields spatially weighted features. F _2.

[0161] The cross-scale fusion unit achieves spatial alignment and fusion of shallow fine textures, deep strong semantics, and current layer features through deformable convolution, solving the problem of multi-scale differences in barcodes. This cross-scale fusion unit adopts a design of scale unification, three-way feature concatenation, DCNv2 spatial alignment, and feature enhancement output to deeply fuse cross-scale contextual information from adjacent layers with high-frequency texture information and spatial location information of the current layer.

[0162] It should be noted that the standard layer generation logic of the original Feature Pyramid Network module in YOLOv8 is as follows: The YOLOv8 backbone network outputs three effective feature layers: shallow feature C3, with the largest size and fewest channels, containing rich fine-grained texture information; mid-layer feature C4, with a medium size and medium number of channels, balancing texture and semantics; and deep feature C5, with the smallest size and most channels, containing rich global semantic information. The Feature Pyramid Network module adopts a top-down layer-by-layer fusion strategy, starting from the deepest layer and fusing upwards to generate shallower enhanced features: first, C5 generates the intermediate feature P5, then P5 is upsampled and fused with C4 to generate the intermediate feature P4, and finally, the intermediate feature P4 is upsampled and fused with C3 to generate the intermediate feature P3. The FSA-FPN module proposed in this example can inherit this logic, and in each fusion step, high-frequency features and spatially weighted features are added for fusion with adjacent cross-scale features after scale unification. The input features can be varied according to the corresponding output target fusion features M3, M4, and M5, rather than being fixed.

[0163] Figure 8 This is a schematic diagram of an improved YOLOv8 cross-scale fusion process provided in an embodiment of this application, as shown below. Figure 8 As shown, the process may include the following: First, deep features (e.g., M5 and M4) are upsampled using transposed convolution and bilinear interpolation to enlarge their size to match the current layer's features, outputting the deep upsampled feature F_up. Then, shallow features (e.g., C3) are downsampled using a 3×3 convolution with a stride of 2 to reduce their size to match the current layer's features, outputting the shallow downsampled feature F_down. To avoid fusion failure due to scale and channel mismatch, the core information of each layer's features is preserved as much as possible during upsampling and downsampling. Bilinear interpolation reduces texture blurring, and stride convolution prevents feature loss.

[0164] Then, channel concatenation is performed: the features of the three information components (deep upsampled feature F_up or shallow downsampled feature F_down, fused high-frequency feature F_1, and spatially weighted feature F_2) are concatenated along the channel dimension to obtain a concatenated feature of size H×W×3C, retaining the three information components. Specifically, if the input is a deep feature (e.g., M5 and M4), it is the deep upsampled feature F_up, fused high-frequency feature F_1, and spatially weighted feature F_2; if the input is a shallow feature (e.g., C3), it is the shallow downsampled feature F_down, fused high-frequency feature F_1, and spatially weighted feature F_2.

[0165] Next, deformable convolution and 1×1 convolution dimensionality reduction are performed: 3×3 deformable convolution from DCNv2 is used to process the spliced ​​features. This convolution can dynamically adjust the sampling position by learning the offset, resolving spatial misalignment of features at different scales, such as barcode positioning pattern offset after deep upsampling and edge position deviation after shallow downsampling. The 1×1 convolution compresses the 3C channels to a C channel, consistent with the initial feature channel number, resulting in the compressed feature F_fuse. Simultaneously, it integrates redundant information between channels, reducing computational load. Finally, a 3×3 convolution is performed: spatial feature integration is performed on the compressed feature F_fuse to strengthen the correlation between features at different scales. For example, shallow edge details are bound to deep semantic categories, making the features more compact. The final output is the target fusion features M3, M4, and M5, which correspond to the fusion results of the input features C3, C4, and C5 as the initial features, respectively. To generate the target fusion feature M5, the shallow feature C3 output by the original backbone network needs to be downsampled by a 3×3 convolution with a stride of 2 to obtain the shallow downsampled feature F_down. The fusion high-frequency feature F_1 and the spatial weighted feature F_2 corresponding to the deep feature C5 are concatenated by channel, and the target fusion feature M5 is output after subsequent processing.

[0166] It's important to note that to address the issue of texture loss in small targets within deep features, the core of barcode detection lies in the high-frequency texture features of the black and white bar boundaries. These features primarily reside in shallow features. Shallow feature C3 boasts the highest spatial resolution, fully preserving the edge and texture information of barcodes of all sizes, while deep feature C5 almost completely loses all texture information for barcodes smaller than 16×16 pixels. Downsampling shallow feature C3 to the same size as deep feature C5 allows the fine-grained texture information from the shallow layers to be injected into the deepest target fusion feature M5, enabling M5 to also detect small barcodes.

[0167] Similarly, if it is necessary to generate the target fusion feature M4, the already generated target fusion feature M5 needs to be transposed and upsampled by bilinear interpolation to obtain the deep upsampled feature F_up. The fusion high-frequency feature F_1 and spatial weighted feature F_2 corresponding to the middle feature C4 are concatenated by channel, and the target fusion feature M4 is output after subsequent processing.

[0168] Similarly, if it is necessary to generate target fusion feature M3, the generated target fusion feature M4 needs to be transposed convolution and bilinear interpolation upsampled to obtain deep upsampled feature F_up. The fusion high-frequency feature F_1 and spatial weighted feature F_2 corresponding to the shallow feature C3 are concatenated by channel, and the target fusion feature M3 is output after subsequent processing.

[0169] In the specific application scenarios mentioned above, by embedding the FSA-FPN module into the neck network of the YOLOv8 network to replace the original feature pyramid network module, the accuracy and robustness of barcode detection can be significantly improved while maintaining lightweight deployment requirements. Simultaneously, the model's computational cost is low, fully meeting the real-time deployment needs of edge devices such as barcode readers.

[0170] Based on the same technical concept as the above embodiments, the barcode feature fusion method based on attention collaboration provided in this application can be executed by a barcode feature fusion device based on attention collaboration. This application uses an example of an attention collaboration-based barcode feature fusion device executing the attention collaboration-based barcode feature fusion method to illustrate the attention collaboration-based barcode feature fusion device provided in this application. Figure 9 This is a schematic diagram of the barcode feature fusion device based on attention collaboration provided in an embodiment of this application, as shown below. Figure 9 As shown, the attention-based collaborative barcode feature fusion device 900 includes: The feature extraction module 910 is used to extract features from the target barcode to obtain initial features.

[0171] The frequency domain enhancement module 920 is used to perform frequency domain enhancement processing on the initial features to obtain fused high-frequency features.

[0172] The spatial weighting module 930 is used to perform spatial attention weighting on the initial features to obtain spatially weighted features.

[0173] The feature fusion module 940 is used to perform feature fusion based on initial features, fused high-frequency features and spatially weighted features to obtain target fused features.

[0174] In some implementations, the frequency domain enhancement module 920 is specifically used to perform frequency domain enhancement processing on the initial features to obtain fused high-frequency features, including: Frequency domain decomposition and adaptive weight fusion are performed on the initial features to obtain frequency domain fused features; Spatial multi-scale fusion is performed on the initial features to obtain spatial fused features; Feature fusion is performed based on initial features, frequency domain fusion features, and spatial domain fusion features to obtain initial fused high-frequency features; The core texture region of the initial fused high-frequency features is weighted and enhanced to obtain the fused high-frequency features.

[0175] In some implementations, the frequency domain enhancement module 920 is specifically used to perform frequency domain decomposition and adaptive weight fusion on the initial features to obtain frequency domain fused features, including: The initial features are processed by Laplacian convolution in the first frequency band channel to obtain high-frequency features; The initial features are processed by dilated Laplacian convolution in the second frequency band channel to obtain mid-to-high frequency features. The initial features are processed by convolution and activation function in the third frequency band channel to obtain the low-frequency suppressed features. Adaptive weight fusion is performed based on high-frequency features, mid-to-high-frequency features, and low-frequency suppressed features to obtain frequency domain fusion features.

[0176] In some implementations, the frequency domain enhancement module 920 is specifically used to perform spatial multi-scale fusion on the initial features to obtain spatial fused features, including: Multiple dilated convolutions with different receptive fields are performed on the initial features to obtain multiple spatial texture features; Based on the spatial texture features, feature splicing is performed to obtain spatial splicing features; The spatial domain splicing features are processed by convolution to obtain the spatial domain fusion features.

[0177] In some implementations, the frequency domain enhancement module 920 is specifically used to perform weighted amplification and enhancement on the core texture region of the initially fused high-frequency features to obtain fused high-frequency features, including: The core texture region is determined based on the gradient value of the initial fused high-frequency features; Based on the core texture region, the initial fused high-frequency features are weighted to obtain texture weight features; Texture feature enhancement is performed based on the initial fused high-frequency features and texture weight features to obtain high-frequency enhanced features; The high-frequency enhancement features are integrated to obtain the fused high-frequency features.

[0178] In some implementations, the spatial weighting module 930 is specifically used to perform spatial attention weighting processing on the initial features to obtain spatially weighted features, including: The initial features are subjected to global average pooling and channel dimensionality reduction to obtain compressed features; Spatial attention is obtained by performing nonlinear spatial attention learning on compressed features; Spatial attention is mapped to the spatial dimension of the initial features to generate spatial weight features; Spatial weighted features are obtained by spatial weighted fusion based on initial features and spatial weight features.

[0179] In some implementations, the feature fusion module 940 is specifically used to perform feature fusion based on initial features, fused high-frequency features, and spatially weighted features to obtain target fused features, including: Channel splicing is performed based on initial features, fused high-frequency features, and spatially weighted features to obtain the target splicing features; The target splicing features are processed by deformable convolution and convolution dimensionality reduction to obtain the target compressed features; Spatial feature integration is performed on the target compressed features to obtain target fusion features. The barcode feature fusion device based on attention collaboration provided in this application embodiment can achieve accurate extraction of high-frequency features in barcodes. Through efficient spatial localization and background suppression, combined with flexible cross-scale fusion, target fusion features are obtained for barcode detection, which significantly improves the accuracy and robustness of barcode detection. It can still stably detect barcodes in complex scenarios such as reflection, motion blur, and dirt, and is suitable for complex industrial and logistics scenarios.

[0180] It is understood that the implementation methods of the barcode feature fusion method based on attention collaboration in the above method embodiments are also applicable to the embodiments of this device and can achieve the same technical effect, so they will not be described again here.

[0181] Based on the same technical concept, embodiments of this application also provide an attention-based barcode feature fusion device, which can be any device with data processing capabilities. For example, the aforementioned attention-based barcode feature fusion device can be a desktop computer, a laptop computer, a server, a workstation, or an edge computing device, etc. Figure 10 This is a schematic diagram of the hardware structure of a barcode feature fusion device based on attention collaboration provided in an embodiment of this application, as shown below. Figure 10 As shown, the attention-based collaborative barcode feature fusion device 1000 may include a processor 1010, a communication interface 1020, a memory 1030, and a communication bus 1040. The processor 1010, communication interface 1020, and memory 1030 communicate with each other via the communication bus 1040. The processor 1010 can call logical instructions in the memory 1030 to execute the steps of the attention-based collaborative barcode feature fusion method as described in the above method embodiment.

[0182] The processor 1010 can be a central processing unit (CPU). The processor can also 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, or combinations of the above types of chips.

[0183] Furthermore, the logical instructions in the aforementioned memory 1030 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to related technologies, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0184] The memory 1030 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the processor, etc. Furthermore, the memory may include high-speed random access memory and non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include memory remotely located relative to the processor, which can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0185] Based on the same concept, embodiments of this application also provide a computer-readable storage medium storing a computer program containing at least one piece of code that can be executed by a master control device to control the master control device to implement the steps of the barcode feature fusion method based on attention collaboration as described in the above method embodiments.

[0186] Based on the same technical concept, this application also provides a computer program that, when executed by a main control device, implements the barcode feature fusion method based on attention collaboration described in the above method embodiments. This computer program can be stored wholly or partially on a computer-readable storage medium packaged with a processor, or it can be stored wholly or partially on a memory not packaged with a processor.

[0187] Based on the same technical concept, this application also provides a computer program product, wherein the instructions in the computer program product, when executed by the processor of an electronic device, cause the electronic device to implement the steps of the attention-based collaborative barcode feature fusion method in the above method embodiments.

[0188] Based on the same technical concept, embodiments of this application also provide a processor for implementing the steps of the attention-based collaborative barcode feature fusion method in the above method embodiments. The processor can be a chip.

[0189] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0190] The functional blocks shown in the structural block diagrams of the above embodiments can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried in a carrier wave. Machine-readable media can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0191] The embodiments described above are merely examples of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these modifications and improvements all fall within the protection scope of this application.

[0192] Finally, it should be noted that 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.

Claims

1. A barcode feature fusion method based on attention collaboration, characterized in that, include: Feature extraction is performed on the target barcode to obtain initial features; The initial features are subjected to frequency domain enhancement processing to obtain fused high-frequency features; The initial features are subjected to spatial attention weighting to obtain spatially weighted features; The target fused feature is obtained by performing feature fusion based on the initial feature, the fused high-frequency feature, and the spatial weighted feature; The step of performing frequency domain enhancement processing on the initial features to obtain fused high-frequency features includes: The initial features are subjected to frequency domain decomposition and adaptive weight fusion to obtain frequency domain fused features; The initial features are subjected to spatial multi-scale fusion to obtain spatial fused features; Based on the initial features, the frequency domain fusion features, and the spatial domain fusion features, feature fusion is performed to obtain the initial fused high-frequency features; The core texture region of the initial fused high-frequency feature is weighted and enhanced to obtain the fused high-frequency feature.

2. The barcode feature fusion method based on attention collaboration according to claim 1, characterized in that, The step of performing frequency domain decomposition and adaptive weight fusion on the initial features to obtain frequency domain fused features includes: The initial features are convolved in at least two frequency band channels to obtain at least two target frequency band features; Adaptive weight fusion is performed on the at least two target frequency band features to obtain the frequency domain fused features.

3. The barcode feature fusion method based on attention collaboration according to claim 2, characterized in that, The step of performing a convolution operation on the initial features in at least two frequency band channels to obtain at least two target frequency band features includes: The initial features are processed by Laplacian convolution in the first frequency band channel to obtain high-frequency features; The initial features are processed by dilated Laplacian convolution in the second frequency band channel to obtain mid-to-high frequency features. The initial features are processed by convolution and activation function in the third frequency band channel to obtain low-frequency suppressed features.

4. The barcode feature fusion method based on attention collaboration according to claim 1, characterized in that, The process of performing spatial multi-scale fusion on the initial features to obtain spatial fused features includes: The initial features are subjected to dilated convolution with multiple different receptive fields to obtain multiple spatial texture features; Based on the aforementioned spatial texture features, feature splicing is performed to obtain spatial splicing features; The spatial domain splicing features are convolutionally processed to obtain the spatial domain fusion features.

5. The barcode feature fusion method based on attention collaboration according to claim 1, characterized in that, The step of weighting and enhancing the core texture region of the initial fused high-frequency features to obtain the fused high-frequency features includes: The core texture region is determined based on the gradient value of the initial fused high-frequency features; Based on the core texture region, the initial fused high-frequency features are weighted to obtain texture weight features; Texture features are enhanced based on the initial fused high-frequency features and the texture weight features to obtain high-frequency enhanced features; The high-frequency enhancement features are integrated to obtain the fused high-frequency features.

6. The barcode feature fusion method based on attention collaboration according to claim 1, characterized in that, The spatial attention weighting process applied to the initial features to obtain spatially weighted features includes: The initial features are subjected to global average pooling and channel dimensionality reduction to obtain compressed features; The spatial attention is obtained by performing nonlinear spatial attention learning on the compressed features; The spatial attention is mapped to the spatial dimension of the initial feature to generate spatial weight features; The spatial weighted features are obtained by performing spatial weighted fusion based on the initial features and the spatial weighted features.

7. The barcode feature fusion method based on attention collaboration according to claim 1, characterized in that, The step of fusing features based on the initial features, the fused high-frequency features, and the spatially weighted features to obtain the target fused features includes: Channel splicing is performed based on the initial features, the fused high-frequency features, and the spatial weighted features to obtain the target splicing features; The target splicing features are subjected to deformable convolution and convolution dimensionality reduction processing to obtain the target compressed features; Spatial feature integration is performed on the target compressed features to obtain the target fused features.

8. A barcode feature fusion device based on attention collaboration, characterized in that, include: The feature extraction module is used to extract features from the target barcode to obtain initial features; The frequency domain enhancement module is used to perform frequency domain enhancement processing on the initial features to obtain fused high-frequency features; The spatial weighting module is used to perform spatial attention weighting processing on the initial features to obtain spatially weighted features; The feature fusion module is used to perform feature fusion based on the initial features, the fused high-frequency features, and the spatially weighted features to obtain the target fused features.

9. A barcode feature fusion device based on attention collaboration, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the barcode feature fusion method based on attention collaboration as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the barcode feature fusion method based on attention collaboration as described in any one of claims 1 to 7.