scieee AI-readable full text Open interactive document viewer

Modeling of Path Loss for RadioWave Propagation in Wireless Sensor Networks in Cassava Crops Using Machine Learning

Barrios Ulloa, Alexis,Cama Pinto, Alejandro,De-la-Hoz-Franco, Emiro,Ramírez-Velarde, Raúl,Cama Pinto, Dora

Abstract

Modeling radio signal propagation remains one of the most critical tasks in the planning of wireless communication systems, including wireless sensor networks (WSN). Despite the existence of a considerable number of propagation models, the studies aimed at characterizing the attenuation in the wireless channel are still numerous and relevant. These studies are used in the design and planning of wireless networks deployed in various environments, including those with abundant vegetation. This paper analyzes the performance of three vegetation propagation models, ITU-R, FITU-R, and COST-235, and compares them with path loss measurements conducted in a cassava field in Sincelejo, Colombia. Additionally, we applied four machine learning techniques: linear regression (LR), k-nearest neighbors (K-NN), support vector machine (SVM), and random forest (RF), aiming to enhance prediction accuracy levels. The results show that vegetation models based on traditional approaches are not able to adequately characterize attenuation, while models obtained by machine learning using RF, K-NN, and SVM can predict path loss in cassava with RMSE and MAE values below 5 dB.

Full text

