Vehicle X-ray image dangerous article injection processing method

By preprocessing and embedding the automotive X-ray images, high-quality hazardous materials-containing images are generated, which solves the problem of lack of training data in the existing technology and realizes the intelligent development of vehicle X-ray detection.

CN120375293AActive Publication Date: 2025-07-25YANTAI PORT GRP CO LTD +5
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202510845961.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-24
Publication Date
2025-07-25
Estimated Expiration
2045-06-24

AI Technical Summary

Technical Problem

The prior art is difficult to effectively use high-resolution automotive X-ray images to train artificial intelligence object detection models, especially because the lack of sufficient image data containing hazardous goods and the process of artificial injecting hazardous goods is time-consuming and labor-intensive, and is not suitable for vehicle X-ray detection scenarios.

Method used

By pre-processing the X-ray images of hazardous goods and hazardous goods, the hazardous goods white background matrix and pixel labeling matrix are generated, and rotated and embedded in the hazardous goods image to form high-quality training data to simulate the changes in different positions and sizes of hazardous goods in the vehicle.

Benefits of technology

Use a small number of hazardous goods images and no hazardous goods images to synthesize a large number of high-quality hazardous goods images, provide sufficient training data, and promote the intelligent development of vehicle X-ray detection technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120375293A_ABST
    Figure CN120375293A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of vehicle security inspection, and particularly relates to a vehicle X-ray image dangerous article injection processing method. Cutting out an area only containing the dangerous goods from the original X-ray image of the dangerous goods, generating a dangerous goods sub-image, and representing the dangerous goods sub-image as a three-dimensional brightness matrix; preprocessing the brightness matrix of the dangerous goods to obtain a white background matrix of the dangerous goods and a pixel-level labeling matrix of a dangerous goods area; representing the dangerous goods-free original X-ray image as a dangerous goods-free brightness matrix; preprocessing the brightness matrix without dangerous goods to obtain an approximate area matrix of the vehicle; judging whether the pixel-level segmentation matrix of the dangerous goods falls in an approximate area matrix of the vehicle or not; if yes, the to-be-injected hazardous article matrix is injected into the non-hazardous article brightness matrix, a large number of high-quality hazardous article containing automobile X-ray images are synthesized, sufficient training data are provided for an artificial intelligence target detection algorithm, and therefore intelligent development of the whole automobile X-ray detection technology is promoted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of vehicle security inspection, and particularly relates to a method for processing dangerous goods injection in vehicle X-ray images. Background Art

[0002] The X-ray inspection device for the whole vehicle has become an important tool for identifying potential dangerous goods by virtue of its ability to generate high-resolution top-view X-ray fluoroscopic images. These images provide an intuitive and efficient detection means, which helps to quickly screen out vehicles that may carry dangerous goods and ensure the security of ports. However, with the wide application of artificial intelligence technology in the field of image recognition, how to effectively apply these high-resolution X-ray images to automated target detection, especially dangerous goods detection, has become a key problem to be solved urgently.

[0003] Currently, the performance of artificial intelligence target detection algorithms highly depends on a large amount of high-quality training data. For the whole vehicle X-ray inspection, this means that a large number of automotive X-ray images containing dangerous goods need to be collected and labeled to train an accurate and reliable detection model. However, the actual situation faces many challenges: First, the vast majority of automotive images do not contain dangerous goods, which makes it extremely difficult to directly collect a sufficient number of positive samples (i.e., images containing dangerous goods); Second, even if dangerous goods are placed in the vehicle manually and scanned images are made, this process is extremely time-consuming and laborious, and it is difficult to ensure the authenticity and diversity of the images. At the same time, manually placing dangerous goods may not cover all possible types and positions of dangerous goods, further limiting the richness of the training data.

