Material identification method based on photon counting X-ray spectrum

By using photon counting X-ray spectroscopy technology and matching K-side encoded feature words with hardware hash tables, the real-time problem of identifying materials with similar densities on high-speed production lines using traditional X-ray imaging technology has been solved, achieving efficient material identification and foreign object removal.

CN122016902APending Publication Date: 2026-05-12ZHIYAN INTELLIGENT TECH (JIAXING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHIYAN INTELLIGENT TECH (JIAXING) CO LTD
Filing Date
2026-02-06
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Traditional X-ray imaging techniques are ineffective at distinguishing substances with similar densities but different chemical compositions, and existing algorithms cannot meet the real-time processing requirements of high-speed production lines, resulting in the inability to effectively identify trace amounts of high atomic number contaminants.

Method used

A material identification method based on photon counting X-ray spectroscopy is adopted. By obtaining the original energy spectrum vector, logarithmic attenuation correction and smoothing filtering are performed to generate K-side encoded feature words. Then, hardware hash tables and Hamming distance matching technology are used for material identification to achieve data compression and fast matching.

Benefits of technology

The single-pixel processing latency has been reduced to the microsecond level on high-speed production lines, improving the real-time removal capability of foreign objects containing specific heavy elements and enhancing the safety level of industrial production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122016902A_ABST
    Figure CN122016902A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a material identification method based on a photon counting X-ray spectrum, and relates to the technical field of material identification technologies. The method comprises the following steps: acquiring an original energy spectrum vector of a measured object at a current pixel point, wherein the original energy spectrum vector comprises photon count values of a plurality of energy channels; performing logarithmic attenuation correction and smooth filtering processing on the original energy spectrum vector to generate a physical absorption spectrum vector; generating K-edge coding feature words based on the physical absorption spectrum vectors; and determining a material label of the pixel point based on the K-edge coding feature word. According to the invention, the realization problem is solved, and the real-time performance of material identification on a high-speed production line is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of material detection, and more specifically, to a material identification method based on photon counting X-ray spectroscopy. Background Technology

[0002] Traditional X-ray imaging techniques rely primarily on the total attenuation of X-rays by a substance (i.e., integrated intensity) for imaging. This method works well for distinguishing substances with significant density differences (such as metals and plastics), but it often fails when dealing with substances of similar density but drastically different chemical compositions. For example, in pharmaceutical manufacturing, it is necessary to detect trace amounts of high atomic number contaminants (such as lead or mercury particles) mixed into drug powders, or to detect residues of specialty chemicals containing iodine or barium in food packaging. The density of these substances may be similar to that of high-density, harmless components (such as compacted bone or heavy metal packaging), rendering traditional grayscale-based detection methods ineffective.

[0003] To address this issue, photon counting detectors and multi-energy spectral (or hyperspectral) imaging techniques have emerged. This technology can acquire the energy spectrum vector of each pixel, and theoretically, it can accurately identify materials by analyzing elemental characteristics (such as the K absorption edge of heavy elements).

[0004] However, in high-speed production line applications (e.g., conveyor belt speeds greater than 0.5 m / s), traditional pixel-by-pixel full-spectrum matching algorithms based on principal component analysis (PCA) or support vector machine (SVM) typically have computational delays in the millisecond range, which cannot meet the stringent requirements of high-speed production lines for microsecond-level real-time processing. Summary of the Invention

[0005] This invention provides a material identification method and system based on photon counting X-ray spectroscopy, which at least solves the problem of poor real-time performance in related technologies.

[0006] According to an embodiment of the present invention, a material identification method based on photon counting X-ray spectroscopy is provided, comprising: Obtain the original energy spectrum vector of the object under test at the current pixel point, wherein the original energy spectrum vector contains photon count values ​​of multiple energy channels; Logarithmic attenuation correction and smoothing filtering are performed on the original energy spectrum vector to generate a physical absorption spectrum vector; Based on the physical absorption spectrum vector, K-side encoded feature words are generated, wherein the generation process includes calculating the first derivative spectrum of the physical absorption spectrum vector, searching for local peaks that satisfy a preset derivative threshold in the first derivative spectrum, and mapping the energy position information and amplitude information of the local peaks into an integer bit field of a predetermined length. The material label of the pixel is determined based on the K-side encoded feature word, wherein the determination process includes matching the K-side encoded feature word with a preset material fingerprint database.

[0007] In one exemplary embodiment, performing logarithmic attenuation correction on the original energy spectrum vector includes: Gain correction matrix and dark noise matrix are obtained based on field scanning data; Based on the gain correction matrix, the dark noise matrix, and the preset minimum protection constant, the logarithmic decay value of the original energy spectrum vector is calculated.

[0008] In one exemplary embodiment, generating K-side encoded feature words based on the physical absorption spectrum vector includes: The full energy spectrum range is divided into multiple non-overlapping energy tolerance windows; For each energy tolerance window, search for the maximum derivative value within that window range in the first derivative spectrum of the physical absorption spectrum vector; If the maximum derivative value is less than the preset derivative threshold, the bit field corresponding to the window is set to zero; If the maximum derivative value is greater than or equal to the preset derivative threshold, the maximum derivative value is quantized based on the preset amplitude quantization factor, and the quantized value is written into the bit field corresponding to the window.

[0009] In an exemplary embodiment, determining the material label of the pixel based on the K-side encoded feature word includes: The generated K-edge encoded feature word is used as a hash key to search in a hardware hash table deployed on the on-chip memory; If the search is successful, the material identifier stored in the hash table is directly read as the material label; If the search fails, calculate the Hamming distance between the K-edge encoded feature word and all reference feature words in the material fingerprint database, and select the material identifier corresponding to the reference feature word with the smallest Hamming distance that is less than a preset Hamming threshold as the material label.

[0010] In one exemplary embodiment, the method further includes: Calculate the first integral value of the original energy spectrum vector in the high-energy range and the second integral value in the low-energy range; The dual-energy ratio auxiliary feature is calculated based on the first integral value and the second integral value; The method of determining the material label of the pixel based on the K-side encoded feature word further includes: When the K-side encoded feature word is successfully matched, verify whether the dual-energy ratio auxiliary feature is within the preset tolerance range.

[0011] According to another embodiment of the present invention, a material identification system based on photon counting X-ray spectroscopy is provided, comprising: The spectral acquisition module is configured to control the photon counting X-ray detector to acquire the original energy spectrum vector of the object under test at the pixel point. The feature generation module is configured to receive the original energy spectrum vector, perform logarithmic decay correction and smoothing differentiation on it, and generate K-side encoded feature words based on the derivative peak features; A material matching module is configured to store a material fingerprint database and match the K-edge encoded feature words with the material fingerprint database to output a material label; wherein, the feature generation module and the material matching module are deployed on a hardware acceleration circuit.

[0012] In one exemplary embodiment, the material matching module includes a hash table stored in on-chip random access memory.

[0013] In one exemplary embodiment, generating K-side encoded feature words based on the physical absorption spectrum vector includes: The full energy spectrum range is divided into multiple non-overlapping energy tolerance windows; For each energy tolerance window, search for the maximum derivative value within that window range in the first derivative spectrum of the physical absorption spectrum vector; If the maximum derivative value is less than the preset derivative threshold, the bit field corresponding to the window is set to zero; If the maximum derivative value is greater than or equal to the preset derivative threshold, the maximum derivative value is quantized based on a preset amplitude quantization factor, and the quantized value is written into the bit field corresponding to the window.

[0014] According to yet another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.

[0015] According to yet another embodiment of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0016] This invention, through the construction of a K-side encoded feature word mechanism, irreversibly compresses traditional high-dimensional floating-point energy spectrum vectors into low-dimensional discrete integers, achieving a data compression ratio of over 100 times, fundamentally eliminating the memory bandwidth bottleneck. Simultaneously, it transforms complex vector distance calculations into nanosecond-level bitwise operations (such as XOR and shift) and hash lookups, reducing single-pixel processing latency to the microsecond level. This enables real-time removal of foreign objects containing specific heavy elements on high-speed production lines, significantly improving the safety assurance level of industrial production. Therefore, it can solve the problem of poor real-time performance in material identification on high-speed production lines, achieving the effect of improving the real-time performance of material identification on high-speed production lines. Attached Figure Description

