Image detection method, device and storage medium

Through the combination of target decomposition network and target number prediction network, the accuracy problem of overlapping target detection in X-ray security inspection images is solved, and the accuracy and efficiency of target detection are improved.

CN118351490BActive Publication Date: 2024-09-17ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410772882.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-09-17
Estimated Expiration
2044-06-17

AI Technical Summary

Technical Problem

It is difficult to accurately detect and distinguish overlapping target items in X-ray security inspection images with existing technology, leading to problems of target misdetection and missed detection.

Method used

Using the image detection method, the image to be detected is decomposed into foreground and background images through the target decomposition network, and the target number prediction network is used to determine the number of overlapping foreground targets based on the hierarchical target image. If the number of overlapping targets is less than or equal to 1, it is determined to be detected. Result image.

Benefits of technology

It improves the accuracy of target detection in X-ray security inspection images, solves the problem of distinguishing overlapping targets, and enhances the efficiency and accuracy of the security inspection process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118351490B
    Figure CN118351490B
Patent Text Reader

Abstract

The present application relates to an image detection method, device and storage medium, wherein the image detection method comprises: obtaining an image to be detected, inputting the image to be detected into a target decomposition network to obtain a hierarchical target image output by the target decomposition network, wherein the hierarchical target image comprises a foreground image and a background image decomposed from the image to be detected, inputting the hierarchical target image into a target number prediction network to obtain a target number prediction map output by the target number prediction network, and determining the number of overlapping foreground targets in the hierarchical target image according to the target number prediction map, and determining the hierarchical target image as a detection result image when the number of overlapping foreground targets is less than or equal to 1. Through the present application, the problem of how to detect and distinguish overlapping targets in an image in the related art is solved, and the accuracy of target detection in the image to be detected is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to an image detection method, device and storage medium. Background Art

[0002] With the increasing demand for travel in modern life, security checks are often required for various places and items in more and more scenarios. For example, in airports, railway stations, subway stations, large event venues, etc., it is often necessary to conduct security checks on the luggage and parcels carried. The security inspection workload in these places is huge, and it requires high efficiency and accuracy, which will generate a large number of X-ray security inspection images that need to be processed. Target detection for X-ray security inspection images is an important research technology in the current security inspection field. It accurately identifies various potential threat items and targets by analyzing X-ray security inspection images. However, multiple item targets in luggage and parcels are often highly overlapped, thus blocking each other, which can easily cause problems of target misdetection and missed detection. Therefore, an image detection method is needed to accurately detect and distinguish overlapping targets in X-ray security inspection images.

[0003] Currently, no effective solution has been proposed for the problem of how to detect and distinguish overlapping objects in images in related technologies. Summary of the invention

[0004] The embodiments of the present application provide an image detection method, device, and storage medium to at least solve the problem of how to accurately detect and distinguish overlapping objects in an image in the related art.

[0005] In a first aspect, an embodiment of the present application provides an image detection method.

[0006] In some embodiments, the image detection method includes:

[0007] Executing a step of acquiring an image to be detected, wherein the step of acquiring an image to be detected comprises acquiring an image to be detected;

[0008] Inputting the image to be detected into a target decomposition network to obtain a hierarchical target image output by the target decomposition network, wherein the hierarchical target image includes a foreground image and a background image decomposed from the image to be detected;

[0009] Inputting the hierarchical target image into a target number prediction network to obtain a target number prediction map output by the target number prediction network, and determining the number of overlapping foreground targets in the hierarchical target image according to the target number prediction map;

[0010] When the number of overlapping foreground objects is less than or equal to 1, the layered object image is determined as the detection result image.

[0011] In some embodiments, the method further comprises:

[0012] When the number of overlapping foreground objects is greater than 1, the layered object image is determined as the current image to be detected, and the process proceeds to the step of acquiring the image to be detected.

[0013] In some of these embodiments, the target decomposition network includes a decomposition convolutional layer and a decomposition dense network block;

[0014] The step of inputting the image to be detected into the target decomposition network to obtain a hierarchical target image output by the target decomposition network comprises:

[0015] The image to be detected is sequentially input into the decomposed convolutional layer and the decomposed dense network block to obtain the output hierarchical target image.

[0016] In some of these embodiments, the target number prediction network includes a feature extraction module and an attention module;

[0017] The step of inputting the hierarchical target image into a target number prediction network to obtain a target number prediction map output by the target number prediction network, and determining the number of overlapping foreground targets in the hierarchical target image according to the target number prediction map comprises:

[0018] Inputting the hierarchical target image into a feature extraction module and an attention module in sequence to obtain the output target number prediction map;

[0019] The number of overlapping foreground objects in the layered object image is determined according to the pixel value of each pixel in the object number prediction map.

[0020] In some embodiments, before inputting the image to be detected into the target decomposition network to obtain the hierarchical target image output by the target decomposition network, the method further includes:

