A method for detecting a local change in refractive index of a dielectric medium located on the surface of an optical sensor, said optical sensor comprising either a waveguide comprising a region, called the active region, covered with at least one metallic and/or dielectric layer in contact with the dielectric medium, or a waveguide facing another waveguide, this other waveguide forming a resonator and constituting a region, called the active region, in contact with the dielectric medium, said method comprising the following steps:
- a) emitting a light beam at the input of the waveguide so that the light beam can be propagated, within the waveguide, according to at least N propagation modes, where N is a natural integer such that N≥2, towards the active region, the light beam reflected or transmitted by the active region, thus presenting a given spatial distribution of an intensity;
- b) measuring a local intensity from at least one zone of the given spatial distribution of the intensity of the light beam reflected or transmitted by said active region of the optical sensor, the local intensity only taking into account the intensity of one part of said given spatial distribution;
- and
- c) detecting the local change in the refractive index of the dielectric medium by means of a database supplying a link between the local intensity of said at least one zone of the given spatial distribution of the intensity of the light beam reflected or transmitted by the active region of the optical sensor and a change in refractive index relative to a reference medium.