Rapid sensing of hidden objects and defects using a single-pixel diffractive terahertz sensor

EP4680940A2Pending Publication Date: 2026-01-21RGT UNIV OF CALIFORNIA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
EP2024771333
Authority / Receiving Office
EP · EP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-16
Filing Date
2024-01-30
Publication Date
2026-01-21

AI Technical Summary

Technical Problem

Existing terahertz imaging systems are limited by low-speed, low-throughput, and high-cost due to the need for raster scanning and bulky lasers, and they struggle to detect hidden defects or objects within opaque materials effectively, with focal-plane arrays failing to provide time-resolved and frequency-resolved data.

Method used

A single-pixel diffractive terahertz sensor using optimized diffractive layers with deep learning, which modifies the terahertz radiation spectrum to detect hidden defects or objects all-optically without scanning, employing a single-pixel spectroscopic detector and passive diffractive layers that eliminate the need for external power and digital processing.

Benefits of technology

Enables rapid, high-throughput detection of hidden defects or objects within opaque materials, simplifying the detection process and reducing costs by eliminating the need for focal plane arrays and digital processing, while maintaining high sensitivity and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure US2024013612_19092024_PF_FP_ABST
    Figure US2024013612_19092024_PF_FP_ABST
Patent Text Reader

Abstract

A diffractive sensor rapidly detects hidden defects or target features within a sample using a single-pixel spectroscopic detector without scanning the sample or forming / processing its image. The diffractive sensor includes passive diffractive layers that are optimized using deep learning to modify the spectrum of terahertz radiation according to the absence / presence of hidden structures or defects. The diffractive sensor all-optically probes the structural information of the sample volume and outputs a spectrum that directly indicates the presence or absence of hidden structures. A diffractive terahertz sensor was trained to sense hidden defects or target features inside test samples and its performance was evaluated by analyzing the detection sensitivity as a function of the size and position of the unknown defects. Feasibility was validated by successfully detecting hidden defects using pulsed terahertz illumination. This technique will be valuable for various applications, e.g., security screening, biomedical sensing, industrial quality control, anti-counterfeiting measures and cultural heritage protection.
Need to check novelty before this filing date? Find Prior Art

Description

2023-184-2 RAPID SENSING OF HIDDEN OBJECTS AND DEFECTS USING A SINGLE-PIXEL DIFFRACTIVE TERAHERTZ SENSOR Related Application

[0001] This Application claims priority to U.S. Provisional Patent Application No. 63 / 490,745 filed on March 16, 2023 which is hereby incorporated by reference. Priority is claimed pursuant to 35 U.S.C. § 119 and any other applicable statute. Technical Field

[0002] The technical field generally relates to non-invasive detection systems that utilize all-optical processing. More specifically, the technical field relates to a diffractive sensor that rapidly detects hidden defects / objects within a target sample using a single-pixel spectroscopic terahertz detector, without scanning the sample or forming / processing its image. Statement Regarding Federally Sponsored Research and Development

[0003] This invention was made with government support under Grant Number N00014- 22-1-2016, awarded by the U.S. Navy, Office of Naval Research. The government has certain rights in the invention. Background

[0004] Inspecting hidden structures within materials or samples represents a critical requirement across various applications, such as security screening, industrial manufacturing and quality control, medicine, construction, and defense. Non-invasive detection systems based on terahertz technology offer unique opportunities for this purpose due to the ability of terahertz waves to penetrate through most optically-opaque materials and grasp the molecular fingerprint information of the sample through the rich spectral signatures of different materials in the terahertz band. For example, terahertz time-domain spectroscopy (THz-TDS) systems have been extensively used in various non-destructive quality control applications since they can provide frequency-resolved and time-resolved responses of hidden objects. However, existing THz-TDS systems are single-pixel and require raster scanning to acquire the image of the hidden features, resulting in relatively low-speed / low-throughput systems.2023-184-2 Nonlinear optical processes can also be utilized to convert the terahertz information of the illuminated sample to the near-infrared regime to visualize the hidden structural information of the sample through an optical camera without raster scanning. However, these imaging systems offer relatively low signal-to-noise ratio (SNR) levels and require bulky and expensive high-energy lasers to offer acceptable nonlinear conversion efficiencies. Alternatively, terahertz information of the illuminated sample can be encoded using spatial light modulators and the image data can be resolved using computational methods without raster scanning. However, the physical constraints of spatial light modulators operating at terahertz wavelengths limit the speed, and increase the size, cost, and complexity of these imaging systems. In addition to these, currently available terahertz focal-plane arrays based on field-effect transistors and microbolometers do not provide time-resolved and frequency- resolved image data, limiting the types of structural information that can be detected. Due to these limitations, the space-bandwidth products (SBPs) of existing terahertz imaging systems are orders of magnitude lower than their counterparts operating in the visible band, thereby constraining the system's overall information throughput and its capacity to adequately capture the desired details of the hidden structures of interest.

[0005] Apart from these limitations of existing terahertz imaging systems, the identification of hidden structural features in test volumes through the processing of large- pixel-count image data is, in general, bottlenecked and challenging to reach high throughputs needed in many applications (e.g., industrial quality control and security screening) due to the digital storage, data transmission and image processing / classification requirements that are demanding for continuous imaging and sensing systems. Summary

[0006] According to one embodiment, a diffractive sensor is disclosed that can rapidly detect hidden defects or defects or target features (e.g., objects) within a target sample volume or target object (e.g., an object to be tested) using a single-pixel spectroscopic terahertz detector. Unlike traditional approaches that involve point-by-point scanning and digital reconstruction of the target sample volume using a computer, this single-pixel diffractive sensor rapidly inspects the volume of the test sample or object illuminated with terahertz radiation, without the formation or digital processing of an image of the sample. Stated differently, rather than formulating the detection and classification of defects or hidden target features as part of a standard machine vision pipeline (i.e., image, digitize and then2023-184-2 analyze using a computer), instead, the detection system is treated as a coherent diffractive sensor of terahertz waves that can all-optically search for and classify undesired or unexpected sources of secondary waves generated by diffraction through hidden defects or structures. In this sense, the diffractive sensor can be considered an all-optical sensor for unexpected or hidden sources of secondary waves within a test volume or object, which are detected through a single-pixel spectroscopic detector. The design includes a series of diffractive layers (also referred to as substrate layers), optimized to modify the spectrum of the terahertz radiation scattered from the test sample volume or object according to the absence or presence of target features (e.g., hidden structures) or defects. The diffractive layers are jointly optimized using deep learning, and contain tens of thousands of subwavelength phase features. Once their deep learning-based training is complete, the resulting diffractive layers are physically fabricated using 3D printing or additive manufacturing, which forms an optical neural network portion of the diffractive sensor. When the test object is illuminated with terahertz radiation, the scattered terahertz waves from the object are all-optically processed by the diffractive network and sampled by a single-pixel spectroscopic detector at the output aperture of the system. The measured spectrum reveals the existence of hidden defects / structures within the object all-optically, without the need for raster scanning or any image reconstruction or processing steps. Since these target features or defects of interest are hidden within a solid volume that forms the object, traditional machine vision approaches that operate at visible wavelengths cannot provide an alternative approach for these tasks.

[0007] A diffractive sensor device was created and tested that detected hidden defects in silicon samples, which were prepared by stacking two wafers; one wafer containing etched defects and the other wafer covering the defective regions. The diffractive layers were designed to introduce a differential variation in the peak spectral intensity near two predetermined terahertz wavelengths. This diffractive defect sensor was realized using a single-pixel THz-TDS system with a plasmonic nanoantenna-based source generating pulsed terahertz illumination and a plasmonic nanoantenna-based detector sampling the terahertz spectrum at the output aperture. The performance of the diffractive defect sensor was numerically analyzed by evaluating its detection sensitivity as a function of the size and the position of the hidden defects within the detection field-of-view (FOV), also covering subwavelength feature sizes. The optimized diffractive layers were fabricated using a 3D printer and conducted experimental tests for hidden defect detection. The experimental results2023-184-2 on silicon wafers with various unknown defect sizes and positions showed a good agreement with the numerical analysis, successfully revealing the presence of unknown hidden defects.

[0008] The reported approach offers distinct advantages compared to the existing terahertz imaging and sensing systems. First, the hidden target feature / defect detection is accomplished using, in some embodiments, a single-pixel spectroscopic detector, eliminating the need for a focal plane array or raster scanning, thus greatly simplifying and accelerating the target feature / defect detection process. Second, the diffractive layers employed are passive optical components, enabling the diffractive sensor to analyze the test object volume without requiring any external power source except for the terahertz illumination and single-pixel detector. Third, the all-optical end-to-end detection process negates the need for memory, data / image transmission or digital processing using e.g., a graphics processing unit (GPU), resulting in a high-throughput target feature / defect detection scheme.

[0009] Although the diffractive target feature / defect sensors reported herein were primarily designed for the terahertz band, the underlying concept and design approaches are also applicable for defect detection in other parts of the spectrum, including infrared, visible, and X-ray. These unique capabilities of performing computational sensing without a digital computer or the need for creating a digital 3D image will inspire the development of new task-specific all-optical detection systems and smart sensors. These systems can find diverse applications, such as industrial manufacturing and quality control, material inspection, detection / classification of hidden objects, security screening, and anti-counterfeiting measures. The non-destructive and non-invasive nature of this technology platform also makes it a valuable tool for sensitive applications, e.g., cultural heritage preservation and biomedical sensing. This framework can deliver transformative advances in various fields, where defect detection and materials diagnosis are of utmost importance.

[0010] In one embodiment, a diffractive sensor for sensing a defect or a target feature in an object includes a multi-wavelength illumination system including a broadband light source or individual light sources centered at different wavelengths of electromagnetic radiation and one or more output detectors arranged along an optical path; one or more optically transmissive and / or reflective substrate layer(s) arranged in the optical path and having the object interposed between or outside of the one or more optically transmissive and / or reflective substrate layer(s) along the optical path, each of the optically transmissive and / or reflective substrate layer(s) comprising a plurality of physical features formed on or within the one or more optically transmissive and / or reflective substrate layer(s) and having different2023-184-2 transmission and / or reflection properties as a function of the lateral coordinates across each substrate layer, wherein the one or more optically transmissive and / or reflective substrate layer(s) and the object collectively modulate an input optical signal from the light source(s) to generate output optical signals at different wavelengths at the one or more output detectors, wherein the output optical signals at different wavelengths encode for the presence or absence of the defect or the target feature in the object; and wherein the one or more optically transmissive and / or reflective substrate layer(s) are designed during a training phase with training objects to define or optimize the plurality of physical features formed on or within the one or more optically transmissive and / or reflective substrate layer(s) to sense the defect or the target feature in the object based on the output optical signals at different wavelengths detected at the one or more output detectors.

[0011] In another embodiment, a method of detecting the presence of a defect or a target feature in an object includes providing a diffractive sensor for sensing the defect or the target feature in the object including: (1) a multi-wavelength illumination system comprising a broadband light source or individual light sources centered at different wavelengths of electromagnetic radiation and one or more output detectors arranged along an optical path; and (2) one or more optically transmissive and / or reflective substrate layer(s) arranged in the optical path and having the object interposed between or outside of the one or more optically transmissive and / or reflective substrate layer(s) along the optical path, each of the optically transmissive and / or reflective substrate layer(s) comprising a plurality of physical features formed on or within the one or more optically transmissive or reflective substrate layer(s) and having different transmission and / or reflection properties as a function of the lateral coordinates across each substrate layer, wherein the one or more optically transmissive and / or reflective substrate layer(s) and the object collectively modulate an input optical signal from the light source(s) to generate output optical signals at different wavelengths at the one or more output detectors, wherein the output optical signals at different wavelengths detected at the one or more output detectors encode for the presence or absence of the defect or the target feature in the object; inputting the input optical signal to the diffractive sensor; capturing the output optical signals with the one or more detectors; and detecting the presence or absence of the defect or the target feature based on the output optical signals at different wavelengths detected at the one or more output detectors.2023-184-2 Brief Description of the Drawings

