Illegal express sheet identification method and device, equipment and storage medium

By training the face sheet recognition model of the improved Cascade R-CNN network, the problem of insufficient brand identification detection on face sheets in the existing technology is solved, real-time detection and early warning of violation face sheets is realized, and the efficiency of logistics face sheet management and the maintenance of legitimate rights and interests is improved.

CN120236291APending Publication Date: 2025-07-01SHANGHAI DONGPU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510227052.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

The existing facebook inspection technology ignores the detection and identification of company logos or other brand logos that may exist on the facebook, making it difficult for the logistics sorting system to distinguish between non-company facebooks, which may lead to the mixing of express parcels from other companies, resulting in confusion in processing and reduced efficiency.

Method used

By training the face sheet recognition model of the improved Cascade R-CNN network, real-time detection and identification of the brand logo on the face sheet is realized, and early warning instructions are generated to safeguard the legitimate rights and interests of the logistics company.

Benefits of technology

Real-time detection and early warning of violation letters has been realized, the dependence on manual review has been reduced, labor costs and audit work intensity has been reduced, the efficiency of logistics letter management has been improved, and the illegal letters have been discovered and processed in a timely manner, and the legitimate rights and interests of logistics companies have been maintained.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120236291A_ABST
    Figure CN120236291A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image recognition, in particular to an illegal express sheet recognition method, device and equipment and a storage medium, and the method comprises the steps: obtaining an express sheet sample, and carrying out the preprocessing of the express sheet sample, and obtaining a training sample; the method comprises the following steps: constructing an express sheet identification model based on an improved Cascade R-CNN network, and initializing parameter setting of the express sheet identification model; training an express sheet recognition model based on the training sample, and embedding the trained express sheet recognition model into an express sheet scanning device; judging whether a real-time express sheet image fed back by the express sheet scanning equipment is a violation express sheet by using an express sheet recognition model, and if yes, confirming violation information and generating an early warning instruction; according to the method disclosed by the invention, by training the express sheet identification model of the improved Cascade R-CNN network, real-time detection of illegal express sheets is realized, the dependence on manual auditing is reduced, the labor cost and the auditing work intensity are reduced, the logistics express sheet management efficiency is improved, the illegal express sheets can be found and processed in time, and the logistics express sheet management efficiency is improved. And legitimate rights and interests of logistics companies are effectively maintained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image recognition, and particularly to a method, device, equipment and storage medium for identifying illegal waybills. Background Art

[0002] Current waybill detection technologies mainly focus on the automatic recognition and extraction of text information on waybills, such as the parsing of key information like the recipient's name, address, and phone number; however, current waybill detection technologies neglect the detection and recognition of possible company logos or other brand identifiers on waybills, and this limitation has led to several key problems:

[0003] Firstly, due to the lack of detection of brand identifiers on waybills, it is difficult for the logistics sorting system to effectively distinguish and screen out waybills that do not belong to this logistics company; this may cause the express deliveries of other companies to inadvertently mix into the sorting system of this company, resulting in chaos in logistics processing and a decline in efficiency.

[0004] Secondly, criminals may take advantage of this. Specifically, by using forged or stolen waybills of other companies for sending, they can avoid logistics fees or conduct other illegal activities; such behavior not only damages the economic interests of logistics companies, but may also have a negative impact on the company's reputation and brand rights.

[0005] In addition, the lack of detection of brand identifiers also means that logistics companies cannot utilize the visual elements on waybills for deeper data analysis and market research; for example, by analyzing the appearance frequencies of waybills of different brands, logistics companies can better understand market trends to adjust service strategies.

[0006] It can be seen that the existing technology still needs to be improved. Summary of the Invention

[0007] In order to overcome the deficiencies of the prior art, the purpose of the present invention is to provide a method for identifying illegal waybills. By training a waybill recognition model of an improved Cascade R-CNN network, real-time detection and timely warning of illegal waybills are achieved, effectively safeguarding the legitimate rights and interests of logistics companies.

[0008] The first aspect of the present invention provides a method for identifying illegal waybills, including: obtaining waybill samples, preprocessing the waybill samples to obtain training samples; constructing a waybill recognition model based on an improved Cascade R-CNN network, and initializing the parameter settings of the waybill recognition model; training the waybill recognition model with the training samples, and embedding the trained waybill recognition model into a waybill scanning device; obtaining real-time waybill images feedback by the waybill scanning device, and using the waybill recognition model to determine whether there are illegal waybills; when there are illegal waybills, confirming the illegal information, and generating a warning instruction based on the illegal information.

[0009] Optionally, in the first implementation manner of the first aspect of the present invention, the obtaining of the waybill sample and preprocessing the waybill sample to obtain a training sample includes: obtaining a waybill sample, where the waybill sample includes multiple waybill images of different time periods and different business types; respectively performing image enhancement processing and denoising processing on the multiple waybill images included in the waybill sample to obtain a first processed sample; respectively performing image cropping processing and image correction processing on the multiple waybill images included in the first processed sample to obtain a second processed sample; using a labeling tool to respectively label the multiple waybill images included in the second processed sample to obtain a training sample.