[0017] Figure 1 This is a flowchart of a material identification method based on photon counting X-ray spectroscopy according to an embodiment of the present invention; Figure 2 This is a structural block diagram of a material identification system based on photon counting X-ray spectroscopy according to an embodiment of the present invention; Figure 3 This is a physical absorption spectrum according to a specific embodiment of the present invention. Detailed Implementation

[0018] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.

[0019] In the following description, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0020] Furthermore, in this application, directional terms such as "upper," "lower," "left," and "right" may be defined relative to the orientation of the components shown in the accompanying drawings. It should be understood that these directional terms can be relative concepts, used for relative description and clarification, and may change accordingly depending on the orientation of the components in the accompanying drawings.

[0021] In this application, unless otherwise expressly specified and limited, the term "connection" should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral part; it can be a direct connection or an indirect connection through an intermediate medium. Furthermore, the term "coupled" can refer to an electrical connection that enables signal transmission.

[0022] As used herein, “about,” “approximately,” or “approximately” includes the stated value and the average value within an acceptable range of deviation from the given value, wherein the acceptable range of deviation is determined by a person skilled in the art taking into account the measurement under discussion and the error associated with the measurement of the given quantity (i.e., the limitations of the measurement system).

[0023] This application provides a material identification method and system based on photon counting X-ray spectroscopy. The method employs a "K-edge encoded feature word (KEFW)" generation and matching mechanism, combined with a dedicated FPGA hardware pipeline architecture, to identify relevant materials. The identification system running this mechanism can respond to high-dimensional, continuous, and noisy photon counting energy spectrum vector input within a timescale of hundreds of nanoseconds, mapping and encoding it into a low-dimensional, discrete, and robust digital fingerprint, and performing ultra-fast material classification directly in on-chip memory. This method solves the computational and memory bandwidth bottlenecks caused by processing massive amounts of hyperspectral data in existing photon counting imaging technologies in high-speed industrial inspection scenarios, enabling a breakthrough in the system's inability to identify high-density heavy metals or specific chemical contaminants in real time. Based on this, this method can control the single-pixel processing delay to below 10 microseconds even at conveyor belt speeds exceeding 0.5 m / s, and substantially improves the detection rate of tiny high atomic number foreign objects (such as lead-containing particles and iodides).