[0012] FIG.1A illustrates a schematic representation of a diffractive sensor according to one embodiment. This embodiment illustrates a diffractive sensor that operates in transmission mode. A multi-wavelength illumination system comprising illuminates the diffractive sensor that includes a plurality of substrates and an object or sample volume that is being tested for a defect or the presence of a target feature. Here the object is interposed between two substrate layers on either side. One or more output detectors positioned along the optical path at the output of the diffractive sensor captures the optical output signals at a plurality of wavelengths. The one or more output detectors are used to obtain the power spectrum signal from the diffractive sensor. A differential spectral score is calculated and compared to a threshold. In this embodiment, a differential spectral score that is at or above the threshold means that a defect or target feature has been detected. A differential spectral score that is below the threshold means that no defect or target feature has been detected.

[0013] FIG.1B illustrates a schematic representation of a diffractive sensor according to another embodiment. This embodiment illustrates a diffractive sensor that operates in reflection mode. A multi-wavelength illumination system comprising illuminates the diffractive sensor that includes a plurality of substrates and an object or sample volume that is being tested for a defect or target feature. Here the object is interposed between two reflective substrate layers along a folded optical path. One or more output detectors positioned along the optical path at the output of the diffractive sensor captures the optical output signals at a plurality of wavelengths. The one or more output detectors are used to obtain the power spectrum signal from the diffractive sensor. A differential spectral score is calculated and compared to a threshold. In this embodiment, a differential spectral score that is at or above the threshold means that a defect or target feature has been detected. A differential spectral score that is below the threshold means that no defect or target feature has been detected.

[0014] FIG.2 illustrates a single substrate layer of the diffractive sensor. The substrate layer may be made from a material that is optically transmissive (for transmission mode) or an optically reflective material (for reflective mode). The substrate layer, which may be formed as a substrate or plate in some embodiments, has surface features formed across the substrate layer. The surface features form a patterned surface (e.g., an array) having different valued transmission (or reflection) coefficients as a function of lateral coordinates across each substrate layer. These surface features act as artificial “neurons” that connect to other “neurons” of other substrate layers of the optical neural network portion of the diffractive2023-184-2 sensor through optical diffraction (or reflection) and alter the phase and / or amplitude of the light wave.

[0015] FIG.3 schematically illustrates a cross-sectional view of a single substrate layer of diffractive sensor according to one embodiment. In this embodiment, the surface features are formed by adjusting the thickness of the substrate layer that forms the optical neural network. These different thicknesses may define peaks and valleys in the substrate layer that act as the artificial “neurons.”

[0016] FIG.4 schematically illustrates a cross-sectional view of a single substrate layer of a diffractive sensor according to another embodiment. In this embodiment, the different surface features are formed by altering the material composition or material properties of the single substrate layer at different lateral locations across the substrate layer. This may be accomplished by doping the substrate layer with a dopant or incorporating other optical materials into the substrate layer. Metamaterials or plasmonic structures may also be incorporated into the substrate layer.

[0017] FIG.5 schematically illustrates a cross-sectional view of a single substrate layer of a diffractive sensor according to another embodiment. In this embodiment, the substrate layer is reconfigurable in that the optical properties of the various artificial neurons may be changed, for example, by application of a stimulus (e.g., electrical current or field). An example includes spatial light modulators (SLMs) which can change their optical properties. In this embodiment, the neuronal structure is not fixed and can be dynamically changed or tuned as appropriate. This embodiment, for example, can provide a learning diffractive sensor or a changeable diffractive sensor that can be altered on-the-fly (e.g., over time) to improve the performance, compensate for aberrations, or even change another task.

[0018] FIG.6 illustrates a flowchart illustrating how a digital model of the diffractive sensor is first digitally trained to sense a defect in a sample volume / object based on captured output optical signals at different wavelengths. Once the digital model of the diffractive sensor is trained, a physical embodiment of the diffractive sensors is than manufactured and used.

[0019] FIG.7A illustrates a schematic of a diffractive terahertz sensor for rapid sensing of hidden objects or defects using a single pixel spectroscopic detector. The analysis and sensing of hidden defects are performed all-optically using passive and spatially-structured diffractive substrate layers that encode the presence or absence of unknown defects hidden within the2023-184-2 target sample volume / object into the output terahertz spectrum, which is then detected using a single-pixel spectroscopic detector.

[0020] FIG.7B illustrates the working principle of the all-optical hidden object / defectdetection scheme. The spectral intensity values, ^^^^^^^and ^^^^^ଶ^, sampled at twopredetermined wavelengths ^^^and ^^ଶby the single-pixel detector are used to compute the output score for indicating the existence ofdefects / structures within the sample volume. ^^ = ( ^^ + ^^ )୫^ ଶ / 2.

[0021] FIG.8A is a side view schematic of the sample or object under test that includes two silicon wafers stacked with a hidden defect structure fabricated on the surface of one of the wafers through photolithography and etching. The opaque regions are covered with aluminum to block the terahertz wave transmission, leaving a square-shaped opening of 2×2 cm that serves as the detection FOV. The photos showing cross-sections of a sample structure at planes F, D and B are provided in FIG.12. The direction of terahertz wave propagation is defined as the z direction, while the x and y directions represent the lateral directions.

[0022] FIG.8B illustrates the physical layout of the single-pixel diffractive terahertz sensor set-up, with the sizes of input / output apertures, the size of the detection FOV, and the axial distances between the adjacent components annotated. Note that dimensions and sizes are not to be construed as limitations on the diffractive sensor.

[0023] FIG.8C illustrates the thickness profiles of the designed diffractive substrate layers (D1 through D4).

[0024] FIG.9A illustrates a cross-section of the sample or object under test that includes two silicon wafers stacked with a hidden defect structure fabricated on the surface of one of the wafers. The depth direction Dz is illustrated.

[0025] FIG.9B illustrates the lateral dimensions (Dx and Dy) of the defect in the sample or object under test. These dimensions are used for analyzing the impact of the shape and size of the hidden defect, defined by the lateral sizes, Dx and Dy, and the depth, Dz, on the detection sensitivity of the diffractive terahertz sensor design. For a given combination of (Dx, Dy, Dz), a total of nsample = 100 test samples were numerically generated for each region (R1-R6), with each sample containing a hidden defect with a dimension of (Dx, Dy, Dz) located randomly across the detection FOV.

[0026] FIG.9C illustrates defect detection accuracies as a function of the defect dimensions (Dx, Dy and Dz) that are defined in (FIG.9A) and (FIG.9B).2023-184-2

[0027] FIG.9D is an illustration for analyzing the impact of the position of the hidden defect within the detection FOV on the detection sensitivity of the diffractive defect sensor. For this analysis, the entire detection FOV is virtually divided into a series of concentric circles of equal radius, forming ring-like regions, R1 to R6. For each of these regions, a total of nsample = 100 test samples were numerically generated, each containing a hidden defect located randomly within the region.

[0028] FIG.9E illustrates a bar graph showing the resulting defect detection accuracies within different regions of the detection FOV that are defined in (FIG.9D) using randomly located subwavelength hidden defects with Dx = Dy = 0.75 mm and Dz = 0.18 mm.

[0029] FIG.10A is a schematic of the THz-TDS experimental set-up. Dark lines represent the propagation path of the femtosecond pulses generated from a Ti:Sapphire laser operating at 780 nm to pump / probe the terahertz source / detector. Light lines depict the propagation path of the terahertz pulses, which are generated with a peak frequency of ~500 GHz and a bandwidth of ~5 THz and modulated by the 3D-printed diffractive terahertz sensor to inspect the hidden structures within the test sample.

[0030] FIG.10B are photographs of the 3D-printed diffractive layers.

[0031] FIG.10C is a photograph of the experimental set-up.

[0032] FIG.10D is a photograph of the assembled diffractive terahertz sensor. ^^୫= ( ^^^+ ^^ଶ) / 2 = 0.95 mm.

[0033] FIG.11A is a cross-sectional illustration of the sample under test showing planes F, D, B.

[0034] FIG.11B shows photograph images of the exemplary test samples used for the experimental blind testing, which reveal the hidden structures at the cross-sectional plane D (not visible from outside). The first nine of the test samples (i.e., samples No.1-9) contain etched defects that have different shapes and are positioned at different locations within the detection FOV, while the last sample (i.e., sample No.10) has no defects. These photos were captured by removing the smaller silicon wafer at the front, i.e., the left wafer in (FIG.10A).

[0035] FIG.11C illustrates normalized experimental spectral scores for the test samples shown in (FIG.11B).

[0036] FIG.11D illustrates a histogram showing the distribution of the 252 experimental differential detection scores, which were obtained through measuring a defect-free (negative) sample 10 times through repeated experiments and combining these 10 spectral measurements in unique groups of 5, each resulting in an experimental differential detection2023-184-2 score, ^^^^^,^^୮, based on the average spectrum. Note that ^^^^ହ^^ ൌ 252, where ^^ refers to the combination operation.

[0037] FIG.11E illustrates normalized experimental spectral intensity (solid lines) for the different test samples shown in (FIG.11B), compared with their numerically simulated counterparts (dashed lines). Each test sample was measured 5 times and the results of all 5 measurements are shown in the same graph. For the test samples with defects (i.e., samples No.1-9), the lateral sizes (Dx and Dy) and positions (xd, yd) of the defects are shown in italicized texts, and Dz = 0.25 mm. The experimental differential detection scores, ^^^^^,^^୮, are calculated for each test sample based on averaging the 5 spectral measurements, which are also compared with their numerical counterpart ^^^^^,^୧୫, reported at the bottom of each panel.

[0038] FIG.12 illustrates photographs of the cross-sectional planes F, D and B of the test sample structure illustrated in FIG.11A.

[0039] FIGS.13A and 13B illustrate the dispersion curves of the material used for the diffractive layers: the refractive index ^^ௗ^ ^^^ (FIG.13A) and the extinction coefficient ^^ௗ^ ^^^ (FIG.13B).

[0040] FIG.14 illustrates a graph showing the impact of different averaging factors (Navg) used for experimental spectral measurements on the false positive rate (FPR) in the defect detection results. For this analysis, a defect-free (negative) sample was measured 10 times through repeated experiments; using ^^ ^^^ே^౬^^, and within these 10 spectral measurements all the possible combinations of Navgeach resulting in an experimental differential detection score, ^^^^^,^^୮, based on the average spectrum. By comparing these ^^^^^,^^୮with the detection threshold ^^^୦= 0.5, the FPR as a function of Navg was obtained.

[0041] FIG.15A shows amplitude and phase distributions of the field ^^^^^^^^at two predetermined wavelengths, ^^^and ^^ଶ.

[0042] FIG.15B is an illustration used for analyzing the impact of the position of the hidden defect within the detection FOV.

