Hyperspectral imaging provides rich spectral information for food inspection and authentication, but its practical adoption is limited by acquisition cost, system complexity, and large data dimensionality. To reduce the dependence on dedicated hyperspectral hardware, this work investigates task-driven spectral reconstruction from low-dimensional RGB-IR measurements for flour analysis. The proposed framework combines a two-shot RGB-IR acquisition strategy with end-to-end optical optimization, spectral reconstruction, and downstream material analysis. A first acquisition is obtained using a fixed RGB-IR filter, while a second complementary acquisition is generated through a learnable spectral filter whose transmittance is optimized jointly with the reconstruction model. The two RGB-IR observations are concatenated and used to recover a dense hyperspectral representation of the sample.
The reconstructed spectra are evaluated in two progressively more challenging scenarios. First, the framework is applied to flour identification, where reconstructed hyperspectral data are used to classify bread samples prepared with refined and whole wheat flour. Second, the approach is extended to quantitative flour mixture estimation, where samples may contain multiple flour types and the objective is to estimate their relative proportions.
Experimental results show that optimized RGB-IR spectral reconstruction substantially improves over direct RGB and RGB-IR inputs and approaches the performance obtained with measured hyperspectral data. The analysis also highlights the interaction between sensing design, reconstruction capacity, and downstream task performance. Moreover, the quantitative estimation framework is validated not only in simulation but also with a real acquisition setup, demonstrating the potential of optimized RGB-IR imaging as a practical and cost-effective alternative to full hyperspectral acquisition for food authentication and compositional analysis.