[0021] Obtaining a training target image and a training background image;

[0022] Determining a training overlapping image according to the training target image and the training background image;

[0023] The target decomposition network is trained based on the training target image, the training background image and the training overlapping image.

[0024] In some of the embodiments, before inputting the hierarchical target image into the target number prediction network to obtain the target number prediction map output by the target number prediction network, and determining the number of overlapping foreground targets in the hierarchical target image according to the target number prediction map, the method further includes:

[0025] Calculating the number of overlapping objects at each pixel in the training overlapping image;

[0026] Determine the number of overlapping objects as pixel values ​​of corresponding pixels in the training overlapping image to determine the object number training image;

[0027] The target number prediction network is trained based on the training overlapping images and the target number training graph.

[0028] In a second aspect, an embodiment of the present application provides an X-ray security inspection image detection method.

[0029] In some embodiments, the X-ray security inspection image detection method includes:

[0030] Acquire an X-ray security inspection image to be detected; wherein the X-ray security inspection image to be detected includes a target object to be inspected;

[0031] Inputting the to-be-detected X-ray security inspection image into a target decomposition network to obtain an X-ray foreground image and an X-ray background image decomposed from the to-be-detected X-ray security inspection image; wherein the X-ray foreground image includes a first target object among the target objects, and the X-ray background image does not include the first target object;

[0032] Inputting the X-ray foreground image into a target number prediction network to obtain a first target number prediction map output by the target number prediction network, and determining the first number of overlapping foreground targets in the X-ray foreground image according to the first target number prediction map;

[0033] Inputting the X-ray background image into the target number prediction network to obtain a second target number prediction map output by the target number prediction network, and determining the number of second overlapping foreground targets in the X-ray background image according to the second target number prediction map;

[0034] When the number of the first overlapping foreground objects is less than or equal to 1, determining the corresponding X-ray foreground image as a first detection result image;

[0035] When the number of the second overlapping foreground objects is less than or equal to 1, the corresponding X-ray background image is determined as the second detection result image.

[0036] In some of the embodiments, the X-ray security inspection image to be detected is a color image with a size greater than or equal to 700 pixels and less than or equal to 1200 pixels;

[0037] The sizes of the X-ray foreground image, the X-ray background image and the X-ray security inspection image to be detected are the same.

[0038] In a third aspect, an embodiment of the present application provides an image detection device.

[0039] In some embodiments, the image detection device includes a module for acquiring an image to be detected, a module for acquiring a layered target image, a module for determining the number of overlapping foreground targets, and a module for determining a detection result image:

[0040] The image acquisition module to be detected is used to execute the image acquisition step to be detected, and the image acquisition step to be detected includes acquiring the image to be detected;

[0041] The layered target image acquisition module is used to input the image to be detected into the target decomposition network to obtain the layered target image output by the target decomposition network, wherein the layered target image includes a foreground image and a background image decomposed from the image to be detected;

[0042] The overlapping foreground object number determination module is used to input the hierarchical object image into the object number prediction network to obtain the object number prediction map output by the object number prediction network, and determine the number of overlapping foreground objects in the hierarchical object image according to the object number prediction map;

[0043] The detection result image determination module is used to determine the layered target image as the detection result image when the number of overlapping foreground targets is less than or equal to 1.

[0044] In a fourth aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the image detection method described in the first aspect and the X-ray security inspection image detection method described in the second aspect.

[0045] Compared with the related art, the image detection method, device and storage medium provided in the embodiments of the present application obtain an image to be detected and input the image to be detected into a target decomposition network to obtain a layered target image output by the target decomposition network, wherein the layered target image includes a foreground image and a background image decomposed from the image to be detected; further, the layered target image is input into a target number prediction network to obtain a target number prediction map output by the target number prediction network, and the number of overlapping foreground targets in the layered target image is determined according to the target number prediction map; when the number of overlapping foreground targets is less than or equal to 1, the layered target image is determined as the detection result image, which solves the problem of how to detect and distinguish overlapping targets in an image in the related art and improves the accuracy of target detection in the image to be detected.

[0046] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0048] Figure 1 is a hardware structure block diagram of a terminal according to an image detection method of an embodiment of the present application;

[0049] Figure 2 is a flow chart of an image detection method according to an embodiment of the present application;

[0050] Figure 3 is a flow chart of another image detection method according to an embodiment of the present application;

[0051] Figure 4 is a flow chart of an image detection method according to a preferred embodiment of the present application;

[0052] Figure 5 is a flow chart of an X-ray security inspection image detection method according to an embodiment of the present application;