[0043] FIGS.15C and 15D illustrate the output spectral intensity at the two operationalwavelengths ^^^^^^^and ^^^^^ଶ^as a function of the hidden defect’s position within thedetection FOV.

[0044] FIG.15E illustrates the final detection score ^^^^^as a function of the hidden defect’s position within the detection FOV.2023-184-2

[0045] FIG.15F illustrates the final detection results as a function of the hidden defect’s position within the detection FOV. TP: True Positive. FN: False Negative. Detailed Description of Illustrated Embodiments

[0046] With reference to FIGS.1A, 1B, 7A, 7B, 8B, and 10A-10D, the diffractive sensor 10 according to one embodiment contains a plurality of diffractive layers or substrate layers 20 that are physical layers which may be formed as a physical substrate or matrix of optically transmissive material (for transmission mode as seen in FIG.1A) or optically reflective material (for reflective mode as seen in FIG.1B). In transmission mode, light or electromagnetic radiation passes through the substrate layer(s) 20. Conversely, in reflective mode, light or radiation reflects off the substrate layer(s) 20. Exemplary materials that may be used for the substrate layers 20 include polymers and plastics (e.g., those used in additive manufacturing techniques such as 3D printing) as well as semiconductor-based materials (e.g., silicon and oxides thereof, gallium arsenide and oxides thereof), crystalline materials or amorphous materials such as glass and combinations of the same. Metal coated materials may be used for reflective substrate layers 20. It should be appreciated that other embodiments may combined aspects of both transmission mode (FIG.1A) and reflection mode (FIG.1B) into the diffractive sensor 10.

[0047] With reference to FIGS.1A and 1B, the diffractive sensor 10 includes a multi- wavelength illumination system 30 that includes a broadband source or individual sources centered at different wavelengths of electromagnetic radiation. The light from the multi- wavelength illumination system 30 travels along an optical path 12 that passes through the object 100 and the substrate layer(s) 20 and ends at one or more output detectors 14. Alternatively, the light from the wavelength illumination system 30 may reflect off the object 100 and / or the substrate layer(s) 20 in reflection-based embodiments. The optical path 12 may be substantially linear as seen in FIG.1A or it may be folded as is seen in FIG.1B. The one or more output detectors 14 may include optical sensors or detectors. The one or more output detectors 14 generate output optical signals for different detected wavelengths of light. This may include a single output detector 14, for example, the single-pixel spectroscopic detector (THz detector) as described herein. The one or more output detectors 14 may also include different optical sensors or detectors that capture different bands or ranges of wavelengths. For example, a plurality of optical sensors or detectors may be used that capture2023-184-2 light at different bands or ranges of wavelengths. This may include optical sensors or detectors associated with filters to filter particular wavelength ranges or bands.

[0048] In one embodiment, the multi-wavelength illumination system 30 is a time-domain spectroscopy (TDS) system that is used along with the plurality of substrate layers 20. In one embodiment, a sample volume or object 100 that is to be examined or interrogated is interposed between the plurality of substrate layers 20 as described herein. In other embodiments, the sample volume or object 100 to be examined or interrogated is located outside of the plurality of substrate layers 20 (i.e., before a first substrate layer 20 encountered by the light from the multi-wavelength illumination system 30 or after a last substrate layer 20 encountered by the light from the multi-wavelength illumination system 30). The object 100 may include a semiconductor in one embodiment (e.g., silicon wafer). The object 100 may also include a circuit, a commercial product, an art work, or the like. It should be understood, however, that in other embodiments, the object 100 may include other types of objects. This includes inorganic and / or organic materials. A biological sample or tissues may include examples of objects 100 in some embodiments. In one embodiment, the multi-wavelength illumination system 30 is a terahertz (THz-TDS) system as best seen in FIGS.10A-10D. The THz-TDS system 30 includes a femtosecond laser 32 and beam splitter 34 that divides the laser to a THz source 36 in one arm and to a delay stage 38 in the other arm. The THz source 36 generates THz pulses that are input via an off-axis parabolic mirror 40 and separate mirror 42 through an input aperture 44 that defines the input plane to the diffractive sensor 10 (FIGS.10C-10D) and into the plurality of substrate layers 20 and the object 100. The input THz pulses (e.g., input optical signals) are modulated by the substrate layers 20 to inspect target features such as hidden objects / structures or defects within the object 100 that is interposed in the optical path of the diffractive sensor 10. The modulated signal passes through an outlet aperture 46 where the output optical signal is captured by one or more output detectors 14. In the THz embodiment described herein, the one or more output detectors 14 is a single-pixel spectroscopic detector (THz detector). The single-pixel spectroscopic detector samples the terahertz spectrum at the output aperture 46.

[0049] With reference to FIGS.2-5, each substrate layer 20 of the diffractive sensor 10 has a plurality of physical features 22 formed on the surface of the substrate layer 20 or within the substrate layer 20 itself that collectively define a pattern of physical locations along the length and width of each substrate layer 20 that have varied transmission properties (or varied reflection properties). The physical features 22 formed on or in the substrate2023-184-2 layer(s) 20 thus create a pattern of physical locations within the substrate layer(s) 20 that have different valued transmission (or reflection) properties as a function of lateral coordinates (e.g., length and width and in some embodiments depth) across each substrate layer 20. In some embodiments, each separate physical feature 22 may define a discrete physical location on the substrate layer 20 while in other embodiments, multiple physical features 22 may combine or collectively define a physical region with a particular transmission (or reflection) property. These physical regions act as the “neurons” within the physical optical network of the diffractive sensor 10.

[0050] The pattern of physical locations formed by the physical features 22 may define, in some embodiments, an array located across the surface of the substrate layer 20. With reference to FIG.2, the substrate layer 20 in one embodiment is a two-dimensional generally planer substrate having a length (L), width (W), and thickness (t) that all may vary depending on the particular application. In other embodiments, the substrate layer 20 may be non-planer such as, for example, curved. In addition, while FIG.2 illustrates a rectangular or square- shaped substrate layer 20, different geometries are contemplated. The physical features 22 and the physical regions formed thereby act as artificial “neurons” that connect to other “neurons” of other substrate layers 20 of the diffractive sensor 20 through optical diffraction (or reflection) and alter the phase and / or amplitude of the light wave that passes through or reflects off the layer 20. The particular number and density of the physical features 22 or artificial neurons that are formed in each substrate layer 20 may vary depending on the type of application. In some embodiments, the total number of artificial neurons may only need to be in the hundreds or thousands while in other embodiments, hundreds of thousands or millions of neurons or more may be used. Likewise, the number of substrate layers 20 that are used in the diffractive sensor 10 may vary although it typically ranges from at least two substrate layers 20 to less than ten substrate layers 20.

[0051] FIG.3 illustrates one embodiment of how different physical features 22 are formed in the substrate layer 20. In this embodiment, a substrate layer 20 has different thicknesses (t) of material at different lateral locations along the substrate layer 20. In one embodiment, the different thicknesses (t) modulates the phase of the light passing through the substrate layer 20. This type of physical feature 22 may be used, for instance, in the transmission mode embodiment of FIGS.1A, 7A-7B, 8B, 10A-10D. The different thicknesses of material in the substrate layer 20 form a plurality of discrete “peaks” and “valleys” that control the transmission coefficient of the neurons formed in the substrate layer 20. The different2023-184-2 thicknesses of the substrate layer 20 may be formed using additive manufacturing techniques (e.g., 3D printing) or lithographic methods utilized in semiconductor processing. For example, the design of the substrate layers 20 may be stored in a stereolithographic file format (e.g., .stl file format) which is then used to 3D print the substrate layers 20. Other manufacturing techniques include well-known wet and dry etching processes that can form very small lithographic features on a substrate layer 20. Lithographic methods may be used to form very small and dense physical features 22 on the substrate layer 20 which may be used with shorter wavelengths of the light. As seen in FIG.3, in this embodiment, the physical features 22 are fixed in permanent state (i.e., the surface profile is established and remains the same once complete).

[0052] FIG.4 illustrates another embodiment in which the physical features 22 are created or formed within the substrate layer 20. In this embodiment, the substrate layer 20 may have a substantially uniform thickness but have different regions of the substrate layer 20 have different optical properties. For example, the refractive (or reflective) index of the substrate layers 20 may altered by doping the substrate layers 20 with a dopant (e.g., ions or the like) to form the regions of neurons in the substrate layers 20 with controlled transmission properties (or absorption and / or spectral features). In still other embodiments, optical nonlinearity can be incorporated into the diffractive sensor 10 design using various optical non-linear materials (e.g., crystals, polymers, semiconductor materials, doped glasses, polymers, organic materials, semiconductors, graphene, quantum dots, carbon nanotubes, and the like) that are incorporated into the substrate layer 20. A masking layer or coating that partially transmits or partially blocks light in different lateral locations on the substrate layer 20 may also be used to form the neurons on the substrate layers 20.

[0053] Alternatively, the transmission function of the physical features 22 or neurons can also be engineered by using metamaterial or plasmonic structures. Combinations of all these techniques may also be used. In other embodiments, non-passive components may be incorporated in into the substrate layers 20 such as spatial light modulators (SLMs). SLMs are devices that imposes spatial varying modulation of the phase, amplitude, or polarization of a light. SLMs may include optically addressed SLMs and electrically addressed SLM. Electric SLMs include liquid crystal-based technologies that are switched by using thin-film transistors (for transmission applications) or silicon backplanes (for reflective applications). Another example of an electric SLM includes magneto-optic devices that use pixelated crystals of aluminum garnet switched by an array of magnetic coils using the magneto-optical2023-184-2 effect. Additional electronic SLMs include devices that use nanofabricated deformable or moveable mirrors that are electrostatically controlled to selectively deflect light.

[0054] FIG.5 schematically illustrates a cross-sectional view of a single substrate layer 20 of a diffractive sensor 10 according to another embodiment. In this embodiment, the substrate layer 20 is reconfigurable in that the optical properties of the various physical features 22 that form the artificial neurons may be changed, for example, by application of a stimulus (e.g., electrical current or field). An example includes spatial light modulators (SLMs) discussed above which can change their optical properties. In other embodiments, the layers may use the DC electro-optic effect to introduce optical nonlinearity into the substrate layers 20 of the diffractive sensor 10 and require a DC electric-field for each substrate layer 20 of the diffractive sensor 10. This electric-field (or electric current) can be externally applied to each substrate layer 20 of diffractive sensor 10. Alternatively, one can also use poled materials with very strong built-in electric fields as part of the material (e.g., poled crystals or glasses). In this embodiment, the neuronal structure is not fixed and can be dynamically changed or tuned as appropriate (i.e., changed on demand). This embodiment, for example, can provide a learning diffractive sensor 10 or a changeable diffractive sensor 10 that can be altered on-the- fly to improve the performance, compensate for aberrations, or even change another task.