Citation: Barrios-Ulloa, A.; Cama-Pinto, A.; De-la-Hoz-Franco, E.; Ramírez-Velarde, R.; Cama-Pinto, D. Modeling of Path Loss for Radio Wave Propagation in Wireless Sensor Networks in Cassava Crops Using Machine Learning. Agriculture 2023, 13, 2046. https://doi.org/10.3390/ agriculture13112046 Academic Editors: Gniewko Niedbała, Sebastian Kujawa, Magdalena Piekutowska and Tomasz Wojciechowski Received: 15 September 2023 Revised: 10 October 2023 Accepted: 18 October 2023 Published: 25 October 2023 Copyright: © 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/). agriculture Article Modeling of Path Loss for Radio Wave Propagation in Wireless Sensor Networks in Cassava Crops Using Machine Learning Alexis Barrios-Ulloa 1, Alejandro Cama-Pinto 2,* , Emiro De-la-Hoz-Franco 2, Raúl Ramírez-Velarde 3 and Dora Cama-Pinto 4,5,* 1Department of Electronic Engineering, Universidad de Sucre, Sincelejo 700001, Colombia; [email protected] 2Department of Computer Science and Electronics, Universidad de la Costa, Barranquilla 080002, Colombia; [email protected] 3School of Engineering and Sciences, Instituto Tecnológico y de Estudios Superiores de Monterrey, Monterrey 64849, Mexico; rramir[email protected] 4Faculty of Industrial Engineering, Universidad Nacional Mayor de San Marcos, Lima 15081, Peru 5Department of Computer Architecture and Technology, University of Granada, 18071 Granada, Spain *Correspondence: [email protected] (A.C.-P.); [email protected].es (D.C.-P.) Abstract: Modeling radio signal propagation remains one of the most critical tasks in the planning of wireless communication systems, including wireless sensor networks (WSN). Despite the existence of a considerable number of propagation models, the studies aimed at characterizing the attenuation in the wireless channel are still numerous and relevant. These studies are used in the design and planning of wireless networks deployed in various environments, including those with abundant vegetation. This paper analyzes the performance of three vegetation propagation models, ITU-R, FITU-R, and COST-235, and compares them with path loss measurements conducted in a cassava field in Sincelejo, Colombia. Additionally, we applied four machine learning techniques: linear regression (LR), k-nearest neighbors (K-NN), support vector machine (SVM), and random forest (RF), aiming to enhance prediction accuracy levels. The results show that vegetation models based on traditional approaches are not able to adequately characterize attenuation, while models obtained by machine learning using RF, K-NN, and SVM can predict path loss in cassava with RMSE and MAE values below 5 dB. Keywords: agriculture; cassava crops; machine learning; radio wave propagation models; wireless sensor networks 1. Introduction Agriculture is an activity of great relevance in several countries, and in many of them, it is considered a priority within their national security policies because of its importance in sustaining the population [ 1 ]. Like other industrial sectors, agriculture has undergone a significant evolution in the last two decades, transitioning from a model based on variable monitoring to one of greater autonomy and automation in cultivation. This evolution can encompass the entire production chain, from planting to the final marketing stage [ 2 ]. In this regard, precision agriculture (PA) is one of the most significant concepts in the modern agricultural industry, owing to the adoption of management strategies that enable the collection, processing, and analysis of data. All of this is aimed at enhancing the sustainability of production in the cultivation fields [ 3 ]. To achieve this, it makes use of different electronic tools and information and communication technologies (ICT), including machine learning (ML) and wireless sensor networks (WSN), which have been increasingly used in the agricultural sector in recent years [4,5]. The implementation of WSNs in agriculture allows farmers to remotely monitor large areas of the plantation, providing information that improves decision-making and Agriculture 2023,13, 2046. https://doi.org/10.3390/agriculture13112046 https://www.mdpi.com/journal/agriculture Agriculture 2023,13, 2046 2 of 15 optimizes the economic performance of the activity [ 6 ]. However, the efficient transmission of the data obtained depends to a large extent on the correct deployment of the motes in the field [ 7 ], also allowing infrastructure costs not to increase because of a higher-than-required node usage or, on the contrary, inefficient coverage in the field because of a lower number of motes than needed [ 8 ]. Hence, it is necessary to efficiently model the radio signal losses caused by the path and the environment in which the WSN infrastructure is deployed [ 9 ]. Based on the above, WSN planning demands the utilization of suitable propagation models that optimize the deployment of sensor nodes in the field. Each scenario with vegetation presence (e.g., crop fields) possesses unique propagation characteristics that impact radio signal attenuation. In addition to frequency and distance, which are generally considered the main attenuating factors of wireless signals, other factors stand out, such as plant height and the presence of leaves [10]. Various radio wave propagation models have been developed for use in crop environments or where vegetation is present. Examples include those based on the MED (exponential decay model), among which stand out the ITU-R (recommended by the International Telecommunication Union), the FITU-R (ITU-R adjusted), and COST-235 (Cooperation in Science and Technology 235). Despite their recognition and widespread use, their implementation can produce results with high levels of error [5,11]. 1.1. Background Cassava (Manihot esculenta) is nowadays considered a very relevant product to ensure food sustainability. It is grown in more than 100 countries and is reputed to be an excellent and inexpensive source of nutrition [ 12 ]. Additionally, it serves as input in the industrial production of starch, alcohol, and fermented beverages [ 13 ]. Regarding the implementation of ICTs and electronic tools, there are not many specific developments for this type of cultivation. In [ 14 ], they implemented an agronomic variable monitoring system using WSN in a municipality located in the northern region of Colombia, while other studies focused on leaf disease detection through deep learning [ 15 ] or deep neural networks [ 16 ]; however, only in [ 17 ] do they utilize sensors and the Internet of Things (IoT) as part of a comprehensive solution aimed at PA. Regarding radio wave propagation, the systematic literature review does not show any evidence of comparative studies or the development of propagation models in cassava plantations. However, these investigations have been conducted in a wide variety of crops; such is the case with corn [ 6 ], rice [ 18 ], sugarcane [ 19 ], banana [ 20 ], oil palm [ 21 ], citrus [ 22 ], and various greenhouse products like cucumber [23] and tomato [8]. In relation to the techniques used in the development of propagation models, there is a growing trend in the use of ML, which is one of the most representative and powerful subfields of artificial intelligence. ML can identify patterns and detect correlations between variables in a large dataset [ 24 ]. Some examples applied in research related to characterizing behavior using these types of techniques in vegetation-present environments have considered settings with a predominance of grasslands [ 19 ], forests [ 25 ], or greenhouse tomato crops [26]. 1.2. Motivation and Objectives This paper presents the results of a radio channel measurement campaign in a cassava crop on a farm near the city of Sincelejo, Sucre, Colombia. Based on the data collected, traditional vegetation models were compared to assess their effectiveness in cassava plantations. As mentioned in the previous section, there are no prior records of similar studies in this type of cultivation. Only [ 14 ] obtained received signal strength indicator (RSSI) values but did not characterize the attenuation caused by the plants. Given the above and considering the significance of cassava cultivation, it is necessary to understand the radio signal propagation behavior in these plantations, which will facilitate the future implementation of AP-oriented technologies. The main contributions of this research are as follows: Agriculture 2023,13, 2046 3 of 15 • We have analyzed the effectiveness of widely recognized vegetation propagation models based on measurements in a real scenario, leaving aside the simulations chosen by some studies; • We present the results of the modeling of radio wave propagation in cassava crops obtained by ML from data collected in a cassava crop. The rest of the paper is organized as follows: Section 2presents the methodology and materials used in obtaining and analyzing the data; Section 3shows the comparative analysis between different models and the results of the ML propagation modeling; finally, Section 4contains the discussion. 2. Materials and Methods This section first presents the vegetation loss models considered in the comparative analysis to determine their effectiveness in predicting attenuation in cassava crops. Below, we describe the testing environment, as well as the tools used in both the measurement and evaluation of the results. Finally, we present an overview of the ML techniques used in propagation modeling. 2.1. Vegetation Propagation Models There are a large number of models of radio wave propagation. They can be obtained empirically, stochastically, or deterministically. When transceiver equipment is in scenarios with significant vegetation or foliage presence (e.g., forests, crops, or gardens), it is important to consider their effect on attenuation. Additionally, there are significant differences in the arrangement of signal-obstructing elements in various environments, as well as their physical and geometrical characteristics, preventing the use of a generalized method for predicting losses [ 27 ]. However, there are recognized and widely used models for estimating attenuation caused by vegetation. The COST-235 model is derived from the MED and is one of the most widely used models to characterize the signal attenuation caused by bushes in radio propagation. One of its main features is to consider the presence or absence of leaves on plants. The equation for this model is given in Equation (1) [28]: PLCOST−235(dB)=(15.6 ×f−0.009 ×d0.26 on the leaves 26.6 ×f0.2 ×d0.5 out o f the leaves (1) where fis the operating frequency given in MHz, and dis the distance between the transmitting antenna (Tx) and the receiving antenna (Rx) in meters. A relevant condition of this model is that it can be used for distances of up to 200 m [ 29 ]. Like the COST-235 model, the ITU-R model is derived from the MED and is widely used to model radio channel losses in vegetated environments. It is suggested to use this when antennas are located near bushes and a significant part of the signal propagates through the foliage [ 30 ]. Equation (2) expresses the losses of this model [31]. PLITU−R(dB)=0.2 ×f0.3 ×d0.6 (2) where fis the frequency in MHz, and dis the distance in meters. In this model, the distance between Tx and Rx should not exceed 400 m [ 31 ]. A modification of the ITU-R model is the ITUF-R model, derived from measurements in the 11.2 GHz to 20 GHz range. It takes into account the presence of leaves in the bush [32]. Equation (3) shows this [33]: PLFITU−R(dB)=(0.39 ×f0.39 ×d0.25 on the leaves 0.37 ×f0.18 ×d0.59 out o f the leaves (3) where fis expressed in MHz and din meters. Like ITU-R, the adjusted model considers a maximum distance of 400 m between Tx and Rx. Another model widely used in this type Agriculture 2023,13, 2046 4 of 15 of study is free space path loss (FSPL). This is not a vegetative model, and it assumes ideal propagation. Equation (4) allows the calculation of free space losses [34]. FSPL(dB)=32.44 +20 logd+20log f(4) where distance is expressed in kilometers and frequency in Megahertz. 2.2. Measuring Equipment and Methodology To analyze the propagation characteristics of the wireless channel, RSSI data were collected in a bitter cassava crop, which is mainly used as a raw material for starch production. The measurements were taken on a farm in the rural area of Sincelejo, capital of the department of Sucre, one of the largest producers in Colombia. The measurements were conducted on sunny days during the second planting period (August to March) at coordinates 9◦2005300 N latitude and 75◦25003300 W longitude (see Figure 1). Agriculture 2023, 13, x FOR PEER REVIEW 4 of 15 where f is expressed in MHz and d in meters. Like ITU-R, the adjusted model considers a maximum distance of 400 m between Tx and Rx. Another model widely used in this type of study is free space path loss (FSPL). This is not a vegetative model, and it assumes ideal propagation. Equation (4) allows the calculation of free space losses [34]. 𝐹𝑆𝑃𝐿(𝑑𝐵)=32.44+20log𝑑+20log𝑓 (4) where distance is expressed in kilometers and frequency in Megahertz. 2.2. Measuring Equipment and Methodology To analyze the propagation characteristics of the wireless channel, RSSI data were collected in a bitter cassava crop, which is mainly used as a raw material for starch production. The measurements were taken on a farm in the rural area of Sincelejo, capital of the department of Sucre, one of the largest producers in Colombia. The measurements were conducted on sunny days during the second planting period (August to March) at coordinates 9°2″53″ N latitude and 75°25″33″ W longitude (see Figure 1). Figure 1. Geographical location of the measurement site. The cassava bushes were planted in a commonly used arrangement for this type of crop, with 120 cm between rows and 93 cm between plants. Figure 2 depicts the positioning of bushes in the selected cultivation. The measurement campaign was carried out using Digi Xbee XK3-Z8S-WZM transceiver modules operating on the IEEE 802.15.4 standard, capable of functioning as both Tx and Rx in the 2400 MHz band. The antennas at both ends are omnidirectional, which are commonly used in WSN deployments in agricultural environments [8]. The system parameters are presented in Table 1. Figure 1. Geographical location of the measurement site. The cassava bushes were planted in a commonly used arrangement for this type of crop, with 120 cm between rows and 93 cm between plants. Figure 2depicts the positioning of bushes in the selected cultivation. The measurement campaign was carried out using Digi Xbee XK3-Z8S-WZM transceiver modules operating on the IEEE 802.15.4 standard, capable of functioning as both Tx and Rx in the 2400 MHz band. The antennas at both ends are omnidirectional, which are commonly used in WSN deployments in agricultural environments [8]. The system parameters are presented in Table 1. Table 1. System parameters. Parameter Value Frequency 2400 MHz Antenna gain 2.1 dBi Transmission power 8 dBm Receiver sensitivity −103 dBm Antenna type Omnidirectional Agriculture 2023,13, 2046 5 of 15 Agriculture 2023, 13, x FOR PEER REVIEW 5 of 15 Figure 2. Arrangement of cassava plants in the crop. Table 1. System parameters. Parameter Value Frequency 2400 MHz Antenna gain 2.1 dBi Transmission power 8 dBm Receiver sensitivity −103 dBm Antenna type Omnidirectional Data were collected and stored during three stages of bush growth. In each round, the Tx and Rx antennas were adjusted to heights of 80 cm, 130 cm, and 180 cm, with no obstructions other than the crop itself. The transmitting antenna was positioned at a fixed point, and the receiver was moved in 5 m increments, with equal antenna heights at each step. At each measurement point, 20 RSSI values were obtained and averaged, and additionally, tests were conducted with the transmission of 100 packets at intervals of 1000 ms. Because the spaces between rows of plants are commonly used as pathways by the individuals responsible for the plantation, the nodes were positioned along the rows of bushes. The receiver was moved until it reached the maximum distance between the rows of the crop, which in this case was 50 m, or until packet losses were recorded. The information obtained was stored on a computer connected to the transmitter module via USB. Figure 3a,b show a diagram of the applied set-up and the arrangement of the equipment in the culture. Since the geographical area where the measurements were taken has limited mobile phone coverage by the operators providing service in the region, it was decided not to upload the data to any cloud platform. Instead, the data were backed up and isolated on an external memory stick, thus ensuring data protection. Figure 2. Arrangement of cassava plants in the crop. Data were collected and stored during three stages of bush growth. In each round, the Tx and Rx antennas were adjusted to heights of 80 cm, 130 cm, and 180 cm, with no obstructions other than the crop itself. The transmitting antenna was positioned at a fixed point, and the receiver was moved in 5 m increments, with equal antenna heights at each step. At each measurement point, 20 RSSI values were obtained and averaged, and additionally, tests were conducted with the transmission of 100 packets at intervals of 1000 ms. Because the spaces between rows of plants are commonly used as pathways by the individuals responsible for the plantation, the nodes were positioned along the rows of bushes. The receiver was moved until it reached the maximum distance between the rows of the crop, which in this case was 50 m, or until packet losses were recorded. The information obtained was stored on a computer connected to the transmitter module via USB. Figure 3a,b show a diagram of the applied set-up and the arrangement of the equipment in the culture. Agriculture 2023, 13, x FOR PEER REVIEW 6 of 15 (a) (b) Figure 3. (a) Schematic of the measurement system in place and (b) arrangement of the cassava plants in the crop. 2.3. Machine Learning Techniques In machine learning, there are mainly two learning methods: supervised and unsupervised. The former requires initial data to detect patterns, while the latter learns the variable space without the use of labeled data [35]. In this research, we calculate the radio signal loss between a transmitter and a receiver in a cassava crop using a supervised approach with techniques that determine the attenuation from a set of measurements with varying values of distance, plant height, and antenna height. One of the simplest and most widely used methods in supervised learning is linear regression (LR), where the prediction is made from the weighted sum of the input features and a constant called the intercept, as shown in Equation (5). 𝑦=𝛽0+𝛽1𝑥1+𝛽2𝑥2+...+𝛽𝑛𝑥𝑛, (5) where 𝑦 is the variable to predict, 𝛽𝑖 are the model parameters, 𝑥𝑖 is the i-th value of the features, and n is the number of features. The goal when training an LR model in ML is to find a value beta that minimizes the error [36]. Another advantage of LR is that models using this technique are less likely to overfit the data. However, as a drawback, it exhibits high sensitivity to outliers. Support vector machine (SVM) is another regression technique widely used in ML but more advanced than LR. In SVM, the goal is to fit a hyperplane in a high-dimensional space that maximizes the distance to the nearest training data points of any class [37]. The hyperplane in the feature space can be described as the linear function shown in Equation (6) [38]. 𝑓(𝑥)=𝑤𝑇𝑥+𝑏, (6) where w corresponds to the vector determining the direction of the hyperplane, x is the input feature vector, and b is the bias term. The prediction function is presented in Equation (7). 𝑓(𝑥)=∑(𝑎𝑖−𝑎𝑖∗)𝐾(𝑥𝑖,𝑥)+𝑏 𝑁 𝑖=1 , (7) where 𝑎𝑖 and 𝑎𝑖∗ are the Lagrange multipliers, 𝐾 represents the kernel used in the mapping, and i represents the sample number. Unlike other regression techniques, SVM is less sensitive to outliers in the data [39] but is dependent on the kernel used and data scaling Figure 3. ( a ) Schematic of the measurement system in place and ( b ) arrangement of the cassava plants in the crop. Agriculture 2023,13, 2046 6 of 15 Since the geographical area where the measurements were taken has limited mobile phone coverage by the operators providing service in the region, it was decided not to upload the data to any cloud platform. Instead, the data were backed up and isolated on an external memory stick, thus ensuring data protection. 2.3. Machine Learning Techniques In machine learning, there are mainly two learning methods: supervised and unsupervised. The former requires initial data to detect patterns, while the latter learns the variable space without the use of labeled data [ 35 ]. In this research, we calculate the radio signal loss between a transmitter and a receiver in a cassava crop using a supervised approach with techniques that determine the attenuation from a set of measurements with varying values of distance, plant height, and antenna height. One of the simplest and most widely used methods in supervised learning is linear regression (LR), where the prediction is made from the weighted sum of the input features and a constant called the intercept, as shown in Equation (5). y=β0+β1x1+β2x2+. . . +βnxn, (5) where y is the variable to predict, βi are the model parameters, xi is the i-th value of the features, and nis the number of features. The goal when training an LR model in ML is to find a value beta that minimizes the error [ 36 ]. Another advantage of LR is that models using this technique are less likely to overfit the data. However, as a drawback, it exhibits high sensitivity to outliers. Support vector machine (SVM) is another regression technique widely used in ML but more advanced than LR. In SVM, the goal is to fit a hyperplane in a high-dimensional space that maximizes the distance to the nearest training data points of any class [ 37 ]. The hyperplane in the feature space can be described as the linear function shown in Equation (6) [38]. f(x)=wTx+b, (6) where wcorresponds to the vector determining the direction of the hyperplane, xis the input feature vector, and bis the bias term. The prediction function is presented in Equation (7) . f(x)= N ∑ i=1 (ai−a∗ i)K(xi,x)+b, (7) where ai and a* i are the Lagrange multipliers, K represents the kernel used in the mapping, and irepresents the sample number. Unlike other regression techniques, SVM is less sensitive to outliers in the data [ 39 ] but is dependent on the kernel used and data scaling [ 38 ]. Due to its advantages and effectiveness, SVM is a supervised learning technique successfully used in predicting path loss in various scenarios [40]. K-nearest neighbors (K-NN) is a technique that can be used in both regression and classification problems. It makes predictions on test vectors based on the learning obtained from training vectors [ 41 ]. K-NN uses distance functions as metrics to calculate the mean of the numerical target of the k-nearest neighbors. Equations (8)–(10) show the distance functions used in K-NN [42]. Euclidean :D=v u u t k ∑ i=1 (xi−yi)2, (8) Manhattan :D=∑|xi−yi|, (9) Agriculture 2023,13, 2046 7 of 15 Minkowski :D= v u u t k ∑ i=1 (|xi−yi|)q  1 q ,q≥1, (10) where xis the measured value, and yis the predicted value. Although K-NN is a method that can yield good results when fitting the data, the computational effort increases as the size of the data used grows [42]. The fourth technique considered in this research is random forest (RF). It is a nonparametric approach used in regression and classification tasks and was developed as an improvement over decision trees [ 43 ]. Instead of using a single tree, random forest (RF) creates a ‘forest’ of random trees, each trained on a random sample of the data and a random selection of features. The predictions from all the trees are used to generate a final prediction [ 40 , 44 ]. Each new prediction at a point xwith RF is obtained by taking the mean value of the predictions of each tree, ^ f1. . . ˆ fNTree , as shown in Equation (11) [45]. ˆ fRF(x)=1 NTree NTree ∑ K=1 ˆ fK(x), (11) These techniques, along with others in the field of ML, can be considered valid alternatives when modeling radio wave propagation in different scenarios. However, since no validation method allows the best one to be selected in advance, it is common practice to try different algorithms to see which one performs better for a given problem [ 41 ]. Therefore, due to the amount of data and variables used in the training process, as well as the ease of implementation, interpretation, and computational efficiency, the following algorithms have been chosen for this research: LR, SVM, K-NN, and RF. 3. Results 3.1. Comparison of Models We evaluated the effectiveness of the vegetative models presented in Section 2.1 by comparing them with results obtained from the measurement campaign. Since it is preferable to monitor the crop from the beginning of the planting process, measurements were taken at three different stages of average plant growth (50 cm, 150 cm, and 190 cm ). The obtained RSSI values indicate that the radio signal range was greater when the antennas were configured at heights of 180 cm for plant sizes of 50 cm and 150 cm, as they exhibited line-of-sight (LoS) conditions. However, during the stage of maximum bush growth and with the same configuration of experimental conditions applied in the first two measurement stages, the best coverage was achieved with antennas placed 80 cm above ground level. The path loss was calculated from the RSSI measurements at each measurement point using Equation (12). PL(dB)=PTx +GTx +GRx −PRx, (12) where P Tx is the transmission power, G Tx and G Rx are the gains of the transmitter and receiver antennas, respectively, and P Rx is the received power at the receiver determined from the RSSI. Since the vegetative models only consider the loss caused by foliage and not the total loss along the link, the analysis was complemented with the free space path loss (FSPL) model to calculate the total attenuation along the path [ 46 , 47 ]. Figure 4a–c depict the behavior of the measured losses concerning the measurement distance in each of the three stages of cultivation where measurements were taken, along with the estimations obtained using the vegetative models. Agriculture 2023,13, 2046 8 of 15 Agriculture 2023, 13, x FOR PEER REVIEW 8 of 15 level. The path loss was calculated from the RSSI measurements at each measurement point using Equation (12). 𝑃𝐿(𝑑𝐵)=𝑃𝑇𝑥+𝐺𝑇𝑥+𝐺𝑅𝑥−𝑃𝑅𝑥, (12) where PTx is the transmission power, GTx and GRx are the gains of the transmitter and receiver antennas, respectively, and PRx is the received power at the receiver determined from the RSSI. Since the vegetative models only consider the loss caused by foliage and not the total loss along the link, the analysis was complemented with the free space path loss (FSPL) model to calculate the total attenuation along the path [46,47]. Figure 4a–c depict the behavior of the measured losses concerning the measurement distance in each of the three stages of cultivation where measurements were taken, along with the estimations obtained using the vegetative models. (a) (b) Agriculture 2023, 13, x FOR PEER REVIEW 9 of 15 (c) Figure 4. Path loss as a function of distance with bush heights of (a) 50 cm, (b) 150 cm, and (c) 190 cm. Additionally, the root mean square error (RMSE) was calculated, which is one of the most used tools for evaluating the effectiveness of radio wave propagation models. This is presented in Equation (13). 𝑅𝑀𝑆𝐸=√1𝑁×∑(𝑥𝑖−𝑥𝑖)2, 𝑁 𝑖=1 (13) where 𝑥𝑖 and 𝑥𝑖 are the measured and predicted values, respectively, and N corresponds to the number of samples. In this case, the higher the RMSE value, the lower the ability of the models to accurately predict actual crop losses. Figure 4a–c, along with the obtained RMSE, indicate that in all measurement stages and for each antenna height configuration, the FSPL+FITU-R combination underestimated the measurements, reaching minimum RMSE values of 19.99 and maximum values of 29.86. For FSPL+ITU-R, it underestimated the losses in stages 1 and 3, but the RMSE decreased to values of 8.72 and 19.05, respectively. Meanwhile, in stage 2, it overestimated the measurements when the antennas were placed at 80 cm and 130 cm above the ground and underestimated them at 190 cm, giving an RMSE of 15.21. Finally, FSPL+COST-235 exhibited the best performance in stages 1 and 3, achieving the lowest error values in estimating the losses. It showed a trend of losses with values higher than the measurements and RMSE of 6.81 and 6.39, respectively. However, in stage 2, the estimation error increased, reaching a value of 17.4. These results show that the propagation and the range of the modules are affected by the modifications of the different experimental conditions that have been proposed. Furthermore, the vegetative models considered in this study do not estimate cassava crop losses with error levels considered acceptable. Therefore, it is necessary to adjust or develop a model for this specific environment. 3.2. New Model In this study, we calculated the loss of radio signals between a transmitter and a receiver in a cassava crop using a supervised approach with algorithms that determine attenuation based on a series of measurements at different distances, plant heights, and antenna heights. The correlation matrix with the contribution of each attribute considered in the study is shown in Figure 5. It is observed that losses in cassava crops are highly affected by clearing losses (considering frequency and distance), followed by cassava bush height and antenna height. Figure 4. Path loss as a function of distance with bush heights of ( a ) 50 cm, ( b ) 150 cm, and ( c ) 190 cm. Agriculture 2023,13, 2046 9 of 15 Additionally, the root mean square error (RMSE) was calculated, which is one of the most used tools for evaluating the effectiveness of radio wave propagation models. This is presented in Equation (13). RMSE =v u u t1 N× N ∑ i=1 (xi−ˆ xi)2, (13) where xi and ˆ xi are the measured and predicted values, respectively, and Ncorresponds to the number of samples. In this case, the higher the RMSE value, the lower the ability of the models to accurately predict actual crop losses. Figure 4a–c, along with the obtained RMSE, indicate that in all measurement stages and for each antenna height configuration, the FSPL+FITU-R combination underestimated the measurements, reaching minimum RMSE values of 19.99 and maximum values of 29.86. For FSPL+ITU-R, it underestimated the losses in stages 1 and 3, but the RMSE decreased to values of 8.72 and 19.05, respectively. Meanwhile, in stage 2, it overestimated the measurements when the antennas were placed at 80 cm and 130 cm above the ground and underestimated them at 190 cm, giving an RMSE of 15.21. Finally, FSPL+COST-235 exhibited the best performance in stages 1 and 3, achieving the lowest error values in estimating the losses. It showed a trend of losses with values higher than the measurements and RMSE of 6.81 and 6.39, respectively. However, in stage 2, the estimation error increased, reaching a value of 17.4. These results show that the propagation and the range of the modules are affected by the modifications of the different experimental conditions that have been proposed. Furthermore, the vegetative models considered in this study do not estimate cassava crop losses with error levels considered acceptable. Therefore, it is necessary to adjust or develop a model for this specific environment. 3.2. New Model In this study, we calculated the loss of radio signals between a transmitter and a receiver in a cassava crop using a supervised approach with algorithms that determine attenuation based on a series of measurements at different distances, plant heights, and antenna heights. The correlation matrix with the contribution of each attribute considered in the study is shown in Figure 5. It is observed that losses in cassava crops are highly affected by clearing losses (considering frequency and distance), followed by cassava bush height and antenna height. Agriculture 2023, 13, x FOR PEER REVIEW 10 of 15 Figure 5. Correlation matrix. In the proposed methodology, we selected 70% of the dataset for training and 30% for testing, applying this procedure with the evaluated techniques LR, K-NN, SVM, and RF. In the case of K-NN, the used kernel was optimal with k-neighbors equal to 16, while in SVM, the implemented kernel is a radial basis function, with data scaling. Regarding RF, we adjusted the number of trees to 20. Taking into account the evaluation metrics used in similar studies [38,48–50], in this work, we have considered the RMSE presented in Section 3, as well as the mean absolute error (MAE) and the coefficient of determination (referred to as R2), calculated using Equations (14) and (15), respectively. 𝑀𝐴𝐸=1𝑛∑𝑥𝑖−𝑥𝑖 𝑛 𝑖=1 , (14) 𝑅2=∑ (𝑥𝑖−𝑥)2 𝑛𝑖=1 ∑ (𝑥𝑖−𝑥)2 𝑛𝑖=1 , (15) where 𝑥𝑖, 𝑥, and 𝑥𝑖 are the measured values, mean of the values, and predicted values, respectively. Additionally, n represents the number of samples. In the case of RMSE and MAE, the models exhibit a better fit of the data as they tend toward zero, while in the case of R2, it indicates that it is capable of accurately representing the data as it tends toward 1. The performance of the models obtained from the use of LR, K-NN, SVM, and RF with the training and testing dataset is presented in Table 2. The results of the metrics indicate that the models obtained from RF, K-NN, and SVM predict path losses in the studied crop with low levels of error, significantly outperforming the vegetative models UIT-R, FITU-R, and COST-235. However, when using LR as an algorithm in ML, the error values increase considerably, making it the technique with the poorest performance. Table 2. Performance comparison of ML models Model RMSE MAE R2 LR 8.81 7.29 0.4650 K-NN 2.62 1.76 0.9575 SVM 2.66 1.85 0.9507 RF 2.51 1.78 0.9604 Further analysis of the results reveals that RF offers the best performance (RMSE = 2.51, MAE = 1.78, and R2 = 0.9604). The evaluation metrics demonstrate that K-NN can perform regression based on the training data, with minimal variation compared to the results obtained with RF. As for the SVM using the radial basis function, it is evident that it is also capable of accurate path loss predictions in the study scenario, keeping the RMSE and MAE values below 5 dB and an R2 slightly above 95%. In addition, Figure 6a–d show the scatter plots of the values, showing the difference between the expected prediction and the results obtained with the models. Black lines represent ideal predictions for each Figure 5. Correlation matrix. In the proposed methodology, we selected 70% of the dataset for training and 30% for testing, applying this procedure with the evaluated techniques LR, K-NN, SVM, and RF. In the case of K-NN, the used kernel was optimal with k-neighbors equal to 16, while in SVM, the implemented kernel is a radial basis function, with data scaling. Regarding RF, we adjusted the number of trees to 20. Taking into account the evaluation metrics