Target detection method and ray scanning detection system

By constructing a sample library and feature library, using pre-trained models to generate searchers, and combining with adversarial sample optimization, we solve the problems of difficulty in labeling and insufficient continuous learning capabilities in ray scanning image recognition, and achieve new categories with fast online learning and high accuracy. Identify.

CN118035481BActive Publication Date: 2024-10-01NUCTECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410430802.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-11
Publication Date
2024-10-01
Estimated Expiration
2044-04-11

AI Technical Summary

Technical Problem

Existing deep learning applications in radiographic image recognition have problems such as difficulty in obtaining annotated data, lack of continuous learning capabilities, difficulty in identifying new categories, high computational overhead, and poor interpretability, which causes the system to need to be retrained when dealing with new categories. , time-consuming and labor-intensive.

Method used

By constructing a sample library and feature library, using pre-trained feature extraction models to extract image features, generating a searcher to achieve similar retrieval, and optimizing the feature library combined with adversarial samples, rapid online learning and recognition under small sample conditions can be achieved.

Benefits of technology

It reduces the need for labeled samples, improves the system's adaptation speed and recognition accuracy, reduces the amount of manual labeling and repeated training time, and enhances the robustness and interpretability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118035481B_ABST
    Figure CN118035481B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for generating a retriever, a method and device for target detection, an electronic device, and a ray scanning detection system, which can be used in the field of image processing. The generation method includes: constructing a sample library, including: obtaining first sample data, including a first image and a first label, the first label represents the category of the first detection target; obtaining second sample data, including a second image and a second label, the second label represents the category of the second detection target, and the first and second sample data are positive and negative sample data respectively; constructing a feature library, including: extracting first and second image features using a feature extraction model; forming a first and second feature-label relationship; generating a feature library based on the first and second feature-label relationship; and generating a retriever based on the feature library. In this way, only a small number of samples are needed to obtain feature representations through an image feature extraction network, and to construct a feature library corresponding to the category.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of image processing and / or target detection, and in particular to a target detection method and device, electronic equipment, a ray scanning detection system, a computer-readable storage medium and a program product. Background Art

[0002] The widespread application of X-ray scanning detection technology has brought great convenience to the identification of abnormal objects, but the rapidly increasing number of packages and the pass rate requirements have put tremendous pressure on traditional manual image judgment, and a more automated identification method is urgently needed. X-ray scanning image intelligent recognition technology has emerged. This technology uses a deep learning-based target detection method to automatically identify and alarm the collected X-ray scanning images, greatly reducing the human burden.

[0003] In related technologies, there are deep learning-based ray scanning image recognition methods. However, current deep learning applications usually have some defects or problems. For example, retraining of deep learning models usually requires a large number of labeled samples, and obtaining labeled data for some rare categories is very challenging. For another example, the current mainstream algorithms do not have the ability to continuously learn. After the network model is deployed, the structure and parameters are fixed and no longer change, and the data exposed after deployment cannot be fully utilized for optimization.

[0004] The above information disclosed in this section is only for understanding the background of the inventive concept of the present application and therefore the above information may contain information that does not constitute the prior art. Summary of the invention

[0005] In view of at least one aspect of the above technical problems, a method and device for generating a retriever, a method and device for detecting a target, an electronic device, a ray scanning detection system, a computer-readable storage medium and a program product are proposed.

[0006] In one aspect, a method for generating a retriever for a radiation scanning detection system is provided, the method comprising:

[0007] Constructing a sample library, the constructing the sample library comprising: acquiring first sample data, the first sample data comprising a first image and a first label, the first image being an image comprising at least one first detection target, the first label indicating the category of the at least one first detection target; and acquiring second sample data, the second sample data comprising a second image and a second label, the second image being an image comprising at least one second detection target, the second label indicating the category of the at least one second detection target, the first sample data being positive sample data, and the second sample data being negative sample data;

[0008] Constructing a feature library, the constructing the feature library comprising: extracting a first image feature of the first image and extracting a second image feature of the second image using a pre-trained feature extraction model; forming a first feature-label relationship based on the first image feature and the first label, and forming a second feature-label relationship based on the second image feature and the second label; and generating a feature library based on the first feature-label relationship and the second feature-label relationship; and

[0009] Based on the feature library, a retriever is generated.

[0010] According to some exemplary embodiments, constructing the sample library also includes: acquiring third sample data, the third sample data including a third image and a third label, the third image being a X-ray scanning image including at least one third detection target, the third label indicating a category of the at least one third detection target, wherein the third sample data includes positive sample data and / or negative sample data.

[0011] According to some exemplary embodiments, constructing the feature library also includes: extracting third image features of the third image using a pre-trained feature extraction model; forming a third feature-label relationship based on the third image features and the third label; and storing the third feature-label relationship in the feature library.

[0012] According to some exemplary embodiments, the first image feature includes at least one of a sparse feature and a dense feature; and / or, the second image feature includes at least one of a sparse feature and a dense feature; and / or, the third image feature includes at least one of a sparse feature and a dense feature.

[0013] According to some exemplary embodiments, the sparse features include region features represented by bounding box annotation; and / or the dense features include region features represented by pixel-level mask annotation.

[0014] According to some exemplary embodiments, acquiring the first sample data includes: acquiring a plurality of first images for an application scenario of the ray scanning detection system, wherein each of the plurality of first images includes at least one first detection target, and the first detection target is a typical detection target suitable for the application scenario of the ray scanning detection system; and marking the categories of the first detection targets in the plurality of first images to form a plurality of first labels.

[0015] According to some exemplary embodiments, obtaining the second sample data includes: obtaining a plurality of second images according to the first sample data, wherein each of the plurality of second images includes at least one second detection target, the second detection target is similar to the first detection target, and the second detection target is of a different category from the first detection target; and marking the categories of the second detection targets in the plurality of second images to form a plurality of second labels.

[0016] According to some exemplary embodiments, acquiring the plurality of second images comprises acquiring the plurality of second images by at least one of actively collecting, retrieving historical data, and synthesizing based on a generative model.

[0017] According to some exemplary embodiments, the first sample data and the second sample data are acquired before the radiation scanning detection system is formally operated.

[0018] According to some exemplary embodiments, the third sample data is acquired during the formal operation of the ray scanning detection system.

[0019] According to some exemplary embodiments, the obtaining of the third sample data includes: during the formal operation of the radiation scanning detection system, spot-checking the detection results of the radiation scanning detection system; in response to the existence of omissions and / or false alarms in the detection results, obtaining an image with the omissions and / or false alarms as a third image; and marking the category of the third detection target in the third image to form multiple third labels.

[0020] In another aspect, a target detection method for a ray scanning detection system is provided, the method comprising: acquiring a ray scanning image through the ray scanning detection system, the ray scanning image including at least one detection target; extracting image features of the ray scanning image using a pre-trained feature extraction model; performing similarity retrieval on the image features of the ray scanning image using a retriever generated by the method described above; and acquiring a category corresponding to the image features of the ray scanning image in response to matching the image features of the ray scanning image with image features in the feature library, and determining that the category is the category of at least one detection target included in the ray scanning image.

[0021] According to some exemplary embodiments, the similarity retrieval includes: using a nearest neighbor search algorithm to search for image features matching the image features of the X-ray scanning image in a feature library of the retriever.

[0022] According to some exemplary embodiments, the image features in the feature library include sparse features and dense features; the similarity retrieval includes: for the image features of the X-ray scanning image, searching the feature library of the retriever for sparse features that match the image features of the X-ray scanning image; and in response to the existence of sparse features that match the image features of the X-ray scanning image, further searching the feature library of the retriever for dense features that match the image features of the X-ray scanning image for the image features of the X-ray scanning image; or, the similarity retrieval includes: for the image features of the X-ray scanning image, only searching the feature library of the retriever for dense features that match the image features of the X-ray scanning image; or, the similarity retrieval includes: for the image features of the X-ray scanning image, only searching the feature library of the retriever for sparse features that match the image features of the X-ray scanning image.

[0023] According to some exemplary embodiments, the method includes: in the process of acquiring the X-ray scanning image, further acquiring meta information corresponding to the X-ray scanning image, wherein the meta information includes device parameters for acquiring the image.

[0024] According to some exemplary embodiments, the ray scanning detection system includes a multi-view scanning detection system; the method also includes: based on acquiring the ray scanning image and the category of at least one detection target included in the ray scanning image, forming two-dimensional scanning images of multiple perspectives; and, based on the geometric relationship and the at least one detection target identified, performing three-dimensional fusion of the two-dimensional scanning images of the multiple perspectives to form a three-dimensional scanning image, wherein the three-dimensional recognition result of the at least one detection target is displayed in the three-dimensional scanning image; or, the method also includes: based on acquiring the ray scanning image and the category of at least one detection target included in the ray scanning image, forming two-dimensional scanning images of multiple perspectives; and, based on the geometric relationship and the at least one detection target identified, obtaining the three-dimensional recognition result of the at least one detection target without fusing the three-dimensional scanning image.

[0025] According to some exemplary embodiments, the method further includes: based on acquiring the X-ray scanning image and the category of at least one detection target included in the X-ray scanning image, determining the physical properties of the at least one detection target according to the category; based on the physical properties and the at least one identified detection target, performing three-dimensional fusion of the X-ray scanning image to form a three-dimensional scanning image, wherein the three-dimensional recognition result of the at least one detection target is displayed in the three-dimensional scanning image.

[0026] In yet another aspect, a device for generating a retriever for a radiation scanning detection system is provided, the device comprising:

[0027] A first construction module is used to construct a sample library, and the first construction module includes: a first data acquisition submodule, used to acquire first sample data, wherein the first sample data includes a first image and a first label, the first image is a ray scanning image including at least one first detection target, and the first label indicates the category of the at least one first detection target; and a second data acquisition submodule, used to acquire second sample data, wherein the second sample data includes a second image and a second label, the second image is a ray scanning image including at least one second detection target, the second label indicates the category of the at least one second detection target, the first sample data is positive sample data, and the second sample data is negative sample data;

[0028] a second construction module for constructing a feature library, the second construction module comprising: an extraction submodule for extracting a first image feature of the first image and a second image feature of the second image using a pre-trained feature extraction model; a relationship formation submodule for forming a first feature-label relationship based on the first image feature and the first label, and a second feature-label relationship based on the second image feature and the second label; and a feature library generation submodule for generating a feature library based on the first feature-label relationship and the second feature-label relationship; and

