We propose a feature color extraction method that improves the accuracy of water quality analysis using a digital image and eliminates the effect of interfering ions and chromogenic agents on the color after a color reaction. The proposed method is based on color deconvolution (CD) combined with machine learning for substance measurement in water. After an ordinary camera acquires the solution image after color reaction, the CD algorithm is applied to extract the feature image, calculate the first-order, second-order, and third-order color moments corresponding to RGB channels, and construct a gradient boosting regression tree prediction model based on color moment features to detect substances in water. In predicting ammonia, nitrite, and orthophosphate concentrations, the mean square error values were 0.01029, 0.00063, and 0.1361, and the mean absolute error values were 0.08103, 0.02231, and 0.32886, respectively. There was no significant difference in the results of the comparative spectrophotometric method on the actual water samples. The spiked recoveries of the samples ranged from 94% to 120%, confirming that the method can effectively measure the content of substances in water.
Read full abstract