Intelligent photodetectors 'sniff and seek' like retriever dogs to recognize materials directly from light spectra