Portable X-ray fluorescence (pXRF) spectrometers provide simple, rapid, nondestructive, and cost-effective analysis of the metal contents in soils. The current method for improving pXRF measurement accuracy is soil sample preparation, which inevitably consumes significant amounts of time. To eliminate the influence of sample preparation on PXRF measurements, this study evaluates the performance of pXRF measurements in the prediction of eight heavy metals’ contents through machine learning algorithm linear regression (LR) and multivariate adaptive regression spline (MARS) models. Soil samples were collected from five industrial sites and separated into high-value and low-value datasets with pXRF measurements above or below the background values. The results showed that for Cu and Cr, the MARS models were better than the LR models at prediction (the MARS-R2 values were 0.88 and 0.78; the MARS-RPD values were 2.89 and 2.11). For the pXRF low-value dataset, the multivariate MARS models improved the pXRF measurement accuracy, with the R2 values improved from 0.032 to 0.39 and the RPD values increased by 0.02 to 0.37. For the pXRF high-value dataset, the univariate MARS models predicted the content of Cu and Cr with less calculation. Our study reveals that machine learning methods can better predict the Cu and Cr of large samples from multiple contaminated sites.
Aiming at the problem of difficult crack detection in underground urban sewage pipelines, a lightweight sewage pipeline crack detection method based on sewage pipeline robots and improved YOLOv8n is proposed. The method uses pipeline robots as the equipment carrier to move rapidly and collect high-definition data of apparent diseases in sewage pipelines with both water and sludge media. The lightweight RGCSPELAN module is introduced to reduce the number of parameters while ensuring the detection performance. First, we replaced the lightweight detection head Detect_LADH to reduce the number of parameters and improve the feature extraction of modeled cracks. Finally, we added the LSKA module to the SPPF module to improve the robustness of YOLOv8n. Compared with YOLOv5n, YOLOv6n, YOLOv8n, RT-DETRr18, YOLOv9t, and YOLOv10n, the improved YOLOv8n has a smaller number of parameters of only 1.6 M. The FPS index reaches 261, which is good for real-time detection, and at the same time, the model also has a good detection accuracy. The validation of sewage pipe crack detection through real scenarios proves the feasibility of the proposed method, which has good results in targeting both small and long cracks. It shows potential in improving the safety maintenance, detection efficiency, and cost-effectiveness of urban sewage pipes.