[0010] Optionally, in the second implementation manner of the first aspect of the present invention, the constructing of a waybill recognition model based on an improved CascadeR-CNN network and initializing the parameter settings of the waybill recognition model includes: obtaining a pre-trained backbone model as the backbone of the Cascade R-CNN network, where the backbone model is a ResNet model; constructing the head network of Cascade R-CNN, where the head network includes multiple cascaded detection heads; constructing an FPN structure after the backbone of the Cascade R-CNN network, and using the output of the FPN as the input of the region proposal network in the Cascade R-CNN network to complete the construction of the waybill recognition model; initializing the learning rate, batch size, and number of iterations of the waybill recognition model.

[0011] Optionally, in the third implementation manner of the first aspect of the present invention, the using of the training sample to train the waybill recognition model and embedding the trained waybill recognition model into a waybill scanning device includes: performing random rotation processing or random scaling processing or random cropping processing on the multiple waybill images included in the training sample to obtain an enhanced sample; performing data partitioning processing on the enhanced sample according to a preset partitioning ratio to obtain a training set, a validation set, and a test set; using the training set and the validation set to train the waybill recognition model, and using the test set to test the trained waybill recognition model; embedding the waybill recognition model that passes the test into the waybill scanning device.

[0012] Optionally, in the fourth implementation manner of the first aspect of the present invention, training the face bill recognition model using the training set and the validation set, and testing the trained face bill recognition model using the test set includes: training the face bill recognition model using the training set, and selecting the FOCAL LOSS loss function as the loss function of the face bill recognition model; recording the performance on the validation set for each epoch, adjusting the learning rate of the face bill recognition model according to the recorded performance using the cosine annealing learning rate strategy, and updating the weights of the face bill recognition model using the Adam optimizer; inputting the test set into the trained face bill recognition model to obtain the prediction results output by the face bill recognition model; evaluating the performance of the model according to the prediction results to confirm whether the trained face bill recognition model meets the deployment requirements.

[0013] Optionally, in the fifth implementation manner of the first aspect of the present invention, obtaining the real-time face bill image fed back by the face bill scanning device and using the face bill recognition model to determine whether there is a violation face bill includes: obtaining the real-time face bill image fed back by the face bill scanning device and performing preprocessing based on some threads in the pre-constructed thread pool; based on another part of the threads in the pre-constructed thread pool, calling the CUDA programming interface and using the GPU resources to run the face bill recognition model to recognize the preprocessed real-time face bill image; obtaining the recognition results output by the face bill recognition model, and if the recognition results indicate that the brand logo on the real-time face bill image is inconsistent with the preset brand logo, it indicates that the face bill corresponding to the real-time face bill image is a violation face bill.

[0014] Optionally, in the sixth implementation manner of the first aspect of the present invention, when there is a violation face bill, confirming the violation information and generating a warning instruction based on the violation information includes: when there is a violation face bill, using the OCR technology to obtain the face bill information from the real-time face bill image, and the face bill information includes the face bill number; generating the violation information based on the face bill information, the recognition results output by the face bill recognition model, and the current recognition timestamp, and storing the generated violation information based on the pre-constructed SQL statement; obtaining the preset warning method and the pre-constructed warning template, and generating a warning instruction based on the violation information, the preset warning method, and the pre-constructed warning template.

[0015] In a second aspect of the present invention, there is provided an illegal waybill recognition device, including: a processing module, configured to obtain waybill samples, preprocess the waybill samples to obtain training samples; a construction module, configured to construct a waybill recognition model based on an improved Cascade R-CNN network and initialize the parameter settings of the waybill recognition model; a training module, configured to train the waybill recognition model using the training samples and embed the trained waybill recognition model into a waybill scanning device; an identification module, configured to obtain a real-time waybill image fed back by the waybill scanning device and use the waybill recognition model to determine whether there is an illegal waybill; a generation module, configured to confirm illegal information when there is an illegal waybill and generate a warning instruction based on the illegal information.

[0016] Optionally, in a first implementation manner of the second aspect of the present invention, the processing module includes: a first acquisition unit, configured to obtain waybill samples, where the waybill samples include multiple waybill images of different time periods and different business types; a first processing unit, configured to perform image enhancement processing and denoising processing on the multiple waybill images included in the waybill samples respectively to obtain a first processed sample; a second processing unit, configured to perform image cropping processing and image correction processing on the multiple waybill images included in the first processed sample respectively to obtain a second processed sample; a labeling unit, configured to label the multiple waybill images included in the second processed sample respectively using a labeling tool to obtain training samples.

[0017] Optionally, in a second implementation manner of the second aspect of the present invention, the construction module includes: a second acquisition unit, configured to obtain a pre-trained backbone model as the backbone of the Cascade R-CNN network, where the backbone model is a ResNet model; a first construction unit, configured to construct the head network of the Cascade R-CNN, where the head network includes multiple cascaded detection heads; a second construction unit, configured to construct an FPN structure after the backbone of the Cascade R-CNN network, use the output of the FPN as the input of the region proposal network in the Cascade R-CNN network to complete the construction of the waybill recognition model; an initial unit, configured to initialize the learning rate, batch size, and number of iterations of the waybill recognition model.

[0018] Optionally, in the third implementation manner of the second aspect of the present invention, the training module includes: an enhancement unit, configured to perform random rotation processing, random scaling processing, or random cropping processing on multiple waybill images included in the training samples to obtain enhanced samples; a partitioning unit, configured to perform data partitioning processing on the enhanced samples according to a preset partitioning ratio to obtain a training set, a validation set, and a test set; a first training unit, configured to train the waybill recognition model using the training set and the validation set, and test the trained waybill recognition model using the test set; an embedding unit, configured to embed the waybill recognition model that passes the test into the waybill scanning device.

