Parcel detection method and device, computer equipment and readable storage medium
By combining the information of the outer packaging and the internal perspective image, identification and fusion processing, the problem of poor packaging detection effect in the prior art is solved, and the identification accuracy and recall rate of contraband are improved.
Patent Information
- Application Number
- CN202310862913.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-13
- Publication Date
- 2025-01-14
AI Technical Summary
The existing package detection methods have poor results when identifying contraband products, have a low recall rate, and some contraband products are similar in internal perspective imaging, which is prone to confusion and affect the detection effect.
By obtaining the outer packaging scanned image of the package, the image recognition process is performed, the tag classification information is extracted, and the internal perspective image is combined for fusion processing is generated to generate object detection information, and the contraband detection results are finally determined, and the detection results are verified using the preset confidence threshold value. accuracy.
It improves the recall and accuracy of package contraband testing, reduces misjudgment, and enhances the ability to identify dangerous goods.
Smart Images

Figure CN119314090A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of express delivery technology, and specifically to a package detection method, device, computer equipment, and readable storage medium. Background Art
[0002] In logistics and transportation scenarios, some packages containing dangerous goods such as flammable and explosive substances, toxic substances, radioactive substances, and corrosive substances require special transportation methods. Due to irregular operations during delivery, such packages are not discovered or the wrong transportation method is selected. In the end, such packages containing prohibited items may spontaneously combust or corrode and damage packages on the same vehicle or plane, and even cause serious safety accidents. Therefore, it is necessary to identify whether the package contains prohibited items during logistics and transportation.
[0003] However, most of the existing technologies identify prohibited items in parcels based on the internal perspective image obtained by scanning the parcel with an X-ray scanning device. However, the above method cannot effectively guarantee the identification of all prohibited items, and some prohibited items are similar in internal perspective imaging, which is easy to cause confusion, thus affecting the effect of parcel detection, such as low detection recall rate. Summary of the invention
[0004] The embodiments of the present application provide a package detection method, apparatus, computer device and readable storage medium, which aim to solve the problems of poor package detection effect and low detection recall rate in existing package detection methods.
[0005] On the one hand, an embodiment of the present application provides a package detection method, including:
[0006] Obtain a scanned image of the outer packaging of the target package to be detected;
[0007] Performing image recognition processing on the outer packaging scanned image to obtain label classification information corresponding to the outer packaging scanned image;
[0008] Acquire an internal perspective image of the target package;
[0009] The contraband detection result of the target package is determined according to the label classification information and the internal perspective image.
[0010] As a feasible embodiment of the present application, the determining of the contraband detection result of the target package according to the label classification information and the internal perspective image includes:
[0011] Extracting image features corresponding to different levels of the internal perspective image;
[0012] fusing the image features to obtain fused image features corresponding to the internal perspective image;
[0013] Generating object detection information corresponding to the target package based on the fused image features;
[0014] Based on the tag classification information and the object detection information, a contraband detection result of the target package is determined.
[0015] As a feasible embodiment of the present application, determining the contraband detection result of the target package based on the label classification information and the object detection information includes:
[0016] Querying a preset data table to obtain a confidence threshold associated with the target label classification confidence in the label classification information;
[0017] Based on the relationship between the target object confidence in the object detection information and the confidence threshold, a contraband detection result of the target package is determined.
[0018] As a feasible embodiment of the present application, the querying of the preset data table to obtain the confidence threshold associated with the target label classification confidence in the label classification information includes:
[0019] Extracting the tag type from the tag classification information;
[0020] A data table corresponding to the tag type is queried to obtain a confidence threshold associated with the target tag classification confidence in the tag classification information.
[0021] As a feasible embodiment of the present application, the performing image recognition processing on the outer packaging scan image to obtain label classification information corresponding to the outer packaging scan image includes:
[0022] Processing the outer packaging scan image based on a preset label detection algorithm to obtain label position information corresponding to the outer packaging scan image;
[0023] Extracting a target area image in the outer packaging scan image based on the label position information;
[0024] The target area image is classified based on a preset label classification algorithm to obtain label classification information corresponding to the outer packaging scan image.
[0025] As a feasible embodiment of the present application, before classifying the target area image based on a preset label classification algorithm to obtain the corresponding label classification information on the outer packaging scan image, the method further includes:
[0026] Performing filtering processing on the target area image to obtain a denoised area image;
[0027] Performing edge enhancement processing on the denoised area image to obtain an enhanced area image;
[0028] The classifying process of the target area image based on a preset label classification algorithm to obtain label classification information corresponding to the outer packaging scan image includes:
[0029] The enhanced region image is classified based on a preset label classification algorithm to obtain label classification information corresponding to the outer packaging scan image.
[0030] As a feasible embodiment of the present application, the step of obtaining a scanned image of an outer packaging of a target package to be detected includes:
[0031] Obtaining a scanned image of the outer packaging of the target package to be inspected through a preset visible light scanning device;
[0032] The step of acquiring the internal perspective image of the target package includes:
[0033] The internal perspective image of the target package is obtained by a preset X-ray scanning device.
[0034] On the other hand, an embodiment of the present application further provides a package detection device, including:
[0035] A first acquisition module is used to acquire a scanned image of an outer packaging of a target package to be detected;
[0036] A recognition module, used to perform image recognition processing on the outer packaging scan image to obtain label classification information corresponding to the outer packaging scan image;
[0037] A second acquisition module, used to acquire an internal perspective image of the target package;
[0038] A detection module is used to determine a contraband detection result of the target package according to the label classification information and the internal perspective image.
[0039] On the other hand, an embodiment of the present application further provides a computer device, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-mentioned package detection method.
[0040] On the other hand, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to implement the above-mentioned package detection method.
[0041] The package detection method provided by the present application takes into account that dangerous goods usually need to have a dangerous goods sign clearly affixed or printed on the surface of the package. Therefore, by obtaining a scanned image of the outer packaging of the package, and then using recognition processing on the scanned image of the outer packaging to obtain the label classification information on the outer packaging of the package, and then using this label classification information and the internal perspective image of the target package to comprehensively determine its contraband detection result. Compared with the existing technology that only uses the internal perspective image to obtain the contraband detection result, the recall rate of the package contraband detection result can be effectively improved, and the contraband detection effect is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0043] Figure 1 A schematic diagram of the steps of a package detection method provided in an embodiment of the present application;
[0044] Figure 2 A schematic flow chart of the steps of fusing label classification information and internal perspective images to determine package inspection results provided in an embodiment of the present application;
[0045] Figure 2 (a) is a schematic diagram of processing an internal perspective image to obtain object detection information provided by an embodiment of the present application;
[0046] Figure 3 A schematic flow chart of the steps for determining a package detection result based on label classification and confidence of object detection provided in an embodiment of the present application;
[0047] Figure 4 A schematic diagram of a process flow for obtaining a confidence threshold provided in an embodiment of the present application;
[0048] Figure 5 A schematic diagram of a process flow of identifying and processing an image to obtain label classification information provided in an embodiment of the present application;
[0049] Figure 6 A schematic diagram of a process flow for performing enhancement preprocessing on a regional image provided in an embodiment of the present application;
[0050] Figure 7 A schematic diagram of the structure of a package detection device provided in an embodiment of the present application;
[0051] Figure 8A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of the present invention.
[0053] In the embodiments of the present application, the word "exemplary" is used to mean "used as an example, illustration or description". Any embodiment described as "exemplary" in the embodiments of the present application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is given to enable any technician in the field to implement and use the present invention. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present invention can be implemented without using these specific details. In other examples, well-known structures and processes will not be elaborated in detail to avoid unnecessary details that make the description of the present invention obscure. Therefore, the present invention is not intended to be limited to the embodiments shown, but is consistent with the widest range of principles and features disclosed in the embodiments of the present application.
[0054] To facilitate understanding of the package detection method provided in the embodiment of the present application, the implementation scenario diagram of the method is first described. In the field of logistics and transportation, it is very necessary to detect contraband in packages. At present, it is usually based on the X-ray scanning device to obtain the internal perspective view of the package, and then obtain the object information in the package based on the target recognition algorithm. However, the above scheme cannot effectively guarantee the identification of all contraband, and some contraband are similar in internal perspective imaging, which is easy to cause confusion, affecting the detection effect of contraband in the package. In order to solve the above problems, the embodiment of the present application fully considers that dangerous goods need to be clearly affixed or printed with dangerous goods signs on the surface of the package, and proposes a package detection method that integrates the outer package label for contraband identification, which can effectively improve the accuracy of package detection. Specifically, the package detection method provided in the embodiment of the present application is installed in the package detection device in the form of a computer program, and the package detection device is set in the computer device in the form of a processor. The computer device executes the package detection method provided in the embodiment of the present application by running the computer program corresponding to the package detection device.
[0055] like Figure 1 As shown, Figure 1 A schematic flow chart of a package detection method provided in an embodiment of the present application, specifically, comprising steps S110 to S140:
[0056] S110, obtaining a scanned image of the outer packaging of a target package to be inspected.
[0057] In the embodiments of the present application, the target package to be inspected generally refers to a package that needs to be inspected for prohibited items during the consignment and mailing process, wherein the prohibited items generally include flammable and explosive items, toxic substances, radioactive substances, corrosive substances, and other dangerous goods that clearly require special transportation methods. Of course, it may also include special items based on the actual transportation type or the regulations of the logistics company. For example, lithium batteries are generally prohibited in air transportation scenarios, but are allowed in land transportation scenarios. Therefore, the specific types of inspection for prohibited items can be set based on actual needs, and the embodiments of the present application do not make any relevant restrictions on prohibited items.
[0058] Furthermore, the outer packaging scan image of the target package generally refers to a visible light image obtained by scanning the package surface by a visible light scanning device. Of course, in order to improve the effect of subsequent label recognition, as a feasible embodiment of the present application, the visible light scanning device generally scans the package surface from several directions respectively, thereby obtaining several outer packaging scan images.
[0059] S120, performing image recognition processing on the outer packaging scan image to obtain label classification information corresponding to the outer packaging scan image.
[0060] In the embodiment of the present application, after the outer packaging scan image of the package is obtained by scanning with the visible light scanning device, the package detection device will further perform image recognition processing on the outer packaging scan image to obtain the label classification information corresponding to the outer packaging scan image. Usually, the label classification information generally includes the label classification type, such as "fragile", "keep dry", "corrosive", etc. Of course, the label classification information may further include the confidence of each label classification type. The confidence refers to the possibility of describing the label as a certain label classification type in a probabilistic way. The higher the confidence of a certain label classification type, the more likely the label is that label classification type. Specifically, the label classification information obtained by image recognition processing can usually be realized by a convolutional neural network model pre-trained based on deep learning. Of course, it is also feasible to use other image recognition processing algorithms to process the outer packaging scan image to obtain label classification information. The embodiment of the present application will not be repeated here.
[0061] Furthermore, considering that in the actual detection process, the scanned image of the outer packaging is usually a grayscale image that loses color information, and the label accounts for a small proportion of the overall area of the image, in order to improve the accuracy of the label classification information obtained by the image recognition processing, the embodiment of the present application provides an image recognition processing algorithm that integrates position detection and label classification. The specific implementation scheme can be referred to in the subsequent Figure 5 and its explanatory contents.
[0062] S130, obtaining an internal perspective image of the target package.
[0063] In the embodiments of the present application, the internal perspective image of the target package generally refers to the internal image obtained by scanning the target package based on an X-ray (i.e., X-ray) scanning device. For example, more commonly, when a package passes through a security inspection machine, the internal perspective image of the target package can be acquired by the X-ray scanning device in the security inspection machine, which will not be described in detail in the embodiments of the present application.
[0064] S140: Determine a contraband detection result of the target package according to the label classification information and the internal perspective image.
[0065] After obtaining the internal perspective image of the target package as mentioned above, compared with the prior art that directly uses the internal perspective image to determine the contraband detection result of the target package, the embodiment of the present application will further integrate the outer packaging scan image of the outer surface of the package to comprehensively complete the contraband detection of the target package. For example, as a feasible embodiment of the present application, the contraband detection result corresponding to the internal perspective image can be obtained by performing image detection processing on the internal perspective image, and the contraband detection result of the target package can be further obtained by analyzing the difference between the contraband detection result and the label classification information. The specific implementation scheme can be referred to in the subsequent Figure 2 and its explanatory contents.
[0066] The package detection method provided by the present application takes into account that dangerous goods usually need to have a dangerous goods sign clearly affixed or printed on the surface of the package. Therefore, by obtaining a scanned image of the outer packaging of the package, and then using recognition processing on the scanned image of the outer packaging to obtain the label classification information on the outer packaging of the package, and then using this label classification information and the internal perspective image of the target package to comprehensively determine its contraband detection result. Compared with the existing technology that only uses the internal perspective image to obtain the contraband detection result, the recall rate of the package contraband detection result can be effectively improved, and the contraband detection effect is improved.
[0067] like Figure 2 As shown, Figure 2A schematic flow chart of steps for fusing label classification information and internal perspective images to determine package detection results provided in an embodiment of the present application, specifically, including steps S210 to S240:
[0068] S210, extracting image features corresponding to different levels of the internal perspective image.
[0069] In an embodiment of the present application, after downsampling the internal perspective image to obtain downsampled images corresponding to different levels, feature extraction is performed on each downsampled image based on the trained feature extraction layer to obtain image features corresponding to different levels of the internal perspective image.
[0070] S220: Fusing the image features to obtain fused image features corresponding to the internal perspective image.
[0071] In the embodiment of the present application, after obtaining the image features of different levels corresponding to the internal perspective image as mentioned above, further fusion processing is performed on each image feature to obtain the fused image features corresponding to the internal perspective image.
[0072] S230: Generate object detection information corresponding to the target package based on the fused image features.
[0073] In the embodiment of the present application, since the fused image features include image features of different levels corresponding to the internal perspective image, the object information contained in the internal perspective image can be more accurately determined based on the fused image features, thereby obtaining object detection information corresponding to the target package. Specifically, the object detection information generally includes object coordinates, object category, object confidence, and the like.
[0074] Specifically, to facilitate understanding of the above implementation scheme, specifically, Figure 2 As shown in (a), Figure 2 (a) is a schematic diagram of processing an internal perspective image to obtain object detection information provided by an embodiment of the present application, which is described in detail as follows.
[0075] The feature extraction module is mainly used for feature extraction and fusion processing of internal perspective images. C2, C3, C4, and C5 correspond to image features at different levels, while P2, P3, P4, and P5 are fused image features obtained by fusing image features at different levels. The output module is mainly used to further generate object detection information corresponding to the target package based on the obtained fused image features.
[0076] S240: Determine a contraband detection result of the target package based on the tag classification information and the object detection information.
[0077] In the embodiment of the present application, after obtaining the label classification information and the object detection information, the contraband detection result of the target package can be further determined based on the difference between the label classification information and the object detection information. Of course, in order to improve the accuracy of the contraband detection result, as a feasible embodiment of the present application, a scheme for obtaining the contraband detection result of the target package based on the confidence in the label classification information and the confidence in the object detection information is provided. For details, please refer to the subsequent Figure 3 and its explanatory contents.
[0078] like Figure 3 As shown, Figure 3 A schematic flow chart of steps for determining a package detection result based on label classification and confidence of object detection provided in an embodiment of the present application, specifically, including steps S310 to S320:
[0079] S310, querying a preset data table to obtain a confidence threshold associated with the target tag classification confidence in the tag classification information.
[0080] In the embodiment of the present application, combined with the above-mentioned related description, it can be known that the label classification information generally includes not only the label classification type, but also the confidence corresponding to each label classification type, wherein the target label classification confidence refers to the confidence describing the possibility that the label may be a dangerous goods label type. Specifically, the higher the target label classification confidence, the more likely it is that there are contraband in the package. At this time, a lower confidence threshold can be provided for subsequent object detection to facilitate the detection of contraband in the package. In other words, in the data table, the target label classification confidence and the confidence threshold are usually negatively correlated, that is, the higher the target label classification confidence, the lower the confidence threshold.
[0081] Of course, the relationship between the target label classification confidence and the confidence threshold can be set based on actual conditions. For example, as a feasible embodiment of the present application, the relationship between the target label classification confidence and the confidence threshold can be set based on the label type in the label classification information, that is, corresponding to different label types, the association relationship between the target label classification confidence and the confidence threshold corresponding to the label type is stored in different data tables. For specific implementation schemes, please refer to the subsequent Figure 4 and its explanatory contents.
[0082] S320: Determine a contraband detection result of the target package based on a relationship between the target object confidence in the object detection information and the confidence threshold.
[0083] In the embodiments of the present application, the target object confidence generally refers to the confidence of the detected dangerous goods. After determining the appropriate confidence threshold based on the target label classification confidence, the target object confidence in the object detection information is compared with the confidence threshold to determine the accuracy of the contraband detection result of the target package. For example, when the target object confidence in the object detection information describing the possibility that the object is a dangerous object is higher than the confidence threshold, it indicates that the object is more likely to be a contraband. At this time, the contraband detection result of the target package is that contraband exists and needs to be intercepted. On the contrary, when the target object confidence in the object detection information describing the possibility that the object is a dangerous object is higher than the confidence threshold, it indicates that the object is more likely not to be a contraband and no subsequent interception process is required.
[0084] like Figure 4 As shown, Figure 4 A schematic flow chart of a step of obtaining a confidence threshold provided in an embodiment of the present application, specifically, comprising steps S410 to S420:
[0085] S410: extracting tag types from the tag classification information.
[0086] In the embodiment of the present application, combined with the above-mentioned related description, it can be known that the label classification information also includes the label type, for example, corrosive items, explosive items, etc. For these different label types, since the possibility of misjudgment is different, different associations between target label classification confidence and confidence threshold can be set for different label types, as described in the subsequent step S420.
[0087] S420, querying a data table corresponding to the tag type, and obtaining a confidence threshold associated with the target tag classification confidence in the tag classification information.
[0088] In an embodiment of the present application, different tag types correspond to different data tables, and different data tables store different correlations between target tag classification confidences and confidence thresholds. For example, for tag types with higher misjudgment rates, when corresponding to the same target tag classification confidence, the confidence threshold can be set relatively lower, and for tag types with lower misjudgment rates, when corresponding to the same target tag classification confidence, the confidence threshold can be set relatively higher. The above method can further improve the accuracy of contraband detection results of subsequent target packages.
[0089] like Figure 5 As shown, Figure 5 A schematic flow chart of a step of performing image recognition processing to obtain label classification information provided in an embodiment of the present application, specifically, comprising steps S510 to S530:
[0090] S510: Process the outer packaging scan image based on a preset label detection algorithm to obtain label position information corresponding to the outer packaging scan image.
[0091] In the embodiment of the present application, the label detection algorithm can identify the location information of the label identification by processing the outer packaging scan image. Specifically, the label detection algorithm can be implemented using the relatively common lightweight target detection model yolov5n. Of course, it is also feasible to use other label detection algorithms that can identify labels with regular shapes in the outer packaging scan image to obtain the label location information. The embodiments of the present application will not be repeated here.
[0092] S520: Extract a target area image in the outer packaging scan image based on the label position information.
[0093] On the basis of the foregoing, taking into account that the label occupies a relatively low proportion of the image area, which will affect the subsequent label classification results, an embodiment of the present application provides a method for cropping the outer packaging scanned image according to the label position information, thereby obtaining a target area image containing the label for subsequent detection processing.
[0094] S530, classifying the target area image based on a preset label classification algorithm to obtain label classification information corresponding to the outer packaging scan image.
[0095] In the embodiment of the present application, since the label area of the target area image accounts for a higher proportion of the area in the image than the outer packaging scan image, when the label classification algorithm is used to classify the target area image, the interference of interference information from other areas in the outer packaging scan image on the label classification result can be ignored, thereby obtaining more accurate label classification information. Specifically, as an optional embodiment of the present application, the label classification algorithm can be implemented using the MoCoVit (Mobile Convolutional Vision Transformer) algorithm model. Compared with other label classification algorithms, the MoCoVit algorithm model uses a lightweight attention module and a feedforward network layer to effectively reduce the computational complexity of the model while ensuring the output accuracy, thereby improving the efficiency of package detection in logistics scenarios to improve logistics efficiency.
[0096] Furthermore, considering that the target area image obtained by cropping the outer packaging scanned image often loses part of the image information, in order to ensure the effect of the obtained target area image when used for subsequent classification processing, as a feasible embodiment of the present application, a scheme for enhancing the target area image containing the label is proposed. For details, please refer to the subsequent Figure 6and its explanatory contents.
[0097] like Figure 6 As shown, Figure 6 A schematic flow chart of a step of performing enhancement preprocessing on a regional image provided in an embodiment of the present application, specifically, comprising steps S610 to S630:
[0098] S610, filtering the target area image to obtain a denoised area image.
[0099] In the embodiment of the present application, by performing Gaussian filtering on the target area image, noise information in the target area image can be effectively removed, thereby obtaining a denoised area image.
[0100] S620, performing edge enhancement processing on the denoised region image to obtain an enhanced region image.
[0101] In the embodiment of the present application, on the basis of the denoised region image obtained above, by further performing edge enhancement processing on the denoised region image, the edge lines in the label can be effectively enhanced, thereby ensuring the subsequent label classification results. Specifically, the edge enhancement processing can use the HED (holistically-nested edge detection) algorithm to complete the edge detection and enhancement processing, thereby obtaining an enhanced region image.
[0102] S630: Classify the enhanced region image based on a preset label classification algorithm to obtain label classification information corresponding to the outer packaging scan image.
[0103] In an embodiment of the present application, compared with the conventional target area image, the enhanced area image enhances the edge information in the image, which can better reflect the edge information in the label, so that when the enhanced area image is classified using the label classification algorithm, more accurate label classification information can be obtained.
[0104] To facilitate understanding of the complete implementation of the package detection method provided in the embodiment of the present application, the following will be combined with the aforementioned Figure 1 to Figure 6 The content provided gives a complete implementation process of a package detection method, which specifically includes the following steps:
[0105] 1) Scanning the outer surface of the package from six directions respectively by a preset six-side image scanning device to obtain an outer packaging scan image;
[0106] 2) Use the yolox5n algorithm to detect labels on the outer packaging scanned image and obtain label position information;
[0107] 3) cropping the outer packaging scanned image based on the label position information to obtain an image of the target area containing the label;
[0108] 4) De-noising the target area image based on the Gaussian filtering algorithm to obtain a de-noised area image;
[0109] 5) Perform edge detection and edge enhancement processing on the denoised area image based on the HED edge detection algorithm to obtain an enhanced area image;
[0110] 6) Input the enhanced region image into the pre-built label classification algorithm model based on the enhanced region image architecture to obtain the label classification information corresponding to the outer packaging scan image, which includes the label type corresponding to the outer packaging scan image and the confidence of the corresponding label type; if it includes the target label classification related to contraband and the target label classification confidence, then execute the subsequent steps;
[0111] 7) Obtain the corresponding data table based on the label type of the target label classification, and then query the data table to obtain the confidence threshold associated with the target label classification confidence;
[0112] 8) Obtaining an internal perspective image of the package through an X-ray scanning device;
[0113] 9) extracting image features of different levels corresponding to the internal perspective image, and then fusing the image features of different levels to obtain fused image features;
[0114] 10) Based on the fused image features, complete object detection is performed using the trained model to obtain object detection information, including the object type and its corresponding confidence level;
[0115] 11) If the confidence level corresponding to the prohibited items in the object detection information is higher than the confidence threshold obtained above, the prohibited items detection result of the target package is determined to be the presence of prohibited items; if the confidence level corresponding to the prohibited items in the object detection information is lower than the confidence threshold obtained above, the prohibited items detection result of the target package is determined to be the absence of prohibited items.
[0116] In order to better implement the package detection method provided in the embodiment of the present application, based on the package detection method, the embodiment of the present application also provides a package detection device. Figure 7 As shown, Figure 7 A schematic diagram of the structure of a package detection device provided in an embodiment of the present application. Specifically, the package detection device includes:
[0117] The first acquisition module 710 is used to acquire a scanned image of an outer package of a target package to be detected;
[0118] The recognition module 720 is used to perform image recognition processing on the outer packaging scan image to obtain label classification information corresponding to the outer packaging scan image;
[0119] A second acquisition module 730 is used to acquire an internal perspective image of the target package;
[0120] The detection module 740 is used to determine the contraband detection result of the target package according to the label classification information and the internal perspective image.
[0121] As a feasible embodiment of the present application, the detection module 740 is also used to extract image features of different levels corresponding to the internal perspective image; fuse the image features to obtain fused image features corresponding to the internal perspective image; generate object detection information corresponding to the target package based on the fused image features; and determine the contraband detection result of the target package based on the label classification information and the object detection information.
[0122] As a feasible embodiment of the present application, the detection module 740 is also used to query a preset data table to obtain a confidence threshold associated with the target label classification confidence in the label classification information; based on the relationship between the target object confidence in the object detection information and the confidence threshold, determine the contraband detection result of the target package.
[0123] As a feasible embodiment of the present application, the detection module 740 is also used to extract the label type in the label classification information; query the data table corresponding to the label type, and obtain the confidence threshold associated with the target label classification confidence in the label classification information.
[0124] As a feasible embodiment of the present application, the identification module 720 is also used to process the outer packaging scan image based on a preset label detection algorithm to obtain label position information corresponding to the outer packaging scan image; extract the target area image in the outer packaging scan image based on the label position information; classify the target area image based on a preset label classification algorithm to obtain the corresponding label classification information on the outer packaging scan image.
[0125] As a feasible embodiment of the present application, the recognition module 720 is also used to filter the target area image to obtain a denoised area image; perform edge enhancement processing on the denoised area image to obtain an enhanced area image; perform classification processing on the enhanced area image based on a preset label classification algorithm to obtain the corresponding label classification information on the outer packaging scan image.
[0126] As a feasible embodiment of the present application, the first acquisition module 710 is also used to acquire a scanning image of the outer packaging of the target package to be detected through a preset visible light scanning device; the second acquisition module 730 is also used to acquire an internal perspective image of the target package through a preset X-ray scanning device.
[0127] For the specific definition of the package detection device, please refer to the definition of the package detection method above, which will not be repeated here. Each module in the above package detection device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules. Specifically, Figure 8 As shown, Figure 8 A schematic diagram of the structure of a computer device provided in an embodiment of the present application.
[0128] Specifically, the computer device may include one or more processing cores of the processor 801, one or more storage media of the memory 802, a power supply 803 and an input unit 804. Those skilled in the art will understand that Figure 8 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:
[0129] The processor 801 is the control center of the computer device. It uses various interfaces and lines to connect various parts of the entire computer device. By running or executing software programs and / or modules stored in the memory 802 and calling data stored in the memory 802, it executes various functions of the computer device and processes data, thereby monitoring the computer device as a whole. Optionally, the processor 801 may include one or more processing cores; preferably, the processor 801 may integrate a package detector and a modem processor, wherein the package detector mainly processes the operating system, user interface and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 801.
[0130] The memory 802 can be used to store software programs and modules. The processor 801 executes various functional applications and data processing by running the software programs and modules stored in the memory 802. The memory 802 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 802 may also include a memory controller to provide the processor 801 with access to the memory 802.
[0131] The computer device also includes a power supply 803 for supplying power to each component. Preferably, the power supply 803 can be logically connected to the processor 801 through a power management system, so that the power management system can manage charging, discharging, power consumption and other functions. The power supply 803 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.
[0132] The computer device may further include an input unit 804, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0133] Although not shown, the computer device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 801 in the computer device will load the executable files corresponding to the processes of one or more application programs into the memory 802 according to the following instructions, and the processor 801 will run the application programs stored in the memory 802, thereby executing the following steps:
[0134] Obtain a scanned image of the outer packaging of the target package to be detected;
[0135] Performing image recognition processing on the outer packaging scanned image to obtain label classification information corresponding to the outer packaging scanned image;
[0136] Acquire an internal perspective image of the target package;
[0137] The contraband detection result of the target package is determined according to the label classification information and the internal perspective image.
[0138] Furthermore, when the processor runs the application stored in the memory, the following steps may be performed: extracting image features of different levels corresponding to the internal perspective image; fusing the image features to obtain fused image features corresponding to the internal perspective image; generating object detection information corresponding to the target package based on the fused image features; and determining the contraband detection result of the target package based on the label classification information and the object detection information.
[0139] Furthermore, when the processor runs an application stored in the memory, the following steps may be performed: querying a preset data table to obtain a confidence threshold associated with the target label classification confidence in the label classification information; and determining a contraband detection result of the target package based on a relationship between the target object confidence in the object detection information and the confidence threshold.
[0140] Furthermore, when the processor runs an application stored in the memory, the following steps may also be performed: extracting the label type in the label classification information; querying the data table corresponding to the label type, and obtaining a confidence threshold associated with the target label classification confidence in the label classification information.
[0141] Furthermore, when the processor runs an application stored in the memory, the following steps may be performed: processing the outer packaging scan image based on a preset label detection algorithm to obtain label position information corresponding to the outer packaging scan image; extracting the target area image in the outer packaging scan image based on the label position information; classifying the target area image based on a preset label classification algorithm to obtain the corresponding label classification information on the outer packaging scan image.
[0142] Furthermore, when the processor runs the application stored in the memory, the following steps can also be executed: filtering the target area image to obtain a denoised area image; performing edge enhancement processing on the denoised area image to obtain an enhanced area image; classifying the enhanced area image based on a preset label classification algorithm to obtain the corresponding label classification information on the outer packaging scan image.
[0143] Furthermore, when the processor runs the application stored in the memory, the following steps may also be performed: obtaining a scanning image of the outer packaging of the target package to be inspected through a preset visible light scanning device; and obtaining an internal perspective image of the target package through a preset X-ray scanning device.
[0144] To this end, an embodiment of the present application provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the following steps are implemented:
[0145] Obtain a scanned image of the outer packaging of the target package to be detected;
[0146] Performing image recognition processing on the outer packaging scanned image to obtain label classification information corresponding to the outer packaging scanned image;
[0147] Acquire an internal perspective image of the target package;
[0148] The contraband detection result of the target package is determined according to the label classification information and the internal perspective image.
[0149] Furthermore, when the computer program is processed and executed, the following steps can also be implemented: extracting image features of different levels corresponding to the internal perspective image; fusing the image features to obtain fused image features corresponding to the internal perspective image; generating object detection information corresponding to the target package based on the fused image features; and determining the contraband detection result of the target package based on the label classification information and the object detection information.
[0150] Furthermore, when the computer program is processed and executed, the following steps can also be implemented: querying a preset data table to obtain a confidence threshold associated with the target label classification confidence in the label classification information; based on the relationship between the target object confidence in the object detection information and the confidence threshold, determining the contraband detection result of the target package.
[0151] Furthermore, when the computer program is processed and executed, the following steps can also be implemented: extracting the label type in the label classification information; querying the data table corresponding to the label type, and obtaining the confidence threshold associated with the target label classification confidence in the label classification information.
[0152] Furthermore, when the computer program is processed and executed, the following steps can also be implemented: processing the outer packaging scan image based on a preset label detection algorithm to obtain label position information corresponding to the outer packaging scan image; extracting the target area image in the outer packaging scan image based on the label position information; classifying the target area image based on a preset label classification algorithm to obtain the corresponding label classification information on the outer packaging scan image.
[0153] Furthermore, when the computer program is processed and executed, the following steps can also be implemented: filtering the target area image to obtain a denoised area image; performing edge enhancement processing on the denoised area image to obtain an enhanced area image; classifying the enhanced area image based on a preset label classification algorithm to obtain the corresponding label classification information on the outer packaging scan image.
[0154] Furthermore, when the computer program is processed and executed, the following steps can also be implemented: obtaining a scanning image of the outer packaging of the target package to be inspected through a preset visible light scanning device; and obtaining an internal perspective image of the target package through a preset X-ray scanning device.
[0155] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the detailed description of other embodiments above, and will not be repeated here.
[0156] In specific implementation, the above units or structures can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units or structures can refer to the previous method embodiments, which will not be repeated here.
[0157] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0158] The above is a detailed introduction to a package detection method provided in an embodiment of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A package detection method, characterized in that: include Obtain a scanned image of the outer packaging of the target package to be detected; Performing image recognition processing on the outer packaging scanned image to obtain label classification information corresponding to the outer packaging scanned image; Acquire an internal perspective image of the target package; The contraband detection result of the target package is determined according to the label classification information and the internal perspective image.
2. The package detection method according to claim 1, characterized in that: The step of determining the contraband detection result of the target package according to the label classification information and the internal perspective image includes: Extracting image features corresponding to different levels of the internal perspective image; fusing the image features to obtain fused image features corresponding to the internal perspective image; Generating object detection information corresponding to the target package based on the fused image features; Based on the tag classification information and the object detection information, a contraband detection result of the target package is determined.
3. The package detection method according to claim 2, characterized in that: The determining of the contraband detection result of the target package based on the label classification information and the object detection information includes: Querying a preset data table to obtain a confidence threshold associated with the target label classification confidence in the label classification information; Based on the relationship between the target object confidence in the object detection information and the confidence threshold, a contraband detection result of the target package is determined.
4. The package detection method according to claim 3, characterized in that: The querying of the preset data table to obtain the confidence threshold associated with the target label classification confidence in the label classification information includes: Extracting the tag type from the tag classification information; A data table corresponding to the tag type is queried to obtain a confidence threshold associated with the target tag classification confidence in the tag classification information.
5. The package detection method according to claim 1, characterized in that: The performing image recognition processing on the outer packaging scanned image to obtain label classification information corresponding to the outer packaging scanned image includes: Processing the outer packaging scan image based on a preset label detection algorithm to obtain label position information corresponding to the outer packaging scan image; Extracting a target area image in the outer packaging scan image based on the label position information; The target area image is classified based on a preset label classification algorithm to obtain label classification information corresponding to the outer packaging scan image.
6. The package detection method according to claim 5, characterized in that: Before classifying the target area image based on a preset label classification algorithm to obtain label classification information corresponding to the outer packaging scan image, the method further includes: Performing filtering processing on the target area image to obtain a denoised area image; Performing edge enhancement processing on the denoised area image to obtain an enhanced area image; The classifying process of the target area image based on a preset label classification algorithm to obtain label classification information corresponding to the outer packaging scan image includes: The enhanced region image is classified based on a preset label classification algorithm to obtain label classification information corresponding to the outer packaging scan image.
7. The package detection method according to any one of claims 1 to 6, characterized in that: The step of obtaining a scanned image of an outer package of a target package to be detected includes: Obtaining a scanned image of the outer packaging of the target package to be inspected through a preset visible light scanning device; The step of acquiring the internal perspective image of the target package includes: The internal perspective image of the target package is obtained by a preset X-ray scanning device.
8. A package detection device, characterized in that: include A first acquisition module is used to acquire a scanned image of an outer packaging of a target package to be detected; A recognition module, used to perform image recognition processing on the outer packaging scan image to obtain label classification information corresponding to the outer packaging scan image; A second acquisition module, used to acquire an internal perspective image of the target package; A detection module is used to determine a contraband detection result of the target package according to the label classification information and the internal perspective image.
9. A computer device, characterized in that: The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the package detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the package detection method according to any one of claims 1 to 7.