Patent Publication Number: US-2023147681-A1

Title: Methods and Systems for Performing On-The-Fly Automatic Calibration Adjustments of X-Ray Inspection Systems

Description:
CROSS-REFERENCE 
     The present application relies on U.S. Patent Provisional Application No. 63/369,386, titled “Methods and Systems for Performing On-The-Fly Automatic Calibration Adjustments of X-Ray Inspection Systems”, and filed on Jul. 26, 2022, for priority, which is herein incorporated by reference in its entirety. 
    
    
     FIELD 
     The present specification is related generally to the field of X-ray inspection. More specifically, the present specification is related to a method of enabling automatic adjustment of calibration data of X-ray inspection systems while scanning an object under examination or inspection. 
     BACKGROUND 
     Most modern high energy (2.5-9 MeV) transmission X-ray non-intrusive inspection systems offer some degree of cargo composition estimation by using interlaced dual energy pulses. By comparing the radiographic images of the low energy (3-5 MeV) and high energy (6-9 MeV) of the same container, different regions inside it can be characterized into four broad categories of materials: organic, inorganic (such as soil, fertilizer, salts, aluminum), metallic (such as steel, scrap metal), and High-Z materials (such as materials having an atomic number at or above tungsten). 
     Unlike the low energy inspection systems used for parcel and luggage screening where the prevailing process is the photoelectric effect, at high energies, the Compton effect dominates the interaction of X-rays with matter. The Compton process is weakly dependent on the effective atomic number of the material, making an accurate assessment difficult. 
     In addition to the challenges brought by physics, there are other challenges specific to the cargo screening such as, but not limited to: a) cargo clutter, where multiple optically dense objects overlap in the image; b) X-ray source stability (in terms of maintaining a consistent and/or predictable value for dose and energy) and detector stability, both of which may lead to calibration drift; c) energy-dependent X-ray scatter, where low and high energy beams produce different blur in the image and d) obscured objects of interest (such as high-Z shielding, weapons, or smuggled drug packages), which are often small compared to the rest of the imaged cargo. 
     Dual energy material separation methods involve a calibration process in which a set of materials with known atomic numbers and densities such as plastic, aluminum, steel, lead, tungsten, with different thicknesses are placed between the source and detectors, a scan is performed and responses of detectors for the high and low energy beam components are recorded. In normal operation mode, the inverse process takes place. Detectors record the high and low energy response to objects in the beam, and then algorithms determine the closest candidate, based on an effective atomic number (Zeff), in terms of material type and thickness. An uncertainty is associated with the determination of the material type, depending on the system geometry, X-ray flux and energies, and the number of samples (pulse pairs) used to make the determination. 
     Unfortunately, materials separation calibration does not remain stable over the lifetime of an X-ray inspection system. Changes often appear that make the Zeff calculation unreliable. In some conditions, the drift may even happen between two scans taken minutes apart. 
     Therefore, there is a need for a method that enables automatic modulation of calibration data for an X-ray system during scanning of an object under examination or inspection. 
     SUMMARY 
     The following embodiments and aspects thereof are described and illustrated in conjunction with systems, tools and methods, which are meant to be exemplary and illustrative, and not limiting in scope. The present application discloses numerous embodiments. 
     In some embodiments, the present specification discloses a method of performing an on-the-fly adjustment of calibration data corresponding to an X-ray inspection system that comprises an X-ray source in data communication with a computing device, the method being implemented in the computing device having one or more physical processors programmed with a plurality of program instructions that, when executed by the one or more physical processors, cause the computing device to perform the method, the method comprising: generating, by the X-ray inspection system, a first plurality of calibration data, wherein the first plurality of calibration data is stored in a memory associated with the computing device; generating, using the X-ray inspection system, data representative of X-ray scan images of a cargo container; segmenting data representative of X-ray scan images into a plurality of regions of interest, wherein at least some of the plurality of regions of interest contain only one type of material having at least one of a known effective atomic number (Zeff) or a known HS code; determining, using the first plurality of calibration data, first data indicative of Zeff of the at least some of the plurality of regions of interest; comparing the first data with second data indicative of Zeff corresponding to the known Zeff or known HS code; adjusting the first plurality of calibration data to generate a second plurality of calibration data if the first and second data differ more than a predefined threshold; and using the second plurality of calibration data to process the data representative of X-ray scan images to generate and display X-ray scan images. 
     Optionally, the method further comprises calculating a Zeff value for each pixel in the X-ray scan images; applying a smoothing algorithm to the Zeff values of multiple pixels, associated with each of the plurality of regions of interest, in order to generate smoothed Zeff-based regions of interest; applying a predefined color map to the smoothed Zeff-based regions of interest; and displaying the color-coded X-ray scan images. 
     Optionally, the Zeff value for each pixel is calculated using the second plurality of calibration data if the first and second data differ more than the predefined threshold, and wherein the Zeff value for each pixel is calculated using the first plurality of calibration data if the first and second data do not differ more than the predefined threshold. 
     Optionally, the smoothing algorithm includes any one of simple running averages, shape preserving smoothing filters, image-guided segmentation or K-means clustering. 
     Optionally, the at least some of the plurality of regions of interest correspond to empty or unobstructed regions of the cargo container. 
     Optionally, the at least some of the plurality of regions of interest correspond to at least one of a volume encompassing only a top surface of the cargo container, a volume encompassing only a front end of the cargo container, or a volume encompassing only a rear end of the cargo container. 
     Optionally, the first plurality of calibration data is generated by: placing, between a radiation source and detectors of the X-ray inspection system, a set of materials with known atomic numbers and densities, wherein the set of materials have different thicknesses; and recording responses of the detectors for each of the set of materials. 
     Optionally, the X-ray scan images correspond to low and high energies of the radiation source. 
     In some embodiments, the present specification is directed towards an X-ray inspection system comprising: a radiation source; an array of detectors; a computing device in data communication with the radiation source and the array of detectors, wherein the computing device has one or more physical processors programmed with a plurality of program instructions that, when executed by the one or more physical processors, cause the computing device to generate, using the X-ray inspection system, a first plurality of calibration data, wherein the first plurality of calibration data are stored in a memory associated with the computing device; generate, using the X-ray inspection system, X-ray scan images of a cargo container; segment the X-ray scan images into a plurality of regions of interest, wherein each of the plurality of regions of interest contain a single type of a material associated with a known atomic number or a single type of a material associated with a known HS code; determine, using the first plurality of calibration data, first data indicative of a first effective atomic number of the single type of the material associated with the known atomic number or a second effective atomic number of the single type of the material associated with the known HS code for each of the plurality of regions of interest; compare the first data with second data indicative of a known effective atomic number corresponding to the material associated with the known atomic number or a known effective atomic number corresponding to the material associated with the known HS code; adjust the first plurality of calibration data to generate a second plurality of calibration data if the first and second data differ significantly; and replace the first plurality of calibration data by the second plurality of calibration data in the memory. 
     Optionally, the plurality of program instructions, when executed by the one or more physical processors, further cause the computing device to: calculate an effective atomic number value for each pixel in the X-ray scan images; apply a smoothing algorithm to the effective atomic number values of multiple pixels, associated with each of the plurality of regions of interest, in order to generate smoothed effective atomic number-based regions of interest; apply a predefined color map to the smoothed effective atomic number-based regions of interest; and display the color coded X-ray scan images. 
     Optionally, the effective atomic number value for each pixel is calculated using the second plurality of calibration data if the first and second data differ significantly, and wherein the effective atomic number value for each pixel is calculated using the first plurality of calibration data if the first and second data do not differ significantly. 
     Optionally, the smoothing algorithm includes any one of simple running averages, shape preserving smoothing filters, image-guided segmentation or K-means clustering. 
     Optionally, at least some of the plurality of regions of interest are empty or unobstructed. 
     Optionally, at least some of the plurality of regions of interest contain correspond to at least one of a volume encompassing only a top surface of the cargo container, a volume encompassing only a front end of the cargo container, or a volume encompassing only a rear end of the cargo container. 
     Optionally, the first plurality of calibration data is generated by: placing, between a radiation source and detectors of the X-ray inspection system, a set of materials with known atomic numbers and densities, wherein the set of materials have different thicknesses; and recording response of the detectors for each of the set of materials. 
     Optionally, the X-ray scan images correspond to low and high energies of the radiation source. 
     The aforementioned and other embodiments of the present specification shall be described in greater depth in the drawings and detailed description provided below. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
       The accompanying drawings illustrate various embodiments of systems, methods, and embodiments of various other aspects of the disclosure. Any person with ordinary skills in the art will appreciate that the illustrated element boundaries (e.g., boxes, groups of boxes, or other shapes) in the figures represent one example of the boundaries. It may be that in some examples one element may be designed as multiple elements or that multiple elements may be designed as one element. In some examples, an element shown as an internal component of one element may be implemented as an external component in another and vice versa. Furthermore, elements may not be drawn to scale. Non-limiting and non-exhaustive descriptions are described with reference to the following drawings. The components in the figures are not necessarily to scale, emphasis instead being placed upon illustrating principles. 
         FIG.  1    is a schematic drawing of an exemplary LINAC-based high-energy X-ray cargo inspection system that may implement a method described in the present specification in an embodiment; 
         FIG.  2 A  shows segmented regions of a radiographic scan image of a cargo container, in accordance with some embodiments of the present specification; 
         FIG.  2 B  shows a radiographic scan image of a container housing bananas, in accordance with some embodiments of the present specification; and 
         FIG.  3    is a flowchart of a plurality of exemplary steps of a method of processing X-ray scan images of an object under inspection for materials classification and on-the-fly automatic adaptive calibration, in accordance with some embodiments of the present specification. 
     
    
    
     DETAILED DESCRIPTION 
     The present specification is directed towards multiple embodiments. The following disclosure is provided in order to enable a person having ordinary skill in the art to practice the invention. Language used in this specification should not be interpreted as a general disavowal of any one specific embodiment or used to limit the claims beyond the meaning of the terms used therein. The general principles defined herein may be applied to other embodiments and applications without departing from the spirit and scope of the invention. Also, the terminology and phraseology used is for the purpose of describing exemplary embodiments and should not be considered limiting. Thus, the present invention is to be accorded the widest scope encompassing numerous alternatives, modifications and equivalents consistent with the principles and features disclosed. For purpose of clarity, details relating to technical material that is known in the technical fields related to the invention have not been described in detail so as not to unnecessarily obscure the present invention. 
     In various embodiments, a computing device includes an input/output controller, at least one communications interface and system memory. The system memory includes at least one random access memory (RAM) and at least one read-only memory (ROM). These elements are in communication with a central processing unit (CPU) to enable operation of the computing device. In various embodiments, the computing device may be a conventional standalone computer or alternatively, the functions of the computing device may be distributed across multiple computer systems and architectures. 
     In some embodiments, execution of a plurality of sequences of programmatic instructions or code enable or cause the CPU of the computing device to perform various functions and processes. In alternate embodiments, hard-wired circuitry may be used in place of, or in combination with, software instructions for implementation of the processes of systems and methods described in this application. Thus, the systems and methods described are not limited to any specific combination of hardware and software. 
     In the description and claims of the application, each of the words “comprise”, “include”, “have”, “contain”, and forms thereof, are not necessarily limited to members in a list with which the words may be associated. Thus, they are intended to be equivalent in meaning and be open-ended in that an item or items following any one of these words is not meant to be an exhaustive listing of such item or items, or meant to be limited to only the listed item or items. It should be noted herein that any feature or component described in association with a specific embodiment may be used and implemented with any other embodiment unless clearly indicated otherwise. 
     It must also be noted that as used herein and in the appended claims, the singular forms “a,” “an,” and “the” include plural references unless the context dictates otherwise. Although any systems and methods similar or equivalent to those described herein can be used in the practice or testing of embodiments of the present disclosure, the preferred, systems and methods are now described. 
     “On-the-fly adjustment” refers to performing an adjustment to calibration data 1) immediately after a scan has occurred (first scan) and before an immediately subsequent scan is performed, 2) based on the scan data that was just acquired from the first scan, and 3) without manual or human intervention. 
     Overview 
       FIG.  1    illustrates an exemplary LINAC-based high-energy X-ray cargo inspection system that may be configured and used, in an embodiment, to implement the method(s) described in the present specification. As shown, the cargo inspection system  130  comprises a high-energy radiation source  105  for irradiating an object under inspection  110  with a vertically divergent fan beam of radiation  115 . The high-energy radiation source  105  may be, but is not limited to, a linear accelerator (LINAC) or Betatron. In embodiments, the LINAC or any other source provides a radiation dose sufficient for imaging containers and cargo. In an embodiment, the energy and dose output of the LINAC or any other source ranges from 750 keV to 10 MeV and 0.07 Gy/min to 15 Gy/min, respectively. 
     The choice of source type, source intensity, and energy output depends upon the sensitivity of the detectors, the radiographic density of the cargo positioned in the space between the source and detectors, radiation safety considerations, and operational requirements, such as the inspection speed. One of ordinary skill in the art would appreciate the factors that need to be considered when selecting a radiation source type depend upon inspection requirements. In one embodiment, where the object under inspection  110  is a large-sized container or car that highly attenuates the X-ray beam, the radiation may be from an X-ray source operating at an energy ranging from approximately 750 keV and even up to 10 MeV or more. In various embodiments, the object under inspection  110  may be a vehicle, truck, rail car or other containers for carrying cargo, passenger luggage or general belongings. 
     The cargo inspection system  130  further comprises a detector array  120 , which is preferably positioned behind the object under inspection  110  and is configured to and used to detect radiation transmitted through the object under inspection  110 . The detectors  120 , in an embodiment, are formed by a stack of crystals that generate analog signals when X-rays impinge upon them, with the signal strength proportional to the amount of beam attenuation in the object under inspection  110 . In one embodiment, the X-ray beam detector arrangement consists of a linear array of solid-state detectors of the crystal-diode type. A typical arrangement uses cadmium tungstate scintillating crystals to absorb the X-rays transmitted through the object under inspection  110  and to convert the absorbed X-rays into photons of visible light. Crystals such as bismuth germinate, sodium iodide or other suitable crystals may be alternatively used as known to a person of ordinary skill in the art. The crystals can be directly coupled to a suitable detector, such as a photodiode or photo-multiplier. The detector photodiodes may be linearly arranged, which through unity-gain devices, provide advantages over photo-multipliers in terms of operating range, linearity and detector-to-detector matching. In another embodiment, an area detector is used as an alternative to linear array detectors. Such an area detector may be a scintillating strip, such as cesium iodide or other materials known in the art, viewed by a suitable camera or optically coupled to a charge-coupled device (CCD). 
     It would be apparent to persons of skill in the art that the cargo inspection system  130  shown in  FIG.  1    is just one example of an inspection system employing high-energy X-ray sources such as, but not limited to LINAC or Betatron. In some embodiments, the radiation source  105  uses interlaced dual energy pulses in order to generate X-ray scan images of low energy (3-5 MeV) and high energy (6-9 MeV) of the object under inspection  110 . 
     Calibration Drift 
     The present specification recognizes that calibration data for materials separation does not remain stable over the lifetime of an X-ray inspection system. Changes in calibration, also referred to as “calibration drift” often appear and render the Zeff (effective atomic number) calculation unreliable for effective materials separation data. In some conditions, the drift may happen even between two scans taken minutes apart. The following sources, factors, causes or variables may all contribute to calibration drift. The X-ray source itself may be a contributing cause of calibration drift. Dose drift may be induced by beam current or beam energy changes. These include magnet changes (Betatron), automatic frequency control (AFC) shift, and wave guide temperature variation. Beam formation mechanics, which may include collimator alignment casting shadows, detector stack boom oscillations, detector collimator fins shift may also contribute to calibration drift. In addition, X-ray detectors may have problems with photodiode dark current and scintillator light yield, which contribute to calibration drift. 
     More than one cause of calibration shift may occur at the same time. However, only a few of the sources, factors, causes or variables of calibration drift have built-in mechanisms for compensation such as, for example, reference detectors and dark current measurement at the beginning of a scan or in-between pulses. These sources, factors, causes or variables of calibration drift are generally non-linear and are often linked with each other in complicated ways. Also, full recalibration is time consuming and is only a temporary solution for causes such as temperature excursions or slight magnetic drift (in a Betatron) or AFC drift (in a LINAC). 
     Automatic Adaptive Calibration 
     In accordance with aspects of the present specification, instead of parametrizing the contribution of each source, factor, cause or variable to the calibration drift, a phenomenological model is developed in which the system is configured to check an accuracy of the Zeff calculation in almost every scan and in which the system is configured to automatically adjust the calibration data in order to improve scan data, and in particular, materials separation accuracy. 
       FIG.  2 A  shows segmented regions of a radiographic scan image  200  of a cargo container  202 , in accordance with some embodiments of the present specification. In a non-limiting exemplary scenario, the image  200  has at least five regions or sections (also referred to as regions or sections of interest), that is, first region  205 , second region  207 , third region  209 , fourth region  211 , and fifth region  213  for which the material is conventionally known to be steel (for ISO containers, for example). Also, for the at least five regions  205 ,  207 ,  209 ,  211 ,  213  the attenuation and angular range (relative to a central axis of an X-ray beam used to scan the cargo container  202 ) vary enough. In embodiments, the regions are selected for different purposes. For example, referring to  FIG.  2 A , and by way of example only, regions  207 ,  209 , and  211  are selected for stability since the variation is relatively small compared to regions  205  and  213 , which are selected to have large angular coverage and varying attenuations. 
     In embodiments, a radiographic scan image, such as the image  200  of the cargo container  202 , is segmented into one or more regions or sections of interest based on a variability of attenuation and an angular range relative to the central axis of the X-ray beam. In some embodiments, the one or more regions or sections of interest are selected such that the expected attenuation (of the regions or sections of interest) varies more than 10% and the angular range or span is greater than  2  degrees relative to the central axis of the X-ray beam. 
     Containers, such as the cargo container  202 , typically have one or more regions such as, for example, a front end (comprising first region  205 ) and a rear end (comprising fifth region  213 ) and a top portion (comprising second region  207 , third region  209 , and fourth region  211 ) that remain unobstructed. It should be noted that the fifth region  213  and at least the second top region  207  are almost always unobstructed for most cargo containers. The first region or front end  205  is also unobstructed in most cases. The second region  207 , third region  209 , and fourth region  211  are illustrative non-limiting examples of areas or portions in the image  200  that are found to be unobstructed and that can be used for calibration adjustment. These regions will, however, differ on a case-by-case basis depending on how a container is loaded. In some embodiments, a bottom surface or portion  227  of the cargo container  202  may also be at least partially unobstructed (with known container material). Therefore, in various embodiments, an X-ray scan image of a container is analyzed and segmented to identify regions or areas for which material composition is known, wherein such regions or areas of known material composition include portions inside or within the container such as, but not limited to, unobstructed regions (that is, regions not loaded with cargo) of the container, and portions outside the container such as, but not limited to, tires, windshield, vehicle frame around axles and fuel or gas tank. 
     For example, in one embodiment, the region of interest comprising the top portion (comprising at least one of the second region  207 , third region  209 , and fourth region  211 ) of the cargo container  202  is made of only the material that separates the internal volume of the cargo container  202  from the outside environment. In another embodiment, the material that separates the internal volume of the cargo container  202  from the outside environment makes up at least 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, or any numerical increment between 20% and 90% of the region of interest comprising the top portion of the cargo container  202 . 
     In another example, in one embodiment, the region of interest comprising the front end (comprising first region  205 ) of the cargo container  202  is made of only the material that separates the internal volume of the cargo container  202  from the outside environment. In another embodiment, the material that separates the internal volume of the cargo container  202  from the outside environment makes up at least 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, or any numerical increment between 20% and 90% of the region of interest comprising the front end of the cargo container  202 . 
     In yet another example, in one embodiment, the region of interest comprising the rear end (comprising fifth region  213 ) of the cargo container  202  is made of only the material that separates the internal volume of the cargo container  202  from the outside environment. In another embodiment, the material that separates the internal volume of the cargo container  202  from the outside environment makes up at least 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, or any numerical increment between 20% and 90% of the region of interest comprising the rear end of the cargo container  202 . 
     In still another example, in one embodiment, the region of interest comprising the bottom surface or portion  227  of the cargo container  202  is made of only the material that separates the internal volume of the cargo container  202  from the outside environment. In another embodiment, the material that separates the internal volume of the cargo container  202  from the outside environment makes up at least 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, or any numerical increment between 20% and 90% of the region of interest comprising the bottom surface or portion of the cargo container  202 . 
     Also, the first region  205  and fifth region  213  are of interest because of the angular coverage or span of more than 15 degrees off the central axis of the X-ray beam. As known to persons of ordinary skill in the art, due to the physics of X-ray production, the shape of an attenuation curve is expected to change if the energy of the electrons producing the X-rays changes. High energy beams have flux and energy composition roll-off as a function of angle relative to the central axis of the X-ray beam. The roll-off function is different at 4 MeV versus 6 MeV. In some embodiments, the change, drift or modification of the calibration curves is determined by calculating the variation of the roll-off curves. 
     In accordance with some embodiments, the unobstructed regions, such as second region  207 , third region  209 , and fourth region  211 , are identified and used as data points. In some embodiments, machine learning techniques such as, but not limited to, mask R-CNNs (Region-based Convolutional Neural Networks) or U-Nets are configured to segment the image  200  for more features inside and outside the cargo container  202  suitable for use in automatic calibration adjustments. 
     In some embodiments, for scans that have the HS code associated with the X-ray image, the cargo inside the container is used to check and adjust, if required, the calibration data. For example,  FIG.  2 B  shows a radiographic scan image  220  of a container  230  housing bananas, in accordance with some embodiments of the present specification. The dotted box  225  shows that the cargo segmentation algorithm successfully identified the cargo region  222  inside the refrigerated ISO container  230 . 
     In accordance with various embodiments, there are multiple other sections or regions inside the container  230  that can be used to check and, if required, adjust the calibration data. The top edge region  235  of the container  230  is metallic and uncluttered, the back edge  240  of the container  230  is also metallic and spans a large angular range relative to a central axis of an X-ray beam used to scan the container  230 . Inside, the bananas  222  are organic with a large angular and attenuation coverage. 
     Thus, in embodiments, the present specification is directed towards a radiographic or X-ray image processing method of identifying or segmenting one or more regions or sections of interest of a cargo container for which the materials are known and that have associated large angular and attenuation coverage. In various embodiments, the one or more regions or sections of interest have an associated angular span of more than 2 degrees and an attenuation variation of more than 10% relative to the mean inside each of the one or more regions or sections of interest. Thus, in embodiments, this refers to particular values relative to the values within the region itself. As an non-limiting example, this may represent regions  205  and  213 . Thereafter, the method computationally links the variation of Zeff values of the identified or segmented regions of interest relative to the current calibration and adjusts the parameters of the calibration curves to match with known materials. 
     In embodiments, the regions of interest may become obstructed by known features and materials, such as, for example, the skin of the cargo container. In order to be a region of interest, a condition is being able to determine (or having a way of knowing) what material is contained by the region of interest. This information is obtained either through the identification of known features (for example, cargo container parts, vehicle tires, windshield, etc.), HS codes, or other ways of identifying an object. For example, a machine learning algorithm may be configured to identify tires, ceramic tiles or engine blocks inside the cargo container as these are made of known materials. 
       FIG.  3    is a flowchart of a plurality of exemplary steps of a method  300  of processing X-ray scan images of an object under inspection for materials classification and on-the-fly automatic adaptive adjustment of calibration data, in accordance with some embodiments of the present specification. In embodiments, the method  300  comprises a plurality of programmatic instructions or code stored in a non-transient memory associated with a computing device that is in data communication with an X-ray inspection system configured to generate the X-ray scan images. The computing device includes a processor and random access memory, wherein the processor executes the method  300 . 
     In some embodiments, the X-ray inspection system is configured to use interlaced dual energy pulses in order to generate the X-ray scan images of low energy (3-5 MeV) and high energy (6-9 MeV) of the cargo container. In various embodiments, the object under inspection may be a vehicle, truck, rail car or other containers for carrying cargo, passenger luggage or general belongings. In a non-limiting exemplary scenario, the steps of the method  300  are being described with reference to a cargo container scanned using a dual-energy X-ray inspection system. Alternate embodiments may use a single-energy X-ray inspection system. Further, embodiments may use a multi-view X-ray inspection system having single or dual-energy capabilities. 
     At step  302 , as a result of an initial calibration process, the X-ray inspection system is configured to generate a first plurality of calibration data. The first plurality of calibration data is stored in the non-transient memory associated with the computing device. In the initial calibration process, a set of materials with known atomic numbers and densities such as plastic, aluminum, steel, lead, tungsten, with different thicknesses is put between the X-ray source and detectors (of the X-ray inspection system) and the response of the detectors, for the high and low energy beam components, is recorded corresponding to the first plurality of calibration data. 
     At step  304 , the X-ray inspection system is operated to scan a cargo container, thereby generating data indicative of dual-energy X-ray scan images. At step  306 , the computing device is configured to apply a cargo materials segmentation algorithm, known to persons of ordinary skill in the art, to the X-ray scan images in order to identify and segment first areas or regions of interest (ROI) with known materials composition (in some embodiments, the first areas or regions of interest contain only one type of material having a known effective atomic number (Zeff)). For example, for an ISO container, the first areas or regions of interest include top and ends (front and rear) that may be unobstructed and known to be of steel. The unobstructed areas or regions may also include those portions of the container that are empty or devoid of the presence of any cargo or goods. In further examples, the first areas or regions of interest may additionally include tires, the windshield, vehicle frame around axles and fuel tank. 
     It should be appreciated that calibration curves are non-linear. Although a single region or section of interest can be used for materials classification and on-the-fly automatic adaptive adjustment of calibration data, the greater the number of regions or sections of interest are processed, the more accurate the recalibration or adjustment of calibration data becomes. 
     At step  308 , the computing device is configured to determine if one or more HS (Harmonized Commodity Description and Coding System) codes, associated with the cargo or goods of the cargo container and therefore the X-ray scan images, are known. HS codes are identification codes given to goods for use in international trade. The HS codes are administered by the World Customs Organization (WCO) and are internationally accepted for use by customs authorities and companies to identify goods/cargo. 
     If the one or more HS codes are known, then at step  310 , the computing device is configured to further segment the cargo or goods regions of the X-ray scan images into one or more second areas or regions of interest corresponding to the one or more HS codes and subsequently the flow moves to step  312 . At step  312 , the computing device is configured to determine first data indicative of the Zeff of the segmented first and/or second regions of interest using the first plurality of calibration data. 
     If the one or more HS codes are not known, then the computing device is configured to determine first data indicative of the Zeff of the segmented first regions of interest using the first plurality of calibration data. The second regions of interest, which include known HS codes, are used to provide additional data points to the recalibration model. As described earlier, the segmented first regions of interest are those corresponding to known materials while the segmented second regions of interest are those corresponding to one or more HS codes. Thus, if the one or more HS codes are known, then the computing device is configured to determine first data indicative of the Zeff of the segmented first region of interest and segmented second region of interest using the first plurality of calibration data. 
     At step  314 , the computing device is configured to compare the first data with second data indicative of reference Zeff corresponding to the known materials and/or HS codes of the segmented first and/or second regions of interest. At step  316 , the computing device is configured to determine if the first data is significantly different or deviated from the second data. In some embodiments, the first data is considered to be significantly different or deviated from the second data if the first and second data differ or deviate by at least 2 atomic number units. In some embodiments, the first data is considered to be significantly different or deviated from the second data if the first and second data differ or deviate by at least 3 atomic number units. 
     If a significant difference or deviation is determined, as defined above, then at step  318 , the first plurality of calibration data is adjusted or modulated based on the second data in order to generate a second plurality of calibration data, the first plurality of calibration data is replaced by the second plurality of calibration data for storing in the memory, at step  320 , and subsequently the flow moves to step  322 . 
     It should be appreciated that the adjustment or modulation of the first plurality of calibration data is non-linear. The adjustment or modulation is dependent on the number of regions or sections of interest identified or available. In some embodiments, if the identified regions or sections of interest correspond only to container components then a shift in the calibration curves (of the first plurality of calibration data) is performed to recalibrate. However, if the regions or sections of interest with HS codes are also available then each calibration curve (in the first plurality of calibration data) corresponding to the specific type of material is modified or modulated. 
     At step  322 , the computing device is configured to calculate a Zeff value for each individual pixel in the whole X-ray scan images. In embodiments, the Zeff value for each pixel is calculated using the second plurality of calibration data if the first and second data differ significantly, as defined above. However, the Zeff value for each pixel is calculated using the first plurality of calibration data if the first and second data do not differ significantly. 
     At step  324 , the computing device is configured to apply materials segmentation algorithm to the X-ray images in order to generate a plurality of segments and thereafter apply a smoothing or averaging filter or algorithm to the Zeff values (of step  322 ) of multiple pixels, associated with each of the plurality of segments, in order to generate one or more smoothed Zeff-based segments, regions or clusters in the X-ray images. In various embodiments, the smoothing or averaging involves techniques such as, but not limited to, simple running averages to shape preserving smoothing filters, image-guided segmentation and K-means clustering. 
     Thereafter, at step  326 , the computing device is configured to apply a predefined color map or code to the one or more smoothed Zeff-based regions of interest, segments or clusters. For example, a smoothed Zeff-based segment corresponding to organic materials are colored orange, metallic materials are colored in blue, inorganic materials are colored in green and high-Z materials are colored in red. Segments or regions with unreliable Zeff due to too little attenuation or too much noise remain uncolored (grayscale). 
     Finally, at step  328 , the computing device is configured to render or display color-coded X-ray images on a display. 
     The above examples are merely illustrative of the many applications of the systems and methods of the present specification. Although only a few embodiments of the present invention have been described herein, it should be understood that the present invention might be embodied in many other specific forms without departing from the spirit or scope of the invention. Therefore, the present examples and embodiments are to be considered as illustrative and not restrictive, and the invention may be modified within the scope of the appended claims.