[0055] As explained herein, and with reference to FIG.6, a computerized model of the diffractive sensor 10 is first digitally trained. Here, the model of the diffractive sensor 10 is trained to sense hidden defects or target features within the object. As seen in operation 200, at least one computing device 100 having one or more processors 102 executes software 104 thereon to digitally train a model or mathematical representation of diffractive sensor 10. During this training phase, training objects are used to define or optimize the plurality of physical features 22 formed on or within the one or more optically transmissive and / or reflective substrate layer(s) 10 to sense the defects or target features in the object 100 based on the output optical signals at different wavelengths detected at the one or more output detectors 14. Once the design or model has been established that encodes a physical layout for the different physical features 22 that form the artificial neurons in each of the plurality of substrate layers 20 which are present in the diffractive sensor 10, the actual physical embodiment of the diffractive sensor 10 is then manufactured or fabricated that reflects the computer-derived design. This is illustrated in operation 210 of FIG.6. The design, in some embodiments, may be embodied in a software format (e.g., SolidWorks, AutoCAD, Inventor, or other computer-aided design (CAD) program or lithographic software program) may then2023-184-2 be manufactured into a physical embodiment that includes the substrate layers 20. The substrate layers 20, once manufactured may be mounted or disposed in a holder or housing 16 as explained herein (e.g., illustrated in FIGS.1A and 10D). The holder or housing 16 may include a number of slots formed therein to hold the substrate layers 20 in the required sequence and with the required spacing between adjacent substrate layers 20 (if needed). Once the physical embodiment of the diffractive sensor 10 has been made, the diffractive sensor 10 is then used to analyze objects 100 for potential defects or target features. Use of the physical embodiment is seen in operation 220 in FIG.6.

[0056] Although the diffractive sensor 10 reported herein were primarily designed for the terahertz band of the electromagnetic spectrum, the underlying concept and design approaches are also applicable for defect / target features detection in other parts of the electromagnetic spectrum, including infrared, visible, and X-ray. These unique capabilities of performing computational sensing without a digital computer or the need for creating a digital 3D image will inspire the development of new task-specific all-optical detection systems and smart sensors. Such diffractive sensors 10 and systems employing the same can find diverse applications, such as industrial manufacturing and quality control, material inspection, detection / classification of hidden objects, security screening, and anti- counterfeiting measures. The non-destructive and non-invasive nature of this technology platform also makes it a valuable tool for sensitive applications, e.g., cultural heritage preservation and biomedical sensing. This framework can deliver transformative advances in various fields, where defect / target feature detection and materials diagnosis are of utmost importance.

[0057] To use the diffractive sensor 10 for sensing a defect or target feature in an object 100, the object 100 is located along the optical path 12 of the diffractive sensor 10. As explained herein, this may be located between one or more front-end diffractive / substrate layers 20 and one or more back-end diffractive / substrate layers 20. The illumination source 30 then illuminates the object 100 via an optical path that transmits through and / or reflects off of the diffractive / substrate layers 20. The object 100 along with the diffraction / substrate layers 20 collectively modulate the input optical signal from the illumination source to generate output optical signals at different wavelengths at one or more output detectors 14. The output optical signals at different wavelengths encode for the presence or absence of the defect or target feature in the object 100. The one or more output detectors 14 capture the power spectrum signal at a plurality of wavelengths (FIGS.1A, 1B). The power spectrum of2023-184-2 the output optical signal includes, in one embodiment, a plurality of wavelength peaks detected at the one or more output detectors 14. According to one embodiment, the presence or absence of the defect or target feature in the object 100 is based on the relative intensities of the plurality of wavelength peaks detected at the one or more output detectors 14. According to another embodiment, the presence or absence of the defect or target feature in the object 100 is based on the signal intensities of one or more wavelengths detected at the one or more output detectors 14.

[0058]

[0059] The power spectrum is used, in one particular embodiment, to calculate a differential spectral score sdetwhich is then compared to a threshold sththat may be empirically derived to determine the presence or absence of a defect or target feature within the object 100. For example, a differential spectral score sdetthat is at or above the threshold sthmay indicate that a defect or target feature is detected in the object 100. Conversely, a differential spectral score sdetthat is below the threshold sthmay indicate that a defect or target feature is not detected in the object 100.

[0060] The differential spectral score sdetmay be calculated and compared to the threshold sth by a computing device, microcontroller, or circuitry 110 that interfaces with or receives the output(s) from the one or more output detectors. Optional software or instructions executed by the computing device, microcontroller, or circuitry 110 may automatically perform the differential spectral score calculations and threshold comparisons. The computing device, microcontroller, or circuitry 110 may be part of the diffractive sensor 10 or, alternatively, may be separate from the diffractive sensor 10. The computing device, microcontroller, or circuitry 110 may optionally be associated with a display or the like for communicating the sensing results of the diffractive sensor 10. For example, the user may be presented with the output of the diffractive sensor 10 (e.g., “Defect Detected” or “No Defect”) and / or the power spectrum signal, differential spectral score sdet, and threshold sth.

[0061] Experimental

[0062] Results

[0063] The reported approach demonstrates all-optical detection of hidden structures within 3D objects 100, enabled by a single-pixel spectroscopic terahertz detector 14, entirely eliminating the need to scan the samples or create, store and digitally process their images. The design employs an optical architecture featuring a passive diffractive encoder that2023-184-2 generates structured illumination impinging onto the 3D sample or object of interest 100, coupled with a diffractive decoder that performs space-to-spectrum transformation, achieving defect or target feature detection based on the optical fields scattered from the sample volume. Leveraging this synergy between the two diffractive networks and their joint training / optimization, this single-pixel defect / target feature sensor 10 offers distinct advantages compared to the existing terahertz imaging and sensing systems used for the same purpose. First, the hidden defect or target feature detection is accomplished using a single- pixel spectroscopic detector 14, eliminating the need for a focal plane array or raster scanning, thus greatly simplifying and accelerating the defect or target feature detection process. Second, the diffractive or substrate layers 20 that are employed are passive optical components, enabling the diffractive sensor 10 to analyze the test object 100 volume without requiring any external power source except for the terahertz illumination system 30 and single-pixel detector 14. Third, the all-optical end-to-end detection process negates the need for memory, data / image transmission or digital processing using e.g., a graphics processing unit (GPU), resulting in a high-throughput defect or target feature detection scheme. Overall, these characteristics render the single-pixel diffractive terahertz sensors 10 particularly well- suited for high-throughput screening applications such as in industrial settings, e.g., manufacturing and security. These applications require high-throughput defect or target feature detection, where the hidden defects or objects of interest are often rare, but critically important to catch. Unlike conventional imaging-based methods, which are often hindered by the 3D image data overload due to redundant information and limited frame rates of 2D image sensors, the non-imaging and single-pixel defect / target feature detection approach can deliver markedly higher sensing throughput while offering cost-effectiveness and simplicity.

[0064] Design of the single-pixel diffractive terahertz sensor

[0065] FIGS.1A, 1B, 7A and 7B illustrate the basic principles of the proof-of-concept for the single-pixel diffractive terahertz sensor 10 design. The forward model of this design can be treated as a coherent optical system that processes spatially coherent terahertz waves at a predetermined set of two wavelengths ( ^^^and ^^ଶ), where the resulting diffraction and interference processes are used fordetection task. As depicted in FIG.7A, a set of diffractive layers or substrates 20 is positioned before the sample or object 100 under test to provide spatially coherent, structured broadband illumination within a given detection FOV, acting as an all-optical front-end network that is trainable. Another group of diffractive layers 20, positioned after the test sample or object 100, acts as the jointly-trained back-end2023-184-2 network, which all-optically performs the detection of hidden defects / target features inside the target sample or object 100 by encoding the defect / target feature information into the power spectrum at the single-pixel output aperture 46. This output spectrum is measured at two predetermined wavelengths, ^^^and ^^ଶ, producing the spectral intensity values ^^^^^^^and ^^^ ^^ ^ that yield a normalized detection score ^^^ఒభ^ଶ ^^^^ൌ^^ఒభ^ା^^ఒమ^( ^^^^^∈ (0,1)); see FIG.7B. By comparing ^^ at the single-pixel output with a threshold ^^^୦, defect / target feature inference is performed to predictof hidden defects or target features within the target sample volume, i.e., ^^^^^^ ^^^୦for a defect / target feature, while ^^^^^^ ^^^୦indicates no defect / target feature. As will be detailed later on, an unbiased threshold of ^^^୦= 0.5 was selected in the numerical analysis and experimental validation and, therefore a simple differential decision rule of ^^^ ^^^^ ≥ ^^^ ^^ଶ^ indicates the existence of hidden defects / target features, and ^^^ ^^^^ < ^^^ ^^ଶ^ indicates a defect / target feature-free (negative) sample. More details about the forward physical model and the joint training of the front-end and back-end diffractive layers of FIG.7A are provided in the Methods section herein.

[0066] To demonstrate the feasibility of the nondestructive diffractive defect / target feature detection framework, a proof-of-concept single-pixel diffractive terahertz sensor 10 was designed that can effectively detect pore-like hidden defects within silicon materials; these defects are not visible from the outside. Such a capability is highly sought after in numerous industrial applications due to its high prevalence and significance in determining e.g., the quality, reliability, and performance of manufactured parts / products. To achieve this capability, as depicted in FIG.8A, test samples or objects 100 were created with hidden defects by forming a stack of two silicon wafers that are in close contact with each other, where the surface of one of the wafers contained defect structures fabricated using photolithography and etching (see Methods for details). The inspection FOV of each test object 100 was chosen as 2×2 cm. As illustrated in FIG.8A, an exemplary defect is located somewhere inside the detection FOV at the interface between the two wafers. FIG.12 includes additional photographs of a silicon test sample / object 100, showcasing its structure across three cross-sectional planes: planes F and B for the front and back surfaces of the stacked wafers, respectively, and plane D for the contact interface of the two silicon wafers (planes illustrated in FIG.11A). Such hidden defects cannot be inspected by visible or infrared cameras and would normally demand scanning imaging systems using terahertz2023-184-2 wavelengths to form a digital image of the test object to visualize or detect potential defects using a computer.

[0067] To achieve all-optical detection of such hidden defects using the single-pixel diffractive terahertz sensor 10, ^^^= 0.8 mm and ^^ଶ= 1.1 mm were empirically selected, and accordingly optimized the architecture of the diffractive terahertz sensor 10 and its layers 20 using deep learning (see thesection). The single-pixel diffractive sensor 10 design consists of four diffractive / substrate layers 20, with two layers 20 positioned before the target sample and two layers 20 positioned after the target sample or object 100, i.e., forming the front-end and back-end diffractive sensors, respectively. Each of these diffractive / substrate layers 20 is spatially coded with the same number of diffractive features 22 (100×100), each with a lateral size of ~0.53 ^^୫, where ^^୫= ( ^^^+ ^^ଶ) / 2 = 0.95 mm. The layout of this diffractive design is provided in

[0068] Since the diffractive sensor to effectively detect the hidden defects of unknown shapes and sizes that may appear anywhere in the target sample / object 100, a data- driven approach was adopted by simulating a total of 20,000 silicon test samples with hidden defects of varying sizes and shapes for training the diffractive sensor model. The defects within these simulated test samples were set to be rectangular, with their lateral sizes (Dxand Dy) randomly generated within a range of 1 to 3 mm and a depth (Dz) randomly chosen between 0.23 and 0.27 mm. The positions of these defects (xd, yd) were also randomly set within the detection FOV. A test sample / object 100 was modeled that has no defects in the numerical simulations, which forms the negative sample in the training data. To avoid the diffractive model being trained with a heavy bias towards positive samples (i.e., test samples with defects), during the formation of the training dataset, 20,000 replicas of the defect-free sample were created and mixed them with the 20,000 samples with defects, such that the final training set had a balanced ratio of positive and negative samples. A blind testing set composed of 2,000 samples or objects 100 with various defects following the same approach was generated; all these defective test samples / objects 100 were created using different combinations of parameters (Dx, Dy, Dz, xd, yd) that are uniquely different than any of those used by the training samples.

