  Optical spectroscopy the measurement of electromagnetic spectra is
fundamental to various scientific domains and serves as the building block of
numerous technologies. Computational spectrometry is an emerging field that
employs an array of photodetectors with different spectral responses or a
single photodetector device with tunable spectral response, in conjunction with
numerical algorithms, for spectroscopic measurements. Compact single
photodetectors made from layered materials are particularly attractive, since
they eliminate the need for bulky mechanical and optical components used in
traditional spectrometers and can easily be engineered as heterostructures to
optimize device performance. However, compact tunable photodetectors are
typically nonlinear devices and this adds complexity to extracting optical
spectra from the device response. Here, we report on the training of an
artificial neural network (ANN) to recover the full nonlinear spectral
photoresponse of a nonlinear problem of high dimensionality of a single
GeSe-InSe p-n heterojunction device. We demonstrate the functionality of a
calibrated spectrometer in the spectral range of 400-1100 nm, with a small
device footprint of ~25X25 micrometers, and we achieve a mean reconstruction
error of 0.0002 for the power-spectrum at a spectral resolution of 0.35 nm.
Using our device, we demonstrate a solution to metamerism, an apparent matching
of colors with different power spectral distributions, which is a fundamental
problem in optical imaging.
