Barcode detection method and system based on deep neural network
Through multi-scale feature extraction and physical constraint regularization algorithm, the problems of low detection accuracy of barcodes on non-rigid surfaces and unreasonable deformation correction are solved, and high-precision and robust barcode detection are achieved, which expands the application scenarios.
Patent Information
- Application Number
- CN202510748246.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-06
- Publication Date
- 2025-07-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing barcode detection technology has low accuracy on non-rigid surfaces, unreasonable deformation correction, and poor environmental adaptability, making it difficult to accurately identify barcodes in complex environments.
Multi-scale feature extraction network, deformable convolution network and physical constraint regularization algorithm are used to generate geometrically corrected barcode images through multi-scale local deformation field estimation and accurate deformation correction sampler.
It improves the accuracy and robustness of barcode detection, and enhances adaptability, and can handle barcode detection in complex environments to meet real-time processing needs.
Smart Images

Figure CN120258022A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of computer vision and image processing, and more specifically, to a barcode detection method and system based on a deep neural network. Background Art
[0002] As an important means of commodity identification and information carrier, barcodes are widely used in industries such as logistics, retail, and manufacturing. However, with the diversification of application scenarios, barcode detection technology faces many challenges. Especially when barcodes are attached to non-rigid surfaces, such as packaging bags, flexible containers, etc., the barcodes will undergo deformations such as twisting and wrinkling, making it difficult for traditional detection methods to accurately identify.
[0003] Existing barcode detection technologies are mainly based on image processing and traditional machine learning methods, which perform well under ideal conditions (flat surface, good lighting, no occlusion), but their performance drops sharply in complex environments. Although deep learning has made remarkable progress in the field of object detection in recent years, traditional deep learning models are mainly designed for rigid targets and are difficult to effectively capture and correct the local deformation features of barcodes. In addition, existing methods lack the physical constraint modeling of barcode deformation and cannot guarantee the rationality of the deformation correction results, often producing distortion corrections that do not conform to physical laws, affecting the subsequent recognition accuracy. At the same time, the adaptability to barcodes of different scales is also poor, and it is difficult to process barcodes of different sizes or barcodes with different degrees of deformation simultaneously; Therefore, a detection method that can accurately capture and correct the deformation of barcodes on non-rigid surfaces is needed to improve the accuracy and robustness of barcode detection in complex environments. Summary of the Invention
[0004] The present invention provides a barcode detection method and system based on a deep neural network, which solves the technical problems of low detection accuracy, unreasonable deformation correction, and poor environmental adaptability of barcodes in related technologies.
[0005] The present invention provides a barcode detection method based on a deep neural network, including: Extracting barcode features of different scales from the input image through a multi-scale feature extraction network, and enhancing the feature representation through a spatial attention algorithm to obtain an attention-enhanced feature map; Processing the attention-enhanced feature map using a deformable convolutional network to adaptively capture irregular barcode features, and integrating the deformable convolutional features of different scales to generate a comprehensive feature map; Based on the integrated comprehensive feature map, generating a fine deformation vector field through a multi-scale local deformation field estimation network to accurately describe the local deformation of the barcode surface; Introduce physical constraints based on the elastic properties of the material to regularize the deformation field, optimize the smoothness, continuity, and local consistency of the deformation field, and obtain the optimized deformation field; Based on the optimized deformation field, resample and correct the original input image through an accurate deformation correction sampler to generate a geometrically corrected barcode image.
[0006] In a preferred embodiment, the multi-scale feature extraction network includes a backbone network and a feature pyramid structure. The backbone network is used to extract a basic feature map from the input image, and the feature pyramid structure is used to generate multiple feature maps of different scales; In a preferred embodiment, the spatial attention algorithm is implemented by the following formula: ; where, represents the feature map of the i-th scale, and represent 1×1 and 3×3 convolution operations respectively, represents the sigmoid activation function, represents the generated attention weight map, represents element-wise multiplication, represents the feature map after applying the attention algorithm, represents the scale index of the feature map.
[0007] In a preferred embodiment, the deformable convolutional network is implemented through the following steps: Input the attention-enhanced feature map into the deformable convolutional layer to adaptively capture irregular barcode features by learning spatial offsets; Learn the spatial offsets of each feature point through the offset prediction branch; Integrate the deformable convolutional features of different scales to generate a comprehensive feature map.
[0008] In a preferred embodiment, the physical constraints include smoothness constraints, continuity constraints, and local consistency constraints, and are implemented by the following formula: ; where, represents the total physical constraint loss function of the deformation field , represents the deformation field, , and represent smoothness constraints, continuity constraints, and local consistency constraints respectively, , , The weight coefficients for smoothness constraint, continuity constraint, and local consistency constraint, respectively.
[0009] In a preferred embodiment, the smoothness constraint is achieved by minimizing the gradient norm of the deformation field; The continuity constraint ensures that the deformation field changes continuously in space; The local consistency constraint ensures that the deformations within a local region have similar directions and magnitudes.
[0010] In a preferred embodiment, the accurate deformation correction sampler is implemented through the following steps: Construct an accurate deformation correction sampler based on bilinear interpolation for resampling the original image according to the deformation field; Dynamically adjust the density of the sampling grid according to the complexity of the deformation field; Adopt a multi-resolution sampling strategy to perform deformation correction step by step from low resolution to high resolution; Perform special processing on the boundaries of the corrected image and apply image enhancement techniques to improve the clarity and contrast of the barcode.
[0011] In a preferred embodiment, the dynamic adjustment of the density of the sampling grid is achieved through the following formula: ; where, represents the base grid density, is an adjustment parameter used to control the sensitivity of the grid density to changes in the deformation field gradient, represents the grid density at point , represents the gradient of the deformation field at point , represents the norm of the gradient.
[0012] In a preferred embodiment, the barcode is a barcode attached to a non-rigid surface, including barcodes attached to the surfaces of packaging bags, plastic bottles, and flexible containers.
[0013] In a preferred embodiment, a barcode detection system based on a deep neural network for performing a barcode detection method based on a deep neural network, includes: A multi-scale feature extraction module for extracting barcode features of different scales from the input image and enhancing the feature representation through a spatial attention algorithm; A deformable convolution module for adaptively capturing irregular barcode features; A multi-scale local deformation field estimation module for generating a fine deformation vector field to accurately describe the local deformation of the barcode surface; A physical constraint regularization module for regularizing the predicted deformation field; An accurate geometric correction module for resampling and correcting the image based on the optimized deformation field to generate a geometrically corrected barcode image.
[0014] The beneficial effects of the present invention are as follows: Through multi-scale feature extraction and accurate deformation modeling, the present invention realizes high-precision detection of barcodes on irregular curved surfaces and flexible material surfaces, solves the difficulties of traditional methods in barcode detection on non-rigid surfaces, and improves the detection accuracy.
[0015] The present invention introduces a physical constraint regularization algorithm to ensure that the deformation field conforms to physical laws, avoids unreasonable correction results, and improves the reliability and stability of the system.
[0016] The present invention adopts multi-scale feature fusion and dynamic sampling grids, has good adaptability to barcodes of different sizes and deformation degrees, and expands the application scenarios of barcode technology.
[0017] The present invention has strong robustness under harsh conditions such as low contrast and partial occlusion, can handle complex scenarios that are difficult to handle by traditional methods, and improves the practicality of barcode detection technology.
[0018] The present invention maintains high computational efficiency. Through model optimization and parallel computing, it meets the requirements of real-time processing and can be widely applied to scenarios with high requirements for processing speed such as logistics sorting and retail management. Description of the Drawings
[0019] Figure 1 is a flowchart of a barcode detection method based on a deep neural network according to the present invention; Figure 2 is a detailed flowchart of generating an attention-enhanced feature map according to the present invention; Figure 3 is a detailed flowchart of generating a comprehensive feature map according to the present invention; Figure 4 is a detailed flowchart of accurately describing the local deformation of the barcode surface according to the present invention; Figure 5 is a detailed flowchart of generating an optimized deformation field according to the present invention; Figure 6 is a detailed flowchart of generating a geometrically corrected barcode image according to the present invention. Detailed Embodiments
[0020] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that discussing these embodiments is only to enable those skilled in the art to better understand and thus implement the subject matter described herein. Without departing from the scope of protection of the content of this specification, changes can be made to the functions and arrangements of the elements discussed. Each example can omit, substitute, or add various processes or components as needed. Additionally, the features described in some examples can also be combined in other examples.
[0021] In at least one embodiment of the present invention, a barcode detection method based on a deep neural network is disclosed, as Figures 1 to 6 shown, including the following steps: Step 1, extract barcode features of different scales from the input image through a multi-scale feature extraction network, and enhance the feature representation through a spatial attention algorithm to obtain an attention-enhanced feature map; The specific steps include: Step 1.1, construct a multi-scale feature extraction network; Construct a multi-scale feature extraction network based on a convolutional neural network, including a backbone network and a feature pyramid structure. The backbone network adopts the ResNet-50 architecture, and the feature pyramid contains 5 feature layers of different scales. The input image is first processed by the backbone network to generate a basic feature map : ; wherein, represents the input image, represents the backbone convolutional neural network, represents the generated basic feature map.
[0022] Step 1.2, generate a multi-scale feature pyramid; Based on the basic feature map , construct a multi-scale feature pyramid through upsampling and downsampling operations, wherein, , , respectively represent the feature maps of the , , th scales; ; wherein, represents the feature map of the th scale, represents the scale adjustment operation, represents the th scale factor, represents the convolution operation.
[0023] Step 1.3, apply the spatial attention algorithm; Apply the spatial attention algorithm to the feature maps of each scale, automatically focus on the barcode area, and enhance the feature representation: ; Among them, and represent 1×1 and 3×3 convolution operations respectively, represents the sigmoid activation function, represents the generated attention weight map, represents element-wise multiplication, represents the feature map after applying the attention mechanism.
[0024] Step 2, use the deformable convolutional network to process the attention-enhanced feature map, adaptively capture the irregular barcode features, and integrate the deformable convolutional features of different scales to generate a comprehensive feature map; The specific steps include: Step 2.1, apply the deformable convolutional network; Input the attention-enhanced feature map obtained in Step 1 into the deformable convolutional network, and adaptively capture the irregular barcode features by learning the spatial offset: ; Among them, represents the deformable convolution operation, represents the attention-enhanced feature map, represents the learned offset parameter, represents the output feature map of the deformable convolution.
[0025] Step 2.2, offset learning and feature integration; Through a dedicated offset prediction branch, learn the spatial offset of each feature point: ; Among them, represents the attention-enhanced feature map, represents the learned offset parameter, represents the offset prediction convolutional network.
[0026] Integrate the deformable convolutional features of different scales to generate a comprehensive feature map : ; Among them, represents the comprehensive feature map, represents the feature fusion operation, which can be implemented by weighted summation or feature concatenation, etc., , , respectively represent the -th, , th different-scale feature maps after deformable convolution processing.
[0027] Step 3: Based on the integrated comprehensive feature map, generate a fine-grained deformation vector field through a multi-scale local deformation field estimation network to accurately describe the local deformation on the barcode surface; The specific steps include: Step 3.1: Construct a multi-scale local deformation field estimation network; Based on the fused feature map obtained in Step 2 , construct a multi-scale local deformation field estimation network to predict the deformation vector field on the barcode surface: ; where represents the deformation vector field on the barcode surface, , , respectively represent the -th, , th scale deformation vector fields, represents the number of scales of the deformation field, and each deformation vector field is represented as a two-dimensional vector field describing the displacement change of each pixel point.
[0028] Step 3.2: Hierarchical deformation field generation; Through an encoder-decoder network with a U-Net structure, gradually generate deformation fields with different precisions from coarse to fine: ; where represents the th scale deformation vector field, represents the encoder network, represents the decoder network of the th layer. The deformation fields at lower resolution levels capture the global deformation trend, while the higher resolution levels focus on local detailed deformations.
[0029] Step 3.3: Deformation field refinement; Refine the initial deformation field and improve the accuracy of the deformation field through residual connection and iterative refinement: ; where represents the refinement network, represents the initial deformation field, represents the fused feature map, Represents the refined deformation field.
[0030] Step 4: Introduce physical constraints based on the elastic properties of the material to regularize the deformation field, optimize the smoothness, continuity, and local consistency of the deformation field, and obtain the optimized deformation field. The specific steps include: Step 4.1: Establish a physical constraint model. Based on the material elasticity theory, establish a physical constraint model for barcode deformation, mainly considering three aspects: smoothness, continuity, and local consistency. ; Among them, represents the total physical constraint loss function of the deformation field , represents the deformation field, , and represent the smoothness constraint, continuity constraint, and local consistency constraint respectively, , , are the weight coefficients of the smoothness constraint, continuity constraint, and local consistency constraint respectively.
[0031] Step 4.2: Smoothness constraint. Ensure the smoothness of the deformation field by minimizing the gradient norm of the deformation field: ; Among them, represents the smoothness constraint term of the deformation field , represents the gradient operator, represents the pixel coordinates, represents the square norm of the gradient of the deformation field at the coordinate .
[0032] Step 4.3: Continuity and local consistency constraints. The continuity constraint ensures that the deformation field changes continuously in space: ; Among them, represents the continuity constraint term of the deformation field , , represent the coordinates , at which the deformation vectors are located, and represent the square norms of the differences between the deformation vectors of adjacent pixels in the horizontal and vertical directions respectively.
[0033] Local consistency constraints ensure that the deformations within a local region have similar directions and magnitudes: ; where, represents the local consistency constraint term of the deformation field , represents the neighborhood of pixel , represents the pixel coordinates within the neighborhood, is the weight based on pixel similarity, represents the squared norm of the difference between the deformation vectors of the central pixel and the neighborhood pixels.
[0034] Step 4.4, Deformation field optimization; Integrate physical constraints into the optimization objective of deformation field estimation for joint optimization: ; where, represents the reconstruction loss, which is used to measure the deformation correction effect, is the balance parameter, which is used to adjust the weight ratio between the reconstruction loss and physical constraints, represents the optimized deformation field, represents finding the deformation field that minimizes the objective function .
[0035] Step 5, Based on the optimized deformation field, resample and correct the original input image through an accurate deformation correction sampler to generate a geometrically corrected barcode image; The specific steps include Step 5.1, Construct an accurate deformation correction sampler; Construct an accurate deformation correction sampler based on bilinear interpolation for resampling the original image according to the deformation field: ; where, represents the input image, and respectively represent the components of the deformation field in the and directions, represents the image domain (i.e., the set of all pixel coordinates), represents the corrected image, represents the pixel coordinates in the target image, represents the corresponding sampling coordinates in the original image.
[0036] Step 5.2, Adaptive grid sampling; According to the complexity of the deformation field, dynamically adjust the density of the sampling grid, and use denser sampling points in regions with larger deformation degrees: ; Among them, represents the base grid density (the density of the initial sampling grid), is the adjustment parameter (controlling the sensitivity of the grid density to the change of the deformation gradient), represents the norm of the gradient of the deformation field at the coordinate location, represents the grid density at the point location.
[0037] Step 5.3, Multi-resolution sampling and fusion; Adopt a multi-resolution sampling strategy to gradually perform deformation correction from low resolution to high resolution: ; Among them, represents the input image at the layer resolution, represents the deformation field at the layer resolution, represents the deformation correction sampler, represents the correction result at the layer, represents the total number of resolution levels, represents the index of the resolution level, from to , represents the multi-resolution result fusion operation, represents the fused corrected image.
[0038] Step 5.4, Boundary processing and image enhancement; Perform special processing on the boundary of the corrected image and apply image enhancement technology to improve the clarity and contrast of the barcode: ; Among them, represents the boundary processing operation (such as filling, mirroring, etc.), represents the image enhancement operation (such as contrast adjustment, sharpening, etc.), represents the corrected image, represents the final output barcode image.
[0039] Technical effects of this embodiment: Through the deep neural network and precise deformation modeling, this embodiment realizes high-precision detection of barcodes on irregular curved surfaces and flexible material surfaces, and has the following remarkable technical effects: Significant improvement in detection accuracy: The accuracy of barcode detection on highly irregular and flexible surfaces by this method has been significantly improved, with the detection accuracy on the standard dataset increased by more than 15% and the false detection rate reduced by 30% in complex backgrounds.
[0040] Greatly enhanced adaptability: For barcodes attached to various non-planar surfaces (such as packaging bags, flexible containers, etc.), the detection adaptability has been greatly improved, with the detection recall rate for barcodes of different sizes increased by 20%, expanding the application scenarios of barcode technology.
[0041] Remarkable improvement in robustness: Through multi-scale feature fusion and deformation modeling, the robustness of the system under harsh conditions such as low contrast and partial occlusion has been significantly enhanced, enabling it to handle complex scenarios that are difficult to cope with by traditional methods.
[0042] Physical constraints ensure the rationality of correction: The introduction of a physical constraint regularization algorithm ensures that the deformation field conforms to physical laws, avoiding unreasonable correction results and improving the reliability of the system.
[0043] High computational efficiency maintained: Despite the introduction of complex deformation modeling, this method maintains high computational efficiency through model optimization and parallel computing, meeting the requirements of real-time processing.
[0044] Real application examples of this embodiment: The barcode detection method of this embodiment has been applied to the package sorting system in the logistics industry. In this scenario, it is necessary to perform real-time and accurate detection and recognition of barcodes attached to various shaped packaging materials, including cardboard boxes, plastic bags, bubble wrap, and irregularly shaped packaging bags, etc. These barcodes often exhibit complex geometric deformations due to the deformation, bending, or wrinkling of the packaging materials, and are also subject to interference factors such as complex backgrounds, reflection, and partial occlusion.
[0045] Implementation process example: Implementation of multi-scale feature extraction network: In the logistics sorting application, the multi-scale feature extraction network uses ResNet-50 as the backbone network, and the feature pyramid contains 5 feature layers of different scales, with the corresponding resolution ratios being 1 / 4, 1 / 8, 1 / 16, 1 / 32, and 1 / 64 respectively. For the barcode detection task, the feature extraction network has been specifically optimized: The channel number distribution of the convolutional layers in the backbone network has been adjusted, with the number of channels in the lower layers relatively increased to retain more edge and texture information, which is crucial for barcode detection; Lateral connections are added in the feature pyramid to strengthen the information exchange between features of different resolutions; The spatial attention algorithm adopts a dual attention structure, considering the attention distribution in both the channel dimension and the spatial dimension simultaneously; The above optimizations enable the network to effectively extract the features of barcodes at different scales and maintain stable detection performance even when the size of the barcodes varies significantly.
[0046] Deformable Convolutional Network Configuration: In the implementation of the deformable convolutional network, special configurations are made for the unique structural characteristics of barcodes: The offset field learning adopts a three-layer convolutional structure, and the number of output channels is 18 offset values for each convolutional point (9 sampling points, each point contains offsets in the x and y directions); The distribution of sampling points is initialized with a preference for the barcode stripe direction, making it easier for the network to capture the boundary features between bars and spaces; The learning rate of the offset field is set to 5 times that of the base network to accelerate the network's adaptability to deformed features; These configurations enable the deformable convolutional network to effectively capture the key features of deformed barcodes and adapt to various deformation situations of barcodes on irregular surfaces.
[0047] Local Deformation Field Estimation Network Example: The multi-scale local deformation field estimation network adopts a U-Net structure. The encoder contains 5 downsampling layers, and the decoder contains the corresponding 5 upsampling layers. In the application of logistics sorting, this network has the following characteristics: The deformation field at each resolution level is generated by an independent decoding branch and shares the same encoded features; The refinement network adopts a residual block structure, and each residual block contains two 3×3 convolutional layers and a skip connection; An incremental learning strategy is introduced in the deformation field generation process. First, the global deformation trend is predicted, and then the local deformation details are gradually refined; This structural design enables the deformation field estimation network to simultaneously grasp the overall deformation trend and local deformation details of barcodes and adapt to the barcode detection requirements on complex surfaces.
[0048] Physical Constraint Regularization Implementation Details: The parameter configuration of the physical constraint regularization algorithm in practical applications is as follows: Smoothness Constraint Weight Set to 0.8, Continuity Constraint Weight Set to 0.5, Local Consistency Constraint Weight Set to 0.3; The neighborhood range of the local consistency constraint is set to a 5×5 pixel area; Weight Based on Pixel Similarity Calculated using a Gaussian function: ; Among them, represents the influence weight of the point on the reference point ; represents the pixel value at the coordinate point ; represents the pixel value at the reference point ; is an adjustable parameter; These parameter settings ensure that the deformation field conforms to physical laws, avoid excessive or unreasonable deformation, and improve the accuracy of barcode correction.
[0049] Implementation of the precise geometric correction sampler: The precise geometric correction sampler adopts the following technologies in specific implementation: Bilinear interpolation is implemented with hardware acceleration to improve sampling efficiency; The adaptive grid density parameter is set to 0.4, and the basic grid density is set to 16×16; Multi-resolution sampling adopts 3 resolution levels, which are 1 / 4, 1 / 2, and 1 times of the original resolution respectively; Boundary processing adopts mirror filling method, and image enhancement adopts adaptive histogram equalization algorithm; These implementation details enable the precise geometric correction sampler to efficiently generate the corrected barcode image and provide high-quality input for subsequent recognition.
[0050] Verification of technical effects: Verification of detection accuracy: The test results of the barcode detection accuracy in the logistics sorting scenario of this embodiment are as follows: Table 1: Comparison of barcode detection accuracy on different surface types;
[0051] Table 1 shows that the barcode detection accuracy of this embodiment on various surfaces is better than that of traditional methods, especially the detection accuracy on non-rigid surfaces has a more significant improvement. For example, the detection accuracy on the wrinkled surface has increased by 27.5%.
[0052] Verification of robustness under different deformation degrees: Table 2: Comparison of detection success rates under different deformation degrees;
[0053] The data in Table 2 show that as the degree of deformation increases, the advantages of this embodiment compared to traditional methods become more evident. The detection success rate under compound deformation conditions has increased by 45.3%, demonstrating the excellent ability of this method in dealing with complexly deformed barcodes.
[0054] Detection performance under different interference conditions: Table 3: Comparison of detection performance under different interference conditions;
[0055] Table 3 shows that this embodiment has significant performance advantages under various interference conditions. Especially in the case of reflective surfaces and partial occlusion, the detection accuracy has increased by 25.6% and 23.7% respectively.
[0056] Computational efficiency test: Table 4: Comparison of processing speeds on different hardware platforms (frames per second);
[0057] Table 4 shows that although this embodiment introduces complex deformation modeling and correction processes, the optimized processing speed is close to that of traditional methods and can meet the real-time processing requirements on high-performance hardware.
[0058] In summary, this embodiment demonstrates excellent detection accuracy and robustness in logistics sorting applications, effectively solving the technical problems of barcode detection on irregular curved surfaces and flexible material surfaces, and having significant technical effects and application values.
[0059] The above describes the embodiments of the present invention. However, these embodiments are not limited to the above specific implementation manners. The above specific implementation manners are merely illustrative and not restrictive. Under the inspiration of this embodiment, those of ordinary skill in the art can also make more equivalent embodiments in various forms, all of which fall within the protection scope of this embodiment.
Claims
1. A barcode detection method based on a deep neural network, characterized in that, It includes the following steps: Extract barcode features of different scales from the input image through a multi-scale feature extraction network, and enhance the feature representation through a spatial attention algorithm to obtain an attention-enhanced feature map; Use a deformable convolutional network to process the attention-enhanced feature map, adaptively capture irregular barcode features, and integrate deformable convolutional features of different scales to generate a comprehensive feature map; Based on the integrated comprehensive feature map, generate a fine deformation vector field through a multi-scale local deformation field estimation network to accurately describe the local deformation on the barcode surface; Introduce physical constraints based on the elastic properties of the material to regularize the deformation field, optimize the smoothness, continuity, and local consistency of the deformation field, and obtain an optimized deformation field; Based on the optimized deformation field, resample and correct the original input image through an accurate deformation correction sampler to generate a geometrically corrected barcode image.
2. The barcode detection method based on a deep neural network according to claim 1, wherein, The multi-scale feature extraction network includes a backbone network and a feature pyramid structure. The backbone network is used to extract a basic feature map from the input image, and the feature pyramid structure is used to generate multiple feature maps of different scales.
3. The barcode detection method based on a deep neural network according to claim 2, characterized in that The spatial attention algorithm is implemented through the following formula: ; Among them, represents the feature map of the i-th scale, and represent 1×1 and 3×3 convolution operations respectively, represents the sigmoid activation function, represents the generated attention weight map, represents element-wise multiplication, represents the feature map after applying the attention algorithm, represents the scale index of the feature map.
4. The barcode detection method based on a deep neural network according to claim 1, characterized in that, The deformable convolutional network is implemented through the following steps: Input the attention-enhanced feature map into the deformable convolutional layer to adaptively capture irregular barcode features by learning spatial offsets; Learn the spatial offset of each feature point through the offset prediction branch; Integrate deformable convolutional features of different scales to generate a comprehensive feature map.
5. A barcode detection method based on a deep neural network according to claim 1, characterized in that, The physical constraints include smoothness constraints, continuity constraints, and local consistency constraints, and are implemented through the following formula: ; Among them, represents the total loss function of physical constraints of the deformation field . represents the deformation field , and respectively represent the smoothness constraint, the continuity constraint and the local consistency constraint , , are the weight coefficients of the smoothness constraint, the continuity constraint and the local consistency constraint respectively 6. The barcode detection method based on a deep neural network according to claim 5, wherein, The smoothness constraint is achieved by minimizing the gradient norm of the deformation field; The continuity constraint ensures that the deformation field changes continuously in space; The local consistency constraint ensures that the deformations within a local area have similar directions and amplitudes.
7. A barcode detection method based on a deep neural network according to claim 1, characterized in that, The accurate deformation correction sampler is implemented through the following steps: Construct an accurate deformation correction sampler based on bilinear interpolation for resampling the original image according to the deformation field; Dynamically adjust the density of the sampling grid according to the complexity of the deformation field; Adopt a multi-resolution sampling strategy to perform deformation correction step by step from low resolution to high resolution; Perform special processing on the boundary of the corrected image and apply image enhancement techniques to improve the clarity and contrast of the barcode.
8. A barcode detection method based on a deep neural network according to claim 7, characterized in that, The dynamic adjustment of the density of the sampling grid is implemented through the following formula: ; Among them, represents the basic grid density, is a regulation parameter used to control the sensitivity of the grid density to the change of the deformation field gradient, represents at the point the grid density, represents the gradient of the deformation field at the point and represents the norm of the gradient.
9. A barcode detection method based on a deep neural network according to claim 1, wherein, The barcode is a barcode attached to a non-rigid surface, including barcodes attached to the surfaces of packaging bags, plastic bottles, and flexible containers.
10. A barcode detection system based on a deep neural network, for performing a barcode detection method based on a deep neural network according to any one of claims 1-9, characterized in that, It includes: A multi-scale feature extraction module for extracting barcode features of different scales from the input image and enhancing the feature representation through a spatial attention algorithm; A deformable convolution module for adaptively capturing irregular barcode features; A multi-scale local deformation field estimation module for generating a fine deformation vector field to accurately describe the local deformation on the barcode surface; A physical constraint regularization module for regularizing the predicted deformation field; An accurate geometric correction module for resampling and correcting the image based on the optimized deformation field to generate a geometrically corrected barcode image.
Citation Information
Cited By
Intelligent parcel sorting method and system based on deep learning
CN120823482A
A parcel intelligent sorting method and system based on deep learning
CN120823482B