[0053] Figure 6 It is a structural block diagram of an image detection device according to an embodiment of the present application. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application. In addition, it can also be understood that although the efforts made in this development process may be complex and lengthy, for ordinary technicians in the field related to the contents disclosed in the present application, some changes such as design, manufacturing or production based on the technical contents disclosed in the present application are only conventional technical means, and should not be understood as insufficient contents disclosed in the present application.

[0055] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0056] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantity limitation, and may indicate the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application means greater than or equal to two. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. The terms "first", "second", "third" and the like involved in the present application are merely used to distinguish similar objects and do not represent a specific ordering of the objects.

[0057] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. Taking running on a terminal as an example, Figure 1 FIG. 1 is a hardware structure diagram of a terminal of an image detection method according to an embodiment of the present invention. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0058] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the image detection method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0059] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.

[0060] This embodiment provides an image detection method. Figure 2 is a flow chart of an image detection method according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:

[0061] Step S201, obtaining an image to be detected.

[0062] The image to be detected may be an X-ray security inspection image collected by an X-ray security inspection machine during security inspection. Furthermore, the X-ray security inspection image may include multiple overlapping objects that block each other. For ease of understanding, in subsequent embodiments, the image to be detected may also be expressed as an X-ray overlapping image, and the two are in a unified relationship.

[0063] Step S202, inputting the image to be detected into the target decomposition network to obtain a hierarchical target image output by the target decomposition network, wherein the hierarchical target image includes a foreground image and a background image decomposed from the image to be detected.

[0064] Furthermore, the acquired X-ray overlapping image is input into the target decomposition network to obtain a hierarchical target image output by the target decomposition network. In an embodiment of the present application, the target decomposition network is a deep learning network obtained through training, which can be used to decompose the image input therein into two hierarchical target images including a foreground image and a background image. The foreground image can be an image formed by extracting the first target from the X-ray overlapping image, and the background image can be an image formed by removing the first target from the X-ray overlapping image, and the first target can include one or more targets.

[0065] Step S203, inputting the hierarchical target image into the target number prediction network to obtain a target number prediction map output by the target number prediction network, and determining the number of overlapping foreground targets in the hierarchical target image according to the target number prediction map.

[0066] The acquired hierarchical target images are respectively input into the target number prediction network to obtain a target number prediction map output by the target number prediction network. In the embodiment of the present application, the target number prediction network is a deep learning network obtained through training, which can be used to judge the number of overlapping targets in the input image. Specifically, the target number prediction network includes a feature extraction module and an attention module. The hierarchical target image obtains features through the feature extraction module, and then through the attention module, the feature information acquisition capability is enhanced, and finally a target number prediction map with the same width and height as the input hierarchical target image is output. The pixel value of each pixel in the target number prediction map represents the number of targets corresponding to the pixel coordinates. Therefore, according to the target number prediction map, the embodiment of the present application can determine the number of overlapping foreground targets in the hierarchical target image.

[0067] Step S204: when the number of overlapping foreground objects is less than or equal to 1, the layered object image is determined as the detection result image.

[0068] When the number of overlapping foreground targets is less than or equal to 1, it means that there are no overlapping targets in the corresponding layered target image, that is, all overlapping targets in the X-ray overlapping image have been decomposed. Therefore, the layered target image is determined as the detection result image, indicating that all targets in the X-ray overlapping image have been accurately detected and distinguished.

[0069] Through the above steps, the embodiment of the present application obtains the image to be detected, and inputs the image to be detected into the target decomposition network, the target decomposition network decomposes the image to be detected, and outputs a layered target image, wherein the layered target image includes a foreground image and a background image decomposed from the image to be detected; the decomposed foreground image and background image are then respectively input into the target number prediction network to obtain a target number prediction map output by the target number prediction network, the target number prediction map is used to determine the number of overlapping foreground targets in the layered target image; when the number of overlapping foreground targets is less than or equal to 1, it indicates that there is no target or only one target in the corresponding layered target image, thereby completing the distinction of overlapping targets in the image, and therefore determining the layered target image as the detection result image. The embodiment of the present application solves the problem of how to accurately detect and distinguish overlapping targets in an image, and improves the accuracy of target detection in X-ray security inspection images.

[0070] This embodiment also provides an image detection method. Figure 3 is a flow chart of another image detection method according to an embodiment of the present application, such as Figure 3 As shown, based on steps S201, S202, S203 and S204, the process further includes the following steps:

[0071] Step S301, when the number of overlapping foreground objects is greater than 1, the layered object image is determined as the current image to be detected, and the process goes to step S201.

[0072] When the number of overlapping foreground targets is greater than 1, it means that there are still overlapping targets in the corresponding layered target image. Therefore, it is necessary to determine the layered target image as the current image to be detected and continue to input the target decomposition network for decomposition until the number of overlapping foreground targets in the decomposed image is less than or equal to 1 as judged by the target number prediction network.

