Leveraging the computation capability of the sensor itself, we present a spectral sensor that directly decodes application-relevant spectral information from light. This approach bypasses a large amount of raw sensory data, enabling more efficient spectroscopic recognition.