[0069] Note that the data-driven training process is a one-time effort, similar to the training effort that a digital defect analyzer based on a THz camera would need to go through (using e.g., supervised learning) in an industrial or security setting. In the training of the diffractive designs, a focal cross-entropy loss was used; see the Methods section. This type of2023-184-2 loss function can effectively reduce the penalization from samples that can be easily classified, such as those containing large hidden defects, thereby providing better detection sensitivity for more challenging samples, such as those with smaller-sized hidden defects. Moreover, in the training loss function, a term was incorporated to impose constraints on the energy distribution of the output power spectrum (see the Methods section). This loss term aimed to maximize the output diffraction efficiency at ^^^and ^^ଶ, while minimizing it at other neighboring wavelengths, which helped us enhance the single-pixel SNR at the desired operational wavelengths ( ^^^and ^^ଶ). This designreduced the single-pixel output at other wavelengths, increasing the designs' experimental robustness. Additional details regarding the training data generation and the loss function that were used can be found in the Methods section.

[0070] Numerical results and performance analysis

[0071] FIG.8C shows the resulting diffractive / substrate layers 20 after the training was complete. This diffractive sensor design was numerically tested using the testing set containing 2,000 defective samples / objects 100 that were generated without any overlap with the training defective samples, as well as a test sample or object 100 without any defects. By using an unbiased classification threshold of ^^^୦= 0.5, it was found that 89.62% of the defective test objects 100 were successfully classified, and the defect-free test sample / object 100 was also correctly identified. These results confirm that the diffractive model with ^^^୦= 0.5 could achieve 100% specificity (false positive rate, FPR = 0%), while possessing a high sensitivity (i.e., true positive rate, TPR = 89.62%) to successfully detect various hidden defects with unknown combinations of shapes and locations, demonstrating its generalization for hidden defect detection. Optimization of the value of ^^^୦based on the training or validation sets results in ^^^୦= 0.4989, which further improves the blind detection sensitivity (TPR) to 90.48% for the defective test samples, while maintaining a specificity of 100%. However, the value of the threshold in this case ( ^^^୦ൌ 0.4989) is very close to the output score of a defect-free sample (i.e., ^^^^^ ^୬^^ୟ^୧^^^= 0.4988 < ^^^୦), and this can potentially introduce false positives under experimental errors. Therefore, to be resilient to experimental imperfections and suppress potential false positives, an unbiased threshold of ^^^୦= 0.5 was selected, where ^^^ ^^^^ ≥ ^^^ ^^ଶ^ indicates the existence of hidden defects and ^^^ ^^^^ < ^^^ ^^ଶ^ indicates a defect-free sample or object 100.

[0072] To comprehensively evaluate the efficacy of the single-pixel diffractive defect detection framework with a decision threshold of ^^^୦= 0.5, an in-depth analysis of the2023-184-2 performance of the diffractive sensor 10 was performed. First, the impact of the defect geometry on the detection performance was evaluated by testing samples with rectangular defects of various dimensions (Dx, Dy, and Dz) located randomly within the detection FOV. For a given combination of Dx, Dy, and Dz, 100 test defective samples or objects 100 were simulated and obtained the corresponding detection sensitivity; see FIGS.9A and 9B. By separately scanning the values of Dx, Dy, and Dz, the resulting defect detection accuracies of the diffractive sensor 10 is summarized in FIG.9C. It can be observed that, as the lateral size (Dxor Dy) of the hidden defect reduces, the detection sensitivity decreases considerably, regardless of Dz. For instance, for a relatively large defect of size Dx = Dy = 3 mm and Dz = 0.3 mm located randomly across the detection FOV, the detection sensitivity (i.e., TPR) of the diffractive sensor 10 is 100%, while it drops to 57% when both Dx and Dy reduce to 0.75 mm, which is smaller than ^^^and ^^ଶ. Additionally, the overall detection performance also shows a degradation trend the defect depth Dz is reduced. For example, for test sampleswith Dxand Dyin the range of [2.5, 3] mm, located randomly within the detection FOV, the detection sensitivity reaches ~99.7% when Dz is 0.3 mm, but drops to ~81.2% as Dz reduces to 0.15 mm, which is much smaller than ^^^and ^^ଶ. These analyses further reveal that, for a given detection sensitivity threshold of, TPR=75%, the diffractive sensor design canachieve accurate detection of hidden defects that are Dx, Dy ≥ ~1.25 mm (~1.32 ^^୫) and Dz ≥ ~0.21 mm (~0.22 ^^୫) within a FOV of 2×2 cm (~21 ^^୫×21 ^^୫). It should be noted that the smallest defect used in this analysis has a size close to the diffraction limit of light in air (~0.5 ^^୫). Despite the fact that the diffraction limit would be smaller in a high-refractive- index material like silicon, the medium between the sample or object 100 under test and the detector is air, which sets an upper limit of 1 on the effective numerical aperture (NA) of the detection system. Such small defects in general present SNR challenges for conventional imaging systems even if a diffraction-limited image were to be formed and acquired to be digitally processed.

[0073] The capabilities of the diffractive terahertz sensor 10 were further evaluated to detect small defects located at different positions across the detection FOV (see FIG.9D). For this analysis, the entire detection FOV of 2×2 cm was divided into a series of concentric circles of equal radius, forming ring-like regions denoted as R1 to R6 from the center to the edges. For each one of these regions, n=100 simulations of hidden defect detection were performed, and in each simulation, a small hidden defect of size Dx = Dy = 0.75 mm and Dz = 0.18 mm was positioned at a random location within the corresponding region; see FIG.9E.2023-184-2 It was observed that, when the hidden defect randomly appears within R1 to R4 regions, the detection sensitivity is maintained at ~100%, but it drops to <70% when the hidden defect falls within R5 (TPR = 65%) and R6 (TPR = 20%). These results reveal an outstanding detection sensitivity in a circular region with a diameter of 1.6 cm (~16.84 ^^୫) at the center of the detection FOV. Stated differently, compared to utilizing the entire detection FOV of 2×2 cm, if this inspection FOV is slightly reduced to a diameter of 1.6 cm, the detection performance of the diffractive design can be significantly improved, allowing successful detection of even smaller hidden defects of Dx, Dy > ~0.75 mm (~0.79 ^^୫) and Dz > ~0.18 mm (~0.19 ^^୫) with a sensitivity of TPR > 79%.

[0074] Experimental validation of the diffractive terahertz sensor

[0075] Next, an experimental validation of the diffractive design was performed using a THz-TDS set-up with a plasmonic photoconductive source as part of the illumination system 30 and single-pixel detector 14; see FIG.10A. The diffractive / substrate layers 20 of the design were fabricated through 3D printing, and the photos of these fabricated diffractive layers are shown in FIG.10B. After their fabrication, these layers 20 were assembled and aligned with the test samples or objects 100 using a 3D-printed holder 16, forming a physical diffractive terahertz defect sensor 10 that is integrated with a THz-TDS set-up; see FIG.10C and 10D. Ten different exemplary silicon test samples / objects 100, with or without hidden defects, were prepared for this experimental testing, where the hidden structures of these samples at plane D are shown in FIG.11B. Among these test samples / objects 100, No.1-9 contained a hidden defect that cannot be visibly seen as the defect is located at plane D (between the two wafers); these defects possess different sizes and shapes (defined by Dx, Dyand Dz). Importantly, the combinations of the parameters (Dx, Dy, Dz, xd, yd) for these test samples / objects 100 were never used in the training set, i.e., these 9 test samples containing defects were new to the trained diffractive model. Furthermore, the defect samples No.8 and No.9 had unique characteristics in their defect structures: the defect in test sample No.8 is a rectangle of 1×5 mm, a shape never included in the training set; and the defect in test sample or object 100 No.9 is a 1×3 mm rectangle but rotated 45 ^, where such a rotation was never seen by the diffractive model in the training stage. The specific geometric parameters (Dx, Dy, Dz, xd, yd) of each test object are provided in FIG.11E. The other test sample / object 100, i.e., sample No.10, contains no defects, i.e., represents the negative test sample. During the experiments, each test sample / object 100 was measured 5 times, producing output power spectra shown in FIG.11E (solid lines), which are compared to their numerically generated2023-184-2 counterparts using the trained forward model (dashed lines). Despite the 3D fabrication errors / imperfections, possible misalignments, and other sources of error in the experimental set-up, there is a good agreement between the experimental results and the numerical predictions. However, the measured spectral curves shown in FIG.11E exhibit minor random fluctuations and some small shifts towards longer wavelengths. To improve the SNR and build experimental resilience for hidden defect detection, the 5 spectral measurements for each test object 100 were averaged and the peak spectral values at the resulting average spectrum for ^^^ ^^^^ and ^^^ ^^ଶ^ were used; see FIG.11C. Stated differently, these 5 measurements collectively contributed to the representation of a single data point (i.e., the final detection score ^^̂^^୮^^^^) in FIG.11C. Since an unbiased detection threshold of ^^^୦= 0.5 was selected, the straight line of ^^^ ^^^^ = ^^^ ^^ଶ^ is used as the boundary for judging the presence or absence of defects: ^^^ ^^^^ ≥ ^^^ ^^ଶ^ indicates the existence of hidden defects and ^^^ ^^^^ < ^^^ ^^ଶ^ indicates a defect-free sample. As shown in FIG.11C, the spectral data points corresponding to test samples No.1-9 all lie above this decision boundary, indicating that these samples were predicted by the diffractive sensor 10 to contain hidden defects, demonstrating successful detection (true positive decisions). Meanwhile, the spectral data point for sample No.10, which is defect-free, fell on the other side of this decision boundary, also revealing a correct inference (a true negative decision). Note that in these experiments, the smallest defects have a size of 1×3 mm2(3×1 mm2), and such defects in samples No.4, 6, and 7 were all located near the edges of the detection FOV, presenting particularly challenging detection cases. This small defect area of 3 mm2approaches the smallest hidden feature that the diffractive sensor 10 can detect as characterized in the simulation analysis (1.25 mm × 1.25 mm ≈ 1.56 mm2). Therefore, these experimental results constitute compelling evidence demonstrating the practical feasibility of the diffractive defect sensor 100.

[0076] Next, the false positive rate of the diffractive defect sensor 10 was investigated and new experiments were conducted with another defect-free (negative) test sample that was measured 10 times through repeated measurements.252 unique combinations of these 10 spectral measurements in groups of 5 were formed, and for each random combination of measurements, the 5 spectral measurements for the defect-free test object 100 were used andthe peak spectral values at the resulting average spectrum for ^^^^^^^and ^^^^^ଶ^were used –same as before. The results of this analysis are reported in FIG.11D, where an FPR of ~10.7% was observed for an unbiased detection threshold of ^^^୦= 0.5.2023-184-2

[0077] Discussion

[0078] An all-optical, end-to-end diffractive sensor 10 is disclosed for the rapid detection of hidden structures. This diffractive THz sensor 10 features a distinctive architecture composed of a pair of encoder and decoder diffractive networks formed using layers / substrates 20, each taking the unique responsibilities of structured illumination and spatial-spectral encoding. Based on this unique framework, a proof-of-concept defect / target feature detection sensor 10 based on this framework was demonstrated. The success of the experimental results and analyses confirmed the feasibility of the single-pixel diffractive terahertz detector 10 using pulsed illumination to identify various hidden defects / target features with unknown shapes and locations inside test sample volumes or objects 100, with minimal false positives and without any image formation, acquisition or digital processing steps.

