That kind of sensor is expensive though, and while you could probably do it for cheap with something like a DLP wheel (edit: or an array of different light emitters) plus a B/W camera, ML might be more price-effective, though probably more error-prone, so it isn't a given if you want a high match rate.
Also, isn't this a fire hazard?
[1] https://en.wikipedia.org/wiki/Hyperspectral_imaging#Agricult...