Python algorithm package for automated Estimation of major legume root traits using two dimensional images - Ghimire, Amit; Chung, Yong Suk; Jeong, Sungmoon; Kim, Yoonha (Scientific reports, 2025)
A simple Python algorithm was used to estimate the four major root traits: total root length (TRL), surface area (SA), average diameter (AD), and root volume (RV) of legumes (adzuki bean, mung bean, cowpea, and soybean) based on two-dimensional images. Four different thresholding methods; Otsu, Gaussian adaptive, mean adaptive and triangle threshold were used to know the effect of thresholding in root trait estimation and to optimize the accuracy of root trait estimation. The results generated by the algorithm applied to 400 legume root images were compared with those generated by two separate software (WinRHIZO and RhizoVision), and the algorithm was validated using ground truth data. Distance transform method was used for estimating SA, AD, and RV and ConnectedComponentsWithStat function for TRL estimation. Among the thresholding methods, Otsu thresholding worked well for distance transform, while triangle threshold was effective for TRL. All the traits showed a high correlation with an R² ≥0.98 ( p < 0.001 ) with the ground truth data. The root mean square error (RMSE) and mean bias error (MBE) were also minimal when comparing the algorithm-derived values to the ground truth values, with RMSE and MBE both < 10 for TRL, < 6 for SA, and < 0.5 for AD and RV. This lower value of error metrics indicates smaller differences between the algorithm-derived values and software-derived values. Although the observed error metrics were minimal for both software, the algorithm-derived root traits were closely aligned with those derived from WinRHIZO. We provided a simple Python algorithm for easy estimation of legume root traits where the images can be analyzed without any incurring expenses, and being open source; it can be modified by an expert based on their requirements.