[0079] Some of the unique aspects of the reported framework over conventional approaches that utilize terahertz focal plane arrays or reflective TDS-based machine vision systems should be pointed out. For example, consider a common scenario in industrial quality control systems or security applications: hidden defects are discovered in only a minute fraction of the inspected objects 100, for example, just one in every 1000 or 10000 objects 100. This means that, in more than 99.9% of the inspected cases, the objects 100encountered are ordinary and defect-free. However, for every inspected object 100, traditional terahertz imaging systems must undergo the following steps, one by one: (1) recording and reconstructing 3D images of each of these >1000-10000 objects 100 using a focal plane array and / or a scanning beam system, (2) sequentially storing these 3D images and uploading them to a remote or local server, and then (3) running machine learning algorithms using GPU clusters to digitally determine the presence of hidden defects. Consequently, a substantial amount of imaging and computational resources are wasted in extracting and processing redundant information, leading to lowered detection throughput and a massive burden on data / storage and bandwidth. Even for large defects that are relatively simple to detect using state-of-the-art algorithms frequently used in machine vision, the throughput of such imaging-based solutions would still be limited by the low frame rate of the 2D image sensor- arrays; this image capture process will be even slower for various point-scanning-based THz imaging systems.

[0080] In contrast, this method effectively circumvents all these steps. It does not require reconstructing or creating 3D images for each object 100, nor does it need to store and upload2023-184-2 any images to the cloud, and it also certainly does not necessitate using GPU clusters to handle large volumes of data. Using a single-pixel detector 14 and snap-shot dual illumination wavelengths for defect / target feature sensing, the method signifies a unique paradigm, eliminating the image capture / reconstruction, storage, and transmission steps needed by GPU-based digital processing systems. As a result, the volumetric defect or target feature detection rate can be elevated to align with the exceptional speed of single-pixel sensors 14, which can have a response time of < 1 µs. Therefore, with the presented framework the efficiency of terahertz defect / target feature inspection / detection can be dramatically enhanced, and concurrently the cost per inspection can be substantially reduced using the presented diffractive sensors.

[0081] In the experimental results reported earlier using the single-pixel diffractive defect sensor 10, a strategy was adopted of taking the average of Navg= 5 measurements to improve the detection SNR and the defect detection performance of the system. To delve deeper into this averaging strategy, similar to FIG.10D, from the 10 spectral measurements of this defect-free sample, Navg samples were randomly selected to form a group for averaging, and accordingly took the spectral peaks in the resulting spectrum as ^^^ ^^^^ and ^^^ ^^ଶ^ to obtain the detection score ^^^^^. After analyzing all the detection results corresponding to all the possible combinations, i.e., ^^^^^ே^౬^^, the false positive rate, FPR, was calculated as a function of the averaging factor Navg. FIG.14 reports the impact of Navg on the FPR in the detection results. These findings indicate that when Navgis 1, i.e., no averaging is used, the FPR reaches as high as ~30%. However, as Navg increases, the reported FPR begins to decrease significantly. Specifically, when Navg= 5, the FPR falls to 10.7%, which aligns with earlier results in FIG. 11D. When Navg further increases to 8, the FPR drops to 0%, indicating that false positives can be eliminated by this averaging strategy (see FIG.14).

[0082] Another aspect that needs to be addressed pertains to the variation of the diffractive defect sensor’s performance at different sub-regions within the detection FOV. For this, the terahertz wave field ^ ^^^^^^^^^ was simulated within the detection FOV at plane D, i.e., the plane where the incoming terahertz field interacts with the potential hidden defects. The amplitude and phase distributions of ^^^^^^^^at the two predetermined wavelengths ( ^^^= 0.8 mm and ^^ଶ= 1.1 mm) are shown in FIG.15A. Interestingly, ^^^^^^^^^ ^^^^ exhibitsrelatively uniform amplitude and phase distributions at the center, with the phase profile beginning to present faster changes as moving away from the center. On the other hand, the amplitude and phase distributions of ^^^^^^^^^ ^^ଶ^ present a specific structure, featuring higher intensity in2023-184-2 the center and lower intensity around. These observations suggest that the terahertz light reaching the detection FOV, after being processed by the encoding diffractive network, primarily forms structured light illumination at ^^ଶ, while it largely maintains a spherical wave-like illumination pattern at ^^^. The influence of this structured light illumination on the defect detection results was further analyzed. As illustrated in FIG.15B, a hidden defect was assumed with Dx= Dy= 3 mm, Dz= 0.25 mm that can be located anywhere within the detection FOV, identical to the one in Sample No.1 used in the experimental validation. The output spectral intensity was numerically quantified at the two operational wavelengths,^^^^^^^and ^^^^^ଶ^, as a function of the hidden defect’s position within the detection FOV, andcalculated the resulting final detection score ^^^^^in each case. These results are summarized in FIGS.15C-15F. As shown in FIG.15F, the detection scores ^^^^^within the detection FOV exceed the detection threshold ^^^୦= 0.5, indicating 100% true positive detection, except at the edges of the detection FOV, which have relatively poor representation during the training phase. It can be seen that, ^^^^^^^presents a fairly uniform distribution (excluding the edges); in contrast, the overall distribution of ^^^ ^^ଶ^ shows a significant negative correlation with ^^^^^, and they both exhibit substantial correspondence with the amplitude distribution of ^^^^^^^^^ ^^ଶ^ as shown in FIG.15A. This finding suggests that ^^^^^^^^^ ^^^^ and ^^^^^^^^^ ^^ଶ^ essentially play roles akin to reference light and probe light, respectively. Here, the intensity structure of this “probe” light ^^^^^^^^^ ^^ଶ^ notably contributes to the distribution of ^^^^^, which both exhibit features of higher values at the center and lower values at the periphery, correlating with the observations in FIG.9E.

[0083] Different approaches can be explored to further enhance the performance of the diffractive sensor 10. To achieve a larger detection FOV, one will need to enlarge the diffractive layers 20 so that the possible defect or target feature information can be effectively processed by the diffractive layers 20 using a larger NA. Additionally, the number of trainable diffractive layers 20 in both the front-end and back-end optical networks can be increased to improve the approximation power of the diffractive network by creating a deeper diffractive sensor 10. Furthermore, if the detection of defects or target features with even smaller features is required, one can use shorter terahertz wavelengths, with accordingly smaller diffractive features 22 fabricated as part of each diffractive layer 20.

[0084] In the demonstrated diffractive sensor 10, only two wavelength components were used at the output power spectra of the single-pixel detector 14 to encode the defect or target feature information, and did not leverage the entire spectral bandwidth provided by the THz-2023-184-2 TDS system. The decision to use the THz-TDS system was primarily driven by the availability of hardware resources in the laboratory. Therefore, by using a THz illumination set-up with two pre-determined wavelengths ( ^^^and ^^ଶ), the complexity of the current system would be significantly simplified, with costs substantially reduced. It is also conceivable to train a diffractive sensor 10utilizes more wavelengths, encoding additional information regarding the hidden defects or target features such as e.g., the size and material type of the defect or target feature, which may lead to more comprehensive defect or target feature detection and classification capabilities. To achieve spectral encoding of such defect information using more wavelengths, a larger number of trainable diffractive features per design would, in general, be required; this increase would be approximately proportional to the number of wavelengths used to encode independent channels of information.

[0085] While the presented single-pixel terahertz sensor 10 enabled high-throughput detection of defects with feature sizes close to the diffraction limit of light, the maximum thickness of the test sample or object 100 that can be probed in transmission mode would be limited by the terahertz absorption or scattering inside the sample volume. For highly absorbing samples / objects 100 or samples / objects 100 with metal cores, for example, the proposed transmission system will present limitations to probe deeper into the test sample volume. However, this limitation is not specific to the diffractive sensor design, and is in fact commonly shared by all terahertz-based imaging and sensing systems. In case the terahertz transmission from certain test samples creates major SNR challenges due to terahertz absorption and / or scattering within the depths of the test sample, the presented diffractive sensor designs can be modified to work in reflection mode so that a partial volume of the highly absorbing and / or reflecting test objects 100 can be rapidly probed and analyzed by the single-pixel diffractive sensor. In this reflection mode of operation, the whole deep learning- based training strategy outlined in this work will remain the same, except that between the test sample or object 100 and the encoder diffractive network there will be a beam splitter (e.g., a mylar film) that communicates with an orthogonally placed diffractive decoder that will be jointly trained with the front-end diffractive encoder, following the architecture reported earlier in the Results section. Through this reflection mode of the diffractive sensor 10, one can extend the applications of the all-optical hidden defect / target feature sensor to partially probe and analyze highly absorbing and / or scattering test objects that would otherwise not transmit sufficient terahertz radiation. Compared to conventional reflective2023-184-2 THz-TDS defect detection systems used for similar purposes, which necessitate mechanical scanning to detect defects at various locations, this reflective diffractive sensor 10 design would allow for all-optical, rapid defect or target feature detection within a large sample volume, eliminating the need for mechanical scanning or extensive data storage, transmission and digital processing.

[0086] One additional potential limitation of the framework is uncontrolled mechanical misalignments among the diffractive layers 20 that constitute the diffractive encoder and decoder networks, as well as possible lateral / axial misalignments that might be observed between the diffractive layers 20 and the test sample / object volume. As a mitigation strategy, diffractive designs can be “vaccinated” to such variations by modeling these random variations and misalignments during the optimization phase of the diffractive sensor 10 to build misalignment-resilient physical systems. It has been shown in earlier works that the evolution of diffractive surfaces during the deep learning-based training of a diffractive network can be regularized and guided toward diffractive solutions that can maintain their inference accuracy despite mechanical misalignments. This misalignment-tolerant diffractive network training strategy models the layer-to-layer misalignments, e.g., translations in x, y and z, over random variables and introduces these errors as part of the forward optical model, inducing “vaccination” against such inaccuracies and / or mechanical variations. In addition to mechanical misalignments, the same training scheme can also be extended to mitigate the effects of other potential error sources e.g., fabrication inaccuracies, refractive index measurement errors and detection noise, improving the robustness of single-pixel defect detector devices 10.

[0087] Finally, the diffraction sensor framework can potentially sense the presence of even smaller hidden defects or objects with subwavelength dimensions. While the diffractive defect sensor 10 is diffraction-limited, isolated subwavelength features / defects can still generate traveling waves (through scattering) to be sensed by the diffractive layers 20. This, however, does not mean the diffractive sensor 10 can resolve two closely positioned subwavelength features / defects or morphologically distinguish them from larger defects since it can only process propagating waves from the defect volume, without access to the evanescent waves in the near-field of a defect that carry the super-resolution information. In this respect, similar to localization-based microscopic imaging approaches, it is potentially feasible to sense isolated subwavelength defects within the sample / object volume without any structural fine details or the capability to distinguish them from larger defects. This would be2023-184-2 possible only with sufficient detection sensitivity: if the weak scattering of such small defects / features, coupled into propagating secondary waves, can be detected within the SNR of the single-pixel defect detection system. Moreover, the presented design and the underlying concept can also be applied to other frequency bands of the electromagnetic spectrum, such as the infra-red and X-ray, for all-optical detection of hidden objects or defects. With its unique capabilities to rapidly and accurately inspect hidden objects and identify unknown defects or target features hidden within materials, the single-pixel diffractive terahertz sensor 10 can be useful for a variety of applications, including industrial quality control, material inspection and security screening.

