Abstract:
To address the issue of limited inversion accuracy in retrieving multiple water quality parameters from UV-Vis spectra caused by spectral overlap among components, this paper proposes a multi-task learning model integrated with a spectral interval attention mechanism (Spectral interval attention multi-task learning model, SIA-MTL). Focusing on chemical oxygen demand (COD), total nitrogen (TN), and turbidity, the 225~700 nm spectral range is divided into three characteristic subintervals. Local spectral features from each interval are extracted using parallel 1D-CNNs. Independent attention branches are assigned to each parameter to dynamically allocate interval weights. The weighted features are then integrated via a residual feature fusion module, and the multi-task output layer simultaneously predicts the three parameters. A dataset consisting of 1 000 mixed solution samples is constructed to evaluate the model structure and inversion performance. Ablation experiment results demonstrate that interval partitioning, 1D-CNN, attention mechanism, and feature fusion module all significantly contribute to the improvement of inversion accuracy. The proposed SIA-MTL achieves determination coefficients (R
2) of 0.991, 0.925, and 0.990 for COD, TN, and turbidity, respectively, with root mean square errors (RMSE) of 4.084 mg·L
−1, 2.234 mg·L
−1, and 8.802 NTU. Its predictive performance is significantly superior to traditional models including Partial Least Squares Regression (PLSR), Least Absolute Shrinkage and Selection Operator (LASSO) and Random Forest (RF), as well as classic single deep learning models such as 1D-CNN and Long Short-Term Memory (LSTM). The prediction accuracy of TN is improved most remarkably. This method effectively enhances the inversion accuracy of COD, TN, and turbidity in mixed solutions and provides a new idea for rapid prediction of complex in-situ water quality.