A Framework for Biosensors Assisted by Multiphoton Effects and Machine Learning