Abstract:The total nitrogen (TN) is a major factor contributing to eutrophication and is a crucial parameter in assessing surface water quality. Accurate and rapid methods are crucial for determining the total nitrogen content in water. Herein, a fast, highly sensitive, and pollution-free approach is proposed, which combines ultraviolet (UV) absorption spectroscopy with Bayesian optimized least squares support vector machine (LSSVM) for detecting total nitrogen content in water. Water samples collected from sampling points near the Yangtze River Basin in Chongqing were analyzed using national stand-ard methods to measure TN content as reference values. The prediction of TN content in water was achieved by integrat-ing the UV absorption spectra of water samples with LSSVM. To make the model quickly and accurately select the op-timal parameters to improve the accuracy of the prediction model, the Bayesian optimization (BO) algorithm was used to optimize the parameters of the LSSVM. Results show that the prediction model performs well in predicting total nitrogen concentration, with a high coefficient of prediction determination (R2=0.9413) and a low root mean square error of pre-diction (RMSE=0.0779 mg/L). Comparative analysis with previous studies indicates that the model used in this paper achieves lower prediction errors and superior predictive performance.