[0004] In the prior art, although there are some dangerous goods injection schemes, most of these schemes are designed for luggage security inspection machines and are not directly applicable to the whole vehicle X-ray inspection scenario. There are significant differences in image characteristics between luggage security inspection machines and automotive X-ray inspections, and these differences are largely caused by the different sizes of vehicles and luggage. Specifically, due to the relatively small actual space of the luggage security inspection machine, the injection of dangerous goods needs to be restricted to the vacant area of the luggage, and the size of the injected dangerous goods is relatively fixed, without considering the perspective change of "near is large and far is small". The injection of dangerous goods in automotive X-ray images can be carried out in any area of the vehicle body, and large dangerous goods such as drones and shovels need to be injected and identified. The size of these dangerous goods will have a certain "near is large and far is small" change due to their positions in the vehicle body, and at the same time, the volume of the dangerous goods themselves can also have a large random change. In view of the above problems, the present invention has developed a method for processing dangerous goods image injection in automotive top-view X-ray scan images. Summary of the Invention

[0005] In order to overcome the problems in the prior art, the present invention proposes a method for processing dangerous goods injection in vehicle X-ray images.

[0006] The technical solution of the present invention to solve the above technical problems is as follows: The present invention provides a method for processing dangerous goods injection in vehicle X-ray images, comprising the following steps: Scan a vehicle containing dangerous goods to generate an original X-ray image of the dangerous goods, crop the area containing only the dangerous goods from the original X-ray image of the dangerous goods to generate a sub-image of the dangerous goods, and represent the sub-image of the dangerous goods as a brightness matrix of the dangerous goods; preprocess the brightness matrix of the dangerous goods to obtain a white background matrix of the dangerous goods and a pixel annotation matrix of the dangerous goods; Scan a vehicle without dangerous goods to generate an original X-ray image without dangerous goods, and represent the original X-ray image without dangerous goods as a brightness matrix without dangerous goods; preprocess the brightness matrix without dangerous goods to obtain a rough area matrix of the vehicle; Generate an injection matrix without dangerous goods, rotate the white background matrix of the dangerous goods by an angle and embed it into the injection matrix without dangerous goods to generate a matrix of dangerous goods to be injected; generate a pixel-level segmentation matrix of the dangerous goods, rotate the pixel annotation matrix of the dangerous goods by an angle and embed it into the pixel-level segmentation matrix of the dangerous goods to generate a rough area matrix of the vehicle with the dangerous goods to be injected; determine whether the pixel-level segmentation matrix of the dangerous goods falls within the rough area matrix of the vehicle; if it falls within, inject the matrix of dangerous goods to be injected into the brightness matrix without dangerous goods.

[0007] Further, preprocessing the brightness matrix of the dangerous goods to obtain a white background matrix of the dangerous goods includes: Open the brightness matrix of the dangerous goods into a one-dimensional brightness vector of the dangerous goods; Cluster the vectors in the one-dimensional brightness vector of the dangerous goods into multiple one-dimensional Gaussian distributions, the one with the largest mean in the multiple one-dimensional Gaussian distributions is the distribution of the background brightness, and obtain the mean of the background brightness distribution and the standard deviation of the background brightness distribution; Perform a linear transformation on the pixel values in the brightness matrix of the dangerous goods to obtain a brightness matrix of the dangerous goods with values between 0 and 1, set the pixels with pixel values greater than or equal to the mean of the background brightness distribution in the brightness matrix between 0 and 1 to 1, and the rest to 0, to obtain a white background matrix of the dangerous goods.

[0008] Further, preprocessing the brightness matrix of the dangerous goods to obtain a white background matrix of the dangerous goods includes: Based on the mean of the background brightness distribution and the standard deviation of the background brightness distribution, preset a first brightness threshold; based on the first brightness threshold, compare each pixel in the brightness matrix of the dangerous goods with the first brightness threshold, the pixels less than the first brightness threshold are the dangerous goods areas, denoted as 1; the pixels greater than the first brightness threshold are the background areas, denoted as 0, to obtain a pixel annotation matrix of the dangerous goods.

[0009] Further, the first brightness threshold is the mean of the background brightness distribution minus six times the standard deviation of the background brightness distribution.

