Estimation of Water Hyacinth Using Computer Vision

The different controls of water hyacinth, an invasive species of tropical and subtropical environ-ments, have demonstrated some limitations requiring additional monitoring tasks to maintain the ecological balance. Therefore, quantifying and valuing this aquatic biomass becomes a sustainable management alternative. However, the water hyacinth estimation remains a challenging task in developing countries with regard to the used methods: empirical relationships between yield and production indices calculated experimentally, structural parameters measured or calculated through specific experiments (not dynamic), etc. These methods lose precision depending on the type of plant, cultural methods and practices and the seasons. Then, it becomes urgent to develop a dynamic estimation method with a proven track record of reliability despite the inconsistency of the factors mentioned above. This article contributes to the improvement of aquatic biomass estimation by proposing a Computer Vision based solution for estimating fresh mass of water hyacinth. To achieve this goal, the morphology of the species is assessed and an XML classifier is developed. This model is then implemented in a mobile app facilitating its end use. The proposed algorithm demonstrated a mean average precision of 96.89%. Considering the recorded level of accurateness, the developed method can be used to estimate different types of biomass.


Introduction
Water hyacinth also called Camalote (Eichhornia crassipes) is an aquatic plant of the Pontederiaceae family of the rivers, canals and lakes of the tropical regions. It is one of fast-growing aquatic plants (National Academy of Sciences of Sudan, 1979).
In favorable conditions, water hyacinth becomes a dominant species, because of its extraordinary rapidity of growth and adaptability to all types of freshwaters environments. Affecting the eco-system balance, for decades, water hyacinth causes several environmental and socio-economic damages in riparian communities (Center et al., 2005;Navarro & Phiri, 2000).
In order to respond to the invasion of Eichhornia crassipes, several management programs have been developed, particularly the approach using natural enemies has been promoted (Fanou et al., 2016;Ajuanu et al., 2003;Harley, 1990).
Despite the encouraging results of a large variety of controls, the species expansion continued, consequently, the water hyacinth management took another turn converting the invasive plant into a source of income (Guezo et al., 2018). The species anatomical properties make it attractive and has led to several industrial applications for a variety of end use (Mahmood et al., 2005). These range from: manufacturing paper, fiberboard (Ghosh et al. 1984), threads and cords, bas-ket, stock feed, fish feed and fertilizer or compost manure (National Academy of Sciences of Sudan, 1979;ACED, 2013), to treatment for polluted water and fauna support (Misbahuddin and Fariduddin 2002;Sotolu 2013), via biogas production, charcoal briquetting (Carnaje et al., 2018;Gopal, 1987;Reddy & Sutton, 1984;Rodrigues et al., 2014;Navarro & Phiri, 2000).
In the study area, the Republic of Benin in West Africa, water hyacinth is valued for compost and energy purposes such as biogas and charcoal briquettes (ACED, 2013). Considering this plant renewability and the very low-cost production, estimating the physical potential of the raw mate-rial becomes necessary in order to predict it energy potential.
In the United States of America Biomass Research and Development Act of 2000, the term biomass is defined as "any organic matter that is available on a renewable or recurring basis, includ-ing agricultural crops and trees, wood and wood wastes and residues, plants (including aquatic plants), grasses, residues, fibers, and animal wastes, municipal wastes, and other waste materials" (United States Code, 2000).
Biomass has the potential to make a valuable contribution to achieving several development objectives in lowincome countries (Chaturvedi, 2004;FAO & UNEP, 2009). Therefore, existing biomass must be quantified in order to explore it possible transformations for yield assessment. However, the accurate biomass estimation remains a challenging task.
Different biomass estimation methods are outlined in the literature (Shi & Liu, 2017). Tree biomass is estimated using allometric equations based on the plant size (diameter and height) and different coefficients (Feldpausch et al., 2011;Peng C et al., 2001). A combination of allometric equation with a diameter distribution function (Weibull function) has helped to increase the bio-mass estimation accurateness (Qi et al., 2017). However, small tree diameter and height are not easy to measure in a large environment for accurate calculation.
Another well-known approach for biomass estimation is the method of mean biomass density (Dixon et al., 1994;Fang et al., 2005). This method is based on empiric measurement of data. One thing to be improved in such a method is the margin of error in the measured biomass density. A "two state-dependent impulse controls model using the intersection points in successor func-tions" is proposed for ecological impact analysis of water hyacinth (Fu & Chen, 2018). Alt-hough, this model is an improvement of ordinary methods based on intersection points, there is a lack of stability in certain circumstances.
All above mentioned statistical methods sometimes lose precision due to the data collection methods and practices, seasons and other structural parameters values. Current new approaches are used for vegetation spreading and infestation monitoring in large scale areas. Those modern approaches use a variety of tools, ranging from remote sensing technologies (Simpson et al., 2020), high resolution satellite imagery to artificial intelligence techniques (Datta et al., 2021;Feng et al., 2020;Pádua et al., 2022;Xie et al., 2008). These works, specifically, address the issue of detection and monitoring for analytical and preventive purposes.
In the current context, there is still considerable scope for developing high accurate methods for better estimation of the existing water hyacinth biomass. Therefore, the aim of this study is to develop a robust method based on computer vision, one of the branches of Artificial Intelligence, to estimate the fresh mass of water hyacinth available in a specific environment. Computer vision technology and applications help to improve the daily lives of humans by modernizing and automating some tasks using computers resources (Minichino & Howse, 2015;Tuceryan & Jain, 1998). This technology reduces the energy and the cost of such tasks. The computer vision algorithms allow object detection in images and are provided in a considerable set of libraries developed in a variety of programming languages. In the past years, considerable progress has been achieved in designing automated systems for vision-based object detection. In this field, Python is one of the leading programming languages recommended by an active community of Artificial Intelligence pioneers (Poole & Mackworth, 2021;Yarlagadda, 2018). The Python OpenCV is positioned as a major real-time optimized Computer Vision library supporting advanced Artificial Intelligence algorithms (Marengoni & Stringhini, 2011;Minichino & Howse, 2015). Among the existing algorithms, the Haar Cascade Classifiers implemented in the OpenCV detection en-gine demonstrates very good performance (Padilla et al., 2012;Singh et al., 2013;Viola & Jones, 2001). Considering the abovementioned relevant advantages, the OpenCV is adopted to gener-ate Cascade XML classifier in this work.