[0024] Example 1 This embodiment provides a material identification system based on photon counting X-ray spectroscopy. The system consists of physical hardware components interconnected through a specific data bus, specifically including a front-end sensing subsystem and a back-end processing subsystem. The two are physically connected and exchange data through a high-speed data bus (e.g., PCIe 3.0 x8 or a custom fiber optic link).

[0025] Specifically, such as Figure 2 As shown, the system includes a spectral acquisition module M100, which physically integrates a linear array photon counting X-ray detector. This detector uses cadmium zinc telluride (CZT) as the sensor material, which is processed into an array with a pixel pitch of 0.1 mm and interconnected with a dedicated readout circuit (ASIC) via flip-chip bonding. The ASIC is programmed to count the number of photons falling into a preset energy range in each integration period. The integration period is set to 100 microseconds, the number of preset energy ranges (i.e., the number of spectral channels) is set to 256, and the energy range it covers is configured to be from 20 keV to 120 keV. This energy range is designed to cover the K-absorption edge characteristics of common heavy metal pollutants (such as lead, mercury, and gold) and contrast agents (such as iodine and barium) in the industrial and pharmaceutical fields.

[0026] The system further includes a feature generation module M200, which is configured as a hardware logic unit deployed on a field-programmable gate array (FPGA). The FPGA is selected from Xilinx Kintex-7 series or higher-performance chips (such as UltraScale+). The feature generation module M200 is connected to the spectral acquisition module M100 via an AXI4-Stream bus, which is configured with a bit width of 512 bits to support high-throughput transmission of multi-pixel parallel data streams. The feature generation module M200 internally instantiates multiple digital signal processing (DSP48E1) slices and block random access memory (BRAM). These hardware resources are routed and laid out to construct the full pipeline of energy spectrum processing logic.

[0027] The system also includes a material matching module M300. The material matching module M300 can be integrated as a logic core on the same FPGA chip as M200, or it can be implemented as a tightly coupled embedded processor unit. In this preferred embodiment, M300 exists as an independent logic block within the FPGA. Its core component is a hardware hash table mapped to the FPGA's on-chip UltraRAM or high-density BRAM. The hash table is used to persistently store the material fingerprint database and performs a single-clock-cycle matching operation in response to lookup instructions.