[0010] Further, preprocess the non-hazardous goods brightness matrix to obtain a rough area matrix of the vehicle, including: Perform Gaussian blur on the non-hazardous goods brightness matrix to obtain a Gaussian-blurred non-hazardous goods brightness matrix; expand the pixel values in the Gaussian-blurred non-hazardous goods brightness matrix into a one-dimensional non-hazardous goods brightness vector; Use the one-dimensional Gaussian mixture clustering algorithm to cluster the numerical values in the one-dimensional non-hazardous goods brightness vector into at least two one-dimensional Gaussian distributions. The Gaussian distribution with the largest mean among the at least two Gaussian distributions is the background brightness distribution in the Gaussian-blurred non-hazardous goods brightness matrix, and obtain the mean and standard deviation of the background brightness distribution in the Gaussian-blurred non-hazardous goods brightness matrix; Based on the mean and standard deviation of the background brightness distribution in the Gaussian-blurred non-hazardous goods brightness matrix, segment the Gaussian-blurred non-hazardous goods brightness matrix to obtain a rough area matrix of the vehicle.

[0011] Further, based on the mean and standard deviation of the background brightness distribution in the Gaussian-blurred non-hazardous goods brightness matrix, segment the Gaussian-blurred non-hazardous goods brightness matrix to obtain a rough area matrix of the vehicle, including: Preset a second brightness threshold based on the mean and standard deviation of the background brightness distribution in the Gaussian-blurred non-hazardous goods brightness matrix; Compare each pixel of the Gaussian-blurred non-hazardous goods brightness matrix with the second brightness threshold. Those less than the second brightness threshold are the vehicle areas, denoted as 1; those greater than the second brightness threshold are the background areas, denoted as 0, to obtain a rough area matrix of the vehicle.

[0012] Further, the second brightness threshold is the mean of the background brightness distribution in the Gaussian-blurred non-hazardous goods brightness matrix minus 0.5 times the standard deviation of the background brightness distribution in the Gaussian-blurred non-hazardous goods brightness matrix.

[0013] Compared with the prior art, the present invention has the following technical effects: The present invention can synthesize a large number of high-quality X-ray images of vehicles containing hazardous goods by using a small number of X-ray images of hazardous goods and X-ray images of cars without hazardous goods, providing sufficient training data for artificial intelligence target detection algorithms, thereby promoting the intelligent development of the whole vehicle X-ray detection technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0015] Figure 1 It is a schematic flowchart of the present invention; Figure 2 It is an image of an area containing only dangerous goods; Figure 3 It is an image of dangerous goods on a white background; Figure 4 It is an image of pixel annotation of dangerous goods; Figure 5 It is the probability distribution of pixel brightness with a histogram; Figure 6 It is an image of a vehicle without dangerous goods to be injected; Figure 7 It is an image of a vehicle without dangerous goods after Gaussian blur; Figure 8 It is from Figure 7 The schematic diagram of the area to be injected generated; Figure 9 It is an image of a vehicle injected with multiple dangerous goods, where the colored boxes are the target boxes of dangerous goods, and the text labels on the boxes indicate; Figure 10 It is Figure 6 The pixel-level semantic segmentation map of the image shown. Detailed implementation manners

[0016] To further elaborate on the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following, in combination with the drawings and preferred embodiments, details the specific implementation manners, structures, features, and effects of the technical solutions proposed according to the present invention. The specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present invention belongs.

[0017] In one embodiment of the present invention, referring to Figures 1 - 10 , a method for processing the injection of dangerous goods in vehicle X-ray images is provided, including the following steps: Scan the vehicle containing dangerous goods to generate the original X-ray image of dangerous goods. Crop the area containing only the dangerous goods from the original X-ray image of dangerous goods to generate a sub-image of dangerous goods, and represent the sub-image of dangerous goods as a brightness matrix of dangerous goods. Preprocess the brightness matrix of dangerous goods to obtain a white background matrix of dangerous goods and a pixel annotation matrix of dangerous goods. Scan the vehicle without dangerous goods to generate the original X-ray image without dangerous goods, and represent the original X-ray image without dangerous goods as a brightness matrix without dangerous goods. Preprocess the brightness matrix without dangerous goods to obtain a rough area matrix of the vehicle. Generate an injection matrix without dangerous goods, embed the white background matrix of dangerous goods into the injection matrix without dangerous goods to generate a matrix of dangerous goods to be injected. Generate a pixel-level segmentation matrix of dangerous goods, rotate the pixel annotation matrix of dangerous goods by an angle and embed it into the pixel-level segmentation matrix of dangerous goods to generate a rough area matrix of the vehicle with dangerous goods to be injected. Determine whether the pixel-level segmentation matrix of dangerous goods falls within the rough area matrix of the vehicle. If it falls within, inject the matrix of dangerous goods to be injected into the brightness matrix without dangerous goods.