[0029] The retriever generation module is used to generate a retriever based on the feature library.

[0030] On the other hand, a target detection device for a ray scanning detection system is provided, the device comprising: an image acquisition module, for acquiring a ray scanning image through the ray scanning detection system, the ray scanning image including at least one detection target; a feature extraction module, for extracting image features of the ray scanning image using a pre-trained feature extraction model; a retrieval module, for performing similarity retrieval on the image features of the ray scanning image using a retriever generated by the method as described above; and a target detection module, for acquiring a category corresponding to the image features of the ray scanning image in response to matching the image features of the ray scanning image with image features in the feature library, and determining that the category is the category of at least one detection target included in the ray scanning image.

[0031] On yet another aspect, an electronic device is provided, comprising: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the method as described above.

[0032] On the other hand, a ray scanning detection system is provided, comprising: a ray source for emitting rays; a detector for receiving rays emitted from the ray source and passing through a detection object; and a data processing device, the data processing device being communicatively connected to the detector, wherein the data processing device comprises: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the method as described above.

[0033] In yet another aspect, a computer-readable storage medium is provided, on which executable instructions are stored. When the instructions are executed by a processor, the processor executes the method as described above.

[0034] In yet another aspect, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the method as described above is implemented.

[0035] In an embodiment of the present application, only a small sample library may be constructed, and only a small number of samples are needed to obtain feature representation through an image feature extraction network and to construct a feature library corresponding to a category. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to better understand the present application, the present application will be described in detail according to the following drawings:

[0037] Figure 1 It is a schematic diagram of the structure of a ray scanning detection system according to some exemplary embodiments of the present application.

[0038] Figure 2 It is a schematic diagram of a CT scanning device implementing a reconstruction scanning method according to some exemplary embodiments of the present application.

[0039] Figure 3 An example of attenuation signal data obtained according to an embodiment of the present application is shown.

[0040] Figure 4 It is a schematic flow chart of a method for generating a retriever for a ray scanning detection system according to an embodiment of the present application.

[0041] Figure 5 is a schematic flowchart of building a sample library according to an embodiment of the present application.

[0042] Figure 6 It is a schematic flowchart of constructing a feature library according to an embodiment of the present application.

[0043] Figure 7 is a schematic diagram of a first image according to some exemplary embodiments of the present application.

[0044] Figure 8 is a schematic diagram of a first image according to some other exemplary embodiments of the present application.

[0045] Fig. 9 It is a schematic flow chart of a target detection method for a ray scanning detection system according to an embodiment of the present application.

[0046] Fig.10 It is a schematic flow chart of a target detection method for a ray scanning detection system according to an embodiment of the present application, which schematically shows a retriever generation process and a target detection process.

[0047] Fig.11 It is a structural block diagram of a generating device of a retriever for a ray scanning detection system according to an exemplary embodiment of the present application.

[0048] Fig.12 It is a structural block diagram of a target detection device for a ray scanning detection system according to an exemplary embodiment of the present application.

[0049] Fig.13 The structural block diagram of an electronic device suitable for implementing the retriever generation method or the target detection method according to an exemplary embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0050] The specific embodiments of the present application will be described in detail below. It should be noted that the embodiments described herein are only for illustration and are not intended to limit the present application. In the following description, a large number of specific details are set forth in order to provide a thorough understanding of the present application. However, it is obvious to those of ordinary skill in the art that these specific details need not be adopted to implement the present application. In other examples, in order to avoid confusing the present application, known structures, materials or methods are not specifically described.

[0051] Throughout the specification, references to "one embodiment," "an embodiment," "an example," or "an example" mean that a particular feature, structure, or characteristic described in conjunction with the embodiment or example is included in at least one embodiment of the present application. Therefore, the phrases "in one embodiment," "in an embodiment," "an example," or "an example" appearing in various places throughout the specification do not necessarily all refer to the same embodiment or example. In addition, particular features, structures, or characteristics may be combined in one or more embodiments or examples in any suitable combination and / or subcombination. In addition, those of ordinary skill in the art will appreciate that the term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0052] The terms used herein are only for describing specific embodiments and are not intended to limit the present application. The terms "include", "comprising", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0053] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0054] In the field of computer vision, an important application scenario of deep learning methods is target detection. That is, for an input image, the algorithm can give the location information of the object (bounding box or edge contour) and its category, which has important applications in contraband identification, autonomous driving, anomaly detection, etc.

[0055] The inventor has found through research that with the development of X-ray scanning detection technology and deep learning technology, X-ray scanning image intelligent recognition technology has emerged. This technology uses a deep learning-based target detection method to automatically identify and alarm the collected X-ray scanning images, greatly reducing the burden of manpower. For example, CT (Computed Tomography) scanning technology uses a reconstruction algorithm to obtain the internal three-dimensional structure information of an object, effectively solving the problem of object overlap in DR (Digital Radiography) scanning. It has the ability to detect the internal structure of an object without contact, at a moderate cost, and with intuitive results. It has achieved remarkable results in many fields such as medical imaging, security inspection, and industrial flaw detection. Among them, the dual-energy material recognition technology of security inspection CT can distinguish material information such as the atomic number of an object, greatly improving the ability to detect dangerous goods, and is an important and indispensable means of luggage detection for security inspection CT.

[0056] The widespread use of CT has brought severe challenges to the identification of abnormal objects. The rapidly increasing number of packages and the pass rate requirements have put tremendous pressure on the traditional manual image judgment method, and a more automated recognition method is urgently needed. CT intelligent recognition technology came into being. This technology uses machine learning technology to identify and alarm CT scan data. In 2012, deep learning methods based on artificial neural networks made rapid progress in various sub-fields of computer vision, and performed well in image classification, target detection and super-resolution. The results in various aspects fully demonstrated the powerful ability of deep learning to automatically mine complex structures from image data without manual feature extraction. It is worth noting that the multi-layer neural network as the basis of deep learning models is not a recent proposal. In recent years, there are three main factors that have promoted the breakthrough results of deep learning: complex deep network structure, massive training data represented by ImageNet, and the development of high-performance computing technology. Among them, data is regarded as the fuel for deep learning and plays a decisive role in the final performance of the algorithm.

[0057] The inventors further discovered that, despite the booming development of deep learning, most deep learning applications still have some defects. For example, the current mainstream algorithms do not have the ability to continuously learn. After the network model is deployed, its structure and parameters are fixed and no longer change. It cannot fully utilize the data it encounters after deployment for optimization. The specific reason is that the neural network model obtained by end-to-end training usually has the following characteristics:

[0058] 1. End-to-end neural networks are function fitters for training data: Deep networks learn feature expressions and decision surfaces under specific distributions of training data. Through training, they can acquire powerful feature learning and modeling capabilities. However, this end-to-end learning feature also leads to a high degree of dependence on training data. There is no clear separation of feature extraction and modeling steps within the neural network model, but rather a whole-body fit. This means that when the category changes, it must relearn to adapt to the distribution of the new data.

[0059] 2. Neural networks require a high amount of training data. Although various regularization methods can reduce the model's dependence on data volume to a certain extent, compared with traditional machine learning methods, the network model's data hunger for labeled samples has not been fundamentally solved. This is mainly due to the high complexity of the network structure, and a large number of parameters need to be constrained by large-scale data. Therefore, it is difficult for the network to adapt to small samples.

[0060] 3. Difficulty in category expansion of end-to-end neural network models: The complex nonlinear network structure gives the model powerful recognition capabilities, but also makes it sensitive to the distribution of training data. This means that even in the same classification task, a slight change in the distribution of training data may have a relatively large impact on the model. Therefore, it is difficult for the model to generalize to new categories, and it is difficult to incrementally add new categories, and it often requires overall retraining.

[0061] 4. The computational overhead of the network training process is high. Each fine-tuning of a deep network requires iterative optimization, involving a large number of forward and backward propagation calculations. This results in low network adaptation efficiency and makes it difficult to perform fast online updates.

[0062] 5. Poor interpretability: Deep network is a black box system, and it is difficult to explain its internal representation and prediction basis. This limits the credibility of the model.

[0063] The above defects lead to the following: if the current deep learning-based image recognition system needs to recognize new categories, the entire deep neural network model must be retrained. Retraining the neural network model usually requires a large number of labeled samples, and it is very challenging to obtain labeled data for some rare categories.

[0064] In sharp contrast, humans can learn new knowledge in the process of solving problems and thus make continuous progress. If the network has the ability to continuously learn, that is, to self-learn during online operation, the algorithm performance can be continuously improved during use. The core of continuous learning ability is to learn from the field data obtained from online operation. Therefore, it is of great application value to develop a recognition system that can quickly add new categories with only a small number of samples.

[0065] The inventors have found that in the actual application scenarios of security inspections, the prohibited items identification function required in the initial stage is often limited to certain categories such as knives, guns, and explosives. With the continuous changes in demand during on-site use and the impact of some emergencies, the categories of objects that need to be detected will be constantly updated. However, the series of processes of re-collecting data, manually annotating, adjusting algorithms, and then deploying after each update are extremely time-consuming and economically expensive and difficult to accept. In addition, the daily data flow at the detection site is huge, and the on-site data is extremely authentic and rich. For some fixed categories that need to be detected on a daily basis, if this part of the data can be effectively utilized, it will greatly improve the detection performance of the system. At the same time, it can also more conveniently adjust the algorithm according to the characteristics of the data in the area of ​​use, and further optimize the system performance.

[0066] Based on this, some exemplary embodiments of the present application provide a method for generating a retriever for a ray scanning detection system, the method comprising: constructing a sample library, the constructing the sample library comprising: acquiring first sample data, the first sample data comprising a first image and a first label, the first image being a ray scanning image including at least one first detection target, the first label representing the category of the at least one first detection target; and acquiring second sample data, the second sample data comprising a second image and a second label, the second image being a ray scanning image including at least one second detection target, the second label representing the category of the at least one second detection target, the first sample data being positive sample data, and the second sample data being negative sample data; constructing a feature library, the constructing the feature library comprising: extracting first image features of the first image and extracting second image features of the second image using a pre-trained feature extraction model; forming a first feature-label relationship based on the first image feature and the first label, and forming a second feature-label relationship based on the second image feature and the second label; and generating a feature library based on the first feature-label relationship and the second feature-label relationship; and generating a retriever based on the feature library. In an embodiment of the present application, only a small sample library may be constructed, and only a small number of samples are needed to obtain feature representation through an image feature extraction network and to construct a feature library corresponding to a category.