[0073] Through the above steps, when the number of overlapping foreground targets output by the target number prediction network is greater than 1, the embodiment of the present application determines that there are multiple targets in the corresponding layered target image, then the layered target image is determined as the current image to be detected, and the target decomposition network is cyclically input to further decompose the overlapping targets in the image, thereby improving the accuracy and efficiency of detecting and distinguishing overlapping targets.

[0074] In some embodiments, the target decomposition network includes decomposing convolutional layers and decomposing dense network blocks; step S202 includes:

[0075] Step S2021, input the image to be detected into the decomposition convolution layer and the decomposition dense network block in sequence to obtain an output hierarchical target image.

[0076] After the X-ray overlapping images are processed by the decomposition convolution layer and the decomposition dense network block in sequence, a first preprocessed image and a second preprocessed image are obtained. The first preprocessed image is input into the first reconstruction branch network to obtain a foreground image output by the first reconstruction branch network, and the first reconstruction branch network includes a first convolution layer and a first dense network block; the second preprocessed image is input into the second reconstruction branch network to obtain a background image output by the second reconstruction branch network, and the second reconstruction branch network includes a second convolution layer and a second dense network block.

[0077] Through the above steps, the embodiment of the present application sequentially inputs the image to be detected into the decomposition convolution layer and the decomposition dense network block to obtain an output hierarchical target image, accurately and efficiently decomposing overlapping targets, wherein the hierarchical target image includes a foreground image and a background image.

[0078] In some of these embodiments, the target number prediction network includes a feature extraction module and an attention module;

[0079] Step S203 includes:

[0080] Step S2031, inputting the hierarchical target image into the feature extraction module and the attention module in sequence to obtain an output target number prediction map;

[0081] In the embodiment of the present application, the target number prediction network is a deep learning network obtained through training, which can be used to judge the number of overlapping targets in the input image. Specifically, the target number prediction network includes a feature extraction module and an attention module. The layered target image obtains features through the feature extraction module, and then through the attention module to enhance the feature information acquisition capability, and finally outputs the target number prediction map.

[0082] Step S2032, determining the number of overlapping foreground objects in the layered object image according to the pixel value of each pixel in the object number prediction map.

[0083] The pixel value of each pixel in the target number prediction map represents the number of targets corresponding to the pixel coordinates. Therefore, according to the target number prediction map, the embodiment of the present application can determine the number of overlapping foreground targets in the layered target image. It is worth mentioning that the target number prediction map output by the target number prediction network has the same width and height as the input layered target image, that is, the same size.

[0084] Through the above steps, the embodiment of the present application is based on the feature extraction module and the attention module included in the target number prediction network, so that the layered target image obtains features through the feature extraction module, and then through the attention module, the feature information acquisition capability is enhanced, and finally the number of overlapping foreground targets in the layered target image is accurately and efficiently determined.

[0085] In some embodiments, before step S202, the method further includes:

[0086] Step S212, obtaining a training target image and a training background image.

[0087] The training target image may be a prohibited item target image in a known database, and the training background image may be a package background image in a known database.

[0088] Step S222: determining a training overlapping image according to the training target image and the training background image.

[0089] Specifically, based on the principle of Threat Image Projection (TIP) of X-ray images, the following X-ray image fusion algorithm formula can be used to fuse the training target image f and the training background image b to obtain the training overlapping image fb.

[0090] (1)

[0091] (2)

[0092] From formulas (1) and (2), we can get

[0093] (3)

[0094] Where I0 is the initial image value before X-ray incidence, h f , μ b and h b are the attenuation coefficient and thickness of the training target image f and the training background image b respectively, w1 and w2 are preset parameters, which are set to 0.5 in the embodiment of the present application.

[0095] Step S232, training a target decomposition network according to the training target image, the training background image and the training overlapping image.

[0096] In the embodiment of the present application, a target decomposition network is trained based on a training target image, a training background image, and a training overlapping image.

[0097] Through the above steps, the embodiment of the present application obtains a training overlapping image by fusing the training target image and the training background image, and trains a target decomposition network based on the training target image, the training background image and the training overlapping image, which has high feasibility.

[0098] In some embodiments, step 232 includes:

[0099] Step S2321, determining a first reconstruction loss corresponding to the training target image and a second reconstruction loss corresponding to the training background image.

[0100] Step S2322: determining a target decomposition training loss function of the target decomposition network according to the first reconstruction loss and the second reconstruction loss.

[0101] The target decomposition training loss function of the target decomposition network is the sum of the first reconstruction loss and the second reconstruction loss. The target decomposition training loss function formula is as follows:

[0102]

[0103] In the training loss function formula, is the foreground image output by the first reconstruction branch network, The background image output by the second reconstruction branch network.

[0104] Step S2323, training to obtain a target decomposition network according to the target decomposition training loss function, the training target image, the training background image and the training overlapping image.

