# Mail Inspection Based on Terahertz Time-Domain Spectroscopy
## 3 Sample Scan Strategies and Visualization  
When investigating mail and searching for a specific content, the scan strategy strongly depends on the speed of data acquisition. As TDS systems are mostly single-point measurements, this is an important topic when realizing mail inspection systems, especially if they should work mainly automated. Conventional TDS systems (based on mechanical delay lines) are acquiring up to some tens of spectra per second. With this, scanning of the whole sample area is often too time-consuming, so alternative strategies have to be implemented. Our approach bases on the fact that we assume areas of interest with substances larger than the terahertz focal spot size. If in a measured point, a spectrum is detected that is in our database, its vicinity is set on the list of points to be scanned. If the new points are evaluated to be positive as well, this continues, until the area of the substance is completely covered. This procedure is very helpful, if the data acquisition per spectrum is slow. A time-lapse video of a test measurement of this feature can be found at [[https://youtu.be/fc3](https://youtu.be/fc3) DBzWsPDA]([https://youtu.be/fc3](https://youtu.be/fc3) DBzWsPDA). Four screenshots at significant times can be seen in Figure 11.  
Figure 10: Improvement of false positive rates (FP) when using an incidence of the terahertz radiation at the Brewster’s angle compared to normal incidence for the two simulants PABA (**a**) and \(\alpha\)-Lactose monohydrate (mh.) (**b**). TP: true positive rate. Figure 9: Comparison of the obtained spectra of a PABA sample enclosed in eight sheets of paper (**a**) and 16 sheets of paper (**b**) under normal incidence (red curves) and incidence at the Brewster’s angle (black curves). The spectral quality is greatly enhanced due to the suppression of multiple reflections. The used paper was standard office paper with 80 g/m\({}^{2}\). Spectra are vertically shifted for better readability. First, random points in a defined area of interest are measured and evaluated for suspicious spectra, which indicate forbidden substances. These points are marked as white spots in the graphical user interface on an optical image of the sample, which is taken at the moment of the pull-in of the sample drawer. Once a measured point is identified by comparing its spectrum (after filtering and preprocessing) with a spectrum of the database, it is marked red (positive detection) and the surrounding of this point is defined to be investigated (white spots surrounding the red one), instead of further random points across the sample. This leads to a spread of this detection area, until the hidden substance area is covered with measurement points. After this, the random-like investigation is continued. Negative results (no detection) are marked with green in this example of visualization. Further, as local inhomogeneities can cause singular false positive detections, a consistency check of the surrounding can be made. Depending on the result of the surrounding, the first detection is revised. Of course, this can be made dependent on thresholds, so that too good correlations are not overwritten afterwards. This procedure is helpful to judge results at the edge or above the edge of detection. An example is shown in Figure 12, where a suspicious point (marked with yellow) is investigated in its surrounding and then revised, as the surrounding is identified to be negative results. Figure 11: Procedure of result dependent search strategy. (**a**) First, random points on the sample surface are inspected. (**b**) In case of a positive result (red point upper right), new points (1 st generation) are defined to be measured in the close vicinity. (**c**,**d**) This repeats with subsequent generations (e.g., lower left), until the area with substance is covered with measurement points (lower right). A full time-lapse video can be found at [[https://youtu.be/fc3](https://youtu.be/fc3) DBzWsPDA]([https://youtu.be/fc3](https://youtu.be/fc3) DBzWsPDA).