[0019] Optionally, in the fourth implementation manner of the second aspect of the present invention, the training module further includes: a second training unit, configured to train the waybill recognition model using the training set, and select the FOCAL LOSS loss function as the loss function of the waybill recognition model; an adjustment unit, configured to record the performance of each epoch on the validation set, and adjust the learning rate of the waybill recognition model using the cosine annealing learning rate strategy according to the recorded performance, and update the weights of the waybill recognition model using the Adam optimizer; a test unit, configured to input the test set into the trained waybill recognition model to obtain the prediction results output by the waybill recognition model; an evaluation unit, configured to evaluate the performance of the model according to the prediction results to confirm whether the trained waybill recognition model meets the deployment requirements.

[0020] Optionally, in the fifth implementation manner of the second aspect of the present invention, the recognition module includes: a third acquisition unit, configured to acquire and preprocess the real-time waybill image fed back by the waybill scanning device based on some threads in the pre-constructed thread pool; a recognition unit, configured to call the CUDA programming interface based on another part of the threads in the pre-constructed thread pool, and use the GPU resources to run the waybill recognition model to recognize the preprocessed real-time waybill image; a fourth acquisition unit, configured to acquire the recognition results output by the waybill recognition model. If the recognition results indicate that the brand logo on the real-time waybill image is inconsistent with the preset brand logo, it indicates that the waybill corresponding to the real-time waybill image is a violation waybill.

[0021] Optionally, in the sixth implementation manner of the second aspect of the present invention, the generation module includes: a fifth acquisition unit, configured to, when there is a violation waybill, use the OCR technology to acquire the waybill information from the real-time waybill image, where the waybill information includes the waybill number; a first generation unit, configured to generate violation information based on the waybill information, the recognition results output by the waybill recognition model, and the current recognition timestamp, and store the generated violation information based on the pre-constructed SQL statement; a second generation unit, configured to acquire the preset warning method and the pre-constructed warning template, and generate a warning instruction based on the violation information, the preset warning method, and the pre-constructed warning template.

[0022] In the third aspect of the present invention, there is provided a device for identifying illegal waybills, which includes: a memory and at least one processor, and instructions are stored in the memory; at least one of the processors calls the instructions in the memory to enable the device for identifying illegal waybills to execute each step of the illegal waybill identification method described in any one of the above.

[0023] In the fourth aspect of the present invention, there is provided a computer-readable storage medium, on which instructions are stored, and when the instructions are executed by a processor, each step of the illegal waybill identification method described in any one of the above is implemented.

[0024] In the technical solution of the present invention, by obtaining waybill samples and performing preprocessing, training samples are obtained; a waybill identification model based on an improved Cascade R-CNN network is constructed, and the parameter settings of the waybill identification model are initialized; the waybill identification model is trained based on the training samples, and the trained waybill identification model is embedded into a waybill scanning device; the waybill identification model is used to determine whether the real-time waybill image fed back by the waybill scanning device is an illegal waybill, and if so, the illegal information is confirmed and a warning instruction is generated; the method disclosed in this application realizes the real-time detection of illegal waybills by training the waybill identification model of the improved Cascade R-CNN network, reduces the dependence on manual review, reduces the labor cost and the intensity of review work, improves the efficiency of logistics waybill management, and can timely discover and process illegal waybills, effectively safeguarding the legitimate rights and interests of logistics companies. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 The first flowchart of the illegal waybill identification method provided by the embodiment of the present invention;

[0026] Figure 2 The second flowchart of the illegal waybill identification method provided by the embodiment of the present invention;

[0027] Figure 3 The third flowchart of the illegal waybill identification method provided by the embodiment of the present invention;

[0028] Figure 4 The fourth flowchart of the illegal waybill identification method provided by the embodiment of the present invention;

[0029] Figure 5 The fifth flowchart of the illegal waybill identification method provided by the embodiment of the present invention;

[0030] Figure 6 The sixth flowchart of the illegal waybill identification method provided by the embodiment of the present invention;

[0031] Figure 7The seventh flowchart of the illegal waybill recognition method provided by the embodiment of the present invention;

[0032] Figure 8 A structural schematic diagram of the illegal waybill recognition device provided by the embodiment of the present invention;

[0033] Figure 9 A structural schematic diagram of the illegal waybill recognition device provided by the embodiment of the present invention. Detailed implementation manners

[0034] The present invention provides an illegal waybill recognition method, device, equipment and storage medium. In the present invention, terms such as "first", "second", "third", "fourth", etc. (if any) in the description and claims of the present invention and the above drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments described here can be implemented in an order different from that shown or described here. In addition, the terms "comprising" or "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or equipment comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or equipment.

[0035] For ease of understanding, the specific process of the embodiment of the present invention is described below. Please refer to Figure 1 , an embodiment of the illegal waybill recognition method in the embodiment of the present invention includes:

[0036] 101. Obtain a waybill sample, preprocess the waybill sample to obtain a training sample;

[0037] In this embodiment, by preprocessing the waybill sample, the quality of the training sample is significantly improved, providing a solid foundation for the subsequent training of the waybill recognition model, thereby greatly improving the accuracy and robustness of the waybill recognition model.

[0038] 102. Construct a waybill recognition model based on an improved Cascade R-CNN network, and initialize the parameter settings of the waybill recognition model;

