A Transfer Learning-Based VGG-16 Model for COD Detection in UV-Vis Spectroscopy

Jingwei Li, Iqbal Muhammad Tauqeer, Zhiyu Shao, Haidong YuJ. Imaging 2025 · DOI

TL;DR

This paper introduces a novel approach for detecting Chemical Oxygen Demand (COD) in water using UV-Vis spectroscopy by transforming spectral data into images and leveraging a pre-trained VGG-16 deep learning model. This method significantly improves COD prediction accuracy and efficiency, addressing the limitations of traditional methods and the data scarcity challenges in deep learning for this application.

What Problem Does This Paper Address?

Accurate and rapid detection of Chemical Oxygen Demand (COD) is crucial for monitoring water pollution and protecting environmental health. UV-Vis spectroscopy offers a convenient, reagent-free method for this, but extracting meaningful information from its spectral data for accurate COD prediction has been a challenge. Traditional machine learning methods often struggle with the complex, non-linear relationships within spectral data and can suffer from poor generalization. While deep learning, particularly Convolutional Neural Networks (CNNs), shows promise, training these models typically requires vast amounts of labeled data, which are scarce and expensive to acquire for water quality monitoring. This paper aims to bridge this gap by developing a highly accurate and efficient COD detection model that overcomes data limitations.

Methods

The core of this paper's methodology lies in a two-pronged approach:

  • Spectrum-to-Image Transformation: One-dimensional UV-Vis spectral data is converted into two-dimensional images. This is achieved using the Gramian Angular Field (GAF) method, which transforms spectral sequences into matrices that can be visualized as grayscale images. These grayscale images are then converted into color images (224x224x3) to be compatible with CNN architectures. This transformation allows the application of powerful image recognition techniques to spectral data.
  • Transfer Learning with VGG-16: A pre-trained VGG-16 CNN model, originally trained on the large ImageNet dataset, is employed. Instead of training a CNN from scratch, which would require extensive data, the weights and architecture of the pre-trained VGG-16 are transferred. This "transfer learning" approach allows the model to leverage general features learned from ImageNet and adapt them to the specific task of COD prediction from spectrum images. The initial layers of the VGG-16 model are "frozen" (their weights are not updated), while the later layers are "fine-tuned" using the transformed spectrum images. This fine-tuning process optimizes the model for COD prediction while mitigating overfitting risks associated with small datasets.

Datasets

The study utilized a dataset of 1000 water samples collected from the Grand Canal in Yangzhou, China, over a year. The data was split into a training/calibration set (800 samples) and a testing/prediction set (200 samples) using an equidistant sampling method to maintain similar COD distributions. The UV-Vis spectra were acquired using a DH-2000 deuterium-halogen light source and a USB2000+ spectrometer. COD standard values were measured using the rapid digestion spectrophotometry method.

Key Insights and Ideas

  • Visualizing Spectra for Deep Learning: Transforming 1D spectral data into 2D images is a critical step that unlocks the power of CNNs for spectral analysis, enabling the capture of complex spatial relationships within the data.
  • Transfer Learning as a Data Scarcity Solution: Leveraging pre-trained models like VGG-16 is highly effective for tasks with limited labeled data, significantly reducing training time and improving model generalization.
  • GAF as an Effective Spectrum-to-Image Converter: The Gramian Angular Field method proves to be a robust technique for converting spectral data into image representations that preserve essential information for downstream analysis.
  • Feature Importance Aligns with Spectral Peaks: The analysis of feature importance revealed that the model effectively prioritizes spectral regions corresponding to known absorption peaks related to COD, demonstrating its ability to learn relevant features.

Key Results

The proposed transfer learning-based VGG-16 model achieved excellent performance in COD prediction:

  • High Accuracy: The model achieved a coefficient of determination (R²) of 0.9751 and a Root Mean Squared Error of Prediction (RMSEP) of 4.1662 mg/L on the test set.
  • Superior Performance: Comparative analysis showed that the proposed method significantly outperformed traditional methods like PLSR, SVM, and ANN, as well as other CNN-based approaches, achieving the lowest mean RMSE (4.2318) and standard deviation of RMSEs (0.1528) in cross-validation.
  • Efficient Training: The transfer learning approach, by utilizing pre-trained weights, drastically reduced the need for extensive training from scratch, making the process more efficient.

Limitations and Future Work

The authors acknowledge that while the model demonstrates strong performance on its specific dataset, its generalization ability to diverse water sources and industrial wastewaters may decline. This is attributed to the fine-tuning process being optimized for a particular dataset.

Future work suggested includes:

  • Expanding Datasets: Collecting additional water samples from various environments to create more diverse datasets.
  • Refining the Model: Further fine-tuning and potentially adjusting the model architecture to enhance its adaptability and improve prediction accuracy across a wider range of water types.
  • Investigating Other Preprocessing Techniques: Exploring alternative spectrum-to-image transformation methods.

Summary updated

BibTeX
@article{li2025transfer,
  author = {Jingwei Li and Iqbal Muhammad Tauqeer and Zhiyu Shao and Haidong Yu},
  title = {{A Transfer Learning-Based VGG-16 Model for COD Detection in UV-Vis Spectroscopy}},
  journal = {J. Imaging},
  year = {2025},
  doi = {10.3390/jimaging11050159},
}
Figure