Study Area
This study focuses on the detection of water hyacinth in two regions of South-East Benin in West Africa. Firstly, the Sô river located in the commune of Sô-Ava in southern Benin. The Sô-Ava municipality has a very important hydrographic network which covers almost half of its ter-ritory. The second experimental field is the Songhai center pond in the city of Porto-Novo where the species is well protected.

Materials
Different materials were used to achieve the goal of this study. Some materials helped to collect water hyacinth for various tests and to measure the real fresh mass of the collected plants. A da-taset of water hyacinth pictures, used as positive references for object detection, was compiled using a digital camera. Java, XML and Python are the main programming languages for mobile app development during the project, while the main used software are Android Studio, Anaconda, Spyder and Cascade Trainer GUI. In addition to Tkinter and PyInstaller libraries, OpenCV was used for image analysis and object detection, when the Chaquopy SDK provides interactions with the Python code in the mobile Android App developed in Java.

Computer Vision Process
The Cascade XML classifier is used for the training process. This classifier, introduced by Paul Viola and Michael Jones in 2001, is an effective object detection algorithm used in OpenCV (Minichino & Howse, 2015;Viola & Jones, 2001). Cascade classifiers (XML extension) are trained with multiple samples of "positive" water hyacinth images and arbitrary "negative" images of the same size during the algorithm training stage. The classifier is validated using testing data when the detection results analysis demonstrates very high detection rates (Figure 1).

Positive images
Negative images The training process comprises many states in order to achieve good classification perfor-mance. For each state, a first classifier is created from the positive images and is tested on the negative images. Successively, a second classifier with higher detection rates is created. This training process ends when the classifier in the latest state is constructed. Once the classifier is trained, it can be used to classify a specific region of an image detecting all water hyacinth leaves. Considering a frame, the sliding window can be moved over the image and check each location through the classifier for data detection. This process is a usual image classification ap-proach for object detection (Obukhov, 2011).

