Computer Vision & Pattern Recognition

Improving Generalization of Image-Based Water Turbidity Classification Using Fine-Tuning with Small Real-World Datasets

EfficientNet-B0 with partial fine-tuning on 300+ self-collected phone photos tries to classify turbidity from uncontrolled real-world images — an honest look at how hard field generalization is.

Course paper that tackles image-based turbidity classification with a small custom dataset of 300+ photos taken on three different smartphones in natural, uncontrolled lighting. An ImageNet-pretrained EfficientNet-B0 with partial fine-tuning learns to separate Low / Medium / High turbidity, and the paper candidly reports the limits of doing so from photos alone.

300+
real-world images
3
turbidity classes
EfficientNet-B0
backbone
224×224
input size

[ 01 ]

Research Overview

Turbidity — how cloudy water is — is a key water-quality signal, but conventional nephelometer measurement is expensive, slow, and lab-bound.

This paper proposes a lightweight deep-learning alternative: classify turbidity directly from smartphone photos taken in the field. It collects a real-world dataset, fine-tunes an EfficientNet-B0 backbone, and reports what works and what does not.

[ 02 ]

Problem Statement

  • Lab-collected turbidity datasets do not reflect real field conditions — reflections, shadows, container edges, and colour distortion.
  • Collecting enough labeled real-world images for deep learning is hard, so the dataset is small and class-imbalanced.
  • Prior image-based work evaluated only under controlled imaging environments.

[ 03 ]

Objective

  • Assemble a real-world turbidity dataset captured with consumer smartphones in uncontrolled lighting.
  • Fine-tune EfficientNet-B0 (transfer learning with partial unfreezing) for Low / Medium / High turbidity classification.
  • Analyze generalization honestly — where the model succeeds and where real-world noise defeats it.

[ 04 ]

Methodology

  • Dataset collection: 300+ photos taken with three smartphones (two iPhones, one Android) in natural light, manually sorted into Low, Medium, and High turbidity, and resized to 224×224.
  • Architecture: EfficientNet-B0 backbone pretrained on ImageNet with a custom head (global average pooling + fully connected layer + 3-class softmax); higher-level layers unfrozen for fine-tuning.
  • Training: Adam optimizer, categorical cross-entropy loss, class weights to counter imbalance, and a reduced learning rate during fine-tuning.

[ 05 ]

Models Used

EfficientNet-B0

ImageNet-pretrained backbone with a custom GAP + FC + softmax head; higher layers partially unfrozen.

Transfer learning

Pretrained weights plus partial fine-tuning to cope with the small real-world dataset.

[ 06 ]

Dataset

  • Custom dataset of 300+ photos taken with three different smartphones (two iPhones, one Android) in uncontrolled outdoor lighting.
  • Three classes — Low, Medium, and High turbidity — resized to 224×224.

[ 07 ]

Implementation

  • Images standardized to 224×224 and split by class; class-weighted training to mitigate imbalance.
  • Partial fine-tuning of the backbone's higher layers with a low learning rate.
  • Evaluated with a confusion matrix, per-class precision / recall / F1, and train-versus-validation learning curves.

[ 08 ]

Key Features

  • Real-world capture protocol across multiple devices and natural-light conditions.
  • Transfer learning with partial fine-tuning to survive a small dataset.
  • Class weighting to counter imbalance.
  • Honest reporting of validation accuracy across fine-tuning phases.

[ 09 ]

Results

  • Validation accuracy fluctuated between roughly 18% and 47% across fine-tuning phases while training accuracy kept climbing — the signature of a small, noisy, imbalanced dataset.
  • Predictions skew heavily toward the high-turbidity class, and the model struggles to separate medium from low turbidity.
  • Qualitatively, the model reliably recognizes visually cloudy water; most errors trace to reflections, container edges, and lighting artifacts rather than to the water itself.

[ 10 ]

Outcome

  • A preliminary, low-cost, portable turbidity-assessment approach that demonstrates feasibility and, just as importantly, documents the real-world failure modes.
  • Clear evidence that image-only turbidity classification is an open problem, pointing future work toward better data and physics-aware features.

[ 11 ]

Tools & Technologies

PythonPyTorchEfficientNetNumPymatplotlib

[ 12 ]

Challenges

  • Small, imbalanced dataset from a hard-to-control capture environment.
  • Visual similarity between classes under variable lighting.
  • Reflections, shadows, and container edges corrupt the signal.
  • Validation instability when fine-tuning a deep network on limited data.

[ 13 ]

Future Improvements

  • Augment the dataset substantially across more devices, scenes, and lighting conditions.
  • Move from classification to regression-based turbidity estimation.
  • Investigate physics-informed colour correction to remove lighting and reflection effects.

[ 14 ]

Related work

Back to research