[0039] In this embodiment, a face ticket recognition model based on an improved Cascade R-CNN network is constructed, which adopts a multi-level and multi-stage detection mechanism. Specifically, Cascade R-CNN is a region-based convolutional neural network, which consists of a series of cascaded detection models. Each detection model is trained based on positive and negative samples with different IOU thresholds, and the output of the previous detection model is used as the input of the next detection model. The IOU threshold for defining positive and negative samples increases with the subsequent detection models. This cascade structure can gradually improve the detection accuracy, effectively suppress false positive samples, and improve the overall detection effect.

[0040] 103. Use the training sample to train a face sheet recognition model, and embed the trained face sheet recognition model into a face sheet scanning device;

[0041] In this embodiment, the trained waybill recognition model is embedded in the waybill scanning device, realizing real-time recognition and processing of the waybill image, which not only greatly improves the processing efficiency of the logistics industry and reduces the tediousness and errors of manual operations, but also can comprehensively and accurately identify the waybill as soon as it enters the logistics system, ensuring the accuracy and completeness of the information, and providing reliable data support for subsequent sorting, distribution and other links.

[0042] 104. Obtain the real-time bill image fed back by the bill scanning device, and use the bill recognition model to determine whether there is any illegal bill;

[0043] In this embodiment, by obtaining the real-time waybill image fed back by the waybill scanning device and using the waybill recognition model for efficient judgment, illegal waybills can be discovered and handled in a timely manner; this not only effectively prevents fraud and illegal operations in the logistics process, ensures the safety and stability of the logistics industry, but also provides logistics companies with a powerful risk prevention and control measure, avoiding economic losses caused by illegal waybills.

[0044] 105. When there is an illegal waybill, confirm the illegal information and generate an early warning instruction based on the illegal information.

[0045] The present application discloses a method for identifying illegal waybills. By obtaining waybill samples and performing preprocessing, training samples are obtained; a waybill recognition model based on an improved Cascade R-CNN network is constructed, and the parameter settings of the waybill recognition model are initialized; the waybill recognition model is trained based on the training samples, and the trained waybill recognition model is embedded into a waybill scanning device; the waybill recognition model is used to determine whether the real-time waybill image fed back by the waybill scanning device is an illegal waybill. If so, the illegal information is confirmed and a warning instruction is generated. The method disclosed in the present application realizes the real-time detection of illegal waybills by training the waybill recognition model of the improved Cascade R-CNN network, reduces the dependence on manual review, reduces the labor cost and the intensity of the review work, improves the efficiency of logistics waybill management, and can timely discover and process illegal waybills, effectively safeguarding the legitimate rights and interests of logistics companies.

[0046] Please refer to Figure 2 , the second embodiment of the method for identifying illegal waybills in the embodiments of the present invention includes:

[0047] 201. Obtain waybill samples, where the waybill samples include multiple waybill images of different time periods and different business types;

[0048] In this embodiment, waybill samples can be collected according to a preset time period (such as once a week); each time of collection, through a random sampling algorithm, no less than 500 waybill images are selected from a large amount of waybill data as waybill samples, and it is ensured that the selected waybill images cover different time periods such as weekdays, holidays, and e-commerce promotion periods, as well as waybills of various business types such as ordinary express delivery, cold chain logistics, and cross-border e-commerce, so as to ensure the diversity and representativeness of the data.

[0049] 202. Perform image enhancement processing and denoising processing on the multiple waybill images included in the waybill samples respectively to obtain first processed samples;

[0050] In this embodiment, using image processing algorithms, image enhancement processing and denoising processing are performed on each of the multiple waybill images included in the waybill samples one by one; image enhancement aims to improve the clarity, contrast, and brightness of the image, making the key information in the image more prominent; and denoising processing is used to eliminate the noise and interference in the image to ensure the image quality.

[0051] 203. Perform image cropping processing and image correction processing on the multiple waybill images included in the first processed samples respectively to obtain second processed samples;

[0052] In this embodiment, for each waybill image in the first processed sample, an edge detection algorithm is used for image cropping processing, and an image correction algorithm is used for image correction processing; image cropping aims to remove unimportant areas in the image and retain the key information part; while image correction is used to adjust problems such as the inclination and deformation of the image to ensure the accuracy and readability of the image.

[0053] 204. Use a labeling tool to label each of the multiple waybill images included in the second processed sample to obtain training samples;

[0054] In this embodiment, an open-source labeling tool LabelImg is selected for labeling. This tool is developed based on the Python language and relies on the Qt graphical interface library to achieve convenient operations; before formal labeling, a detailed and comprehensive labeling guide is compiled in XML format, which not only clearly stipulates the labeling specifications for basic features such as the position of the brand logo (precisely defined in pixel coordinates), size (pixel values of length and width), color (represented by RGB color space values), and shape (described by the vertex coordinates of the polygon), but also shows the labeling methods for logos of different styles and forms through XML file examples of a large number of actual cases to ensure the normal progress of the labeling work.

[0055] Please refer to Figure 3 , the third embodiment of the illegal waybill recognition method in the embodiment of the present invention includes:

[0056] 301. Obtain a pre-trained backbone model as the backbone of the Cascade R-CNN network, and the backbone model is a ResNet model;

[0057] 302. Construct the head network of Cascade R-CNN, and the head network includes multiple cascaded detection heads;