[0067] Some exemplary embodiments of the present application also provide a target detection method for a ray scanning detection system, the method comprising: acquiring a ray scanning image through the ray scanning detection system, the ray scanning image including at least one detection target; extracting image features of the ray scanning image using a pre-trained feature extraction model; performing similarity retrieval on the image features of the ray scanning image using a retriever generated by the method described above; and in response to matching the image features of the ray scanning image with image features in the feature library, acquiring a category corresponding to the image features of the ray scanning image, and determining that the category is the category of at least one detection target included in the ray scanning image.

[0068] In the embodiments of the present application, by adopting the retrieval enhancement detection technology, the advantages of the retrieval model and the detection model are effectively integrated to achieve fast online learning under small sample conditions. And by optimizing the sample library based on adversarial samples, the robustness of the model prediction is enhanced.

[0069] Below, taking CT scanning detection as an example, the embodiments of the present application are described in detail. It should be understood that the embodiments of the present application are not limited to CT scanning detection scenarios, and can be applied to various scanning detection scenarios. For example, X-ray machine security inspection, terahertz (millimeter wave) human body security inspection, etc. For another example, it can be applied to scanning detection scenarios including various inspection objects, including but not limited to vehicle scanning detection, luggage / package scanning detection, human body scanning detection, etc. It should be noted that the description of the scanning detection scenario here is not an exhaustive description, and the description here should not be understood as limiting the scope of protection of the present application.

[0070] It should be noted that the embodiments of the present application are not limited to target detection tasks, but can also be applied to tasks such as image classification and image segmentation. Similarly, the dimension of the data is not limited to the detected object, and it can be three-dimensional data used for illustration in the following embodiments, or it can be two-dimensional data, pseudo three-dimensional data (depth data), etc. Thus, in this article, unless otherwise specified, the expression "image recognition" includes but is not limited to various tasks such as target detection, image classification, and image segmentation.

[0071] Figure 1 is a schematic diagram of the structure of a ray scanning detection system according to some exemplary embodiments of the present application. Figure 1 In the figure, a CT scanning device is schematically shown as an example of the ray scanning detection system. Figure 1 As shown, the CT scanning device according to this embodiment includes: a rack 20, a carrying mechanism 40, a controller 50, a data processing device 60 (such as a computer), etc. The rack 20 includes a ray source 10 that emits X-rays for inspection, such as an X-ray machine, and a detection and acquisition device 30. The carrying mechanism 40 carries the inspection object (such as checked luggage) 70 through the scanning area between the ray source 10 of the rack 20 and the detection and acquisition device 30, and the rack 20 rotates around the forward direction of the inspection object 70, so that the rays emitted by the ray source 10 can pass through the inspection object 70, and the inspection object 70 is CT scanned. The detection and acquisition device 30, for example, includes a detector and a data acquisition device with an integral module structure, such as a flat panel detector, which is used to detect the rays that penetrate the inspected object, obtain analog signals, and convert the analog signals into digital signals, thereby outputting the projection data of the inspection object 70 for the X-rays. The controller 50 is used to control the various parts of the entire system to work synchronously. The data processing device 60 is used to process the data collected by the data acquisition device, process and reconstruct the data, and output the results.

[0072] like Figure 1As shown, the ray source 10 is placed on one side where the object to be inspected can be placed, and the detection and acquisition device 30 is placed on the other side of the inspection object 70, including a detector and a data collector, which is used to obtain the transmission data and / or multi-angle projection data of the inspection object 70. The data collector includes a data amplification and shaping circuit, which can work in a (current) integration mode or a pulse (counting) mode. The data output cable of the detection and acquisition device 30 is connected to the controller 50 and the data processing device 60, and the collected data is stored in the data processing device 60 according to the trigger command.

[0073] In an embodiment of the present application, a ray scanning detection module may be deployed in the data processing device 60, and an image recognition model or a target detection model may be deployed in the ray scanning detection module. The ray scanning detection module may use the image recognition model or the target detection model to identify the collected field data (e.g., ray scanning images), and the identification may include target detection, for example, detecting the target object or the object of interest in the ray scanning image. For example, the target object or the object of interest may be various types of contraband. It should be understood that the specific category of the target object or the object of interest depends on the scanning and detection site arranged by the ray scanning detection system, or in other words, the specific category of the target object or the object of interest is determined by the user of the ray scanning detection system (also referred to as the user in this article) according to the specific scanning and detection needs, and it can be dynamically adjusted according to the scanning and detection needs.

[0074] In the embodiment of the present application, the ray source 10 may be, for example, an X-ray machine, and a suitable X-ray machine focal spot size may be selected according to the imaging resolution. In other embodiments, an X-ray machine may not be used, but a linear accelerator may be used to generate an X-ray beam.

[0075] The detection and acquisition device 30 includes an X-ray detector and a data acquisition circuit. The X-ray detector may use a solid detector, a gas detector or other detectors, but the embodiments of the present application are not limited thereto. The data acquisition circuit includes a readout circuit, an acquisition trigger circuit, and a data transmission circuit.

[0076] The combination of the controller 50 and the data processing device 60 includes, for example, a computer device installed with a control program and a data processing program, which is responsible for completing the control of the operation process of the CT scanning device, including mechanical rotation, electrical control, safety interlock control, etc., reconstructing CT images from projection data, training image recognition models or target detection models, and using the trained image recognition models or target detection models to recognize X-ray scanning images, etc.

[0077] Figure 2 is a schematic diagram of a CT scanning device implementing a reconstruction scanning mode according to some exemplary embodiments of the present application. Figure 2As shown, after the X-rays emitted from the ray source 10 pass through a portion of the detection object 70 in the field of view 45, they are received by the detection and acquisition device 30, converted into electrical signals and then converted into digital signals representing attenuation values, which are used as projection data and reconstructed by a computer to obtain a higher quality image.

[0078] According to an embodiment of the present application, the above-mentioned CT scanning device is used to perform CT scanning on the detection object to obtain the original attenuation signal. The attenuation signal data corresponding to a row of detectors can also be displayed in the form of a two-dimensional image. Figure 3 FIG. 2 shows an example of attenuation signal data obtained according to an embodiment of the present application. Figure 3 The horizontal axis of the original attenuation signal shown represents the pixel sequence in the detector column direction (for example, from 1 to 256), and the vertical axis represents the angle (for example, from 1 degree to 360 degrees). The original attenuation signal is preprocessed to become projection data. For example, the projection data can be preprocessed by a CT scanning device such as negative logarithmic transformation to obtain the projection data. Then, the data processing device 60 executes a reconstruction program, for example, a mainstream analytical reconstruction method in the field can be used to obtain a reconstructed image, which is the ray scanning image mentioned in the embodiment of the present application.

[0079] In an embodiment of the present application, the data processing device 60 may perform image recognition (e.g., target detection) on the above-mentioned reconstructed image (i.e., the ray scanning image) to identify an object of interest (e.g., contraband) in the ray scanning image. Specifically, a ray scanning detection module may be deployed in the data processing device 60, and an image recognition model or a target detection model may be deployed in the ray scanning detection module. The ray scanning detection module may use the image recognition model or the target detection model to recognize the ray scanning image.

[0080] Figure 4 is a schematic flow chart of a method for generating a retriever for a ray scanning detection system according to an embodiment of the present application. In an embodiment of the present application, the retriever may be pre-generated as part of a detection model and applied to a ray scanning detection system (e.g. Figure 1 In the CT scanning device shown in the figure), the ray scanning detection system is arranged at the scanning detection site. And as the sample data acquired in the scanning detection site increases, the retriever can be updated. For example, referring to Figure 4 , the method for generating the retriever may include the following operations S410~S430.

[0081] In operation S410, a sample library may be constructed.

[0082] Figure 5 is a schematic flow chart of constructing a sample library according to an embodiment of the present application. Figure 5, the constructing of the sample library may include sub-operations S4101~S4102.

[0083] In sub-operation S4101, first sample data is acquired, where the first sample data includes a first image and a first label, where the first image is an image including at least one first detection target, and the first label indicates a category of the at least one first detection target.

[0084] In some exemplary embodiments of the present application, the detection and acquisition device 30 includes a detector for detecting X-rays, and the first image may include a radiation scanning image such as an X-ray fluoroscopic image, a CT image, etc. Alternatively or additionally, the detection and acquisition device 30 may include a sensor for detecting visible light, for example, an image sensor such as an industrial camera, a surveillance camera, etc., and the first image may include a visible light image.

[0085] In some exemplary embodiments of the present application, in sub-operation S4101, multiple first images can be acquired for the application scenario of the ray scanning detection system, wherein each of the multiple first images includes at least one first detection target, which is a typical detection target suitable for the application scenario of the ray scanning detection system; and the categories of the first detection targets in the multiple first images are marked to form multiple first labels.

[0086] In an embodiment of the present application, the first sample data may be acquired before the ray scanning detection system is formally put into operation. Here, "formal operation" may be understood as the ray scanning detection system being deployed in the actual detection site of the user and performing actual detection work.

[0087] For example, in an embodiment of the present application, the detection and acquisition device 30 supports two types of working modes: offline batch acquisition mode and online acquisition mode. In the offline batch acquisition mode, the ray scanning detection system can collect samples in advance (such as the first image mentioned above) and manually annotate the pre-collected samples. In an embodiment of the present application, the pre-collected samples can be a small number of key samples with category labels obtained by annotating the newly added categories. In the subsequent detection stage, the system can use these small number of samples of known categories to quickly adapt to the new categories. In the online acquisition mode, the system obtains image input in real time for recognition when it is deployed.

[0088] In sub-operation S4102, second sample data is acquired, where the second sample data includes a second image and a second label, the second image is a X-ray scanning image including at least one second detection target, the second label represents a category of the at least one second detection target, the first sample data is positive sample data, and the second sample data is negative sample data.

[0089] In some exemplary embodiments of the present application, the detection and acquisition device 30 includes a detector for detecting X-rays, and the second image may include a radiation scanning image such as an X-ray fluoroscopic image, a CT image, etc. Alternatively or additionally, the detection and acquisition device 30 may include a sensor for detecting visible light, such as an image sensor such as an industrial camera, a surveillance camera, etc., and the second image may include a visible light image.