[0088] Methods

[0089] Numerical forward model of a single-pixel diffractive terahertz sensor. The system consists of successive diffractive or substrate layers 20 that are modeled as thin dielectric optical modulation elements of different thicknesses, where the ^^thfeature on the ^^thlayer 20 at a spatial location ( ^^^, ^^^, ^^^) represents a complex-valued transmission coefficient, ^^^, which depends on the illumination wavelength ( ^^):

[0090] ^^^^ ^^^, ^^^, ^^^, ^^^ ൌ ^^^^ ^^^, ^^^, ^^^, ^^^exp^ ^^ ^^^^ ^^^, ^^^, ^^^, ^^^^ ൫1൯,diffractive layers are connected to each other by free-space propagation, which is modeled through the Rayleigh-Sommerfeld diffraction equation, with an impulse response of ^^^^^ ^^, ^^, ^^, ^^^: ^^^^^, which can be viewed as a secondary wave generated from the source at^^^^, ^^^, ^^^^. Following the Huygens principle, each diffractive feature in a diffractive network can be modeled as the source of a secondary wave, as in Eq. (2). As a result, the optical field modulated by the ^^thdiffractive feature of the ^^thlayer ( ^^ ≥ 1, treating the input object plane as the 0thlayer), ^^^^ ^^^, ^^^, ^^^, ^^^, can be written as:

[0094] ^^^^ ^^^, ^^^, ^^^, ^^^ ൌ ^^^^ ^^^, ^^^, ^^^, ^^^ ∙ ∑^∈ெ^^^ି^^ ^^^, ^^^, ^^^ି^, ^^^ ∙ ^^^^ି^^ ^^^, ^^^, ^^^, ^^^൫3൯,െ diffractive layer and the ^^ location of the ∗thlayer. The axial distances between the input2023-184-2 aperture 44 / output aperture 46, diffractive layers 20 and the object 100 under test can be found in FIG.8B.

[0096] The amplitude and phase components of the complex transmittance of the ^^thfeature of diffractive layer ^^, i.e., ^^^^ ^^^, ^^^, ^^^, ^^^ and ^^^^ ^^^, ^^^, ^^^, ^^^ in Eq. (1), are defined as a function of the material thickness, ℎ^^, as follows: ^^ ^^ଶగ ^ ^ೖ

[0097] ^^^^, ^^^, ^^^, ^^^ ൌ exp ൬െ^ ఒ ^^ఒ ^ ൫4൯,^^ௗ^^^^are therefractive index and the extinction coefficient of the diffractive layer material corresponding to the real and imaginary parts of the complex-valued refractive index ^^^ௗ^ ^^^, i.e., ^^^ௗ^ ^^^ ൌ^^ௗ^^^^^ ^^ ^^ௗ^^^^. These dispersion parameters for the 3D-printing material used in this workwere experimentally measured over a broad spectral range (see FIGS.13A-13B). The thickness values of the diffractive features ℎ^^represent the learnable parameters of the diffractive sensor devices 10, which are composed of two parts, ℎtrainableand ℎbase:

[0100] ℎ ൌ ℎtrainable^ ℎbase൫6൯,

[0101] where ℎtrainabledenotes the learnable thickness parameters of each diffractive feature and is confined between 0 and ℎmax = 0.8 mm. The additional base thickness, ℎbase, is a constant, which is chosen as 0.6 mm to serve as the substrate support for the diffractive layers. To achieve the constraint applied to ℎtrainable, an associated latent trainable variable ℎ௩was defined using:

[0102] ℎtrainableൌ^maxଶ ∙ ^sin^ℎ௩^ ^ 1^ ൫7൯.

[0103] Note that before theof all the diffractive features were initialized as 0.

[0104] The propagation of the optical field inside the sample volume was calculated using:

[0105] ^^^^^ ^^, ^^, ^^, ^^^ ൌ௭ି௭ೞ^ ^ ଶగ^ ^మ ^^exp൬െ^^^୭ୠ୨^ୡ^^ ^^^ െ ^^ ^^୭ୠ୨^ୡ^^ ^^^^^ ൫8൯,refractive index and the extinction coefficient of the object material. Here, since silicon wafers were used as the test objects, ^^୭ୠ୨^ୡ^^ ^^^ and ^^୭ୠ୨^ୡ^^ ^^^ were set to 3.4174 and 0,2023-184-2 respectively (disregarding the negligible material absorption of silicon at the wavelengths of interest). After calculating the impulse response of optical field propagation inside the objectvolume ^^^^, the resulting complex field is calculated using Eq. (3), except that the ^^^isreplaced by ^^^^used for the object material. When the propagating optical field encounters adefect inside the object 100, one can model the defect as a tiny volume element with a certain size, which can also be considered as a thin optical modulation element. Due to the difference in the material properties between the defect and the object 100, the presence of the defect introduces additional amplitude and phase changes, which can be calculated in the forward model using the following formula:

[0107] ^^^^^^ୡ^^ ^^^, ^^^, ^^^, ^^^ ൌ exp൬െ ଶగ^^^^^^౪ఒ^^^^^^^ୡ^^ ^^^ െ ^^୭ୠ୨^ୡ^^ ^^^^^ ൫9൯,coefficient of the object material, ℎ^^^^ୡ^is the depth of the defect along the axial direction. In the experimental validation, these defects were fabricated by etching silicon wafers. Therefore, without loss of generality, air constitutes the material of the defects, i.e., ^^^^^^ୡ^^ ^^^ = ^^ୟ୧୰^ ^^^ = 1 and ^^^^^^ୡ^^ ^^^ = ^^ୟ୧୰^ ^^^ = 0.

[0110] Spectral scores for the detection of hidden objects and defects. Assuming that the diffractive design is composed of ^^ layers (excluding the input, sample, and output planes), a single-pixel spectroscopic detector 14 positioned at the output plane (denoted as the ( ^^ ^ 1)thlayer) measures the power spectrum of the resulting optical field within the active area of the detector ^^, where the resulting spectral signal can be denoted as ^^^ ^^^:

[0111] ^^^ ^^^ ൌ ∑^௫,௬^∈^| ^^^ା^^ ^^, ^^, ^^^ା^, ^^^|ଶ൫11൯,area of the detector 14 and the output aperture 46 are both set to be 2×2 mm. The spectral intensity of the diffractive network output was sampled at a pair of wavelengths ^^^and ^^ଶ, resulting in spectral intensity values ^^^ ^^^^ and ^^^ ^^ଶ^. The output detection^^^^^of the diffractive sensor is given by:

[0113] ^^^^ ^^^^ൌఒభ൫12൯,boils down to a differential detection scheme where ^^^ ^^^^ ≥ ^^^ ^^ଶ^ indicates the existence of hidden defects2023-184-2 and ^^^ ^^^^ < ^^^ ^^ଶ^ indicates a defect-free sample. Here, ^^^and ^^ଶwere empirically selected as 0.8 and 1.1 mm, respectively. To analyze the classification results produced by the diffractive sensor design, the numbers of true positive,positive, true negative and false negative samples, denoted as ^^்^, ^^ி^, ^^்ேand ^^ிே, respectively were analyzed. Based on these, the sensitivity (i.e., true positive rate, TPR), the specificity, the false negative rate (FNR) and the false positive rate (FPR) are reported using:

[0115] Sensitivity ൌ TPR ൌ ^^ು^^ುା^ಷಿൌ 1 െ FNR ^13^,

[0116] Specificity ൌ ^^ಿ^^ಿା^ಷು൫14൯,

[0117] False positive rate ^FPR^ ൌ 1 െ Specificity ൌ ^ಷು^^ಿା^ಷು൫15൯.

[0118] During the training of the diffractive terahertz sensor model,the optical field at the input aperture of the system has a flat spectral magnitude, i.e., the total power of the illumination beam at ^^^and ^^ଶis equal in the numerical simulations. However, the pulsed terahertz source 36 in the experimental TDS set-up contained a differentspectral profile within the band of operation. To calibrate the diffractive sensor system, a normalization step was performed for the experimentally measured output power spectra for all the test samples using a linear correction factor ^^^ ^^^, which was obtained using: ೞ^౨^౩^^ ^ഊమ^^౨^^ିೞ౩^^ഊభ^^౨ ൫ഊᇲ ൯ ೞ^^౨ ൯ ^ ^౨^ଶ spectral intensity values corresponding to the spectral peaks closest to ^^^and ^^ଶ, respectively, using the defect-free sample as the test object 100 after averaging multiple spectral measurements. ^^^୰^^୧୫^ ^^^^ and ^^^୰^^୧୫^ ^^ଶ^ are the numerically computed counterparts of ^^^୰^^^୮^ ^^^^ and ^^^୰^^^୮^ ^^ଶ^,Based on ^^^ ^^^, the experimental spectral curves ^^^^୮^ ^^^ were normalized as:

[0121] ^^̂^^୮^^^^ൌ ^^^^^^^^^^୮^^^^൫17൯.

[0122] By following this calibration / normalization routine outlined above, the diffractive model can be used under different forms of input broadband radiation, without overfitting to any experimental radiation source, which forms an important practical advantage of the framework. Moreover, even if the experimental system contains certain manufacturing errors2023-184-2 and misalignments that result in a mismatch with the ideal forward physical model, the spectral intensity peaks ^^^୰^^^୮^ ^^^ᇱ^ and ^^^୰^^^୮^ ^^ᇱଶ ^ near the two wavelengths ^^^and ^^ଶcan still be utilized as references the calibration of the system. FIG.11E illustrates the normalized experimental spectral^^̂^^୮^ ^^^ defined by Eq. (17) for different test samples, andtheir normalized peak spectral intensity values near ^^^ and ^^ଶ, i.e., ^^̂^^୮^^^ᇱ^^and ^^̂^^୮^^^ᇱଶ^, arereflected in FIG.11C. The experimental differential spectral scores presented in FIG.11Dwere computed based on Eq. (12) by replacing ^^^^ and ^^^ ^^ଶ^ with ^^̂^^୮^ ^^ᇱ^ ^ and ^^̂^^୮^ ^^ଶ^, respectively.

[0123] Training loss functions. The loss function used for training the presented diffractive terahertz sensor is defined as:

[0124] ℒ^୭^ୟ୪ ൌ ℒ^^^ ^ ^^^^^ ∙ ℒ^^^ ^ ^^^^ ∙ ℒ^^ ൫18൯.

[0125] The first loss term, ℒ^^^, stands for defect detection loss. To train the diffractive model to better classify challenging samples, e.g., those with small defects, the focal loss was employed given by:

[0126] ℒ^^^ ൌ ^െ ^^^1 െ ^^^^^^ఊlog^ ^^^^^^ , ^^ୋ^ൌ 1 െ^1 െ ^^^ ^^^^^ఊlog^1 െ ^^^^^^ , ^^ୋ^ ൌ 0൫19൯,

[0127] where ^^ୋ^denotes the ground-truth label of the given 3D object volume, indicating the existence of the hidden defect ( ^^ୋ^ൌ 1) or not ( ^^ୋ^ൌ 0). ^^ denotes the coefficient to balance the loss magnitude for the positive and negative samples, and ^^ is the focusing parameter used to down-weigh the importance of the easy-to-classify samples (e.g., 3D objects with relatively larger hidden defect(s)). ^^ and ^^ were empirically chosen as 0.5 and 4 throughout the training process.