[0018] The following expands each of the above steps in detail: Step 100: Scan the vehicle containing dangerous goods to generate the original X-ray image of dangerous goods. Crop the area containing only the dangerous goods from the original X-ray image of dangerous goods to generate a sub-image of dangerous goods, and represent the sub-image of dangerous goods as a brightness matrix of dangerous goods.

[0019] Scan the object or vehicle containing dangerous goods through an X-ray scanning device to generate the original X-ray image of dangerous goods. Subsequently, use an image annotation tool (such as LabelImg, VGG Image Annotator, etc.) to accurately annotate the dangerous goods area in the image, and mark the location of the dangerous goods in the form of a bounding box or semantic segmentation.

[0020] Based on the annotation information, crop the area containing only the dangerous goods from the original X-ray image of dangerous goods to generate a sub-image of dangerous goods. The cropping process retains the complete morphological characteristics of the dangerous goods and removes background interference at the same time, so that subsequent algorithms can focus on the feature learning of the dangerous goods themselves.

[0021] To enhance the generalization ability of the model, during the data collection stage, scan the same dangerous goods from multiple angles or collect image data in different scenarios. Ensure that the collected dangerous goods images cover various forms (such as size, shape, material) and angles (such as different placement directions, perspective deformations) of the target dangerous goods.

[0022] The pixel values of the X-ray image reflect the actual radiation flux received by the pixel points during the scanning process, and their values range from 0 to 65535 integers. For ease of calculation and processing, the cropped dangerous goods image, that is, the dangerous goods sub-image is represented as a dangerous goods brightness matrix, denoted as The dangerous goods brightness matrix is three-dimensional, with a size of [image height, image width, 1], where the last dimension represents a single-channel grayscale image. Each element of the dangerous goods brightness matrix corresponds to a pixel point in the image, and its value is proportional to the radiation flux of that point.

[0023] To further improve the robustness of the model, data augmentation operations can be performed on the brightness matrix, such as random rotation, scaling, translation, flipping, etc., to simulate complex scenarios in actual applications. At the same time, normalizing the pixel values (such as linearly mapping them to the range of 0-1) helps to accelerate the model convergence and improve the detection accuracy.

[0024] Step 200: Preprocess the dangerous goods brightness matrix to obtain a dangerous goods white background matrix and a dangerous goods pixel annotation matrix.

[0025] In this step 200, the following sub-steps can be included: Step 210: Expand (flatten) the values in the dangerous goods brightness matrix into a one-dimensional dangerous goods brightness vector .

[0026] ; Step 220: Use the one-dimensional Gaussian mixture clustering algorithm to cluster the values in the one-dimensional dangerous goods brightness vector into multiple one-dimensional Gaussian distributions. The Gaussian distribution with the largest mean in the multiple one-dimensional Gaussian distributions is the distribution of the background brightness, and obtain the mean of the background brightness distribution of the dangerous goods brightness matrix and the standard deviation of the background brightness distribution.

[0027] Setting the number of clusters to 6 can ensure that the Gaussian distribution with the largest mean is exactly the background brightness; if the number of clusters is set too small, it may cause this distribution to also include the regions with higher brightness in the dangerous goods, and if the number of clusters is too large, it may cause the background brightness to be split into multiple Gaussian distributions.

[0028] Step 230: Perform a linear transformation on the pixel values in the dangerous goods brightness matrix to obtain a brightness matrix with values between 0 and 1. Set the pixels in the brightness matrix between 0 and 1 whose values are greater than or equal to the mean of the distribution of the background brightness to 1, and the rest to 0, to obtain the dangerous goods white background matrix.