[0090] In some exemplary embodiments of the present application, in sub-operation S4102, multiple second images can be acquired based on the first sample data, wherein each of the multiple second images includes at least one second detection target, the second detection target is similar to the first detection target, and the second detection target is of a different category from the first detection target; and the categories of the second detection targets in the multiple second images are marked to form multiple second labels.

[0091] In an embodiment of the present application, the first sample data is positive sample data. For example, when the ray scanning detection system is applied to a baggage security inspection or package inspection scenario, the positive sample data may be an image including a first detection target, and the first detection target may be a target that a user is interested in or needs to focus on in the baggage security inspection or package inspection scenario.

[0092] Figure 7 is a schematic diagram of a first image according to some exemplary embodiments of the present application. Figure 7 , the first image includes two categories of first detection targets, namely a tablet computer and a watch. In this scenario, the first image feature may include a first annotation box 11 for annotating the tablet computer, and the first label may include "tablet computer"; and the first image feature may also include a first annotation box 12 for annotating the watch, and the first label may also include "watch".

[0093] Figure 8 is a schematic diagram of a first image according to some other exemplary embodiments of the present application. Figure 8 , the first image includes three categories of first detection targets, namely, first category detection targets, second category detection targets (e.g., first tool) and third category detection targets (e.g., second tool). In this scenario, the first image feature may include a first annotation box 13 for annotating the second tool, and the first label may include "tool".

[0094] It should be noted that Figure 7 and Figure 8The categories of the detection targets and the annotation boxes shown in the figure are only schematic diagrams for illustrating the embodiments of the present application and should not be construed as limiting the embodiments of the present application. In other embodiments, the image may include other categories of detection targets and corresponding annotation boxes.

[0095] In an embodiment of the present application, the second sample data is negative sample data. For example, when the ray scanning detection system is applied to a baggage security inspection or a package inspection scenario, the negative sample data may be an image including a second detection target, and the second detection target may be similar to the first detection target, and the second detection target is of a different category from the first detection target. Figure 7 In the scene shown, the shape of the second detection target is the same as or similar to a tablet computer or a watch, but it is not actually a tablet computer or a watch. Figure 8 In the scenario shown, the shape of the second detection target may be the same as or similar to the shape of a gun, a first knife (such as a kitchen knife) or a second knife (such as a dagger), but is not actually a prohibited item.

[0096] In an embodiment of the present application, the second sample data is an adversarial sample. By providing the second sample data, the system can be provided with a control decision boundary. That is to say, in an embodiment of the present application, for each manually labeled positive sample (i.e., the first sample data), an adversarial sample that may cause a false positive can be actively added as a negative sample. These adversarial samples can help the detection model better define the decision boundary and enhance the robustness of the model prediction.

[0097] In some exemplary embodiments, the acquiring of the plurality of second images may include acquiring the plurality of second images by at least one of active acquisition, retrieval of historical data, and synthesis based on a generative model. That is, the source of the adversarial sample may include, but is not limited to, active acquisition by the user, retrieval of the user's historical data by the model, and data synthesis based on a generative model. For example, the generative model includes, but is not limited to, generative models such as a generative adversarial model (GAN) and a diffusion model.

[0098] In an embodiment of the present application, the second sample data may be acquired before the ray scanning detection system is formally put into operation.

[0099] Return to reference Figure 4 , in operation S420, a feature library may be constructed.

[0100] Figure 6 is a schematic flow chart of constructing a feature library according to an embodiment of the present application. Figure 6 , the constructing of the feature library may include sub-operations S4201~S4203.

[0101] In sub-operation S4201, a pre-trained feature extraction model is used to extract first image features of the first image and to extract second image features of the second image.

[0102] In sub-operation S4202, a first feature-label relationship is formed based on the first image feature and the first label, and a second feature-label relationship is formed based on the second image feature and the second label.

[0103] In sub-operation S4203, a feature library is generated based on the first feature-label relationship and the second feature-label relationship.

[0104] Return to reference Figure 4 In operation S430, a retriever may be generated based on the feature library.

[0105] For example, return to reference Figure 5 , the constructing of the sample library may further include a sub-operation S4103. In the sub-operation S4103, third sample data is obtained, the third sample data includes a third image and a third label, the third image is a radiographic scanning image including at least one third detection target, the third label indicates the category of the at least one third detection target, wherein the third sample data includes positive sample data and / or negative sample data.

[0106] In an embodiment of the present application, the third sample data may include false alarm samples. When manual inspection finds that the detection model makes wrong judgments on some samples, these misclassified samples can be saved for annotation and stored in the sample library as error correction samples. Alternatively or additionally, the third sample data may include missed alarm samples. Exemplarily, the missed alarm samples may include dangerous goods that should have alarmed but did not alarm during actual operation. When manual inspection finds these missed alarm samples, these missed alarm samples can be saved for annotation and stored in the sample library as positive samples. These samples mainly come from error cases and are therefore a sample set that grows in operation. In other words, the third sample data can be obtained during the formal operation of the X-ray scanning detection system.

[0107] Specifically, in sub-operation S4103, during the formal operation of the radiation scanning detection system, the detection results of the radiation scanning detection system are randomly checked; in response to the existence of under-reporting and / or false alarms in the detection results, an image with under-reporting and / or false alarms is acquired as a third image; and the category of the third detection target in the third image is marked to form multiple third labels.

[0108] In an embodiment of the present application, based on the misrecognition situation, difficult samples are selected to generate adversarial samples for feature library enhancement, and the adversarial sample generation is used to enhance the feature library.

[0109] In an embodiment of the present application, during the generation process of the retriever, only a small sample library needs to be constructed, that is, only a small number of samples are needed to obtain feature representation through the image feature extraction network and to construct a feature library corresponding to the category.

[0110] Furthermore, sample optimization was performed based on adversarial samples. Specifically, in order to improve recognition accuracy, a sample library optimization method based on adversarial samples was designed. Specifically, for each manually annotated positive sample, an adversarial sample that would cause a false positive in the current library was subsequently added as a negative sample. This adversarial sample pair can better delineate the decision boundary.

[0111] Exemplarily, in sub-operation S4201, a pre-trained feature extraction model is further used to extract a third image feature of the third image. In sub-operation S4202, a third feature-label relationship is formed based on the third image feature and the third label. In sub-operation S4203, a feature library is generated based on the third feature-label relationship.

[0112] It should be noted that in sub-operation S4203, when there is no feature library, that is, when a new feature library needs to be created, the feature library can be generated based on at least one of the first feature-label relationship, the second feature-label relationship and the third feature-label relationship; when there is an existing feature library, at least one of the first feature-label relationship, the second feature-label relationship and the third feature-label relationship can be stored in the existing feature library.

[0113] In some exemplary embodiments of the present application, before performing the feature extraction operation, an image preprocessing operation may be performed.

[0114] For example, the preprocessing operation may include format conversion, size adjustment, etc. For another example, at least one of the first image, the second image, and the third image may be preprocessed by rotation correction, denoising, etc. to ensure image quality.

[0115] Rotation correction can help correct the tilt of the image. For example, a rotation correction method based on the image edge contour can be used to perform rotation correction on at least one of the first image, the second image, and the third image. Specifically, the rotation correction method based on the image edge contour may include the following steps:

[0116] 1. Image grayscale: Convert color images to grayscale images for subsequent processing;

[0117] 2. Threshold binarization: Convert the grayscale image into a binary image so that the target and background in the image are clearly distinguished;

[0118] 3. Detect contours: Detect the edge contours of the target in the binary image;

[0119] 4. Extract the enclosing matrix of the contour: find the minimum rectangular area that encloses the target contour. The edge of this rectangular area can be used to estimate the tilt angle of the image;

[0120] 5. Obtain the deflection angle through the extracted enclosing matrix: calculate the angle between the long side of the enclosing matrix and the horizontal line. This angle is the tilt angle of the image.

[0121] 6. Use affine transformation to deflect the image: Based on the calculated tilt angle, use affine transformation to rotate the image to a normal angle.

[0122] For example, a rotation correction method based on Fourier transform and Hough line detection may be used to perform rotation correction on at least one of the first image, the second image, and the third image. Specifically, the rotation correction method based on Hough line detection may include the following steps:

[0123] 1. Image preprocessing and edge detection: First, preprocess the image, such as grayscale and binarization, and then use edge detection algorithms (such as Sobel operator) to detect edges in the image;

[0124] 2. Hough transform: Hough transform is a technique for detecting straight lines and curves in an image. Here, it is used to detect straight lines in an image. The basic principle of Hough transform is to use the duality of points and lines to transform the lines in the image space into clustered points in the parameter space, thereby detecting whether there is a curve of a given nature in a given image;

[0125] 3. Calculate the tilt angle: Through Hough transform, the polar coordinate representation (ρ, θ) of each straight line in the image can be obtained. Among them, θ represents the tilt angle of the straight line. The tilt angle of the entire image can be obtained by counting the tilt angles of all detected straight lines and then taking the average value;

[0126] 4. Image rotation: Based on the calculated tilt angle, the image can be rotated by an image rotation algorithm (such as affine transformation) to correct it;

[0127] 5. Output the corrected image.

[0128] In some exemplary embodiments, at least one of the first image, the second image, and the third image may be denoised using a filter-based method, a model-based method, or a learning-based method.

[0129] Specifically, in filter-based methods, certain designed low-pass filters (such as median filtering and Wiener filtering, etc.) can be used to remove image noise. For example, the median filter is a nonlinear smoothing filter, and its basic principle is to replace the value of a point in a digital image or digital sequence with the median of the values ​​of each point in a field of that point, so that isolated noise points can be eliminated. In model-based methods, the distribution of natural images or noise can be modeled; then, they use the model distribution as a priori to obtain clear images and optimization algorithms. In learning-based methods, the focus is on learning the potential mapping from noisy images to clean images, which can be divided into traditional learning-based methods and deep network-based learning methods.

[0130] For example, filter-based image denoising methods can include the following: (1) Mean filter: The mean filter uses the average value of adjacent pixels to replace the original pixel value, and uses a linear method to smooth the entire image. (2) Median filter: The median filter uses a nonlinear method to use the median of the convolution template to replace the pixel value, which is suitable for processing salt and pepper noise. The main function of the median filter is to change the pixels with a large difference in grayscale values ​​of the surrounding pixels to values ​​close to the surrounding pixel values, thereby eliminating isolated noise points. (3) Gaussian filter: The Gaussian filter is a linear filter. The coefficients in its convolution template decrease as the distance from the center of the template increases. Compared with the mean filter, the Gaussian filter has a smaller degree of blurring on the entire image, and can effectively suppress noise and smooth the image. (4) Bilateral filter: The bilateral filter is a nonlinear filtering method. It is a compromise processing method that combines the spatial proximity of the image and the similarity of pixel values, which can achieve the effect of retaining edges.