[0058] 303. Construct an FPN structure after the backbone of the Cascade R-CNN network, and use the output of the FPN as the input of the region proposal network in the Cascade R-CNN network to complete the construction of the waybill recognition model;

[0059] In this embodiment, the improved Cascade R-CNN network mainly involves key components such as a feature extraction network (Backbone), a region proposal network (RPN), a feature pyramid network (FPN), region of interest pooling (RoI), and a cascade detector. During the recognition process of the illegal waybill, Cascade RCNN first extracts features from the input image through the Backbone network to generate corresponding feature maps. Subsequently, the FPN network performs multi-scale fusion on these feature maps, gradually constructing from the deep layer to the shallow layer. Then, the fused feature maps are fed into the RPN to obtain target candidate regions. Finally, the cascade detector performs regression and classification tasks. The cascade detector adopted by Cascade R-CNN consists of an ROI Align layer, a fully connected layer, a classifier, and a bounding box regressor. During the illegal waybill recognition process, the detector uses the target bounding box parameters output by the previous detection as the input parameters for the next iteration, and gradually increases the intersection over union (IoU) threshold, obtaining new classification scores and bounding box parameters through iterative training, thereby improving the training effect and detection accuracy of the network.

[0060] Furthermore, FPN utilizes the inherent multi-scale and pyramid hierarchical structure of the deep convolutional network to construct a feature pyramid, combining high-level semantic information with low-level detail information through a top-down path and lateral connections to generate multi-scale feature maps with rich semantics and details. This structure effectively solves the problems of information loss and resolution mismatch during object detection at different scales, enhancing the model's detection ability for objects of different sizes. Introducing the FPN structure into the Cascade R-CNN model enables the model to more effectively fuse multi-scale features when recognizing the brand logo features of waybill images, thereby enhancing the recognition ability for brand logo features under different sizes and complex backgrounds. For example, for small-sized or partially occluded brand logos, as well as waybills with complex backgrounds, the improved waybill recognition model can detect and recognize more accurately, thereby improving the detection accuracy and robustness and reducing the false detection rate.

[0061] 304. Initialize the learning rate, batch size, and number of iterations of the waybill recognition model.

[0062] In this embodiment, when constructing the waybill recognition model, relevant parameters are set, such as the learning rate, batch size, number of iterations, etc. The learning rate determines the step size for updating the model parameters. Too large will cause the model to be unstable, while too small will make the training process slow. The batch size affects the model's fitting ability and generalization ability for data. The number of iterations determines the sufficiency of the model training. Through multiple experiments and adjustments, the parameter combination most suitable for the current task is found to ensure that the model can effectively learn the waybill features and accurately detect illegal waybills.

[0063] Please refer to Figure 4 , the fourth embodiment of the illegal waybill recognition method in the embodiment of the present invention includes:

[0064] 401. Randomly rotate, randomly scale or randomly crop multiple waybill images included in the training samples to obtain enhanced samples;

[0065] In this embodiment, by enhancing the training samples, more diverse waybill image samples are generated, enabling the waybill recognition model to encounter waybills in more different forms and conditions during training, thereby enhancing the adaptability of the waybill recognition model to various actual scenarios and avoiding model overfitting.

[0066] 402. According to a preset division ratio, perform data division processing on the enhanced samples to obtain a training set, a validation set, and a test set;

[0067] In this embodiment, the preset division ratio can be: 60% for the training set, 20% for the validation set, and 20% for the test set; First, randomly shuffle the enhanced samples, then sequentially select the first 60% as the training set, select the first 20% from the remaining data as the validation set, and the last remaining 20% is used as the test set, thereby integrating a training set, a validation set, and a test set with clear structure and reasonable distribution.

[0068] 403. Use the training set and the validation set to train the waybill recognition model, and use the test set to test the trained waybill recognition model;

[0069] 404. Embed the waybill recognition model that passes the test into the waybill scanning device.

[0070] Please refer to Figure 5 , the fifth embodiment of the illegal waybill recognition method in the embodiment of the present invention includes:

[0071] 501. Use the training set to train the waybill recognition model, and select the FOCAL LOSS loss function as the loss function of the waybill recognition model;

[0072] In this embodiment, using Focal Loss as the loss function in the training of the waybill recognition model can effectively solve the problem of unbalanced positive and negative samples; in the illegal waybill recognition task, usually the number of negative samples is much more than that of positive samples, which will cause the model to focus too much on the easily classified negative samples during training and ignore the difficult-to-classify positive samples. Focal Loss adjusts the weights of the easily classified samples, enabling the model to focus more on the difficult-to-classify samples, thereby improving the detection accuracy of the model for illegal waybills and enabling the model to maintain good performance when facing unbalanced data.

[0073] 502. Record the performance of each epoch on the validation set. According to the recorded performance, adjust the learning rate of the waybill recognition model using the cosine annealing learning rate strategy, and update the weights of the waybill recognition model using the Adam optimizer.

[0074] In this embodiment, by recording the performance of each epoch on the validation set, the learning progress and generalization ability of the waybill recognition model can be tracked in real time; according to the recorded performance data, dynamically adjusting the learning rate of the waybill recognition model using the cosine annealing learning rate strategy helps the model avoid falling into local optima during training, while accelerating the convergence speed and improving the final performance; in addition, updating the weights of the waybill recognition model using the Adam optimizer can more efficiently optimize the model parameters and further improve the recognition accuracy and generalization ability of the model.

[0075] 503. Input the test set into the trained waybill recognition model to obtain the prediction results output by the waybill recognition model.