[0028] The system also includes an offline fingerprint database training workstation M400, which is a high-performance computer configured to drive the X-ray machine and conveyor belt through control commands during the system calibration phase, and simultaneously acquire energy dispersive spectral data of standard samples. Based on the acquired data, the workstation M400 performs standard fingerprint calculations and packages and sends the updated fingerprint database to the on-chip memory of the M300 via an Ethernet interface.

[0029] like Figure 1 As shown, the material identification method based on photon counting X-ray spectroscopy provided in this application is described in conjunction with specific processing steps, specifically including the following steps: S100: Online Streaming Process In response to the start command, the M100 spectral acquisition module drives the photon counting X-ray detector to acquire the photon signal of the object under test at the current pixel point and generate the raw energy spectrum vector, and then executes the following sub-steps: S110: Photon Counting and Vector Construction Photon counting and vector construction are performed by the ASIC circuit hardware at the front end of the detector; specifically, in response to an X-ray photon hitting a detector pixel, a charge-sensitive amplifier in the ASIC generates a voltage pulse with an amplitude proportional to the incident photon energy; then the pulse height analyzer (PHA) circuit in the ASIC receives the voltage pulse, compares and quantizes its amplitude, and maps it to one of the 256 energy channels (bins); subsequently, the corresponding hardware counter register performs an increment operation.

[0030] For example, if detector pixel P(12, 100) captures 532 photon events within the current 100-microsecond integration period, the distribution of these photons along the energy axis is structured into the original energy spectrum vector. , It is a one-dimensional integer array with dimension 256, defined as ,in Stored the first The cumulative value of photons within each energy channel. For example, a register. The value (corresponding to an energy range of approximately 33 keV) is read as 120, representing the energy range... 120 photon events were detected within keV; to compensate for the pulse accumulation effect under high throughput, the inverse dead time model correction circuit integrated in the ASIC will correct the count rate in real time to ensure the linearity of the output vector.

[0031] S120: Robust logarithmic decay correction exist After being buffered, the feature generation module M200 receives the original energy spectrum vector via the bus and calls the internal preprocessing logic to perform logarithmic attenuation correction and smoothing filtering to generate the physical absorption spectrum vector. Here, mathematical transformation is used to eliminate the non-uniformity of X-ray source intensity, the difference in detector pixel response, and the influence of dark current noise, and the data domain is converted from the photon counting domain to the physical absorption coefficient domain.

[0032] The input to the calibration process depends on two static calibration matrices written into the FPGA memory during system initialization: the space field gain matrix and the empty field gain matrix. and dark noise matrix ;in, The pixels are stored under conditions where there is no obstruction from the measured object. In energy channels The average photon count benchmark on the surface; The dark count reference for this pixel under conditions without X-ray illumination is stored.

[0033] Specifically, the preprocessing unit in the M200 is equipped with floating-point arithmetic logic for each energy channel. Perform the following logarithmic correction operation:

[0034] in, The maximum value operation is implemented for the comparator logic. It is a minimum protection constant for a pre-written register.

[0035] For example, the minimum value protection constant Configured as Assuming this applies to the channel The register reading is , dark noise ,at this time: Operating Condition A (Normal Signal): Actual Count .

[0036] Operational logic output: .

[0037] Condition B (Dead Pixel / Abnormally Low Signal): Actual Count (Below the dark noise benchmark).

[0038] If not The protection logic is that the denominator calculation result is... This will lead to logarithmic arithmetic unit overflow or NaN error. Introducing... After the protection logic, the comparator output The corresponding operational logic output is: The result As a large positive number, it physically represents an extremely high absorption rate (or invalid data point), thus avoiding mathematical errors and ensuring that the subsequent FPGA pipeline will not be interrupted due to data anomalies.

[0039] Additionally, after the logarithmic transformation, the preprocessing unit pushes the generated absorption spectrum data stream into the smoothing filter logic. For example, this logic is configured as a 7-point window Savitzky-Golay filter, which uses a shift register instantiated in the FPGA to buffer the data stream and performs a weighted summation operation on the data from the current channel and the three channels before and after it, while simultaneously calculating the weight coefficient vector. It is stored in the ROM lookup table; it should be noted that this operation filters out high-frequency statistical noise and outputs a smooth physical absorption spectrum vector. , Defined as a 256-dimensional floating-point vector, its numerical value precisely represents the linear decay coefficient of matter at different energies.