[0029] Refer to Figure 2 for the dangerous goods brightness matrix The pixel values in it are linearly transformed to obtain a dangerous goods brightness matrix with values between 0 and 1. The dangerous goods brightness matrix the pixel values greater than or equal to the mean background brightness distribution are set to 1, and the rest are set to 0 to obtain a dangerous goods white background matrix : ; Step 240: Based on the mean background brightness distribution and the standard deviation of the background brightness distribution, segment the dangerous goods brightness matrix to obtain a pixel-level annotation matrix of the area where the dangerous goods are located, that is, a dangerous goods pixel annotation matrix.

[0030] Referring to Figure 3 and using as the first brightness threshold for segmentation, compare each pixel in the dangerous goods brightness matrix with the first brightness threshold. Those less than the first brightness threshold are the dangerous goods area, denoted as 1; those greater than or equal to the first brightness threshold are the background area, denoted as 0, to obtain a dangerous goods pixel annotation matrix : ; The coefficient of the standard deviation of the background brightness distribution is set to 6. If this coefficient is set too large, the segmented area will not include the brighter part of the dangerous goods area. If this coefficient is set too small, the segmented area will include the lower-brightness noise in the background area.

[0031] Step 300: Scan the vehicle without dangerous goods to generate an original X-ray image without dangerous goods, and represent the original X-ray image without dangerous goods as a brightness matrix without dangerous goods.

[0032] Use an X-ray scanning device to scan an object or vehicle without dangerous goods to generate an original X-ray image without dangerous goods; the pixel values of the X-ray image reflect the actual radiation flux received by the pixel points during the scanning process, and their values range from 0 to 65535 integers. For ease of calculation and processing, represent the original X-ray image without dangerous goods as a brightness matrix without dangerous goods, denoted as with a size of [image height, image width, 1], where the last dimension represents a single-channel grayscale image. Each element of the brightness matrix without dangerous goods corresponds to a pixel point in the image, and its value is proportional to the radiation flux of that point.

[0033] Step 400: Preprocess the brightness matrix without dangerous goods to obtain a rough area matrix of the vehicle.

[0034] As an example, this step 400 may include the following sub-steps: Step 410: For the brightness matrix without dangerous goods Perform Gaussian blur to obtain a Gaussian-blurred non-hazardous item brightness matrix .

[0035] For an image with an actual height between 1000 - 2000 pixels and a width between 2000 - 3000 pixels, set the convolution kernel size of Gaussian blur to 255 and the standard deviation of Gaussian blur to 127. In a more general case, this convolution kernel size and standard deviation should be set to relatively large values to ensure that the is a single solid area.

[0036] Step 420: Flatten the values in the Gaussian-blurred non-hazardous item brightness matrix into a one-dimensional non-hazardous item brightness vector .

[0037] Step 430: Use a one-dimensional Gaussian mixture clustering algorithm to cluster the values in the one-dimensional non-hazardous item brightness vector into 2 one-dimensional Gaussian distributions. The one with the largest mean among the 2 Gaussian distributions is the background brightness distribution in the Gaussian-blurred non-hazardous item brightness matrix . Obtain the mean of the background brightness distribution and the standard deviation of the background brightness distribution in the Gaussian-blurred non-hazardous item brightness matrix.

[0038] Step 440: Based on the mean of the background brightness distribution and the standard deviation of the background brightness distribution in the Gaussian-blurred non-hazardous item brightness matrix , segment the Gaussian-blurred non-hazardous item brightness matrix to obtain a pixel-level annotation matrix of the approximate blurred area where the vehicle is located, simply referred to as the approximate area matrix of the vehicle .

[0039] Segment using as the second brightness threshold. Compare each pixel value in the Gaussian-blurred non-hazardous item brightness matrix with the second brightness threshold. Those less than the second brightness threshold are the vehicle areas, denoted as 1; those greater than or equal to the second brightness threshold are the background areas, denoted as 0, to obtain the approximate area matrix of the vehicle : ; Set the coefficient of

