Abstract
Leveraging machine learning (ML) methods in agriculture offers the potential to enhance plant productivity and drive sustainable practices. Although many efforts have employed ML-based approaches to address tasks such as plant condition monitoring, critical challenges remain unaddressed: among others, the lack of suitable testing methods and reliable generalization assessment (i.e., success on new and unseen data) are surely relevant. These challenges stem from complex sources of biases in agricultural data (i.e., plant biological variability, soil composition, and environmental conditions), which can cause difficult-to-predict performance degradation. This work presents an ML pipeline based on the ElasticNet method on bioimpedance data for classifying water and iron stress conditions in tomato plants. We rely on Leave-One-Plant-Out Cross-Validation for both feature selection and model evaluation, to realistically assess biases in the data. The model achieves an average testing accuracy of 0.84 ± 0.01 and 0.80 ± 0.04 for iron and water stress, respectively. We further assess generalization performance on a larger, out-of-distribution dataset, where accuracy drops to 0.38 ± 0.00 due to distributional shifts. To mitigate these shifts, we apply and compare three domain adaptation methods: linear optimal transport (LOT), subspace alignment (SA), and CORAL. LOT achieves the highest accuracy of 0.71 ± 0.04, outperforming SA (0.39 ± 0.15) and CORAL (0.43 ± 0.12). Finally, we present a user-friendly visual stress-level dashboard built using the principal path method, enabling fine-grained, real-time monitoring of plant condition. Overall, this work paves the way for robust, end-to-end low-power systems for plant stress classification on resource-constrained devices.