[0040] S130: Hardware Pipeline KEFW Generation The feature generation module M200 receives the physical absorption spectrum vector and drives its internal logic to generate K-edge encoded feature words (KEFW). This generation process includes driving the differential engine to calculate the first derivative spectrum, controlling the peak-finding logic to search for local peaks that satisfy a preset derivative threshold, and triggering the mapping logic to encode the energy location information and amplitude information of the local peaks into an integer bit field of a predetermined length. Specifically, this includes: S131: Differential operation. The differential engine in M200 first processes the input... Perform first-order differential operations For example, this operation uses the central difference algorithm, and its hardware implementation formula is as follows:

[0041] This operation is completed within a single clock cycle using the register shift logic and subtractor logic within the FPGA, and its output result... This characterizes the rate of change of absorbance with energy; since the K-absorption edge of a substance physically exhibits a step increase in absorbance, therefore, at the energy corresponding to the K-edge, It will exhibit a significant positive peak characteristic.

[0042] S132: Threshold Peak Finding and Quantization Encoding Subsequently, the encoding logic in M200 processes the peak value based on an energy window; specifically, the system configuration register divides the energy range from 20keV to 120keV into... A non-overlapping energy tolerance window, assuming It was set to 16, and at the same time, the first window The energy coverage is configured as For example, the system is configured to display the first few windows specifically for K-edge features of common heavy metals and contrast agents: (30.0-35.0 keV): The characteristic region corresponding to iodine (I, Z=53, K-edge=33.17 keV).

[0043] (35.0-40.0 keV): The characteristic region corresponding to barium (Ba, Z=56, K-edge=37.44 keV). ... (80.0-85.0 keV): The characteristic region corresponding to gold (Au, Z=79, K-edge=80.7 keV).

[0045] (85.0-90.0 keV): The characteristic region corresponding to lead (Pb, Z=82, K-edge=88.0 keV).

[0046] Each window is allocated 4 bits from the output feature word.

[0047] Then for each window Parallel comparator logic search Maximum value within this energy range .

[0048] A preset derivative threshold is stored in the system register. Assuming the preset derivative threshold Configured as (Dimensionless absorbance derivative units); specifically, this threshold can be based on 6 standard deviations of the spatial scanning noise statistics. This is to prevent random fluctuations caused by background noise from triggering false judgment logic.

[0049] If the comparator determines the maximum value If the logic determines that there is no significant K-absorption edge within the energy window, the 4-bit field corresponding to the window is forcibly set to binary 0000.

[0050] If the comparator determines If so, the logic determines that there is a K-edge and triggers the quantizer to adjust the peak amplitude. Processing is performed; at this time, an amplitude quantization factor is pre-stored in the system register. The amplitude quantization factor here It can be set to The quantizer's hardware logic then executes as follows:

[0051] This means that the peak height is linearly mapped to an integer range. .

[0052] For example, such as Figure 3 As shown, assuming the object being tested contains a lead particle with a diameter of 0.5 mm, the energy window corresponding to the lead K side... Within the range of 85.0-90.0 keV, the physical absorption spectrum changes due to the physical transition of lead at its absorption cross-section for photons above 88 keV. This creates a steep step; the derivative spectrum is calculated at this point. It exhibits a peak at 88 keV, with a height reading of Therefore, the comparator logic determines... Output the K-edge detection signal; simultaneously, the quantizer logic calculates: The binary representation is 1100; these 4 bits 1100 are written into bits 44-47 of the 64-bit KEFW (assuming 4 bits per window). (Corresponding to group 11); Finally, the bit concatenation logic combines the 4-bit quantized values ​​of all 16 windows. Combine them to output the final 64-bit K-edge encoded feature word (KEFW).

[0053] S140: Fast Hash Matching and Classification After KEFW is generated, the material matching module M300 receives the K-edge encoded feature word and determines the material label of the pixel based on it. The determination process involves matching the K-edge encoded feature word as a key value with a preset material fingerprint database. Specifically: S141: Hardware hash lookup The material matching module M300 uses the input KEFW as a key to perform a lookup operation on the hash table deployed in the on-chip BRAM.

