Using machine learning to improve low-cost optical spectroscopy for liquid profiling related to plant cultivation
This thesis explores how supervised and unsupervised machine learning techniques can be used together with low-cost optical spectroscopy for liquid profiling in crop production. Traditional chemical analysis of nutrient solutions, is often expensive and time-consuming. Optical spectroscopy can be used as an alternative method for fast, non-destructive measurements, however spectrometers used in laboratories are costly and impractical for inline deployment. This study examines whether low-cost, lower-resolution spectrometers, combined with appropriate preprocessing and machine learning methods, can provide comparable predictive performance. Three datasets consisting of several types of manure (e.g. cattle, pig and poultry), captured with different spectrometers were merged and analyzed. A modular prediction pipeline was built using scikit-learn, allowing for systematic evaluation of all possible combinations including preprocessing techniques, prediction models, and spectral resolutions. The study finds that downsampling high-resolution spectra to match the capabilities of low-cost sensors causes only a minor decline in performance, with median relative errors between 10–25\% depending on the nutrient. However, the generalization across the datasets showed poor results due to spectral differences between the spectrometers used. In these cases, calibration methods based on common samples, such as spectral space transformation, seem necessary. Attempts to reduce the major influence of water on spectral variance through latent variable based compensation approaches showed no improvement. Finally, real-world tests with the AS7265x, a low-cost sensor confirmed its sensitivity to larger changes in concentration, though it struggled to detect subtle differences similar to those observed in vertical farming using hydroponics.
Publication Details
- Journal
- KTH Publication Database DiVA (KTH Royal Institute of Technology)
- Published
- 2025-01-01
- Primary Topic
- Geochemistry and Geologic Mapping
- Type
- article
- Field-Weighted Citation Impact
- 0.00