[0076] 504. Evaluate the performance of the model based on the prediction results to confirm whether the trained waybill recognition model meets the deployment requirements.

[0077] In this embodiment, according to the prediction results of the waybill recognition model and the true labels of the test data set, calculate the preselected evaluation metrics; analyze the calculated metrics to determine whether the waybill recognition model meets the predetermined performance criteria; based on the evaluation results and error analysis, make necessary adjustments to the model, such as adjusting the model structure, increasing the training data, performing data augmentation, or adjusting the hyperparameters, etc.; repeat the evaluation and adjustment process until the model performance meets the deployment requirements.

[0078] Please refer to Figure 6 , the sixth embodiment of the illegal waybill recognition method in the embodiment of the present invention includes:

[0079] 601. Based on some threads in the pre-constructed thread pool, obtain the real-time waybill images fed back by the waybill scanning device and perform preprocessing.

[0080] 602. Based on another part of the threads in the pre-constructed thread pool, call the CUDA programming interface and use the GPU resources to run the waybill recognition model to recognize the preprocessed real-time waybill images.

[0081] In this embodiment, the NVIDIA GPU acceleration computing technology is utilized, and through CUDA programming, the model is enabled to run rapidly on the GPU. Meanwhile, the multi-threading technology is adopted to optimize the data reading and model inference processes, ensuring that the model can complete the recognition quickly within 1 second and accurately output the recognition result, greatly improving the efficiency of logistics sorting. Specifically, by using some threads in the pre-constructed thread pool to be specifically responsible for obtaining the real-time waybill image feedback by the waybill scanning device and performing preprocessing, this method can efficiently manage and allocate computing resources, ensuring the real-time performance and accuracy of the image data. Among them, the preprocessing steps may include image enhancement, noise removal, etc., providing high-quality input for subsequent waybill recognition. Secondly, another part of the threads in the thread pool is used to call the CUDA programming interface to fully utilize the GPU resources to run the waybill recognition model, which significantly improves the speed and efficiency of waybill recognition. The GPU has significant advantages over the CPU in processing large-scale parallel computing tasks, being able to process image data faster, thereby shortening the recognition time and enhancing the overall system response speed.

[0082] 603. Obtain the recognition result output by the waybill recognition model. If the recognition result indicates that the brand logo on the real-time waybill image is inconsistent with the preset brand logo, it indicates that the waybill corresponding to the real-time waybill image is a violation waybill.

[0083] Please refer to Figure 7 , the seventh embodiment of the violation waybill recognition method in the embodiment of the present invention includes:

[0084] 701. When there is a violation waybill, use the OCR technology to obtain the waybill information from the real-time waybill image, and the waybill information includes the waybill number;

[0085] In this embodiment, the waybill information is automatically obtained from the real-time waybill image through the OCR technology, avoiding the errors and time consumption of manual input and significantly improving the processing efficiency.

[0086] 702. Generate violation information based on the waybill information, the recognition result output by the waybill recognition model, and the current recognition timestamp, and store the generated violation information based on the pre-constructed SQL statement;

[0087] In this embodiment, storing the violation information based on the pre-constructed SQL statement ensures the integrity and security of the data, and is convenient for subsequent data management and analysis; that is, it supports the data backtracking and comparison functions, allowing users to input query conditions through the Web interface, and using the SQL statement to perform backtracking queries on the historical recognition data. By comparing the violation situations in different time periods, the implementation effects of prevention and control measures can be observed, and the strategies can be adjusted in a timely manner.

[0088] 703. Obtain the preset warning method and the pre-built warning template, and generate a warning instruction based on the violation information, the preset warning method, and the pre-built warning template;

[0089] In this embodiment, by obtaining the preset warning method and the pre-built warning template, a warning instruction can be quickly generated to notify relevant personnel for processing in a timely manner, effectively preventing the spread and deterioration of violations; specifically, extract the preset warning methods such as email notification and SMS notification from the database, and retrieve the pre-built warning templates closely related to the violation type from the template repository; subsequently, analyze the violation information to clarify the violation type and severity, and at the same time extract key data; on this basis, accurately match the appropriate warning method and template according to the characteristics of the violation information to ensure that the warning information can be accurately conveyed and trigger the corresponding response mechanism; finally, fill the warning template with the extracted key data and combine the preset warning method to construct a specific warning instruction.

[0090] The method for identifying illegal waybills in the embodiments of the present invention has been described above. Next, the device for identifying illegal waybills in the embodiments of the present invention will be described. Please refer to Figure 8 , an embodiment of the device for identifying illegal waybills in the embodiments of the present invention includes:

[0091] A processing module 801, configured to obtain a waybill sample, preprocess the waybill sample to obtain a training sample; a construction module 802, configured to construct a waybill recognition model based on an improved Cascade R-CNN network and initialize the parameter settings of the waybill recognition model; a training module 803, configured to train the waybill recognition model with the training sample and embed the trained waybill recognition model into a waybill scanning device; an identification module 804, configured to obtain a real-time waybill image fed back by the waybill scanning device and use the waybill recognition model to determine whether there is an illegal waybill; a generation module 805, configured to confirm the violation information when there is an illegal waybill and generate a warning instruction based on the violation information.