[0105] Through the above steps, the embodiment of the present application determines the target decomposition training loss function when training the target decomposition network, so that the trained target decomposition network can output a more accurate target layered image during inference prediction.

[0106] In some embodiments, before step S203, the method further includes:

[0107] Step S213, calculating the number of overlapping objects at each pixel in the training overlapping image.

[0108] Determine the coordinates corresponding to each pixel in the training overlapping image and calculate the number of overlapping objects at each coordinate.

[0109] Step S223, determining the number of overlapping objects as pixel values ​​of corresponding pixels in the training overlapping image to determine an object number training image.

[0110] The number of overlapping objects is determined as the pixel values ​​of corresponding pixels in the training overlapping images, thereby obtaining a training map of the number of objects.

[0111] Step S233, training a target number prediction network according to the training overlapping images and the target number training graph.

[0112] The target number training image is used as a label to supervise the training of the target number prediction network, and the training overlapping image is used as the training object to train the target number prediction network. It is worth mentioning that the training loss function of the target number prediction network can be the commonly used cross entropy loss function:

[0113]

[0114] in, is the number label, is the network output prediction value, and C is the preset target number, which is preset to 10 in the embodiment of the present application.

[0115] Through the above steps, the embodiment of the present application performs pixel annotation on the training overlapping images to determine the target number training map, and further trains to obtain the target number prediction network, which is highly feasible.

[0116] The embodiments of the present application are described and illustrated below through preferred embodiments.

[0117] Figure 4 FIG. 1 is a flow chart of an image detection method according to a preferred embodiment of the present application. Figure 4 As shown, the image detection method includes the following steps:

[0118] Step S401, obtaining a training target image and a training background image, and determining a training overlapping image according to the training target image and the training background image;

[0119] Step S402, training a target decomposition network according to the training target image, the training background image and the training overlapping image;

[0120] Step S403, obtaining an image to be detected, and inputting the image to be detected into a target decomposition network to obtain a hierarchical target image output by the target decomposition network, wherein the hierarchical target image includes a foreground image and a background image decomposed from the image to be detected;

[0121] Step S404, determining a target number training graph according to the training overlapping image, and training a target number prediction network according to the training overlapping image and the target number training graph;

[0122] Step S405, inputting the hierarchical target image into the target number prediction network to obtain a target number prediction map output by the target number prediction network, and determining the number of overlapping foreground targets in the hierarchical target image according to the target number prediction map;

[0123] Step S406: When the number of overlapping foreground objects is less than or equal to 1, the layered object image is determined as the detection result image.

[0124] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0125] This embodiment also provides an X-ray security inspection image detection method. Figure 5 is a flow chart of an X-ray security inspection image detection method according to an embodiment of the present application. Figure 5As shown, the process includes the following steps:

[0126] Step S501, obtaining an X-ray security inspection image to be detected; wherein the X-ray security inspection image to be detected includes a target object to be inspected.

[0127] In the embodiment of the present application, the X-ray security inspection image to be detected can be an X-ray security inspection image obtained by performing an inspection and image acquisition operation on a baggage package through an X-ray security inspection machine in a security inspection scene such as an airport or a railway station. The X-ray security inspection image to be detected includes a target object to be inspected, and the target object can be a plurality of overlapping prohibited items.

[0128] Step S502, inputting the X-ray security inspection image to be detected into a target decomposition network to obtain an X-ray foreground image and an X-ray background image decomposed from the X-ray security inspection image to be detected; wherein the X-ray foreground image includes the first target object among the target objects, and the X-ray background image does not include the first target object.

[0129] In an embodiment of the present application, further, the acquired X-ray security inspection image to be detected is input into a target decomposition network to obtain an X-ray foreground image and an X-ray background image output by the target decomposition network. The target decomposition network is a deep learning network obtained through training, which can be used to decompose the image input therein into two layered target images including a foreground image and a background image. The X-ray foreground image can be an image formed by extracting a first target object from the X-ray security inspection image to be detected, and the X-ray background image can be an image formed by removing the first target object from the X-ray security inspection image to be detected. The first target object can include one or more target objects. The X-ray background image can include a second target object.

[0130] Step S503, inputting the X-ray foreground image into the target number prediction network to obtain a first target number prediction map output by the target number prediction network, and determining the first number of overlapping foreground targets in the X-ray foreground image according to the first target number prediction map.

[0131] In an embodiment of the present application, the acquired X-ray foreground image is input into a target number prediction network to obtain a first target number prediction map corresponding to the X-ray foreground image output by the target number prediction network. The target number prediction network is a deep learning network obtained through training, which can be used to judge the number of overlapping target objects in the input image. Specifically, the target number prediction network includes a feature extraction module and an attention module. The X-ray foreground image acquires features through the feature extraction module, and then the feature information acquisition capability is enhanced through the attention module. Finally, the target number prediction network outputs a first target number prediction map with the same width and height as the input X-ray foreground image. The pixel value of each pixel in the first target number prediction map represents the number of first target objects corresponding to the pixel coordinates. Therefore, according to the first target number prediction map, the embodiment of the present application can determine the number of first overlapping foreground targets in the X-ray foreground image.