[0131] For example, in some exemplary embodiments, a median filter may be used to perform denoising processing on at least one of the first image, the second image, and the third image, and specific steps thereof may include:

[0132] 1. Select a neighborhood window: For each pixel, select a neighborhood window, defined as a rectangular area of ​​size w×w;

[0133] 2. Read the grayscale values ​​of the corresponding pixels under the template: read the grayscale values ​​of the corresponding pixels under the template;

[0134] 3. Sorting: Sort these gray values ​​from large to small;

[0135] 4. Take the middle value: select the gray value of the middle pixel in the gray sequence;

[0136] 5. Assign values ​​to the pixel at the center of the template: Assign the middle value to the pixel at the center of the template.

[0137] In an embodiment of the present application, in sub-operation S4201, a pre-trained feature extraction model is used to extract first image features of the first image, extract second image features of the second image, and extract third image features of the third image.

[0138] In the embodiment of the present application, a pre-trained model is used to extract features from sample images, store them in a feature library, and construct a feature-label index relationship to form a retriever. Depending on the different annotation types, different image feature representations will be stored in the feature library.

[0139] In some exemplary embodiments, a feature extraction model can be pre-trained to extract the feature expression of the input image. The structure of the feature extraction model can use various neural network structures with general expression capabilities as the backbone, such as Transformer such as Vision Transformer, or convolutional neural networks such as ResNet. Its pre-training can be performed on a large-scale image dataset to enable it to learn the general feature expression of the image. This universality of the feature extraction model can reduce the dependence on the sample size during update.

[0140] Optionally, the feature extraction model can use Vision Transformer as the backbone. VisionTransformer (ViT) is a model that applies the Transformer structure to image classification. The specific operations of image feature extraction using ViT may include the following sub-operations:

[0141] 1. Image Block Processing: ViT divides the input image into multiple fixed-size patches, then linearly embeds each patch, adds position embedding, and then inputs the resulting vector sequence into a standard Transformer encoder;

[0142] 2. Image block embedding: Image segmentation is only a preprocessing process. To convert the vector dimension of N×(P^2×C) into a two-dimensional input of size N×D, an image block embedding operation is required. Similar to word embedding in NLP, block embedding is also a way to convert high-dimensional vectors into low-dimensional vectors.

[0143] 3. Position encoding: In order to maintain the spatial position information between input image patches, a position encoding vector needs to be added to the image block embedding;

[0144] 4. Transformer encoder: After embedding the input vector that combines category vector appending, image block embedding and position encoding, it can directly enter the Transformer encoder part, which mainly includes MSA and MLP.

[0145] 5. MLP classification processing: Finally, an MLP is used as the classification head.

[0146] The advantage of this method is that it can effectively extract image features and is highly robust to complex images and noise.

[0147] It should be noted that in deep learning, "backbone" usually refers to the main part of the neural network, that is, the network used for feature extraction. This backbone network often refers to the feature extraction network, whose function is to extract information from the image for use by the subsequent network. "Patch" here refers to the small blocks into which the input image is divided. When using Vision Transformer (ViT) for image processing, the input image is divided into multiple patches of fixed size, and then each patch is processed. The purpose of this is to reduce the computational complexity while maintaining the local characteristics of the image.

[0148] Optionally, the feature extraction model can use ResNet as the backbone. ResNet, or residual network, is a deep convolutional neural network whose main feature is the introduction of cross-layer connections (also called residual connections or short-circuit connections). The specific operations of image feature extraction using ResNet may include the following sub-operations:

[0149] 1. Convolutional layer: The basic building block of ResNet is the residual block. Each residual block contains two or three convolutional layers, which can extract the features of the image.

[0150] 2. Residual connection: In each residual block, the input is directly connected to the output through a cross-layer connection. This cross-layer connection allows the network to learn the residual function between the input and output, thereby effectively alleviating the gradient vanishing and representation bottleneck problems in deep neural networks.

[0151] 3. Pooling layer: After the convolution layer, a pooling layer is usually added to reduce the dimension of features and reduce the amount of computation.

[0152] 4. Fully connected layers: At the end of the network, there are usually one or more fully connected layers to map the extracted features to the target categories.

[0153] 5. Activation function: After the convolutional layer and the fully connected layer, an activation function, such as ReLU, is usually used to increase the nonlinear expression ability of the network.

[0154] 6. Batch Normalization: After the convolution layer, a batch normalization layer is usually used to speed up network training and prevent overfitting.

[0155] In the embodiments of the present application, the goal of image feature extraction is to extract useful data or information from an image and obtain a "non-image" representation or description of the image, such as a numerical value, a vector, and a symbol. For example, the image features may include but are not limited to: (1) Edges: Edges are places where the brightness of an image changes dramatically, usually corresponding to the boundaries of an object; (2) Textures: Textures reflect the microstructure and local illumination changes in an image; (3) Colors: Colors are the most intuitive features in an image and play an important role in the identification and classification of objects; (4) Shapes: Shapes describe the appearance of an object and are an important basis for object identification; (5) Corners: Corners are places where the grayscale changes dramatically in an image and have strong stability.

[0156] In an embodiment of the present application, the first image feature includes at least one of a sparse feature and a dense feature; and / or, the second image feature includes at least one of a sparse feature and a dense feature; and / or, the third image feature includes at least one of a sparse feature and a dense feature.

[0157] Exemplarily, the sparse features include regional features represented by bounding box annotation; and / or the dense features include regional features represented by pixel-level mask annotation.

[0158] Specifically, the bounding box annotation can use a rectangular box to represent the position of the detection target in the image. For example, the format of the rectangular box can be represented by its upper left, lower right coordinates or the center width and height. This annotation method can help the computer understand the position and size of objects in the image, so as to perform further image analysis and processing. In this case, each image can include multiple object instances, each instance has a bounding box. For each bounding box area, the corresponding regional features are extracted using a pre-trained network and saved in the feature library. In this way, each object instance corresponds to a sparse local feature. During prediction, features are extracted for each detected candidate bounding box and matched with the feature library.

[0159] For pixel-level mask annotation, this fine-grained annotation can delineate each semantic region in the image, and dense feature extraction can be used. That is, the image is divided into a grid (for example, 16x16), and each grid unit is regarded as an image block (patch), and features are extracted using a pre-trained network. Such an image will obtain a dense image block feature map. This feature map contains very rich local detail information. When constructing features, the feature map is directly stored. When predicting, a dense feature map is also extracted for the input image, and then compared with the feature map in the library.

[0160] In an embodiment of the present application, a retriever may be generated by the above method, and the retriever includes a feature library. The retriever may be independently deployed in the ray scanning detection system. For example, the retriever may be deployed in the ray scanning detection system in the form of a software module including a feature library, or the retriever may be deployed in the ray scanning detection system in the form of independent hardware.

[0161] The retriever according to the embodiment of the present application is an online learning system that can quickly add new categories with only a small number of labeled samples. The retriever has at least one of the following advantages:

[0162] 1. The sample size requirement is low. New categories can be identified without a large number of labeled samples, which greatly reduces the workload of manual labeling.

[0163] 2. Fast adaptation speed, can recognize new categories based on a small number of new samples in a very short time, without repeated network training;

[0164] 3. High accuracy. The recognition accuracy will not be significantly reduced due to the small sample size and will remain at an acceptable level;

[0165] 4. Easy to deploy, can be integrated into the existing system as an independent module without modifying the overall pipeline;

[0166] 5. Strong scalability: the system can continuously add new categories, and the performance will not decrease rapidly as the number of categories increases.

[0167] In the method provided in the embodiment of the present application, the advantages of traditional machine learning and deep learning technology are comprehensively utilized. The shared pre-trained feature model reduces the sample size requirement; the nearest neighbor search enables rapid adaptation to new categories and avoids repeated training of deep networks; adversarial samples improve the accuracy of decision boundaries. It solves the difficulties of current deep learning-based image recognition systems in dealing with new categories and will promote the implementation of this technology in more practical application scenarios.

[0168] On this basis, an embodiment of the present application also provides a target detection method for a ray scanning detection system. Fig. 9 is a schematic flow chart of a target detection method for a ray scanning detection system according to an embodiment of the present application. Fig. 9 , the target detection method may include the following operations S910~S940.

[0169] In operation S910, a radiographic scanning image is acquired through the radiographic scanning detection system, where the radiographic scanning image includes at least one detection target.

[0170] For example, in Figure 1 After the ray scanning detection system shown is deployed at the detection site, the ray scanning detection system can be controlled to be formally operated. Specifically, the carrying mechanism 40 carries the detection object (such as checked luggage) 70 through the scanning area between the ray source 10 of the rack 20 and the detection and acquisition device 30, and the rack 20 rotates around the forward direction of the detection object 70, so that the rays emitted by the ray source 10 can pass through the detection object 70, and perform CT scanning on the detection object 70. The detection and acquisition device 30 includes a detector for detecting X-rays, which detects the rays emitted from the ray source 10 and passing through the detection object 70 to obtain ray scanning images including X-ray perspective images, CT images, etc.

[0171] In this operation, in the process of acquiring the X-ray scanning image, meta information corresponding to the X-ray scanning image is also acquired, wherein the meta information includes the time and / or equipment parameters for acquiring the image to facilitate subsequent processing.

[0172] In operation S920, image features of the X-ray scanning image are extracted using a pre-trained feature extraction model.

[0173] In some exemplary embodiments of the present application, the feature extraction model used in operation S920 is the same as the feature extraction model used in the above-mentioned retriever generation method.

[0174] In the embodiment of the present application, the retriever generation stage and the current detection stage have a unified image feature expression. A general feature extraction network is obtained through a large number of pre-trained images. The network does not need to be fine-tuned for specific categories. It is responsible for learning to extract the general feature representation of the image and provide a unified feature description for images of different categories. In this way, feature extraction supports nearest neighbor-based search.

[0175] In operation S930, a similarity search is performed on the image features of the X-ray scanning image using a retriever generated by the method described in any of the above embodiments.

