A solution containing a target molecule and a reference molecule is illuminated to obtain Raman signals. An optical metasurface is used as a diffractive optical element to split the Raman signal from the target molecule and the Raman signal from the reference molecule. The target and reference Raman signals can be detected at different locations with different photodetectors, and the target molecule concentration in the solution is determined by comparing the target and reference Raman signals.