[0132] Step S504, inputting the X-ray background image into the target number prediction network to obtain a second target number prediction map output by the target number prediction network, and determining the number of second overlapping foreground targets in the X-ray background image according to the second target number prediction map.

[0133] Similarly, in an embodiment of the present application, the acquired X-ray background image is input into the target number prediction network to obtain a second target number prediction map corresponding to the X-ray background image output by the target number prediction network. In this way, the embodiment of the present application performs target number prediction on all images output by the target decomposition network for subsequent applications. Specifically, the X-ray background image acquires features through the feature extraction module, and then the feature information acquisition capability is enhanced through the attention module, and finally a second target number prediction map with the same width and height as the input X-ray background image is output. The pixel value of each pixel in the second target number prediction map represents the number of second target objects corresponding to the pixel coordinates. Therefore, based on the second target number prediction map, the embodiment of the present application can determine the number of second overlapping foreground targets in the X-ray background image.

[0134] Step S505: when the number of first overlapping foreground objects is less than or equal to 1, the corresponding X-ray foreground image is determined as the first detection result image.

[0135] When the number of the first overlapping foreground targets is less than or equal to 1, it means that there are no overlapping targets in the corresponding X-ray foreground image, that is, all overlapping targets in the X-ray foreground image have been decomposed, so the X-ray foreground image is determined as the first detection result image, indicating that all targets in the X-ray foreground image have been accurately detected and distinguished. That is, the first detection result image is an image obtained after all overlapping targets in the initial X-ray foreground image are decomposed. The initial X-ray foreground image is the X-ray foreground image output after the X-ray security inspection image to be detected is input to the target decomposition network for the first time. There is only a single foreground target (first target object) or no foreground target (first target object) in the first detection result image.

[0136] Step S506: When the number of the second overlapping foreground objects is less than or equal to 1, the corresponding X-ray background image is determined as the second detection result image.

[0137] Similarly, when the number of second overlapping foreground targets is less than or equal to 1, it means that there are no overlapping targets in the corresponding X-ray background image, that is, all overlapping targets in the X-ray background image have been decomposed, so the X-ray background image is determined as the second detection result image, indicating that all targets in the X-ray background image have been accurately detected and distinguished. That is, the second detection result image is an image obtained after all overlapping targets in the initial X-ray background image are decomposed. The initial X-ray background image is the X-ray background image output after the X-ray security inspection image to be detected is input into the target decomposition network for the first time. There is only a single foreground target (second target object) or no foreground target (second target object) in the second detection result image.

[0138] It is worth mentioning that, when the number of the first overlapping foreground targets is greater than 1, the corresponding X-ray foreground image is determined as the current X-ray security inspection image to be detected, and steps S501 to S506 are executed in a loop; similarly, when the number of the second overlapping foreground targets is greater than 1, the corresponding X-ray background image is determined as the current X-ray security inspection image to be detected, and steps S501 to S506 are executed in a loop.

[0139] Through the above steps, the embodiment of the present application obtains an X-ray security inspection image to be detected, and inputs the X-ray security inspection image to be detected into a target decomposition network, the target decomposition network decomposes the X-ray security inspection image to be detected, and outputs an X-ray foreground image and an X-ray background image decomposed from the X-ray security inspection image to be detected; the decomposed X-ray foreground image and the X-ray background image are then respectively input into a target number prediction network to respectively obtain a first target number prediction map and a second target number prediction map output by the target number prediction network; the first target number prediction map is used to determine the number of first overlapping foreground targets in the X-ray foreground image, and the second target number prediction map is used to determine the number of second overlapping foreground targets in the X-ray background image; when the number of first overlapping foreground targets is less than or equal to 1, it indicates that there is no target or only one target in the corresponding X-ray foreground image, thereby completing the distinction of overlapping targets in the X-ray foreground image; when the number of second overlapping foreground targets is less than or equal to 1, it indicates that there is no target or only one target in the corresponding X-ray background image, thereby completing the distinction of overlapping targets in the X-ray background image; therefore, the corresponding X-ray foreground image and the X-ray background image are determined as detection result images. The embodiments of the present application solve the problem of how to accurately detect and distinguish overlapping targets in an image, thereby improving the accuracy of target detection in X-ray security inspection images.

[0140] In some embodiments, the X-ray security inspection image detection method further includes:

[0141] The X-ray security inspection image to be detected is a color image with a size greater than or equal to 700 pixels and less than or equal to 1200 pixels; the sizes of the X-ray foreground image, the X-ray background image and the X-ray security inspection image to be detected are the same.

