Innovation: can machine learning ensure safe drinking water?

21 May 2024

Water and sanitation specialist, Syed Imran Ali, was working in a refugee camp in South Sudan when his team were faced with a mystery. What they discovered changed how they thought about safe water supply, and is now helping to save lives in humanitarian crises around the world.

In 2013, South Sudan’s Maban County refugee camps, home to approximately 68,000 people, were hit by an outbreak of hepatitis E.

Hepatitis E is a waterborne virus with an unusual pattern of attack. It affects otherwise healthy 20 - 30 year old's, causing the liver to malfunction. For most people who contract the disease, the case fatality rate is around two percent, but for pregnant women in their second or third trimester, that jumps to 20 percent.

Imran is a water and sanitation specialist (WATSAN) and was working with MSF in the Jamam refugee camp at the time: “When a pregnant woman with hepatitis E arrived at our medical facility, she would often be so weakened by the virus that she would give birth prematurely, and there was very little we could do to save either the mother or the baby. It was devastating for families, and incredibly difficult for the entire MSF team to witness, especially the medics.”

Hepatitis E has no known cure, so the medical team could only offer supportive care such as making sure patients were well nourished and hydrated. "As the water and sanitation team, we knew we had to beat back the transmission pathways in the camp before the virus got to people" Imran reported.

What caused the outbreak of Hepatitis E?

The water in the camp was supplied at collective tap stands where people would fill jerry cans to take back to their shelters. It would be relatively simple for the team to test the water and adjust the chlorine levels to kill the virus.

However, the tests showed something strange: the chlorine levels at the tap stands were already meeting all the official standards. If the water coming out of the tap was safe, why were so many people getting sick?

Water tanks and jerry cans in South Sudan

A water tank, water tap and jerry cans in the Maban refugee camps, South Sudan © Syed Imran Ali

The team began to investigate. Instead of just testing at the taps, they started testing the water people were actually drinking in their shelters. Soon they had at least part of the answer.

“We saw that the water quality is OK where people collect it, but very quickly it becomes recontaminated. And once water is recontaminated, it becomes a pathway for transmission of disease rather than something that helps people” says Imran.

With this new information, the team began work to ensure that jerry cans were cleaned, and increased the level of chlorination so that it would be effective for longer. Alongside this, they worked to expand overall water supplies, built large-scale sanitation facilities and hand-washing points, and worked with health promoters to ensure that the community knew how to minimise the risks. Eventually the outbreak was brought under control. But the experience stayed with Imran and his colleagues.

“We discovered that the official guidelines that we're using are not always yielding safe water where it matters. This is the problem we saw in South Sudan, and when we continued this research in other camps in Rwanda, Jordan, Syria, Tanzania and elsewhere, we saw the same problem.”

What was the solution?

They set out to create a new set of guidelines for water safety, based on their research in humanitarian settings. “The original WHO guidance on water quality actually comes from conventions meant for cities,” says Imran. “So, no wonder when you try to deploy it in a refugee camp, it doesn't always work.”

The team’s new guidelines allowed for the different conditions that impact water quality in camp settings: things like temperature or sanitary conditions. But when they shared them with other WATSAN teams, they were met with more questions.

“We got feedback saying, ‘we know we need evidenced-based guidelines, but your evidence comes from South Sudan, Jordan and Rwanda. How do we know it's going to work in Nigeria, Bangladesh or Yemen?’ And that was a really valid question,” says Imran. “It helped us realise that maybe universal guidelines weren’t really the point. What was more important were the analytics and modelling that we’d developed to generate those guidelines.” 

So the team got to work, this time building a free online tool that allows humanitarian workers anywhere in the world to upload their local water quality monitoring data, alongside details such as how long the water is stored for in people's home. At the press of a button, the tool will then generate a chlorination target that ensures the water is actually safe to drink for people at that specific site, for as long as it’s likely to be stored. They called it the Safe Water Optimization Tool, or SWOT.

Imagine a mother living in a refugee camp. She’s collecting water from a public tap because she’s been told that it’s safe to drink, but her kids keep getting sick with diarrhoea… The SWOT means that the WATSAN team can use the data that they’re already collecting to optimise the water system, and give this mother assurance that the water that's coming out of the tap is safe when she collects it and still safe the next day when she gives it to her kids.

Syed Imran Ali
Water and sanitation specialist
A team testing water in Uganda

Jerry can water being tested using the SWOT in Uganda © Syed Imran Ali

The Safe Water Optimization Tool

“As far as we’re aware, the SWOT is the first time in civil and environmental engineering that anyone has modelled chlorine decay after distribution,” says Imran.

The SWOT is already being used by teams in MSF and six other humanitarian organisations in nine countries. But the team aren’t stopping there. They’re now working with York University in Toronto to take the tool to the next level.

Using machine learning techniques, the team is now working with data on microbial contamination and health risks, and looking beyond chlorination to a wider range of water treatment processes, including clarification and filtration.

“This will allow water and sanitation teams to understand the health impacts of the different interventions available, so they can make sound decisions about where to focus their attention to have the most impact for people,” says Imran.

“So far we’ve reached half a million people,” he continues. “But our goal is for the SWOT to become part of standard practice for all teams working on safe water supply in emergency settings."

The MSF project in Maban ran from 2011 to 2023. During this time the team conducted over 1.5 million outpatient consultations, vaccinated 405,731 children, and installed dozens of protected boreholes to allow access to safe drinking water.