[0092] In this embodiment, the processing module 801 includes: a first acquisition unit 8011, configured to obtain a waybill sample, where the waybill sample includes multiple waybill images of different time periods and different business types; a first processing unit 8012, configured to perform image enhancement processing and denoising processing on the multiple waybill images included in the waybill sample respectively to obtain a first processed sample; a second processing unit 8013, configured to perform image cropping processing and image correction processing on the multiple waybill images included in the first processed sample respectively to obtain a second processed sample; a labeling unit 8014, configured to label the multiple waybill images included in the second processed sample respectively using a labeling tool to obtain a training sample.

[0093] In this embodiment, the building module 802 includes: a second acquisition unit 8021, configured to acquire a pre-trained backbone model as the backbone of the Cascade R-CNN network, where the backbone model is a ResNet model; a first building unit 8022, configured to build the head network of the Cascade R-CNN, where the head network includes a plurality of cascaded detection heads; a second building unit 8023, configured to build an FPN structure after the backbone of the Cascade R-CNN network, and use the output of the FPN as the input of the region proposal network in the Cascade R-CNN network, thereby completing the construction of the face bill recognition model; an initial unit 8024, configured to initialize the learning rate, batch size, and number of iterations of the face bill recognition model.

[0094] In this embodiment, the training module 803 includes: an enhancement unit 8031, configured to perform random rotation processing, random scaling processing, or random cropping processing on multiple face bill images included in the training samples to obtain enhanced samples; a partitioning unit 8032, configured to perform data partitioning processing on the enhanced samples according to a preset partitioning ratio to obtain a training set, a validation set, and a test set; a first training unit 8033, configured to train the face bill recognition model using the training set and the validation set, and test the trained face bill recognition model using the test set; an embedding unit 8034, configured to embed the face bill recognition model that passes the test into the face bill scanning device.

[0095] In this embodiment, the training module 803 further includes: a second training unit 8035, configured to train the face bill recognition model using the training set, and select the FOCAL LOSS loss function as the loss function of the face bill recognition model; an adjustment unit 8036, configured to record the performance of each epoch on the validation set, and according to the recorded performance, adjust the learning rate of the face bill recognition model using the cosine annealing learning rate strategy, and update the weights of the face bill recognition model using the Adam optimizer; a test unit 8037, configured to input the test set into the trained face bill recognition model to obtain the prediction results output by the face bill recognition model; an evaluation unit 8038, configured to evaluate the performance of the model according to the prediction results to confirm whether the trained face bill recognition model meets the deployment requirements.

[0096] In this embodiment, the recognition module 804 includes: a third acquisition unit 8041, configured to acquire a real-time waybill image fed back by a waybill scanning device and perform preprocessing based on some threads in a pre-constructed thread pool; a recognition unit 8042, configured to call a CUDA programming interface based on another part of the threads in the pre-constructed thread pool, and use GPU resources to run a waybill recognition model to recognize the preprocessed real-time waybill image; a fourth acquisition unit 8043, configured to acquire the recognition result output by the waybill recognition model. If the recognition result indicates that the brand logo on the real-time waybill image is inconsistent with a preset brand logo, it indicates that the waybill corresponding to the real-time waybill image is a violation waybill.

[0097] In this embodiment, the generation module 805 includes: a fifth acquisition unit 8051, configured to, when there is a violation waybill, use OCR technology to acquire waybill information from the real-time waybill image, where the waybill information includes a waybill number; a first generation unit 8052, configured to generate violation information based on the waybill information, the recognition result output by the waybill recognition model, and the current recognition timestamp, and store the generated violation information based on a pre-constructed SQL statement; a second generation unit 8053, configured to acquire a preset warning method and a pre-constructed warning template, and generate a warning instruction based on the violation information, the preset warning method, and the pre-constructed warning template.

[0098] Based on the same idea as the method in the above embodiment, the device provided in this application can implement the method in the above embodiment.

[0099] Above Figure 8 The violation waybill recognition device in the embodiment of the present invention is described in detail from the perspective of modular functional entities. Next, the violation waybill recognition device in the embodiment of the present invention will be described in detail from the perspective of hardware processing.

[0100] Figure 9FIG. 0 is a schematic structural diagram of an illegal waybill recognition device provided by an embodiment of the present invention. The illegal waybill recognition device 900 may vary greatly due to different configurations or performances, and may include one or more processors (central processing units, CPU) 910 (for example, one or more processors) and a memory 920, and one or more storage media 930 (for example, one or more mass storage devices) for storing application programs 933 or data 932. Among them, the memory 920 and the storage media 930 may be transient storage or persistent storage. The program stored in the storage media 930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the illegal waybill recognition device 900. Further, the processor 910 may be configured to communicate with the storage media 930 and execute a series of instruction operations in the storage media 930 on the illegal waybill recognition device 900 to implement the steps of the illegal waybill recognition method provided by the above method embodiments.

[0101] The illegal waybill recognition device 900 may further include one or more power supplies 940, one or more wired or wireless network interfaces 950, one or more input / output interfaces 960, and / or one or more operating systems 931, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, and so on. Those skilled in the art can understand that Figure 9 the shown structural diagram of the illegal waybill recognition device does not constitute a limitation on the illegal waybill recognition device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0102] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions run on a computer, the computer is caused to execute the steps of the illegal waybill recognition method.

[0103] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the above-described system, device, or unit can refer to the corresponding processes in the foregoing method embodiments and will not be described herein again.

[0104] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of this 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 for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.

