Image Processing & Water Quality Analysis
AI Development Gold Medal · Eskom ExpoLab tests for water quality are slow and out of reach for most households. We built a smartphone app that screens water from a single photo. It extracts the dominant colours, classifies them with a neural network and combines the result with what the user observes.
Problem
About 70% of the earth is covered by water, but only 0.34% of the supply is safe for people to use.
Checking water quality usually means sending samples to an authorised lab, which is slow and costly. Sensor kits for pH or turbidity exist, but few households own one. We wanted an early-warning tool that anyone can use with just a phone.
Pipeline
- Extract five dominant coloursThe Color Thief module pulls the five dominant colour groups from the photo. An interactive crop removes reflections and shadows first.
- Classify the coloursTwo methods run side by side. Euclidean distance matches each colour to red, green or blue. A Keras network, trained for 5,000 iterations, sorts it into 11 basic colours.
- Add what the user observesDropdowns capture odour, signs of aquatic life and location. Each answer that matches the database adds 25 points, on top of 25 for a successful colour output.
- Predict and recommendThe system returns likely pollution sources, handling methods and a confidence score.

Results
The classifier reaches 88% accuracy on held-out data.
F1 score by colour class on the 20% test split. Green is easiest to classify. Grey is hardest because its tones overlap with white and black.
Field test
Four real samples were measured on site (pH, smell, colour) and compared with the app’s output.
| Sample | On-field | Detected colours | App result |
|---|---|---|---|
![]() |
pH 5.2 · oily · yellow turbid | Yellow, Green, Yellow, Yellow, Yellow | Yellow · Match |
![]() |
pH 8.3 · soapy · frothy white | White, White, White, Gray, White | White · Match |
![]() |
pH 6.6 · chlorine · clear | Gray, Gray, Gray, Gray, Gray | Gray · Miss |
![]() |
pH 7.3 · earthy · dark brown | Brown, Brown, Black, Brown, Brown | Brown · Match |
The clear sample was misread because the water is transparent: the algorithm picked up the grey container behind it.
The app



Next
Colour alone cannot see dissolved oxygen (DO), one of the most important quality indicators. The next stage proposes a convolutional neural network trained on images of light-scattering patterns from samples with known DO levels. It would draw on Rayleigh scattering and use intensity, colour, texture and edge features to estimate DO from a phone camera.