[0040] to 0.5. Setting this coefficient too large will cause the segmented area not to include parts such as the rearview mirrors at the edge of the vehicle body, and setting it too small will cause the segmented area to include a large area of the background around the vehicle body.Step 500: Generate a non-hazardous material injection matrix, rotate the hazardous material white background matrix by an angle and embed it into the non-hazardous material injection matrix to generate a hazardous material to be injected matrix; generate a pixel-level segmentation matrix of the hazardous material, rotate the hazardous material pixel annotation matrix by an angle and embed it into the pixel-level segmentation matrix of the hazardous material to generate a rough area matrix of the vehicle with the hazardous material to be injected; determine whether the pixel-level segmentation matrix of the hazardous material falls within the rough area matrix of the vehicle; if it can be injected, inject the hazardous material to be injected matrix into the non-hazardous material brightness matrix; After verifying the effectiveness of the injection area, generate an injection image and a hazardous material target box, and repeat until the predetermined quantity is satisfied to form the training data of the target detection model.

[0041] As an example, this Step 500 may include the following sub-steps: Step 510: For the hazardous material white background matrix and the hazardous material pixel annotation matrix , perform random enlargement or reduction.

[0042] Simulate the enlargement / reduction of the volume of the hazardous material itself: Generate a random floating-point number within the range j as the enlargement / reduction ratio, where represents the maximum ratio of the enlargement / reduction of the volume of the hazardous material, taking 0.25; enlarge / reduce the hazardous material white background matrix and the hazardous material pixel annotation matrix to j times their original size respectively, and then adjust the brightness of the hazardous material white background matrix to simulate the change in X-ray absorption rate caused by the change in the volume of the hazardous material: ; Simulate the "near is large and far is small" caused by the change in the height of the hazardous material: Generate a random floating-point number within the range j as the enlargement / reduction ratio, where represents the maximum ratio of the "near is large and far is small" change of the hazardous material, taking 0.25; enlarge / reduce the hazardous material white background matrix and the hazardous material pixel annotation matrix to j times their original size respectively.

[0043] Step 520: Generate a non-hazardous material injection matrix, rotate the hazardous material white background matrix by an angle and embed it into the non-hazardous material injection matrix to generate a hazardous material to be injected matrix.

[0044] Generate a non-hazardous material injection matrix with the same size as the non-hazardous material brightness matrix and all values being floating-point number 1 ; Randomly generate a center point coordinate within the width and height range of the non-hazardous material injection matrix , and then randomly generate an angle between 0° and 360° . Rotate the hazardous material white background matrix a by the angle and then embed it into the non-hazardous material injection matrix a to obtain the matrix of the vehicle to be injected with hazardous materials , whose center point is . .

[0045] Step 530: Generate a pixel-level segmentation matrix of the hazardous material. Rotate the pixel annotation matrix of the hazardous material by the angle a and then embed it into the pixel-level segmentation matrix of the hazardous material to generate a rough area matrix of the vehicle with the hazardous material to be injected.

[0046] First, generate a pixel-level segmentation matrix of the hazardous material that is the same size as the rough area matrix of the vehicle and all its values are integer 0 . Then rotate the pixel annotation matrix of the hazardous material by the angle a and embed it into the pixel-level segmentation matrix of the hazardous material to generate a rough area matrix of the vehicle with the hazardous material injected, such that the center point of the embedded hazardous material segmentation is also .

[0047] Step 540: Determine whether the pixel-level segmentation matrix of the hazardous material falls within the rough area matrix of the vehicle : ; In the above formula, represents the proportion of the pixel-level segmentation matrix of the hazardous material falling within the rough area matrix of the vehicle.

[0048] If R is greater than 99%, it is considered that the area can be injected; otherwise, re-execute Step 510 until R is greater than 99%.

[0049] Step 550: Inject the matrix of the vehicle to be injected with hazardous materials into the non-hazardous material luminance matrix :