[0176] In some exemplary embodiments of the present application, the similarity retrieval may include: using a nearest neighbor search algorithm to search for image features matching the image features of the X-ray scanning image in a feature library of the retriever.

[0177] Nearest neighbor search is a method for finding the data point closest to a given target in a data set. Exemplarily, the nearest neighbor search can use array sorting, or use the HNSW (Hierarchical Navigable SmallWorlds) search algorithm to achieve real-time responsive search and identification.

[0178] Specifically, the main steps of using array sorting to perform nearest neighbor search are as follows:

[0179] (1) Calculating the distance between the features of the scanned image and the features in the feature library. For example, the L2 distance or cosine distance between the features of the scanned image and the features in the feature library can be calculated.

[0180] (2) Sort the distances calculated in step (1);

[0181] (3) Take the features corresponding to the shortest first k distances as the k nearest neighbors.

[0182] Specifically, HNSW is a graph-based approximate nearest neighbor search algorithm with super fast search speed and excellent recall rate. The main steps of the nearest neighbor search algorithm using HNSW are as follows:

[0183] 1. Graph construction: The HNSW algorithm first constructs a hierarchical graph, where each layer is a proximity graph, where two vertices are connected based on their proximity (closer vertices have links between them). In the process of graph construction, vectors are inserted one by one;

[0184] 2. Search: During the search, go to the top layer and find the longest link. These vertices tend to be high-degree vertices (have links that split across multiple layers), which means that by default you start with the reduction phase in NSW. Traverse along the edges of each layer, just as you would in NSW, greedily moving to the nearest vertex until you find a local minimum. Unlike NSW, at this point you move to the current vertex in a lower layer and start searching again. Repeat this process until you find a local minimum in the bottom layer (layer 0).

[0185] In the embodiment of the present application, classification based on nearest neighbor search is implemented. That is, the input image is passed through the same feature extraction network to obtain feature representation, and then the nearest neighbor search is performed with each category sample in the feature library, and the final category label is determined by the search result. This operation has at least one of the following advantages:

[0186] 1. Explainable similarity search: The retrieval model outputs the most similar samples, which can intuitively explain the classification basis. However, end-to-end neural networks have the problem of poor interpretability. It also supports multi-evidence aggregation. Classification does not rely solely on a single nearest neighbor, but integrates multiple nearest neighbor "witnesses" to make multi-evidence decisions through similarity voting to enhance robustness;

[0187] 2. Optional efficient nearest neighbor indexing: You can use efficient algorithms, such as HNSW, to pre-index the features of the knowledge base to ensure the time and space efficiency of large-scale searches. You can also use compression technology to reduce storage and search overhead.

[0188] In some exemplary embodiments, the image features in the feature library may include sparse features and dense features. For example, the sparse features include regional features represented by bounding box annotation, and the dense features include regional features represented by pixel-level mask annotation.

[0189] Optionally, in operation S930, the similarity search includes: for the image features of the X-ray scanning image, searching only the feature library of the retriever for sparse features that match the image features of the X-ray scanning image.

[0190] Optionally, in operation S930, the similarity search includes: with respect to the image features of the X-ray scanning image, further searching in the feature library of the retriever only dense features that match the image features of the X-ray scanning image.

[0191] Optionally, in operation S930, the similarity retrieval includes: searching, for the image features of the X-ray scanning image, whether there are sparse features matching the image features of the X-ray scanning image in the feature library of the retriever; and in response to the existence of sparse features matching the image features of the X-ray scanning image, further searching, for the image features of the X-ray scanning image, for dense features matching the image features of the X-ray scanning image in the feature library of the retriever.

[0192] In the embodiments of the present application, by supporting multiple types of feature representations, feature libraries can be constructed according to different annotation granularities. Dense features contain richer details but occupy more storage, while sparse features are more compact but have weaker fitting capabilities. Selection can be made based on actual annotation conditions and storage constraints. At the same time, multiple features can also be combined for cascade retrieval, which ensures accuracy and controls overhead.

[0193] In operation S940, in response to the image features of the X-ray scanning image matching the image features in the feature library, a category corresponding to the image features of the X-ray scanning image is acquired, and the category is determined to be a category of at least one detection target included in the X-ray scanning image.

[0194] That is to say, in the embodiment of the present application, the feature vector of the query image is searched for the nearest labeled sample in the feature library, and its category is returned.

[0195] Fig.10 is a schematic flow chart of a target detection method for a ray scanning detection system according to an embodiment of the present application, which schematically illustrates a retriever generation process and a target detection process. Fig.10 , the target detection method may include the following operations S1010~S1070.

[0196] In operation S1010 , a labeled sample is obtained. For example, the labeled sample may include the first sample data, the second sample data, and the third sample data, which may be expressed in the form of an image and / or a voxel.

[0197] In operation S1020, the labeled sample is input into an encoder to extract a feature vector. For example, the encoder may include the feature extraction model described above.

[0198] In operation S1030, a feature library is generated based on the feature-label mapping relationship, or the feature-label mapping relationship is stored in the feature library.

[0199] In operation S1040, a sample to be detected is obtained. For example, the sample to be detected includes a X-ray scanning image, which may be in the form of an image and / or voxel.

[0200] In operation S1050, the sample to be detected is input into an encoder to extract a feature vector. For example, the encoder may include the feature extraction model described above.

[0201] In operation S1060, the retriever is used to perform similarity retrieval based on the features of the X-ray scanning image.

[0202] In operation S1070, in response to the image features of the ray scanning image matching the image features in the feature library, the category of the detection target is output.

[0203] In some exemplary embodiments of the present application, the target detection method may further include: based on acquiring the ray scanning image and the category of at least one detection target included in the ray scanning image, fusing the ray scanning image and the category of the at least one detection target to form a fused image.

[0204] Specifically, in operation S940, after determining the category of the at least one detection target by retrieval-feature matching, the determined category of the detection target can be represented in the X-ray scanning image in the form of text, color, annotation, etc. In this way, the X-ray scanning image and the category of the at least one detection target are fused to form a fused image.

[0205] In some exemplary embodiments of the present application, the target detection method may further include: based on acquiring the X-ray scanning image and the category of at least one detection target included in the X-ray scanning image, determining the physical properties of the at least one detection target according to the category; based on the physical properties and the at least one identified detection target, fusing the X-ray scanning image to form a fused image, wherein the three-dimensional recognition result of the at least one detection target is displayed in the three-dimensional scanning image.

[0206] For example, the physical properties may include but are not limited to: density and atomic number of the detection target. Specifically, in operation S940, after determining the category of the at least one detection target by retrieval-feature matching, the values ​​of the physical properties such as density and atomic number of the corresponding category of the material may be obtained by prior knowledge or industry knowledge, and then the physical properties may be represented in the X-ray scanning image by text, color, annotation, etc. In this way, the X-ray scanning image, the category and physical properties of the at least one detection target are fused to form a fused image.

[0207] In this embodiment, in the formed fused image, the 3D recognition result can be optimized based on the physical properties. For example, when forming a fused scanned image, if the suspect category corresponding to a 3D mask is all-metal contraband, all voxels whose corresponding physical properties do not conform to metal can be filtered out, so that the recognized mask can be more compact and accurate.

[0208] In some exemplary embodiments of the present application, the radiation scanning detection system includes a multi-view scanning detection system.

[0209] The target detection method may further include: forming two-dimensional scanning images of multiple perspectives based on acquiring the ray scanning image and the category of at least one detection target included in the ray scanning image; and, based on the geometric relationship and the at least one detected target identified, performing three-dimensional fusion of the two-dimensional scanning images of the multiple perspectives to form a three-dimensional scanning image, wherein the three-dimensional recognition result of the at least one detection target is displayed in the three-dimensional scanning image.

[0210] Exemplarily, the target detection method further includes: forming two-dimensional scanning images of multiple viewing angles based on the acquisition of the ray scanning image and the category of at least one detection target included in the ray scanning image; and obtaining a three-dimensional recognition result of the at least one detection target based on the geometric relationship and the identified at least one detection target without fusing the three-dimensional scanning image. For example, if the two-dimensional recognition results of the same detection target are identified in the two-dimensional scanning images of multiple viewing angles, the three-dimensional recognition result of the detection target can be calculated based on the geometric relationship between the two-dimensional scanning images of the multiple viewing angles and the two-dimensional recognition results without fusing the three-dimensional scanning image.

[0211] Specifically, in operation S940, after determining the category of the at least one detection target by retrieval-feature matching, the two-dimensional scanning images of multiple viewing angles and the category of the detection target in the two-dimensional scanning images of each viewing angle can be obtained. On this basis, three-dimensional image reconstruction can be performed, that is, these two-dimensional images are converted into three-dimensional images through a three-dimensional reconstruction algorithm. In this way, the relationship between the detection target and the structure connected to it can be displayed in three-dimensional and multi-angle, thereby making up for the shortcomings of two-dimensional images.

[0212] In the embodiments of the present application, retrieval-detection fusion can be achieved. Specifically, a fusion strategy can be designed based on task similarity and task difference, and equipment optimization can be performed, such as 3D fusion of multi-view projection data based on geometry, and 3D fusion results can be optimized based on industry knowledge, ultimately forming an enhanced detection output.

[0213] In an embodiment of the present application, the feature library and the retriever can be provided by a developer, and the features and labels related to the third sample data in the feature library can be updated online. The retriever is deployed in a scanning detection system. In actual application, the ray scanning detection system deployed with the retriever is arranged at a scanning detection site for users to use at the scanning detection site. For example, the scanning detection site can be a security inspection site such as an airport or a subway, or it can be an inspection site such as a port, a dock, or a vehicle inspection station. The embodiments of the present application do not impose any special restrictions on the scanning detection site.

[0214] In the embodiments of the present application, a search enhancement detection scheme is proposed, which mainly adopts the following technical means:

[0215] 1. Pre-training a general image feature model: Use large-scale image data to pre-train a general feature extraction model to learn and obtain image representations. This model can fix parameters and be used for feature extraction of different new categories.

[0216] 2. Extract and store small sample features: Only a small number of new category samples are needed to extract their features from the pre-trained model. These features and annotations are used to build a category feature library.

[0217] 3. Classification based on nearest neighbor: Extract features from the input image based on the same model, and then search for the nearest neighbor samples in the feature library to find the most likely category.

[0218] 4. Adversarial sample enhancement: The strategy of adding adversarial samples is used to optimize the feature library and enhance the distinguishability of samples in the feature library.