Water Hyacinth Mass Calculation
Using the Python's OpenCV library, each image sent to the algorithm is read and subjected to analysis. The generated classifier is used to detect leaves and count them when processing each input image. A code is implemented in the proposed detection algorithm to define the mass of water hyacinth in a specific area.
Based on studies conducted by a team of researchers of the International Institute of Tropical Agriculture (IITA) in Benin Republic, known that the fresh mass per individual water hyacinth plant ranged from 170 to 258 g (Ajuonu et al., 2009). This estimation was confirmed, for the study field, by the density values provided by the researchers of The University of Abomey-Calavi (Faton et al., 2016). According to the authors, this estimation is available for mature plants with at least five unfurled leaves when the species remain free of infestation. Consequently, the fresh mass per individual water hyacinth leaf ranged between 34 and 51.6 g. Based on this information, the average mass per leaf is set to 52g to train the mass calculation algorithm.
The working hypothesis is that water hyacinth coverage is uniform with a specific local density in the study area.
The calculation approach below is used when the working hypothesis is verified. Step 1: Delimit a surface S d in the study area and take a picture for processing.
Step 2: Run the mobile application to: (a) detect the number of leaves in the image; (b) calculate the local density ρ of the leaves in the delimited area S d using the formula (1).
Even though the cascade classifier can be constructed efficiently, detection errors are admitted in any computer vision approach. In this experiment, some background pixels can be misclassified due to color matching with water hyacinth leaf. Therefore, to improve the proposed mass calculation algorithm, a coefficient C is defined. This coefficient represents the corrected average fresh mass per individual water hyacinth leaf. (1) where: ρ: Local water hyacinth density (kg.m -2 ) in the experimental field Q: Quantity of leaves deduced by the detection algorithm; S d : Delimited surface for detection; C: Corrected average fresh mass per leaf.
Step 3: Enter the total surface area S concerned by the study. A GPS module can be used from the mobile app to calculate S if needed. Then, the total fresh mass of water hyacinth M in the surface area S is estimated using the formula (2).

M S
(2) where: M: Total water hyacinth mass in the study area; S: Total surface area; ρ: Local water hyacinth density (kg.m -2 ).
If the water hyacinth does not follow the same distributional patterns in the study area, it's necessary to delimitate the area into N spaces with different apparent densities. Then, using the images of each delimitated area, the detection algorithm may find local densities ρ i before calculating the total fresh mass of water hyacinth using the formula (3).

Mobile Application
A mobile application is designed to facilitate the use of the proposed object detection and mass calculation algorithm. The mobile app is developed in the Java programming language combined with Python and XML using the Android Software Development Kit with associated libraries.  Vol. 12, No. 1;2023 In the proposed two blocks architecture, the graphic part is generated by XML code and the processing part is managed by Python (using OpenCV) and Java. The Chaquopy library runs as a bridge between these two languages for the images processing and the results printing.
When the mobile app runs the first time on the user's smartphone, the needed authorizations are requested to create three different folders for functioning data storage. A main folder is created to store the images that will be processed, when a secondary folder helps to store the cascade classifier XML files used by the OpenCV engine to detect water hyacinth leaves in processed images. All generated data are stored in the third folder.
Two main graphical user interfaces are designed in the mobile app to manage different computing processes. The first main layout (Figure 3) is used to display the images that will be processed by the detection engine. A button gives the possibility to capture directly a new picture or to import images for processing. The navigation bar at the bottom of the layout allows the transition between the different interfaces of the mobile app.
The second main layout displays the processing results depending on the input data ( Figure 4). A core GPS component is implemented for field area measurement using a geolocation processor.

Classifier Training Results
The cascade classifier has a considerably low rate for failing detections (Padilla et al., 2012). However, the detection accuracy depends on the training conditions and inputs. Figure 5 shows an instance of output generated by the detection classifier. The main factors influencing the detection accurateness when training the classifier on the dataset are outlined below.
• The image quality plays an important role in object detection. The detection of water jacinth leaves in high quality picture (with high resolution) is more accurate.
• The water hyacinth leaf size in the image remains an important criterion. The detection of small size object in an image is more erroneous.
• Double or erroneous detections happen sometimes due to false-color band combinations in water hyacinth images.
• The power (RAM memory and processor frequency) of the device used for the algorithm running remains a very determining factor for the results quality.
During this project, the use of high-precision camera and high-performance equipment contribute to achieve good performance.