[0050] Among them, is the non-hazardous material luminance matrix, and its value is an integer from 0 to 65535; represents the matrix of the vehicle to be injected with hazardous materials, and its value is a floating point number from 0 to 1; It is the injection result, which is an integer ranging from 0 to 65535.

[0051] Step 560: According to the pixel-level segmentation matrix of dangerous goods Judge the target detection box of dangerous goods: ; ; ; ; The obtained , , , are respectively the upper, lower, left, and right boundaries of the dangerous goods target box.

[0052] Step 570: Repeat the above steps until there is no dangerous goods brightness matrix containing a predetermined number of dangerous goods.

[0053] For this "predetermined number", the empirical value is that injecting 0 - 2 of each type of dangerous goods in each vehicle image has a better effect; the obtained and the target box boundaries of each dangerous good , , , are used as the training data of the target detection model.

[0054] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for processing dangerous goods injection in vehicle X-ray images, characterized in that, Including the following steps: Scanning the vehicle containing dangerous goods to generate the original X-ray image of dangerous goods, cropping the area containing only dangerous goods from the original X-ray image of dangerous goods to generate a sub-image of dangerous goods, and representing the sub-image of dangerous goods as a brightness matrix of dangerous goods; preprocessing the brightness matrix of dangerous goods to obtain a white background matrix of dangerous goods and a pixel annotation matrix of dangerous goods; Scanning the vehicle without dangerous goods to generate the original X-ray image without dangerous goods, and representing the original X-ray image without dangerous goods as a brightness matrix without dangerous goods; Preprocessing the brightness matrix without dangerous goods to obtain a rough area matrix of the vehicle; Generating an injection matrix without dangerous goods, rotating the white background matrix of dangerous goods by an angle and embedding it into the injection matrix without dangerous goods to generate a matrix to be injected with dangerous goods; generating a pixel-level segmentation matrix of dangerous goods, rotating the pixel annotation matrix of dangerous goods by an angle and embedding it into the pixel-level segmentation matrix of dangerous goods to generate a rough area matrix of the vehicle with dangerous goods to be injected; determining whether the pixel-level segmentation matrix of dangerous goods falls within the rough area matrix of the vehicle; If it falls within, injecting the matrix to be injected with dangerous goods into the brightness matrix without dangerous goods.

2. The method for processing dangerous goods injection in vehicle X-ray images according to claim 1, wherein, Preprocessing the brightness matrix of dangerous goods to obtain a white background matrix of dangerous goods, including: Converting the brightness matrix of dangerous goods into a one-dimensional brightness vector of dangerous goods; Clustering the vectors in the one-dimensional brightness vector of dangerous goods into multiple one-dimensional Gaussian distributions, where the one with the largest mean in the multiple one-dimensional Gaussian distributions is the distribution of the background brightness, and obtaining the mean of the background brightness distribution and the standard deviation of the background brightness distribution; Performing a linear transformation on the pixel values in the brightness matrix of dangerous goods to obtain a brightness matrix of dangerous goods with pixel values between 0 and 1, setting the pixels with pixel values greater than or equal to the mean of the background brightness distribution in the brightness matrix between 0 and 1 to 1, and the rest to 0, to obtain the white background matrix of dangerous goods.

3. A method for processing dangerous goods injection in vehicle X-ray images according to claim 2, characterized in that, Preprocessing the brightness matrix of dangerous goods to obtain a white background matrix of dangerous goods, including: Presetting a first brightness threshold based on the mean of the background brightness distribution and the standard deviation of the background brightness distribution; comparing each pixel in the brightness matrix of dangerous goods with the first brightness threshold based on the first brightness threshold, where the pixels less than the first brightness threshold are the dangerous goods area, denoted as 1; and the pixels greater than the first brightness threshold are the background area, denoted as 0, to obtain the pixel annotation matrix of dangerous goods.

4. A method for processing a vehicle X-ray image for dangerous goods injection according to claim 3, characterized in that, The first brightness threshold is the mean of the background brightness distribution minus six times the standard deviation of the background brightness distribution.

