The Danube flows through densely populated areas and is exposed to numerous stress factors such as dams, canalisation, agriculture, and urbanisation, which cause most of the changes in the Danube catchment area. This paper highlights the benefits of using cutting-edge Machine Learning (ML) models on data gathered from the Joint Danube Survey 3 (JDS 3) dataset to detect xenobiotics in rivers using reliable biomarkers. Recognized as key indicators under the Water Framework Directive, macroinvertebrate communities specifically signal chemical pollution through their varied responses to chemical stressors. The use of ML models such as 4-Layer Perceptron, Long Short-Term Memory, and Transformer Neural Networks allows for a precise determination of the ecological conditions of rivers based on biological and chemical parameters.
Certain xenobiotics, especially pesticides like 2,4-Dinitrophenol, Chloroxuron, Bromacil, Fluoranthene, and Bentazone, showed a significant correlation with macroinvertebrates in the Danube River basin. The most suitable ML model is an Artificial Neural Network developed by a specific combination of inputs and outputs. The observation of the correlation between 2,4-Dinitrophenol and Bentazone concentrations and the macroinvertebrate communities indicates the high effectiveness of Long Short-Term Memory models in modelling the ecological status of rivers. The 4-Layer Perceptron model excels in predicting 2,4-Dinitrophenol and Fluoranthene output parameters, while Transformer Neural Networks perform optimally in modelling Bromacil and Fluoranthene concentrations with macroinvertebrates throughout the Danube River Basin. These established artificial neural network architectures can also be applied to other lotic systems and biological parameters.