[0142] In the embodiment of the present application, the X-ray foreground image, the X-ray background image and the X-ray security inspection image to be detected are all color images with a size greater than or equal to 700 pixels and less than or equal to 1200 pixels, and in the same embodiment, the X-ray foreground image, the X-ray background image and the X-ray security inspection image to be detected have the same size. In this way, the embodiment of the present application can improve the visualization effect of image detection and has high feasibility.

[0143] The present embodiment also provides an image detection device, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the terms "module", "unit", "subunit" and the like can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0144] Figure 6 is a structural block diagram of an image detection device according to an embodiment of the present application, such as Figure 6As shown, the device includes: a to-be-detected image acquisition module 10, a layered target image acquisition module 20, an overlapping foreground target quantity determination module 30, and a detection result image determination module 40.

[0145] The image acquisition module 10 is used to execute the image acquisition step, which includes acquiring the image to be detected;

[0146] The layered target image acquisition module 20 is used to input the image to be detected into the target decomposition network to obtain the layered target image output by the target decomposition network, wherein the layered target image includes the foreground image and the background image decomposed from the image to be detected;

[0147] The overlapping foreground object number determination module 30 is used to input the hierarchical object image into the object number prediction network to obtain the object number prediction map output by the object number prediction network, and determine the number of overlapping foreground objects in the hierarchical object image according to the object number prediction map;

[0148] The detection result image determination module 40 is used to determine the layered target image as the detection result image when the number of overlapping foreground targets is less than or equal to 1.

[0149] In some of the embodiments, the image detection device further includes: a module for resetting the image to be detected.

[0150] The image to be detected resetting module is used to determine the layered target image as the current image to be detected when the number of overlapping foreground objects is greater than 1, and go to step S201.

[0151] In some of these embodiments, the target decomposition network includes decomposition convolutional layers and decomposition dense network blocks;

[0152] The hierarchical target image acquisition module is used to input the image to be detected into the decomposition convolution layer and the decomposition dense network block in sequence to obtain an output hierarchical target image.

[0153] In some of the embodiments, the target number prediction network includes a feature extraction module and an attention module; the overlapping foreground target number determination module includes: a target number prediction graph determination module and a foreground target number prediction module;

[0154] The target number prediction map determination module is used to input the hierarchical target image into the feature extraction module and the attention module in sequence to obtain the output target number prediction map;

[0155] The foreground target quantity prediction module is used to determine the number of overlapping foreground targets in the layered target image according to the pixel value of each pixel in the target quantity prediction image.

[0156] In some of the embodiments, the image detection device further comprises: a training image acquisition module, a training overlapping image determination module and a target decomposition network training module;

[0157] The training image acquisition module is used to acquire the training target image and the training background image;

[0158] The training overlapping image determination module is used to determine the training overlapping image according to the training target image and the training background image;

[0159] The target decomposition network training module is used to train the target decomposition network according to the training target image, the training background image and the training overlapping image.

[0160] In some of these embodiments, the image detection device further includes: a target number training graph determination module and a target number prediction network determination module;

[0161] The target number training image determination module is used to determine the target number training image according to the training overlapping image;

[0162] The target number prediction network determination module is used to train a target number prediction network according to the training overlapping images and the target number training graph.

[0163] In some of these embodiments, the target number training map determination module includes: a pixel target number calculation module and a training target number calculation module;

[0164] The pixel point target number calculation module is used to calculate the number of overlapping targets at each pixel point in the training overlapping image;

[0165] The training target number calculation module is used to determine the number of overlapping targets as the pixel values ​​of corresponding pixels in the training overlapping image to determine the target number training map.

[0166] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.

[0167] This embodiment further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0168] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0169] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0170] Executing a step of acquiring an image to be detected, the step of acquiring an image to be detected comprising acquiring an image to be detected;

[0171] Inputting the image to be detected into the target decomposition network to obtain a hierarchical target image output by the target decomposition network, wherein the hierarchical target image includes a foreground image and a background image decomposed from the image to be detected;

[0172] Inputting the hierarchical target image into the target number prediction network to obtain a target number prediction map output by the target number prediction network, and determining the number of overlapping foreground targets in the hierarchical target image according to the target number prediction map;

[0173] When the number of overlapping foreground objects is less than or equal to 1, the layered object image is determined as the detection result image.

[0174] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0175] In addition, in combination with the image detection method in the above embodiment, the embodiment of the present application can provide a storage medium for implementation. The storage medium stores a computer program; when the computer program is executed by a processor, any one of the image detection methods in the above embodiment is implemented.

