How artificial intelligence detects nitrate hotspots

Eawag researchers are using machine learning to map nitrate pollution in Swiss groundwater. This allows gaps in the measurement network to be filled and the causes of excessive values to be identified. The study is part of a larger project analysing the nitrogen cycle in Switzerland.

Nitrate levels in groundwater exceed the limit of 25 milligrams per litre at 15 percent of all measuring points in Switzerland. In areas characterised by arable and vegetable farming, the concentrations are even above the threshold value at around 50 percent of the measuring points. However, these figures from the Federal Office for the Environment (FOEN) are localised values that only reflect the nitrate concentration at the respective groundwater catchment. What the situation looks like a few kilometres away was previously unknown. “With our approach based on artificial intelligence, we are closing the gaps between the various measuring points,” says Lenny Winkel, group leader in the Eawag Water Resources and Drinking Water department and professor at ETH Zurich. The aim is to identify the risk areas in which targeted samples should be taken and where measures may be necessary.

High nitrate concentrations are potentially dangerous, especially for infants, as they can lead to a restricted oxygen supply. Whether there is a connection between the nitrate content in drinking water and the risk of cancer in adults has not yet been clearly established. Health concerns aside, nitrate is a useful indicator of overall water quality as it also reflects the presence of trace substances from agriculture, such as pesticides.

Recognising patterns in the wealth of data using AI

In an initial study, Winkel’s team relied on groundwater data collected at a total of 1,336 national and cantonal measuring sites, as well as data on environmental parameters such as land use, climate, soil, topography and geology. The researchers analysed these data sets using machine learning models, a form of artificial intelligence (AI). “In principle, we collect as much information as possible about a groundwater measuring point,” explains Winkel. “If we then have the same conditions at a different location, but lack a measurement, we can predict whether high or low nitrate levels are to be expected.”

Machine learning is needed to analyse the data because there are countless combinations of different factors that play a role. The models learn independently from which combinations certain conclusions can be drawn about the nitrate concentration in the groundwater. “We use AI for this, although its application in our study is strictly speaking a statistical method,” says Winkel. This means that a wealth of data is collected, which a computer analyses statistically in order to recognise patterns. The nitrate values and environmental parameters at the 1,336 measuring points serve as sample data which trains the computer algorithm to make predictions for locations where there are no measured values. The result of the model calculations: in around 35 percent of the Swiss Central Plateau, nitrate concentrations in groundwater are very likely to exceed the threshold value. A map with a resolution of 250 x 250 metres shows the risk areas (see figure).

What favours high nitrate concentrations?

But that’s not all. “We are now also trying to learn from the model which factors have a particular influence on nitrate pollution,” explains Winkel. In the technical terminology, this is referred to as interpretable machine learning. Unsurprisingly, it turns out that nitrate concentrations in groundwater are higher in areas with a lot of agriculture. However, other factors that have received little attention to date are also important. If it rains heavily in spring but hardly at all in summer, the concentration can be high. This is because the nitrate can be released from the fertiliser applied in spring, enter the groundwater and – if it is not diluted further – remain enriched. Rain in autumn, on the other hand, has a diluting effect because less fertiliser is applied at this time. The nitrate concentration can therefore fluctuate greatly over time.

The researchers also found, for example, that a high organic carbon content in the soil indicates a low nitrate concentration in the groundwater, regardless of the proportion of agricultural land. One explanation for this could be that a higher organic carbon content in the soil leads to higher denitrification rates, whereby more nitrate is converted to molecular nitrogen before it reaches the groundwater. Such information could help the authorities to check the water quality at the hotspots at the right time and initiate measures if necessary.

Nitrogen occurs everywhere on earth in different forms. For example, it is found as molecular nitrogen (N2) in the atmosphere, in soils as ammonium (NH4+) and in water as nitrate (NO3-).

Environmental detectives at work

The prediction models for the nitrate contamination of groundwater are part of a larger ETH Domain project involving Eawag, EPFL, ETH Zurich, PSI and WSL. The joint initiative called ReCLEAN aims to comprehensively understand and quantify the nitrogen cycle in Switzerland. “Nitrogen is a fascinating element because it occurs everywhere on earth in different forms,” says Winkel (see figure).

Several of the different types of nitrogen cause major environmental problems that affect the climate, air quality, ecosystems and human health. “That’s why nitrogen is also a very relevant topic,“ explains Winkel. “We track down where, in what form and in what quantity the element is currently present. In that sense, we are a kind of environmental detective.“ The researchers want to find out how the different compounds are transformed and how the systems interact with each other. They are interested not only in how the situation in a particular area develops over time, but also in how a change in one area affects another. “It is therefore crucial that researchers from different disciplines work together to gain an understanding beyond a specific area,” says Winkel.

Original publications

Covatti, G.; Li, K.-Y.; Podgorski, J.; Winkel, L. H. E.; Berg, M. (2025) Nitrate contamination in groundwater across Switzerland: spatial prediction and data-driven assessment of anthropogenic and environmental drivers, Science of the Total Environment, 973, 179121 (11 pp.), doi:10.1016/j.scitotenv.2025.179121, Institutional Repository

Created by Barbara Vonarburg for the Info Day Magazine 2025

Contact

Claudia Carle Science editor Tel. +41 58 765 5946 Send Mail

Website of the ReCLEAN project

ReCLEAN examines the effects of energy decarbonization on the nitrogen balance within Swiss ecosystems. It will serve as a crucial foundation for developing sustainable policies in Switzerland.