3.3. Method III
The data processed using decision trees are the same as in the previous paragraph. Also in this case, as in the previous one, cross-validation was carried out on 10 folds. Furthermore, two scenarios were also considered in this case (five-class scenario and four-class scenario). In
Table 7 and
Table 8, the obtained results are shown.
For the five-class scenario, the decision tree showed high precision for the F-S group, indicating that most predictions for this class were correct. However, slightly lower recall suggests that some F-S examples were not identified. Overall, high precision balanced by moderate recall reflects an accurate but not exhaustive classification of this group. The precision for the F-W group is significantly low, indicating that many predictions for this class were false. The higher recall suggests that the model was able to identify a good portion of the F-W examples, but at the cost of numerous False Positives. The metrics for the W group show moderate performance. Precision and recall are balanced, suggesting that the model has reasonably good classification ability for this class, but not outstanding. The moderate F1 Score indicates that there is room for improvement. For group L, the recall is relatively high, suggesting that the model is able to identify most of the examples of this class. However, the precision is lower, indicating that there are many False Positives. This reflects a good sensitivity of the model but an improved specificity. The R-L group shows high precision and good recall, suggesting that the model is very effective in correctly classifying this class. The high F1 Score reflects a positive balance between precision and recall, indicating a solid performance of the model for this group.
For the four-class scenario, the decision tree reached better results in discriminating Feeding, compared to the previous case. This suggests that the model is very effective at recognizing this combined class, reducing errors that occurred when the classes were separated. The metrics decrease slightly compared to the five-class scenario, with an F1 Score of 55.88%, precision of 48.56%, and recall of 65.80%, indicating that the model continues to have moderate difficulty with this class. As for L and R-L, the model maintains good performance, and the results are comparable with the previous scenario. As with Method II, in this case too, by combining the two classes relating to Feeding, there were significant improvements.
Also in this case, the confusion matrix showed that the model accuracy in recognizing Feeding activity increased significantly when the two classes were combined (
Figure 7).
In this study, three distinct methodologies for classifying the behaviors of grazing cattle were examined: statistical methods, neural networks, and decision trees. Each method offers specific advantages and disadvantages, which must be carefully considered, particularly in relation to the technological and energy constraints typical of rural environments.
Deep Neural Networks (DNNs) are renowned for their high accuracy in classifying animal behaviors. Due to their ability to learn complex representations from data, they can effectively distinguish between different activities of grazing cattle, such as Walking, Feeding and Lying. However, implementing Neural Networks on microcontrollers requires advanced hardware with higher computational power and memory capacity, leading to a significant increase in costs. Additionally, neural networks demand high energy consumption due to the large number of computational operations needed for inference. This is problematic in rural settings where frequent battery recharging is impractical. Therefore, although the neural network approach could lead to higher accuracy in recognizing different behavioral activities, the need to transfer a large amount of raw data to a data processing unit limits its practical application. Moreover, performing edge computing of classification behavioral algorithms in wearable devices is not a real solution because it would increase energy consumption due to the computational costs of neural networks, reducing battery life.
An alternative approach involves transmitting accelerometric raw data to an external server for remote processing. This method leverages the computational power of the cloud to execute complex Machine Learning algorithms, including Deep Learning. However, continuous data transmission necessitates telecommunications networks with high bandwidth capacity, resulting in high energy consumption to maintain connectivity. Furthermore, in grazing areas, 4G and 5G network coverage may be insufficient or entirely lacking, limiting the reliability and feasibility of this approach. In the study conducted by Arcidiacono et al. [
34], it emerged that by adopting Bluetooth Low-Energy (BLE) communication and transmitting the raw data measured by a triaxial accelerometer (raw data), the overall power consumption would be acceptable. In fact, it was found that, by operating at a sending frequency of 10 Hz, the power consumption is about 160 µA. By reducing the frequency, the consumption would be further reduced (10 µA at a frequency of 0.2 Hz). However, as reported in Mancuso et al. [
26], the range covered by BLE is short; therefore in large grazing areas that characterize extensive livestock systems, this solution is not feasible. Certainly, by using repeaters, gateways, and antennas, the range of action can be extended; however, the feasibility of using this communication technique depends on the size of the area to be covered and the availability of a reliable electrical network.
LPWANs could overcome the limits of short-range communication systems for monitoring animal behavior in extensive farms because they can cover large grazing areas (up to 10 km) by using a single repeater while preserving the battery life of wearable devices. However, due to the reduced bandwidth, classification models based on neural networks are not applicable because of the large amount of data that needs to be transmitted.
In contrast, the use of accelerometric thresholds, which can be calculated using both statistical methods and Machine Learning algorithms such as decision trees, represents a more practical and sustainable solution. These methods can be implemented directly in the firmware of microcontrollers, drastically reducing the need to transmit real-time data. Consequently, energy consumption is significantly lower, extending the battery life of the devices. For example, decision trees can be executed with a reduced number of computational operations compared to neural networks, allowing for efficient classification with less powerful and less energy-demanding hardware. Based on research carried out by the authors of this work, statistical methods with classifiers implemented within wearable devices could be suitable to work with LPWANs. Preliminary tests using a prototype of a cows’ behavior monitoring system operating through a LoRa network proved its feasibility, thanks to its low energy consumption. From preliminary tests, operating at a 4 Hz frequency, the energy consumption was found to be nearly 180 µA. Using a high-capacity 6600 mAh Li-SOCL2 battery, this consumption should lead to a battery life of at least 2 years, making the system suitable for the purpose.
However, the use of accelerometric thresholds has certain limitations compared to neural networks. The accuracy of behavior classification can be lower, as these methods tend to rely on less complex features of the data. Moreover, they may not capture the variability and complexity of animal behaviors’ as effectively as neural networks, which can model nonlinear relationships between data features. Another critical aspect to consider is the need for access to a wide variety of data to develop robust and reliable accelerometric thresholds. Unfortunately, access to such data is not always guaranteed, which can limit the ability to generalize models to different grazing conditions and animal behaviors.
In summary, as schematized in
Table 9, while neural networks offer the highest accuracy in classifying grazing cattle behavior, technological and energy constraints make their implementation challenging in rural contexts. Methods based on accelerometric thresholds and Machine Learning, although less accurate, provide a better balance between energy efficiency, cost, and practicality, making them a more suitable solution for analyzing animal behavior in resource-limited environments. Environmental sustainability aspects must be given due consideration. Indeed, as stated by Primi et al. [
35], research attention to the role of ruminant farming in promoting sustainability has grown in recent years. The increasing use of artificial intelligence tools, combined with the development of GPS tracking techniques, enables continuous monitoring and contributes to improving management practices, especially in the case of grazing livestock. Then, the choice of the most appropriate method should consider the specific operational conditions, the available technological resources, and the availability of sufficiently diverse and representative data to train robust models.
In general, by combining inertial sensors with GPS tracking units, the accuracy of animal grazing behavior classification could be significantly increased (Herlin et al. [
36]). For instance, Cabezas et al. [
37] found a weighted accuracy of 0.93 in classifying behavioral activities for grazing cows through collars instrumented with low-cost 3D accelerometers and GPS sensors. These accuracy values are comparable with those obtained using the neural network approach.
In any case, as stated by Bernabucci et al. [
38], by measuring the time animals spend in each behavioral activity, it is possible to obtain indications of their well-being. In fact, unusual behaviors, excessive rest, abnormal gaits, and the absence of neck movements can indicate illness or stress in the animal.