Diamonds contain tiny defects: instead of two carbon atoms, there's a nitrogen atom and a vacancy. Such a defect senses magnetic fields like a compass needle senses north. When the field changes, the defect changes its emission frequency. But to turn that emission into numbers, the sensor needs lengthy calibration against a reference.
Researchers proposed teaching the algorithm not with labeled examples, but with the law of nature itself. They embedded the rule by which a magnetic field splits the defect's energy levels into the learning program. Now the algorithm doesn't need thousands of examples with known fields: it understands the signal's structure on its own. As a result, the measurement error dropped by a factor of 372 compared to the standard statistical approach.
The method was tested on a real diamond sensor without prior calibration. The algorithm took raw data and produced an accurate magnetic field value. This is a step toward sensors that don't need calibration before every use. The approach could also benefit other rare physical measurements where data is scarce but the laws are known.
Nitrogen defects in diamond are so sensitive they can detect the magnetic field of a single electron from a few nanometers away.