[0105] Finally, it should be noted that the above are only preferred examples of the present invention and are not used to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, for those skilled in the art, they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for identifying illegal bills, characterized in that: include: Obtaining face order samples, preprocessing the face order samples, and obtaining training samples; Build a face-bill recognition model based on the improved Cascade R-CNN network and initialize the parameter settings of the face-bill recognition model; The training samples are used to train a face-in-hand bill recognition model, and the trained face-in-hand bill recognition model is embedded into a face-in-hand bill scanning device; Obtain the real-time bill image fed back by the bill scanning device, and use the bill recognition model to determine whether there is any illegal bill; When there is an illegal waybill, confirm the illegal information and generate an early warning instruction based on the illegal information.

2. The method for identifying illegal bills according to claim 1, characterized in that: The method of obtaining a face order sample and preprocessing the face order sample to obtain a training sample includes: Obtaining a waybill sample, wherein the waybill sample includes a plurality of waybill images of different time periods and different business types; Perform image enhancement processing and denoising processing on a plurality of face order images included in the face order sample respectively to obtain a first processed sample; Performing image cropping and image correction processing on the plurality of single images included in the first processing sample respectively to obtain a second processing sample; A labeling tool is used to label the multiple face sheet images included in the second processing sample to obtain training samples.

3. The method for identifying illegal bills according to claim 1, characterized in that: The method of constructing a face-bill recognition model based on the improved Cascade R-CNN network and initializing parameter settings of the face-bill recognition model includes: Obtain a pre-trained backbone model as the backbone of the Cascade R-CNN network, where the backbone model is a ResNet model; Construct a head network of Cascade R-CNN, wherein the head network includes multiple cascaded detection heads; Build an FPN structure behind the backbone of the Cascade R-CNN network, and use the output of FPN as the input of the region proposal network in the Cascade R-CNN network to complete the construction of the face ticket recognition model. Initialize the learning rate, batch size, and number of iterations of the face recognition model.

4. The method for identifying illegal bills according to claim 3, characterized in that: The method of using the training samples to train the face sheet recognition model and embedding the trained face sheet recognition model into the face sheet scanning device includes: Performing random rotation processing, random scaling processing, or random cropping processing on multiple face single images included in the training samples to obtain enhanced samples; According to the preset division ratio, the enhanced samples are divided into data to obtain the training set, the validation set and the test set; The face order recognition model is trained using the training set and validation set, and the trained face order recognition model is tested using the test set; The tested waybill recognition model will be embedded into the waybill scanning device.

5. The method for identifying illegal bills according to claim 4, characterized in that: The method of using a training set and a validation set to train the face order recognition model, and using a test set to test the trained face order recognition model, includes: Use the training set to train the face order recognition model, and select the FOCAL LOSS loss function as the loss function of the face order recognition model; Record the performance of each epoch on the validation set. Based on the recorded performance, use the cosine annealing learning rate strategy to adjust the learning rate of the face ticket recognition model, and use the Adam optimizer to update the weight of the face ticket recognition model. Input the test set into the trained waybill recognition model to obtain the prediction result output by the waybill recognition model; Evaluate the model's performance based on the prediction results to confirm whether the trained face-bill recognition model meets the deployment requirements.

6. The method for identifying illegal bills according to claim 1, characterized in that: The step of obtaining the real-time bill image fed back by the bill scanning device and using the bill recognition model to determine whether there is an illegal bill includes: Based on some threads in the pre-built thread pool, the real-time bill image fed back by the bill scanning device is obtained and pre-processed; Another part of the threads based on the pre-built thread pool calls the CUDA programming interface and uses GPU resources to run the face order recognition model to recognize the pre-processed real-time face order image; The recognition result output by the waybill recognition model is obtained. If the recognition result indicates that the brand logo on the real-time waybill image is inconsistent with the preset brand logo, it indicates that the waybill corresponding to the real-time waybill image is an illegal waybill.

7. The method for identifying illegal bills according to claim 1, characterized in that: When there is a violation of the order form, confirming the violation information and generating a warning instruction based on the violation information includes: When there is an illegal waybill, OCR technology is used to obtain the waybill information from the real-time waybill image, and the waybill information includes the waybill number; Generate violation information based on the waybill information, the recognition result output by the waybill recognition model, and the current recognition timestamp, and store the generated violation information based on the pre-built SQL statement; Obtain preset warning methods and pre-built warning templates, and generate warning instructions based on violation information, preset warning methods and pre-built warning templates.

8. A device for identifying illegal bills, characterized in that: include: A processing module is used to obtain face order samples, pre-process the face order samples, and obtain training samples; A construction module is used to build a face-bill recognition model based on the improved Cascade R-CNN network and initialize the parameter settings of the face-bill recognition model; A training module, used to train the bill recognition model using the training samples, and embed the trained bill recognition model into the bill scanning device; The recognition module is used to obtain the real-time bill image fed back by the bill scanning device and use the bill recognition model to determine whether there is an illegal bill; The generation module is used to confirm the violation information when there is a violation of the delivery note, and generate an early warning instruction based on the violation information.

9. A device for identifying illegal shipping labels, characterized in that: The illegal bill identification device comprises: a memory and at least one processor, wherein the memory stores instructions; At least one of the processors calls the instructions in the memory so that the illegal bill identification device executes the various steps of the illegal bill identification method as described in any one of claims 1-7.

10. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instruction is executed by the processor, each step of the method for identifying illegal bills as described in any one of claims 1-7 is implemented.