[0219] In the embodiments of the present application, by adopting the retrieval enhancement detection technology, the advantages of the retrieval model and the detection model are effectively integrated to achieve fast online learning under small sample conditions. And by optimizing the sample library based on adversarial samples, the robustness of the model prediction is enhanced.

[0220] In the embodiments of the present application, the retrieval enhanced detection technology mainly has at least one of the following advantages:

[0221] 1. Improve the adaptability to small samples: The retrieval model only needs a small amount of samples to build a feature library and does not require large-scale labeled data for training.

[0222] 2. Accelerate model testing speed: After building the feature library and retriever offline, the prediction stage (i.e., detection stage) only requires fast similarity retrieval, avoiding repeated running of complex neural networks.

[0223] 3. Enhanced detection model prediction: The boundary information provided by adversarial samples can help correct the model’s incorrect predictions and improve the system’s robustness.

[0224] 4. Lower the threshold for deployment and use: The retrieval model can be independent of the specific detection model, making it easier to port and expand.

[0225] In the embodiments of the present application, the retrieval-enhanced detection technology combines the efficient adaptability of the retrieval model (i.e., the retriever) with the accuracy and reliability of prior knowledge. It solves the current dilemma of deep learning systems in terms of large data requirements and model interpretability, and enables the detection system to develop in the direction of small samples, easy interpretation, and high robustness.

[0226] Based on the above method, the embodiment of the present application also provides a device for generating a retriever for a ray scanning detection system. Fig.11 The device is described in detail.

[0227] Fig.11 is a structural block diagram of a device for generating a retriever of a ray scanning detection system according to an exemplary embodiment of the present application. Fig.11The device 1100 includes a first construction module 1110, a second construction module 1120 and a retriever generation module 1130.

[0228] The first construction module 1110 is used to construct a sample library. In some exemplary embodiments, the first construction module 1110 may be used to perform the operation S410 and its sub-operations described above, which will not be described in detail herein.

[0229] The first construction module 1110 may include a first data acquisition submodule 1111 and a second data acquisition submodule 1112 .

[0230] The first data acquisition submodule 1111 is used to acquire first sample data, wherein the first sample data includes a first image and a first label, the first image is a ray scanning image including at least one first detection target, and the first label indicates the category of the at least one first detection target. In some exemplary embodiments, the first data acquisition submodule 1111 can be used to perform the operation S4101 and its sub-operations described above, which will not be described in detail herein.

[0231] The second data acquisition submodule 1112 is used to acquire second sample data, wherein the second sample data includes a second image and a second label, the second image is a ray scanning image including at least one second detection target, the second label indicates the category of the at least one second detection target, the first sample data is positive sample data, and the second sample data is negative sample data. In some exemplary embodiments, the second data acquisition submodule 1112 can be used to perform the operation S4102 and its sub-operations described above, which will not be described in detail here.

[0232] Optionally, the first constructing module 1110 may further include a third data acquiring submodule 1113 .

[0233] The third data acquisition submodule 1113 is used to acquire third sample data, wherein the third sample data includes a third image and a third label, wherein the third image is a ray scanning image including at least one third detection target, and the third label indicates the category of the at least one third detection target, wherein the third sample data includes positive sample data and / or negative sample data. In some exemplary embodiments, the third data acquisition submodule 1113 can be used to perform the operation S4103 and its sub-operations described above, which will not be described in detail herein.

[0234] The second construction module 1120 is used to construct a feature library. In some exemplary embodiments, the second construction module 1120 may be used to perform the operation S420 and its sub-operations described above, which will not be described in detail herein.

[0235] The second construction module 1120 may include an extraction submodule 1121 , a relationship formation submodule 1122 , and a feature library generation submodule 1123 .

[0236] The extraction submodule 1121 is used to extract the first image feature of the first image and the second image feature of the second image using a pre-trained feature extraction model. In some exemplary embodiments, the extraction submodule 1121 can be used to perform the operation S4201 and its sub-operations described above, which will not be repeated here.

[0237] The relationship forming submodule 1122 is used to form a first feature-label relationship based on the first image feature and the first label, and to form a second feature-label relationship based on the second image feature and the second label. In some exemplary embodiments, the relationship forming submodule 1122 can be used to perform the operation S4202 and its sub-operations described above, which will not be repeated here.

[0238] The feature library generation submodule 1123 is used to generate a feature library based on the first feature-label relationship and the second feature-label relationship. In some exemplary embodiments, the feature library generation submodule 1123 can be used to perform the operation S4203 and its sub-operations described above, which will not be repeated here.

[0239] The retriever generation module 1130 is used to generate a retriever based on the feature library. In some exemplary embodiments, the retriever generation module 1130 may be used to perform the operation S430 and its sub-operations described above, which will not be described in detail here.

[0240] Fig.12 is a structural block diagram of a target detection device for a ray scanning detection system according to an exemplary embodiment of the present application. Fig.12 As shown, the target detection device 1200 for the ray scanning detection system includes an image acquisition module 1210 , a feature extraction module 1220 , a retrieval module 1230 and a target detection module 1240 .

[0241] The image acquisition module 1210 is used to acquire a ray scanning image through the ray scanning detection system, wherein the ray scanning image includes at least one detection target. In some exemplary embodiments, the image acquisition module 1210 may be used to perform the operation S910 and its sub-operations described above, which will not be described in detail here.

[0242] The feature extraction module 1220 is used to extract the image features of the X-ray scanning image using a pre-trained feature extraction model. In some exemplary embodiments, the feature extraction module 1220 can be used to perform the operation S920 and its sub-operations described above, which will not be described in detail here.

[0243] The retrieval module 1230 is used to perform similarity retrieval for the image features of the X-ray scanning image using the retriever generated by the above method. In some exemplary embodiments, the retrieval module 1230 can be used to perform the operation S930 and its sub-operations described above, which will not be described in detail here.

[0244] The target detection module 1240 is used to obtain the category corresponding to the image feature of the ray scanning image in response to the image feature of the ray scanning image matching the image feature in the feature library, and determine that the category is the category of at least one detection target included in the ray scanning image. In some exemplary embodiments, the target detection module 1240 can be used to perform the operation S940 and its sub-operations described above, which will not be repeated here.

[0245] According to an embodiment of the present application, any multiple modules of the first construction module 1110, the second construction module 1120, the retriever generation module 1130 and their respective submodules included in the device 1100, and the image acquisition module 1210, the feature extraction module 1220, the retrieval module 1230 and the target detection module 1240 and their submodules included in the target detection device 1200 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present application, the first building module 1110, the second building module 1120, the retriever generation module 1130 and their respective sub-modules included in the device 1100, and at least one of the image acquisition module 1210, the feature extraction module 1220, the retrieval module 1230 and the target detection module 1240 and their sub-modules included in the target detection device 1200 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or can be implemented in any one of the three implementation methods of software, hardware and firmware or in an appropriate combination of any of them. Alternatively, the first construction module 1110, the second construction module 1120, the retriever generation module 1130 and their respective sub-modules included in the device 1100, and at least one of the image acquisition module 1210, the feature extraction module 1220, the retrieval module 1230 and the target detection module 1240 and their sub-modules included in the target detection device 1200 can be at least partially implemented as a computer program module, and when the computer program module is executed, the corresponding function can be executed.

[0246] Fig.13 The structural block diagram of an electronic device suitable for implementing the retriever generation method or the target detection method according to an exemplary embodiment of the present application is schematically shown.

[0247] like Fig.13 As shown, the electronic device 1300 according to an embodiment of the present application includes a processor 1301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1302 or a program loaded from a storage part 1308 to a random access memory (RAM) 1303. The processor 1301 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a dedicated microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 1301 may also include an onboard memory for caching purposes. The processor 1301 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present application.

[0248] For example, the electronic device may be a data processing device of the ray scanning detection system.

[0249] In RAM 1303, various programs and data required for the operation of electronic device 1300 are stored. Processor 1301, ROM 1302 and RAM 1303 are connected to each other via bus 1304. Processor 1301 performs various operations of the method flow according to the embodiment of the present application by executing the program in ROM 1302 and / or RAM 1303. It should be noted that the program can also be stored in one or more memories other than ROM 1302 and RAM 1303. Processor 1301 can also perform various operations of the method flow according to the embodiment of the present application by executing the program stored in the one or more memories.

[0250] According to an embodiment of the present application, the electronic device 1300 may further include an input / output (I / O) interface 1305, which is also connected to the bus 1304. The electronic device 1300 may further include one or more of the following components connected to the I / O interface 1305: an input portion 1306 including a keyboard, a mouse, etc.; an output portion 1307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 1308 including a hard disk, etc.; and a communication portion 1309 including a network interface card such as a LAN card, a modem, etc. The communication portion 1309 performs communication processing via a network such as the Internet. A drive 1310 is also connected to the I / O interface 1305 as needed. A removable medium 1311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1310 as needed, so that a computer program read therefrom is installed into the storage portion 1308 as needed.

[0251] The present application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present application is implemented.

[0252] According to an embodiment of the present application, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present application, the computer-readable storage medium may include the ROM 1302 and / or RAM 1303 described above and / or one or more memories other than ROM 1302 and RAM 1303.

[0253] The embodiment of the present application also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the method provided by the embodiment of the present application.

[0254] The computer program executes the above functions defined in the system / device of the embodiment of the present application when the processor 1301 executes the computer program. According to the embodiment of the present application, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0255] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 1309, and / or installed from the removable medium 1311. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0256] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1309, and / or installed from the removable medium 1311. When the computer program is executed by the processor 1301, the above functions defined in the system of the embodiment of the present application are performed. According to the embodiment of the present application, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.

[0257] According to an embodiment of the present application, the program code for executing the computer program provided by the embodiment of the present application can be written in any combination of one or more programming languages, and specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, such as Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or completely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).

[0258] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0259] The embodiments of the present application provide a method and device for generating a retriever, a method and device for detecting a target, an electronic device, a ray scanning detection system, a computer-readable storage medium, and a program product, which have at least one of the following beneficial effects:

[0260] 1. Low training sample size requirement and easy system expansion: The retrieval model (i.e., retriever) only needs a small amount of samples to build a feature library, avoiding the deep neural network's reliance on a large number of labeled samples and greatly reducing the amount of manual labeling. This method can continuously expand the category library, and the system can gradually evolve to support the recognition of more categories. This makes the system highly scalable and reduces the cost of updating the application system.