Experiments in Infested Environment
To test the performance of the proposed mass calculation algorithm using the cascade classifier, some experiments were run on a dataset collected on the Sô river. Experimental records are pre-sented in the next table with the detection algorithm results (Table 1). The recorded mass in table 1 is the real fresh mass of collected plants. The estimated mass is the fresh mass calculated using the proposed objects detection algorithm.
The low level of the recorded mass could be justified by the non-maturity of water hyacinth due to the threat that the water salinity represents for the species.
The average algorithm precision of 81.04% is related to the admitted error when (i) detecting the water hyacinth leaves number and (ii) calculating the total mass.
Analyzing the recorded error rate, the coefficient C in the formula (1) was corrected to improve the accurateness of the mass calculation algorithm.

Experiments in Healthy Environment
To validate the improved algorithm, new experiments were run in the central Songhai pond where the species is not in presence of natural enemies and is at maturity. The new results recorded after the algorithm improvement are presented in the table 2.

Comparative Analysis
Comparing the tables 1 and 2, the recorded fresh mass of water hyacinth in a healthy environment is higher than the recorded mass in an infested area ( Figure 6) regardless of area size. The mean average precision in table 2 (96.89%) is a much improved score. Consequently, the mean local density is higher in the healthy environment ( Figure 7). Water hyacinth during the experimental period (dry season) is not invasive in Benin. Therefore, the study area must be considered as a natural habitat with a moderate quantity of biomass. According to Faton et al. (2016), during the dry season, the fresh density of water hyacinth varies from 12.42 kg.m -2 to 17.5 kg.m -2 . In the experimental healthy environment of this study, the directly recorded density varies from 12.45 kg.m -2 to 12.81 kg.m -2 when the estimated density using the proposed algorithm is ranged from 12.04 kg.m -2 to 12.45 kg.m -2 . Consequently, the experimental findings are consistent with the results of others works and data disclosed by industry players.
Considering the experimental outcomes, the proposed conceptual framework can be generalized for the fresh mass estimation of various biomass. The developed method for biomass estimation is fast and less restrictive, therefore it opens up new perspectives for biomass proliferation control and industrial applications.
To reduce the admitted error (3.11%) in the proposed algorithm precision, the question of calculating the fresh mass of each detected water hyacinth leaf remains. Indeed, all the detected leaves on a stem of water jacith do not have the same shape. Therefore, calculating the fresh mass in a given area by summing the fresh masses of each leaf (estimated using the characteristics of each leaf), will be more accurate than using the local density to estimate the agragated mass based on the total number of detected leaves in the same area.
Another alternative to increase the proposed algprith performance would be to distinguish healthy fresh leaves from less fresh or dry leaves in order to apply the appropriate correction coefficient for each type of leaves.

Conclusion
This study highlights how computer vision can help in the estimation of biomass, particularly the fresh mass calculation of water hyacinth. By applying the constructed XML classifier, the developed algorithm demonstrated an accuracy level of 96.89%. The proposed method can be applied to different types of biomass and could be improved in order to automate the whole estimation process using a drone equipped with digital camera and highperformance processing unit.
The valorization of water hyacinth has become a strategic management approach to control the invasive effects of the species on the aquatic ecosystem. Considering the key role of bioenergy revolution in achieving access to energy in developing countries, water hyacinth is now seen as a non negligible source of biofuel. The biomass transformation process requires the development of dynamic and accurate methods, taking into account all variable characteristics, for the biomass estimation. The use of tools offered by digital technologies remains a major asset in carrying out this task. The computer vision approach proposed in the present work provides new incomes for future ivestigations.
In perspectives, it would be interesting, after more extensive training, to define an extrapolation function that could help to calculate the output mass taking into account the size of detected individual water hyacinth leaf.