[0176] Those skilled in the art should understand that the technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0177] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0178] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. An image detection method, It is characterized in that The following steps are involved: Executing a step of acquiring an image to be detected, wherein the step of acquiring an image to be detected comprises acquiring an image to be detected; Inputting the image to be detected into a target decomposition network to obtain a hierarchical target image output by the target decomposition network, wherein the hierarchical target image includes a foreground image and a background image decomposed from the image to be detected; Inputting the hierarchical target image into a target number prediction network to obtain a target number prediction map output by the target number prediction network, and determining the number of overlapping foreground targets in the hierarchical target image according to the target number prediction map; When the number of overlapping foreground objects is less than or equal to 1, determining the layered object image as a detection result image; When the number of overlapping foreground objects is greater than 1, the layered object image is determined as the current image to be detected, and the process proceeds to the step of acquiring the image to be detected.

2. The image detection method according to claim 1, It is characterized in that The target decomposition network includes a decomposition convolutional layer and a decomposition dense network block; The step of inputting the image to be detected into the target decomposition network to obtain a hierarchical target image output by the target decomposition network comprises: The image to be detected is sequentially input into the decomposed convolutional layer and the decomposed dense network block to obtain the output hierarchical target image.

3. The image detection method according to claim 2, It is characterized in that The target number prediction network includes a feature extraction module and an attention module; The step of inputting the hierarchical target image into a target number prediction network to obtain a target number prediction map output by the target number prediction network, and determining the number of overlapping foreground targets in the hierarchical target image according to the target number prediction map comprises: Inputting the hierarchical target image into a feature extraction module and an attention module in sequence to obtain the output target number prediction map; The number of overlapping foreground objects in the layered object image is determined according to the pixel value of each pixel in the object number prediction map.

4. The image detection method according to any one of claims 1 to 3, It is characterized in that Before inputting the image to be detected into the target decomposition network to obtain the hierarchical target image output by the target decomposition network, the method further includes: Obtaining a training target image and a training background image; Determining a training overlapping image according to the training target image and the training background image; The target decomposition network is trained based on the training target image, the training background image and the training overlapping image.

5. The image detection method according to claim 4, It is characterized in that Before inputting the hierarchical target image into the target number prediction network to obtain the target number prediction map output by the target number prediction network, and determining the number of overlapping foreground targets in the hierarchical target image according to the target number prediction map, the method further includes: Calculating the number of overlapping objects at each pixel in the training overlapping image; Determine the number of overlapping objects as pixel values ​​of corresponding pixels in the training overlapping image to determine the object number training image; The target number prediction network is trained based on the training overlapping images and the target number training graph.

6. A method for detecting X-ray security images, It is characterized in that The following steps are involved: Acquire an X-ray security inspection image to be detected; wherein the X-ray security inspection image to be detected includes a target object to be inspected; Inputting the X-ray security inspection image to be detected into a target decomposition network to obtain an X-ray foreground image and an X-ray background image decomposed from the X-ray security inspection image to be detected; wherein the X-ray foreground image includes a first target object among the target objects, and the X-ray background image does not include the first target object; Inputting the X-ray foreground image into a target number prediction network to obtain a first target number prediction map output by the target number prediction network, and determining the first number of overlapping foreground targets in the X-ray foreground image according to the first target number prediction map; Inputting the X-ray background image into the target number prediction network to obtain a second target number prediction map output by the target number prediction network, and determining the number of second overlapping foreground targets in the X-ray background image according to the second target number prediction map; When the number of the first overlapping foreground objects is less than or equal to 1, determining the corresponding X-ray foreground image as a first detection result image; When the number of the second overlapping foreground objects is less than or equal to 1, the corresponding X-ray background image is determined as the second detection result image.

7. The image detection method according to claim 6, It is characterized in that The X-ray security inspection image to be detected is a color image with a size greater than or equal to 700 pixels and less than or equal to 1200 pixels; The sizes of the X-ray foreground image, the X-ray background image and the X-ray security inspection image to be detected are the same.

8. An image detection device, It is characterized in that It includes a module for acquiring images to be detected, a module for acquiring layered target images, a module for determining the number of overlapping foreground targets, and a module for determining detection result images: The image acquisition module to be detected is used to execute the image acquisition step to be detected, and the image acquisition step to be detected includes acquiring the image to be detected; The layered target image acquisition module is used to input the image to be detected into the target decomposition network to obtain the layered target image output by the target decomposition network, wherein the layered target image includes a foreground image and a background image decomposed from the image to be detected; The overlapping foreground object number determination module is used to input the hierarchical object image into the object number prediction network to obtain the object number prediction map output by the object number prediction network, and determine the number of overlapping foreground objects in the hierarchical object image according to the object number prediction map; The detection result image determination module is used to determine the layered target image as the detection result image when the number of overlapping foreground objects is less than or equal to 1.

9. A storage medium, It is characterized in that The storage medium stores a computer program, wherein the computer program is configured to execute the image detection method according to any one of claims 1 to 6 when executed.