[0261] 2. Fast adaptation: The feature library is built offline, and real-time prediction only needs to update the feature library to realize the recognition of new categories through sample search. This avoids the time overhead of repeated network training and greatly speeds up the adaptation to new categories.

[0262] 3. High accuracy: The strategy of using adversarial samples can better optimize the feature library, thereby improving the accuracy of recognition. It enhances the robustness of prediction, so that even in the case of small samples, the overall false alarm rate of the system can be well maintained.

[0263] 4. Strong interpretability and user-friendly interaction: The retrieval model can output the most similar samples and intuitively explain the basis for classification. It supports continuous enhancement of the feature library based on feedback and realizes human-computer collaboration. This improves the interpretability and credibility of the system.

[0264] 5. Modular design and easy deployment: The retrieval model and the detection model are decoupled, and the two can choose different technical solutions as needed. This improves the modularity of the system and facilitates migration and upgrades. It can also be connected to the existing system as an independent module to achieve incremental adaptation of new categories.

[0265] The embodiments of the present application are described above. However, these embodiments are only for the purpose of illustration, and are not intended to limit the scope of the present application. Although the embodiments are described above, this does not mean that the measures in the various embodiments cannot be used in combination. The scope of the present application is limited by the attached claims and their equivalents. Without departing from the scope of the present application, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present application.

Claims

1. A target detection method for a ray scanning detection system, characterized in that: The method comprises: Acquiring a radiation scanning image through the radiation scanning detection system, wherein the radiation scanning image includes at least one detection target; Extracting image features of the X-ray scan image using a pre-trained feature extraction model; Performing similarity retrieval using a retriever for image features of the X-ray scan image; and In response to the image feature of the ray scanning image matching the image feature in the feature library, a category corresponding to the image feature of the ray scanning image is obtained, and the category is determined to be a category of at least one detection target included in the ray scanning image, The method for generating the retriever includes: Constructing a sample library, wherein constructing the sample library comprises: Acquire first sample data, where the first sample data includes a first image and a first label, where the first image is an image including at least one first detection target, and the first label indicates a category of the at least one first detection target; Acquire second sample data, the second sample data including a second image and a second label, the second image is an image including at least one second detection target, the second label indicates a category of the at least one second detection target, the first sample data is positive sample data, and the second sample data is negative sample data; and Acquire third sample data, the third sample data including a third image and a third label, the third image being a radiographic scanning image including at least one third detection target, the third label indicating a category of the at least one third detection target, wherein the third sample data includes positive sample data and / or negative sample data; Constructing a feature library, wherein the constructing the feature library comprises: Using a pre-trained feature extraction model, extracting a first image feature of the first image, and extracting a second image feature of the second image; forming a first feature-label relationship based on the first image feature and the first label, and forming a second feature-label relationship based on the second image feature and the second label; Based on the first feature-label relationship and the second feature-label relationship, generating a feature library; and Extracting a third image feature of the third image using a pre-trained feature extraction model; forming a third feature-label relationship based on the third image feature and the third label; storing the third feature-label relationship in the feature library; and Based on the feature library, a retriever is generated, wherein the step of generating the retriever based on the feature library comprises: forming a retriever based on an index relationship between features and tags in the feature library, Wherein, obtaining the third sample data includes: During the formal operation of the ray scanning detection system, spot check the detection results of the ray scanning detection system; In response to the detection result having an under-reporting, acquiring an image having the under-reporting as a third image; or, in response to the detection result having a false-reporting, acquiring an image having the false-reporting as the third image; or, in response to the detection result having an under-reporting and a false-reporting, acquiring an image having the under-reporting and a false-reporting as the third image; and The category of the third detection target in the third image is marked to form a plurality of third labels.

2. The method according to claim 1, wherein: The similarity search includes: using a nearest neighbor search algorithm to search for image features matching the image features of the X-ray scanning image in the feature library of the retriever.

3. The method according to claim 1, wherein: The image features in the feature library include sparse features and Dense features; The similarity search includes: For the image features of the X-ray scanning image, searching in the feature library of the retriever whether there are sparse features matching the image features of the X-ray scanning image; and In response to the existence of sparse features matching the image features of the ray scanning image, further searching the feature library of the retriever for dense features matching the image features of the ray scanning image with respect to the image features of the ray scanning image; or, The similarity search includes: For the image features of the X-ray scanning image, only dense features matching the image features of the X-ray scanning image are searched in the feature library of the retriever; or, The similarity search includes: With respect to the image features of the X-ray scanning image, only sparse features matching the image features of the X-ray scanning image are searched in the feature library of the retriever.

4. The method according to any one of claims 1 to 3, wherein: The method includes: in the process of acquiring the X-ray scanning image, further acquiring meta information corresponding to the X-ray scanning image, wherein the meta information includes equipment parameters for acquiring the image.

5. The method according to any one of claims 1 to 3, wherein: The ray scanning detection system includes a multi-view scanning detection system; The method further includes: forming two-dimensional scanning images of multiple viewing angles based on the acquisition of the ray scanning image and the category of at least one detection target included in the ray scanning image; and, based on the geometric relationship and the identified at least one detection target, performing three-dimensional fusion on the two-dimensional scanning images of the multiple viewing angles to form a three-dimensional scanning image, wherein the three-dimensional recognition result of the at least one detection target is displayed in the three-dimensional scanning image; or, The method also includes: forming two-dimensional scanning images of multiple perspectives based on acquiring the X-ray scanning image and the category of at least one detection target included in the X-ray scanning image; and obtaining a three-dimensional recognition result of the at least one detection target based on the geometric relationship and the identified at least one detection target without fusing the three-dimensional scanning image.

6. The method according to any one of claims 1 to 3, wherein: The method also includes: based on acquiring the X-ray scanning image and the category of at least one detection target included in the X-ray scanning image, determining the physical properties of the at least one detection target according to the category; based on the physical properties and the at least one identified detection target, performing three-dimensional fusion on the X-ray scanning image to form a three-dimensional scanning image, wherein the three-dimensional recognition result of the at least one detection target is displayed in the three-dimensional scanning image.

7. The method according to claim 1, wherein: The first image feature includes at least one of a sparse feature and a dense feature; and / or, the second image feature includes at least one of a sparse feature and a dense feature; and / or, the third image feature includes at least one of a sparse feature and a dense feature.

8. The method according to claim 7, wherein: The sparse features include regional features represented by bounding box annotation; and / or the dense features include regional features represented by pixel-level mask annotation.

9. The method according to any one of claims 1 and 7-8, wherein The obtaining of the first sample data comprises: For the application scenario of the ray scanning detection system, a plurality of first images are acquired, wherein each of the plurality of first images includes at least one first detection target, and the first detection target is a typical detection target suitable for the application scenario of the ray scanning detection system; and The categories of the first detection targets in the plurality of first images are marked to form a plurality of first labels.

10. The method according to any one of claims 1 and 7-8, wherein The obtaining of the second sample data comprises: Acquire a plurality of second images according to the first sample data, wherein each of the plurality of second images includes at least one second detection target, the second detection target is similar to the first detection target, and the second detection target is of a different category from the first detection target; and The categories of the second detection targets in the plurality of second images are marked to form a plurality of second labels.

11. The method according to claim 10, wherein: The acquiring of the plurality of second images comprises acquiring the plurality of second images by at least one of active acquisition, retrieval of historical data, and synthesis based on a generative model.

12. The method according to any one of claims 1 and 7-8, wherein The first sample data and the second sample data are acquired before the ray scanning detection system is formally put into operation.

13. A target detection device for a ray scanning detection system, characterized in that: The device comprises: An image acquisition module, used to acquire a ray scanning image through the ray scanning detection system, wherein the ray scanning image includes at least one detection target; A feature extraction module, used to extract image features of the X-ray scanning image using a pre-trained feature extraction model; A retrieval module, used for performing similarity retrieval using a retriever based on the image features of the X-ray scanning image; and a target detection module, configured to obtain a category corresponding to the image feature of the ray scanning image in response to matching the image feature of the ray scanning image with the image feature in the feature library, and determine that the category is a category of at least one detection target included in the ray scanning image, The method for generating the retriever includes: Constructing a sample library, wherein constructing the sample library comprises: Acquire first sample data, where the first sample data includes a first image and a first label, where the first image is an image including at least one first detection target, and the first label indicates a category of the at least one first detection target; Acquire second sample data, the second sample data including a second image and a second label, the second image is an image including at least one second detection target, the second label indicates a category of the at least one second detection target, the first sample data is positive sample data, and the second sample data is negative sample data; and Acquire third sample data, the third sample data including a third image and a third label, the third image being a radiographic scanning image including at least one third detection target, the third label indicating a category of the at least one third detection target, wherein the third sample data includes positive sample data and / or negative sample data; Constructing a feature library, wherein the constructing the feature library comprises: Using a pre-trained feature extraction model, extracting a first image feature of the first image, and extracting a second image feature of the second image; forming a first feature-label relationship based on the first image feature and the first label, and forming a second feature-label relationship based on the second image feature and the second label; Based on the first feature-label relationship and the second feature-label relationship, generating a feature library; and Extracting a third image feature of the third image using a pre-trained feature extraction model; forming a third feature-label relationship based on the third image feature and the third label; storing the third feature-label relationship in the feature library; and Based on the feature library, a retriever is generated, wherein the step of generating the retriever based on the feature library comprises: forming a retriever based on an index relationship between features and tags in the feature library, Wherein, obtaining the third sample data includes: During the formal operation of the ray scanning detection system, spot check the detection results of the ray scanning detection system; In response to the detection result having an under-reporting, acquiring an image having the under-reporting as a third image; or, in response to the detection result having a false-reporting, acquiring an image having the false-reporting as the third image; or, in response to the detection result having an under-reporting and a false-reporting, acquiring an image having the under-reporting and a false-reporting as the third image; and The category of the third detection target in the third image is marked to form a plurality of third labels.

14. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors execute the method according to any one of claims 1 to 12.

15. A ray scanning detection system, comprising: A ray source, used for emitting rays; A detector, used to receive the radiation emitted from the radiation source and passing through the detection object; as well as a data processing device, the data processing device being communicatively connected to the detector, The data processing device comprises: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the method according to any one of claims 1 to 12.

16. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the method according to any one of claims 1 to 12.

17. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 12 is implemented.