Abstract
This work proposes a deep learning (DL)-based framework, namely Sim2Real, for spectral signal reconstruction in reconstructive spectroscopy, focusing on efficient data sampling and fast inference time. The work focuses on the challenge of reconstructing real-world spectral signals under the extreme setting where only device-informed simulated data are available for training. Such device-informed simulated data are much easier to collect than real-world data but exhibit large distribution shifts from their real-world counterparts. To leverage such simulated data effectively, a hierarchical data augmentation strategy is introduced to mitigate the adverse effects of this domain shift, and a corresponding neural network for the spectral signal reconstruction with our augmented data is designed. Experiments using a real dataset measured from our spectrometer device demonstrate that Sim2Real achieves significant speed-up during the inference while attaining on-par performance with the state-of-the-art optimization-based methods.
Introduction
Miniaturized spectrometers are essential for portable sensing applications, ranging from wearable health monitors to IoT environmental sensors. Reconstructive spectroscopy enables this miniaturization by replacing bulky physical components like gratings with specialized photodetectors that encode spectral information into compressed signals. However, recovering the original spectrum from these encoded readings is a challenging "inverse problem."
Current solutions generally fall into two categories: optimization-based methods and deep learning (DL) methods. Optimization-based methods are accurate but computationally expensive and slow, making them unsuitable for real-time edge deployment. DL methods offer lightning-fast inference but typically require massive amounts of labeled real-world data, which is difficult and expensive to collect. When trained on easily generated simulated data, DL models often fail on real devices due to "domain shift"—the subtle differences in noise and physical response between mathematical models and physical sensors.
The Sim2Real Framework
To address these challenges, we propose the Sim2Real framework. This approach leverages device-informed simulated data for training while ensuring robustness to real-world imperfections through a novel augmentation strategy and a custom architecture.
Hierarchical Data Augmentation (HDA)
The core of the Sim2Real approach is HDA. Instead of simply adding noise to the final output, HDA systematically perturbs the response matrix ($R$)—the mathematical description of the device's physical response—and the encoded signal. By injecting Gaussian noise into these physical parameters during simulation, the model is forced to learn a "robust inverse" of the device's response, making it resilient to the inevitable inaccuracies of real-world hardware.
ReSpecNN Architecture
We designed ReSpecNN, a custom, lightweight neural network optimized for 1D spectral signals. It employs a "gross-to-fine" reconstruction strategy:
- Initial Sketch: A fully connected module (
rec_fc) generates a coarse estimate of the spectrum. - Feature Extraction: A 1D Convolutional Neural Network (CNN) captures spatial features such as peak shapes.
- Refinement: A second fully connected module (
rf_fc) with skip connections refines the details. - Smoothing: A final Sigmoid activation ensures a continuous and smooth spectral output.
Experimental Results
The framework was evaluated using a real-world dataset collected from a portable spectrometer featuring 16 semiconductor photodetectors. The training set consisted of 20,000 pairs of simulated spectra generated using Lorentzian distribution functions.
Performance and Robustness
A significant challenge in Sim2Real is maintaining performance when moving from simulation to reality. While standard models like ResCNN achieve near-zero error on simulated data, their performance degrades significantly on real-world data due to domain shift.
As shown in the results, Sim2Real maintains low error across both domains. On real-world samples, the framework achieved a Mean Absolute Error (MAE) for peak positions of 1.11% for single peaks and 1.35% for multiple peaks, which is on par with state-of-the-art optimization-based methods.
Inference Speed
A key advantage of ReSpecNN is its efficiency. It achieves an average inference time of 1.134 ms, representing a ~10x speedup over traditional optimization-based techniques (which range from 7.9 to 10.6 ms). This efficiency makes it ideal for battery-constrained devices and real-time monitoring.
Conclusion
The Sim2Real framework demonstrates that high-performance spectral reconstruction can be achieved using only simulated training data, provided the simulation is "device-informed" and augmented correctly. By bridging the domain gap, we enable the use of fast, lightweight DL models in miniaturized spectrometers. Future work will explore more complex noise modeling and the scalability of this architecture to different sensor types and signal encoders.
Summary updated