Abstract
Terahertz (THz) imaging is a critical tool for non-invasive security screening, yet it is often hampered by low spatial resolution and a scarcity of labeled training data. This paper presents the first application of Vision-Language Models (VLMs) to THz imaging using In-Context Learning (ICL). By utilizing a modality-aligned prompting framework, we demonstrate that open-source models like Mistral and Qwen can effectively detect concealed explosives without any fine-tuning. Our results show significant performance improvements in one-shot scenarios and highlight the potential for interpretable, human-readable AI justifications in high-stakes security environments.
Introduction
Terahertz (THz) imaging represents a "superpower" for security and material science. Operating between the microwave and infrared frequencies, THz radiation can penetrate clothing and packaging while remaining non-ionizing, making it a safer alternative to X-rays. Despite these advantages, analyzing THz images is notoriously difficult due to high visual ambiguity and a "data desert"—the lack of large, labeled datasets required to train traditional deep-learning models.
In security contexts, the "black-box" nature of standard AI is a significant hurdle. Operators require transparency to understand why a system flags a potential threat. This research addresses these challenges by repurposing VLMs as reasoning engines capable of interpreting specialized spectral data through natural language instructions.
Methodology
To bypass the need for computationally expensive fine-tuning, the study employs In-Context Learning (ICL). This approach treats the VLM as a reasoning agent that can be "primed" at the moment of inference.
Modality-Aligned Prompting Framework
The core of the methodology is a structured prompting strategy designed to bridge the gap between general-purpose vision and specialized scientific data:
- Task Instruction (The "Context Dump"): Models are provided with a detailed textual guide explaining THz physics, the difference between intensity and phase plots, and the specific visual signatures associated with C4 explosives (e.g., circular regions or specific phase shifts).
- Learning Modes: The researchers tested models in Zero-Shot (no examples) and One-Shot (one labeled 26×26 pixel crop example) configurations.
- Model Selection: The study utilized two prominent open-weight models:
Mistral-Small-3.1-24BandQwen2.5-VL-7B. Using open-source models ensures reproducibility and suitability for privacy-sensitive, offline security applications.
Experimental Setup and Datasets
The study utilized a specialized THz dataset comprising 1,400 frames. The experimental scene involved a small sphere of C4 explosive encased in a metallic shell, positioned near a metallic plate on a styrofoam base.
Data was captured using a focused emitter-receiver system and processed via Fourier Transform to generate dual 2D heatmaps:
- Intensity: Measuring the power of the reflected signal.
- Phase: Measuring the timing and delay of the wave.
All frames were manually labeled by human experts to establish a ground truth for classification ("Yes C4" vs. "No C4").
Results and Discussion
The introduction of just one example (one-shot ICL) yielded substantial performance gains, though the models exhibited distinct "personalities" in their reasoning:
- Mistral-Small-3.1-24B: This model showed the most stable improvement. Its accuracy jumped from 0.4950 to 0.7193, and its F1-score rose from 0.3825 to 0.4126. Mistral became more conservative and precise, effectively reducing false alarms.
- Qwen2.5-VL-7B: Qwen demonstrated an "aggressive" detection profile. While its overall accuracy fluctuated, its Recall surged to 0.9661. In a security context, this high sensitivity ensures that very few threats go undetected, even at the cost of more frequent false positives.
The Value of Interpretability
Unlike traditional Convolutional Neural Networks (CNNs) that provide only a numerical probability, these VLMs generate natural language justifications. For instance, a model might flag a frame by noting a "distinct phase shift in the upper right quadrant." This allows human supervisors to verify the logic behind a detection, bridging the gap between raw sensor data and actionable intelligence.
Limitations and Future Work
While this research marks a significant milestone, several challenges remain before deployment in real-world environments:
- Signal Noise: THz spectra often contain aliasing artifacts that can confuse the models, necessitating better signal preprocessing.
- Context Constraints: The limited context windows of current open-source models restrict the number of demonstration examples that can be included in a prompt.
- Reliability: Standalone performance is not yet robust enough for high-stakes safety applications without human oversight.
Future research will explore fine-tuning these models on THz-specific datasets and utilizing larger proprietary models to further bridge the performance gap.
Conclusion
This study proves that VLMs can be "taught" to understand complex, non-optical sensor data through specialized prompting. By leveraging In-Context Learning, researchers have created a path toward interpretable and effective threat detection in data-scarce environments, turning "black-box" AI into a transparent partner for security operators.
Summary updated