[0054] For example, the hash address generation logic execution function ,in Determined by the size of the hash table (e.g.) Each bucket in the hash table is structured to store a Key (standard fingerprint KEFW) and a Value (material ID); to resolve hash collisions, the control logic uses open addressing, that is, if the calculated hash address... If the address is already occupied and the key does not match, the control logic will check the addresses sequentially. , The search continues until a matching key is found or an empty bucket is encountered; due to the exact match being performed, the average time complexity of the search process is O(n log n). If the lookup logic is successful (i.e., the input KEFW is exactly the same as the Key stored in the table), the corresponding material ID will be read and output directly.

[0055] S142: Hamming Distance Fault-Tolerant Matching If the hash lookup logic returns a miss, it indicates that the energy spectrum characteristics of the current pixel deviate from the standard fingerprint (e.g., a slight change in peak height due to scattering). At this time, the material matching module M300 triggers the Hamming distance calculation engine, which traverses all valid fingerprints in the database and calculates the Hamming distance between the input KEFW and them.

[0056] For example, the calculation of the Hamming distance calls the FPGA-specific POPCONT(KEFW_{input} \oplusKEFW_{ref}) instruction, which counts the number of "1"s after XORing two 64-bit words, while the system register stores a preset Hamming threshold. , here It can be set to 2, which means that a difference of no more than 2 bits is allowed in the feature word (e.g., a difference of 1 level in quantization values, or a K-side position offset by 1 adjacent window), while the comparison logic selects the Hamming distance that is the smallest and less than 2 bits. The material ID corresponding to the fingerprint is used as the final result; if the distance of all fingerprints exceeds the threshold, the pixel is marked as "unknown" or "background", and so on.

[0057] S150: Spatial Connectivity Filtering and Alarm The system receives the aforementioned pixel-level material tag matrix. It performs spatial filtering operations on the image; specifically, the image processing logic performs morphological opening operations (erosion followed by dilation).

[0058] For example, the morphological kernel is configured as The structural elements physically eliminate false alarms of isolated single pixels caused by random noise; subsequently, the connected component analysis logic calculates the pixel area of ​​the remaining non-background material connected components.

[0059] For example, the area threshold register is set to If the number of pixels in a connected region is greater than 5 and its material label is identified as "lead" or "gold", the judgment logic confirms that it is a foreign object. The system outputs an alarm level signal and foreign object coordinate data to drive the downstream rejection mechanism to perform the action.

[0060] Example 2 For certain special application scenarios, there may be elements with very close K-edge energies, or it may be necessary to distinguish the effective atomic number of the matrix material while identifying the K-edge; in order to further improve the identification accuracy, this embodiment integrates a dual-energy-ratio auxiliary site processing mechanism.

[0061] Specifically, in the pipeline for generating KEFW, in addition to extracting derivative peak features, the feature generation module M200 also runs an integrator logic in parallel, which is used to calculate the original physical absorption spectrum. Integral values ​​in the two wide energy regions: High-energy integral value The accumulator logic is valid for voltages ranging from 80keV to 120keV. The values ​​are summed.

[0062] Low-energy integral value The accumulator logic is valid for voltages ranging from 20keV to 50keV. The values ​​are summed.

[0063] Subsequently, the divider logic calculates the ratio of the two. This ratio physically reflects the relative proportion of the photoelectric effect and the Compton scattering cross section of a substance, and is the effective atomic number. It is a monotonic function.

[0064] To adapt this floating-point ratio to the integer KEFW system, the quantization logic performs the following operations:

[0065] in and It is the normalized boundary parameter of the pre-written register.

[0066] For example, if real-time calculation And configuration Then output (Binary 01111111).

[0067] This 8-digit It can be packaged as a separate field appended to the 64-bit KEFW (forming a 72-bit feature word), or it can be mapped to some predefined free high bits in the KEFW for storage.

[0068] During the matching phase of S140, the system executes secondary verification logic, specifically: Level 1 verification: Perform 64-bit KEFW matching based on K-edge features (logic as described above).

[0069] Second-level verification: If the first-level match is successful, and the matched candidate material defines a dual-energy ratio constraint, then the comparison logic further checks the input. Does it fall within the tolerance range defined by the material? .

[0070] For example, tolerance register configuration Assuming that for "lead", the standard fingerprint requirements are... exist Within the range; if a pixel has a peak at 88 keV (K-edge matching), but its A reading of 100 (indicating an abnormal slope in the overall attenuation curve, possibly due to some special artifact or mixture) indicates that the verification logic has failed to match, thereby improving the system's anti-interference capability in complex matrix backgrounds.