[0128] In addition to being sensitive and specific to unknown / random hidden defects, the single-pixel diffractive sensor 10 should also be photon efficient, achieving a decent SNR at its output. Therefore, in the training loss function, added a loss term, ℒ^^^was added, to increase the diffraction power efficiency at the output single-pixel aperture. ℒ^^^is defined as:

[0129] ℒ^^^ ൌ ^^^^୦ െ ^^௪, if ^^^୦ ^ ^^^^ ൫20൯,14 and ^^threfers to the penalization threshold for ^^, which was empirically selected as 0.01 during the training process. ^^ is defined as:2023-184-2

[0131] ^^ ൌ ூdetectorூinput(21),the optical field calculated within theactive area ^^ of the output single-pixel detector aperture 46 across the two wavelengths ^^^and ^^ଶ, i.e., ^^detectorൌ ∑ఒ∈^ఒభ,ఒమ^∑^௫,௬^∈^| ^^^ା^^ ^^, ^^, ^^^ା^, ^^^|ଶ, and ^^inputrepresents the total ^^ wavelengthsandൌ ఒ∈^ఒభ,ఒమ^ . sensor design usedherein, the size aperture ^^ is set as 5×5 mm.

[0133] ℒ^^, was incorporated in Eq. (18) to constrain the energy distribution of the output power spectrum, such that the spectral power is maximized at the two predetermined wavelengths used for all-optical inference of defects ( ^^^and ^^ଶ) while maintaining a relatively low power level at the other neighboring To achievethis, the following was used:

[0134] ℒ^^ ൌ^ସ∑ఒ∈ஃ∑^௫,௬^∈^|^^^ା^^ ^^, ^^, ^^^ା^, ^^^|ଶ൫22൯.

[0136] The hyperparameters, ^^^^^and ^^^^, in Eq. (18) are the weight coefficients associated with the diffraction efficiency penalty loss term and the spectral energy distribution loss term, respectively, which were empirically selected as 0.01 and 0.1 throughout the training process.

[0137] Training details of the single-pixel diffractive terahertz sensor. For the numerical model used herein, the smallest sampling period for simulating the complex optical fields is set to 0.25 mm (~0.26 ^^୫), which is half the lateral size of the diffractive features (i.e., 0.5 mm = ~0.53 ^^୫). To build a dataset for training and evaluating the diffractive sensor model, a total of 24,000 defect samples were generated with varying sizes (Dx, Dy, Dz) and positions (xd, yd), which were then divided into three sets: training, validation, and testing, each containing 20,000, 2,000, and 2,000 samples, respectively. A defect-free sample was also generated and mixed the replicas of that with each of these defect sample subsets at a 1:1 ratio during the training process, so that the number of samples with and without defects could be balanced. The error in the thickness of the silicon wafer was also considered in the training forward model. To mitigate its impact on the detection performance of the diffractive sensor, the silicon thickness value was modeled as a random variable that follows a uniform distribution of [0.52, 0.53] mm in the forward model. This ensures that the trained diffractive2023-184-2 sensor can provide detection performance that is resilient to the variations in the thickness values of the silicon wafer test samples.

[0138] The single-pixel diffractive sensor model used herein was trained using TensorFlow (v2.5.0, Google LLC). Adam optimizer was selected, and its parameters were taken as the default values. The batch size was set as 32. The learning rate was set as 0.001. For the training of the diffractive model, a workstation was used with a GeForce GTX 1080Ti GPU (Nvidia Inc.) and Core i78700 central processing unit (CPU, Intel Inc.) and 64 GB of RAM, running Windows 10 operating system (Microsoft Inc.). The training of the diffractive model was performed with 200 epochs, which typically required ~10 hours. The best model was selected based on the detection performance quantified using the validation data set.

[0139] Fabrication of the test samples. The defects on the silicon wafers (i.e., objects 100) were fabricated through the following procedure. First, a SiO2layer was deposited on the silicon wafers using low-pressure chemical vapor deposition (LPCVD). Defect patterns were defined by photolithography, and the SiO2layer was etched in the defect regions using reactive-ion etching (RIE). After removing the remaining photoresist, defects in silicon wafers were formed through deep reactive-ion etching (DRIE) with the SiO2 layer serving as the etch mask. Finally, the SiO2 layer was removed through wet etching using a buffered oxide etchant (BOE). The depth of the defect regions, Dz, was measured with a Dektak 6M profilometer, which was ~0.25 mm for all the prepared test samples.

[0140] The diffractive layers 20 were fabricated using a 3D printer (Form 3, Formlab). To assemble the printed diffractive layers 20 and input objects, a 3D-printed holder 16 (Objet30 Pro, Stratasys) was employed that was designed to ensure the proper placement of these components according to the numerical design.

[0141] Terahertz time-domain spectroscopy set-up. A Ti:Sapphire laser 32 was used to generate femtosecond optical pulses with a 78 MHz repetition rate at a center wavelength of 780 nm. The laser beam was split into two parts: one part was used to pump the terahertz source, a plasmonic photoconductive nano-antenna array, and the other part was used to probe the terahertz detector, a plasmonic photoconductive nano-antenna array providing a high sensitivity and broad detection bandwidth. The terahertz radiation generated by the source 36 was collimated and directed to the scanned sample using an off-axis parabolic mirror 40, as shown in FIG.10A. The output optical signal from the terahertz detector 14 was amplified with a transimpedance amplifier (Femto DHPCA-100) and detected with a lock-in amplifier (Zurich Instruments MFLI). By changing the temporal delay between the terahertz2023-184-2 radiation and the laser probe beam incident on the terahertz detector, the time-domain signal was obtained. The corresponding spectrum was calculated by taking the Fourier transform of the time-domain signal, resulting in an SNR of 90 dB and an observable bandwidth of 5 THz for a time-domain signal span of 320 ps.

[0142] In another alternative embodiment, the geometrical, positional, and / or material information of the defect or target feature of the object 100 is determined based on the signal intensities of one or more wavelengths detected at the one or more output detectors 14. The diffractive sensor 10 may also include polarization-sensitive elements that provide polarization-aware sensing capability and sense defects or target features of the object 100 using polarization characteristics based on the signal intensities of one or more wavelengths detected at the one or more output detectors 14.

[0143] While embodiments of the present invention have been shown and described, various modifications may be made without departing from the scope of the present invention. While the experimental setup used a diffractive sensor 10 to sense a defect the diffractive sensor 10 may also be used to sense certain target features. This may include, for example, a structure or object with sample (or lack of a structure like a void). The target feature may also include a material type. The invention, therefore, should not be limited, except to the following claims, and their equivalents.

Claims

2023-184-2 What is claimed is:

1. A diffractive sensor for sensing a defect or a target feature in an object comprising: a multi-wavelength illumination system comprising a broadband light source or individual light sources centered at different wavelengths of electromagnetic radiation and one or more output detectors arranged along an optical path; one or more optically transmissive and / or reflective substrate layer(s) arranged in the optical path and having the object interposed between or outside of the one or more optically transmissive and / or reflective substrate layer(s) along the optical path, each of the optically transmissive and / or reflective substrate layer(s) comprising a plurality of physical features formed on or within the one or more optically transmissive and / or reflective substrate layer(s) and having different transmission and / or reflection properties as a function of the lateral coordinates across each substrate layer, wherein the one or more optically transmissive and / or reflective substrate layer(s) and the object collectively modulate an input optical signal from the light source(s) to generate output optical signals at different wavelengths at the one or more output detectors, wherein the output optical signals at different wavelengths encode for the presence or absence of the defect or the target feature in the object; and wherein the one or more optically transmissive and / or reflective substrate layer(s) are designed during a training phase with training objects to define or optimize the plurality of physical features formed on or within the one or more optically transmissive and / or reflective substrate layer(s) to sense the defect or the target feature in the object based on the output optical signals at different wavelengths detected at the one or more output detectors.

2. The diffractive sensor of claim 1, wherein the light source is in the THz, infra- red, visible, or x-ray range of the electromagnetic spectrum.

3. The diffractive sensor of claim 2, wherein the object comprises a semiconductor, a circuit, a commercial product, an art work, a tissue, or a biological sample.

4. The diffractive sensor of claim 1, wherein the power spectrum of the output optical signal comprises a plurality of wavelength peaks detected at the one or more output detectors and wherein the presence or absence of the defect or the target feature in the object2023-184-2 is based on the relative intensities of the plurality of wavelength peaks detected at the one or more output detectors.

5. The diffractive sensor of claim 1, wherein the presence or absence of the defect or the target feature in the object is based on the signal intensities of one or more wavelengths detected at the one or more output detectors.

6. The diffractive sensor of claim 1, wherein the diffractive sensor is a single- pixel diffractive sensor wherein the one or more output detectors comprises a single-pixel detector.

7. The diffractive sensor of claim 1, wherein the geometrical, positional, and / or material information of the defect or the target feature in the object is determined based on the signal intensities of one or more wavelengths detected at the one or more output detectors.

8. The diffractive sensor of claim 1, wherein the diffractive sensor includes polarization-sensitive elements that provide polarization-aware sensing capability and sense the defect or the target feature in the object using polarization characteristics based on the signal intensities of one or more wavelengths detected at the one or more output detectors.

9. A method of detecting the presence of a defect or a target feature in an object comprising: providing a diffractive sensor for sensing the defect or the target feature in the object comprising: (1) a multi-wavelength illumination system comprising a broadband light source or individual light sources centered at different wavelengths of electromagnetic radiation and one or more output detectors arranged along an optical path; and (2) one or more optically transmissive and / or reflective substrate layer(s) arranged in the optical path and having the object interposed between or outside of the one or more optically transmissive and / or reflective substrate layer(s) along the optical path, each of the optically transmissive and / or reflective substrate layer(s) comprising a plurality of physical features formed on or within the one or more optically transmissive or reflective substrate layer(s) and having different transmission and / or reflection properties as a function of the lateral coordinates across each substrate layer, wherein the one or more optically transmissive and / or reflective substrate2023-184-2 layer(s) and the object collectively modulate an input optical signal from the light source(s) to generate output optical signals at different wavelengths at the one or more output detectors, wherein the output optical signals at different wavelengths detected at the one or more output detectors encode for the presence or absence of the defect or the target feature in the object; inputting the input optical signal to the diffractive sensor; capturing the output optical signals with the one or more detectors; and detecting the presence or absence of the defect or the target feature based on the output optical signals at different wavelengths detected at the one or more output detectors.

10. The method of claim 9, wherein the output optical signals comprise a plurality of wavelength peaks detected at the one or more output detectors and wherein the presence or absence of the defect or the target feature in the object is based on the relative intensities of the plurality of wavelength peaks detected at the one or more output detectors.

11. The method of claim 9, wherein the geometrical, positional, and / or material information of the defect or the target feature in the object is determined based on the signal intensities of one or more wavelengths detected at the one or more output detectors.

12. The method of claim 9, wherein the diffractive sensor includes polarization- sensitive elements that provide polarization-aware sensing capability and sense the defect or the target feature in the object using polarization characteristics based on the signal intensities of one or more wavelengths detected at the one or more output detectors.

13. The method of claim 9, wherein the light source is in the THz, infra-red, visible, or x-ray range of the electromagnetic spectrum.

14. The method of claim 9, wherein the object comprises a semiconductor, a circuit, a commercial product, an art work, a tissue, or a biological sample.

15. The method of claim 9, wherein the diffractive sensor is a single-pixel diffractive sensor wherein the one or more output detectors comprises a single-pixel detector.