5. A method for processing dangerous goods injection in vehicle X-ray images according to claim 1, characterized in that, Preprocessing the brightness matrix without dangerous goods to obtain a rough area matrix of the vehicle, including: Performing Gaussian blur on the brightness matrix without dangerous goods to obtain a Gaussian-blurred brightness matrix without dangerous goods; expanding the pixel values in the Gaussian-blurred brightness matrix without dangerous goods into a one-dimensional brightness vector without dangerous goods; Using a one-dimensional Gaussian mixture clustering algorithm to cluster the values in the one-dimensional brightness vector without dangerous goods into at least two one-dimensional Gaussian distributions, where the one with the largest mean in the at least two Gaussian distributions is the background brightness distribution in the Gaussian-blurred brightness matrix without dangerous goods, and obtaining the mean of the background brightness distribution and the standard deviation of the background brightness distribution in the Gaussian-blurred brightness matrix without dangerous goods; Based on the mean and standard deviation of the background brightness distribution in the Gaussian-blurred non-hazardous goods brightness matrix, segment the Gaussian-blurred non-hazardous goods brightness matrix to obtain the approximate area matrix of the vehicle.

6. A method for processing dangerous goods injection in vehicle X-ray images according to claim 5, characterized in that, Based on the mean and standard deviation of the background brightness distribution in the Gaussian-blurred non-hazardous goods brightness matrix, segment the Gaussian-blurred non-hazardous goods brightness matrix to obtain the approximate area matrix of the vehicle, including: Based on the mean and standard deviation of the background brightness distribution in the Gaussian-blurred non-hazardous goods brightness matrix, preset the second brightness threshold; Compare each pixel of the Gaussian-blurred non-hazardous goods brightness matrix with the second brightness threshold. Those less than the second brightness threshold are the vehicle area, denoted as 1; those greater than the second brightness threshold are the background area, denoted as 0, to obtain the approximate area matrix of the vehicle.

7. A method for processing dangerous goods injection in vehicle X-ray images according to claim 6, characterized in that, The second brightness threshold is the mean of the background brightness distribution in the Gaussian-blurred non-hazardous goods brightness matrix minus 0.5 times the standard deviation of the background brightness distribution in the Gaussian-blurred non-hazardous goods brightness matrix.

8. A method for processing dangerous goods injection in vehicle X-ray images according to claim 1, characterized in that Generate a non-hazardous goods injection matrix, rotate the hazardous goods white background matrix by an angle and embed it into the non-hazardous goods injection matrix to generate the matrix of the hazardous goods to be injected, including: Generate a non-hazardous goods three-dimensional brightness similarity matrix with the same size as the non-hazardous goods three-dimensional brightness matrix and all values being floating-point number 1. Randomly generate the coordinates of the first center point within the width and height range of the non-hazardous goods injection matrix. Rotate the hazardous goods white background matrix and embed it into the non-hazardous goods injection matrix to obtain the matrix of the hazardous goods to be injected, whose center point is consistent with the coordinates of the first center point.

9. A method for processing dangerous goods injection in vehicle X-ray images according to claim 8, characterized in that, Generate the pixel-level segmentation matrix of the hazardous goods, rotate the hazardous goods pixel annotation matrix by an angle and embed it into the pixel-level segmentation matrix of the hazardous goods to generate the approximate area matrix of the vehicle with the hazardous goods to be injected, including: Generate a pixel-level segmentation matrix of the hazardous goods with the same size as the approximate area matrix of the vehicle and all values being integer 0. Then rotate the hazardous goods pixel annotation matrix and embed it into the pixel-level segmentation matrix of the hazardous goods to generate the approximate area matrix of the vehicle with the hazardous goods injection, making its center point consistent with the coordinates of the first center point.

Citation Information

Patent Citations

  • Security inspection image-based dangerous article image injection method

    CN110210368A

  • Positive and negative data set bidirectional joint intelligent image judgment method based on X-ray machine image

    CN111861986A

  • X-ray machine image recognition method, device and system based on instance segmentation

    CN112069907A

  • Security check X-ray graph discrimination training data expansion method based on sketch style migration

    CN115908986A

  • Data enhancement method based on big law algorithm and channel attention mechanism

    CN116912144A