[0071] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0072] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.

[0073] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.

[0074] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0075] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.

[0076] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0077] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0078] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0079] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0080] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0081] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0082] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A material identification method based on photon counting X-ray spectroscopy, characterized in that, include: Obtain the original energy spectrum vector of the object under test at the current pixel point, wherein the original energy spectrum vector contains photon count values ​​of multiple energy channels; Logarithmic attenuation correction and smoothing filtering are performed on the original energy spectrum vector to generate a physical absorption spectrum vector; Based on the physical absorption spectrum vector, K-side encoded feature words are generated, wherein the generation process includes calculating the first derivative spectrum of the physical absorption spectrum vector, searching for local peaks that satisfy a preset derivative threshold in the first derivative spectrum, and mapping the energy position information and amplitude information of the local peaks into an integer bit field of a predetermined length. The material label of the pixel is determined based on the K-side encoded feature word, wherein the determination process includes matching the K-side encoded feature word with a preset material fingerprint database.

2. The method according to claim 1, characterized in that, The step of performing logarithmic attenuation correction on the original energy spectrum vector includes: Gain correction matrix and dark noise matrix are obtained based on field scanning data; Based on the gain correction matrix, the dark noise matrix, and the preset minimum protection constant, the logarithmic decay value of the original energy spectrum vector is calculated.

3. The method according to claim 1, characterized in that, The generation of K-side encoded feature words based on the physical absorption spectral vector includes: The full energy spectrum range is divided into multiple non-overlapping energy tolerance windows; For each energy tolerance window, search for the maximum derivative value within that window range in the first derivative spectrum of the physical absorption spectrum vector; If the maximum derivative value is less than the preset derivative threshold, the bit field corresponding to the window is set to zero; If the maximum derivative value is greater than or equal to the preset derivative threshold, the maximum derivative value is quantized based on the preset amplitude quantization factor, and the quantized value is written into the bit field corresponding to the window.

4. The method according to claim 1, characterized in that, The process of determining the material label of the pixel based on the K-side encoded feature word includes: The generated K-edge encoded feature word is used as a hash key to search in a hardware hash table deployed on the on-chip memory; If the search is successful, the material identifier stored in the hash table is directly read as the material label; If the search fails, calculate the Hamming distance between the K-edge encoded feature word and all reference feature words in the material fingerprint database, and select the material identifier corresponding to the reference feature word with the smallest Hamming distance that is less than a preset Hamming threshold as the material label.

5. The method according to claim 1, characterized in that, The method further includes: Calculate the first integral value of the original energy spectrum vector in the high-energy range and the second integral value in the low-energy range; The dual-energy ratio auxiliary feature is calculated based on the first integral value and the second integral value; The method of determining the material label of the pixel based on the K-side encoded feature word further includes: When the K-side encoded feature word is successfully matched, verify whether the dual-energy ratio auxiliary feature is within the preset tolerance range.

6. A material identification system based on photon counting X-ray spectroscopy, characterized in that, include: The spectral acquisition module is configured to control the photon counting X-ray detector to acquire the original energy spectrum vector of the object under test at the pixel point. The feature generation module is configured to receive the original energy spectrum vector, perform logarithmic decay correction and smoothing differentiation on it, and generate K-side encoded feature words based on the derivative peak features; A material matching module is configured to store a material fingerprint database and match the K-edge encoded feature words with the material fingerprint database to output a material label; wherein, the feature generation module and the material matching module are deployed on a hardware acceleration circuit.

7. The system according to claim 6, characterized in that, The material matching module includes a hash table stored in on-chip random access memory.

8. The system according to claim 6, characterized in that, The generation of K-side encoded feature words based on the physical absorption spectral vector includes: The full energy spectrum range is divided into multiple non-overlapping energy tolerance windows; For each energy tolerance window, search for the maximum derivative value within that window range in the first derivative spectrum of the physical absorption spectrum vector; If the maximum derivative value is less than the preset derivative threshold, the bit field corresponding to the window is set to zero; If the maximum derivative value is greater than or equal to the preset derivative threshold, the maximum derivative value is quantized based on a preset amplitude quantization factor, and the quantized value is written into the bit field corresponding to the window.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is configured to perform the method described in any one of claims 1 to 5 when executed.

10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method as described in any one of claims 1 to 5.