{'fraction_non_alphanumeric': 0.02119771096961393, 'fraction_numerical': 0.003304586120738293, 'mean_word_length': 5.228915662650603, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Accelerometer based solution for precision livestock farming: geolocation enhancement and animal activity identification

The rapid evolution of electronics and communication technologies in the last years has contributed to the expansion of Precision Livestock Farming applications. In this context, animal geolocation systems applied to extensive farming are interesting for farmers to optimize their daily work organization. Nevertheless, the deployment of these solutions implies several technical challenges which must be resolved, mainly the energy consumption and the suitability of the communication protocols. A recently developed solution that deals with these technical challenges is the e-Pasto platform, which is composed of low power geolocation devices embedded into collars that offer an energetic autonomy of at least seven months, completed with a visualization user interface. The autonomy is assured employing a duty-cycle operation that results in one geolocation position measurement per hour. This work studies the employ of accelerometers to overcome this limitation assuring, at the same time, the required autonomy for the geolocation device. The authors also propose an algorithm that processes the acceleration data in order to identify the steps of an individual. The whole solution (step identification and geolocation) has been validated by means of several experimental tests.


Introduction
From several years, Precision Livestock Farming (PLF) applications have known an increasing deployment mainly due to the evolution of the Information and Communication Technologies and to the miniaturization of the electronic devices. In this frame, the organization of farmers' daily work could be optimized by means of tools capable of locating their animals in real time over large area surfaces. In fact, this kind of applications offers to the farmer the capacity to survey remotely its cattle avoiding unnecessary displacements and, in addition, to define virtual fences in order to better manage the pasture resources.
Nowadays, a significant number of geolocation solutions are based on electronic devices, embedded into collars carried by animals, combined with wireless communication networks that transmit the collected data. Nevertheless, the application of these systems to extensive farming in high mountain pastures implies some technical challenges which must be resolved, mainly the energy consumption and the suitability of the needed communication protocols. In this context, this paper presents an accelerometer based solution that improves the energy efficiency of embedded geolocation devices, allowing at the same time a basic animal activity identification.
The document is structured as follows. Section 2 presents the main technical challenges of animal geolocation in mountain pastures and the e-Pasto platform. The proposed accelerometer based solution is presented in Section 3, along with the obtained experimental results. Finally, Section 4 concludes this paper.

Technical challenges
Geolocation embedded electronic devices, usually carried by the animals, and wireless communication networks that transmit the collected position data to the final user, are the basic technologies needed to implement an animal geolocation system. If the geolocation procedure must be performed in large area mountain pastures, applied to extensive farming, there are a number of technical challenges to be resolved.
The main constraint is the energy autonomy of the embedded devices, mainly impacted by the Global Navigation Satellite Systems (GNSS) which are relatively power-hungry. Several methods can be applied to overcome this problem [1,2], such as increasing the battery capacity (and thus the size and weight of the device), energy harvesting technologies (which are not yet very mature) or the application of a duty-cycle strategy to measure the geolocation positions. This last method obliges to fix a trade-off to assure both the highest autonomy and the maximum number of collected positions. Therefore, the main drawbacks of duty-cycle strategy, considering the autonomy constraint, could be the reduced number of collected position points and the restricted precision.
Concerning the wireless communication networks, the proposed solutions are, in general, based on the existent wireless technologies, such as GSM, WiFi or ZigBee [3]. Nevertheless, in high mountain pastures, it is not always possible to guaranty the correct coverage using these technologies. Moreover, the energy consumption of some of these protocols is excessive for battery powered embedded electronics, limiting even more the energy autonomy of the geolocation devices.

The e-Pasto platform
An interesting example of animal geolocation system for extensive farming in mountain pastures, which deals, at the same time, with the number of measured positions and the battery autonomy of the devices, is the "e-Pasto" platform [4]. Two main parts compose the e-Pasto solution: the geolocation devices and the visualization user interface.
The geolocation devices, which are embedded into a collar carried by the animals as illustrated by figure 1, determine the position via the GNSS module and, afterwards, the collected positions are sent to a central server by means of the long range low power wireless network developed by SIGFOX © . As shown in figure 2, the visualization interface allows farmers to see the animals' measured positions, as well as other statistical data such as the daily distances covered by each animal. The user can also define virtual fences in the interface to delimit the authorized zones for their animals. If an animal goes out of the authorized area, an alarm message is sent to the concerned farmer. This interface can be accessed from computers or portable devices, such as laptops or smartphones.  The correct operation of the overall platform has been validated by means of experimental tests carried out in mountain pastures of France and Spain in 2013 and 2014. The main enhancement provided by the e-Pasto platform concerns the autonomy of the embedded electronic devices, which reaches at least 7 months ensuring, at the same time, the collection of geolocation data in wide surface pastures, along with an innovative long range and low power wireless communication network. Nonetheless, this solution is constrained by its duty cycle operation, which limits the animal position acquisition to one measurement per hour. This duty cycle strategy is very interesting in order to reduce the overall power consumption of the geolocation devices, but it could decrease the interest of users in this kind of systems. Certainly, with this strategy it is not possible to collect geolocation data between two programmed position measurements, even if animals have covered long distances during this period. In addition, the duty cycle implies a continuous position acquisition, procedure which is not optimized to ensure an energy efficient geolocation data measurement especially during the night, when animals stay almost at the same location.

Application of accelerometers to improve the geolocation solution
The solution proposed to improve the e-Pasto performances is to incorporate an accelerometer to the geolocation device. In this manner, geolocation positions measurement is only activated when the accelerometer detects a precise movement of the animal, procedure which is more efficient in terms of battery use. The figure 3 compares the principle of duty-cycle operation with the movement detection one proposed in this article.  Figure 3. Comparison between duty-cycle and movement detection operation modes.

Animal activity identification by means of acceleration data analysis
The accelerometer can be employed not only to activate the geolocation measurement, but also to identify the animal activity and its behaviour by analysing the acceleration data [5]. The table 1 compares different algorithms used for individual activity detection by processing acceleration data. According to its accuracy to correctly identify different animal movements combined with its low processing resource requirements and implementation easiness, the most adapted solution for embedded systems seems to be the moving average method. Consequently, this is the algorithm adopted for the proposed solution.

Step identification and geolocation with accelerometers: a practical case
In the context of animal geolocation solution improvement, the first stage is to implement the moving average algorithm for step identification. In this way, several experimental tests have been conducted with humans in order to validate the movement identification from the accelerometer data, processed with the moving average algorithm.
The figure 4 illustrates the principle of the implemented algorithm, and the results obtained for one axis acceleration data. At t=α, the point A of the curve "average t+2" is lower than point B of the curve "average t+1". At the same time, the point B is lower than point C of the curve "average t0". The distance between A and C is significant, whereas the distance between A et B is the same as between B and C. The measure at α validates the "start" of a step. On the other hand, the measure at t=δ validates the "end" of a step. At t=β, the distance between A and C is not significant enough, and this measure has not been taken into account, which is also the case for t=γ. This algorithm allows the step detection and, in addition, it can identify, from the distance between the points A and C, if the individual is walking or running. A program that implements the proposed algorithm has been developed and tested with the TD 1204 © evaluation electronic card, which is composed of the same elements than the e-Pasto geolocation devices: a low-power microcontroller, a GPS module, and a SIGFOX © modem. In addition to these elements, the TD 1204 © also includes an accelerometer, which was not present in the e-Pasto devices. During the experimental tests, the data issued from the accelerometer were processed by means of the proposed algorithm to identify the steps. The GPS module was activated every 50 steps, and the measured geolocation position was transmitted to a data base through the SIGFOX © wireless network. The figure 5 shows in green the geolocation points measured every 50 steps during the tests. The real path, obtained with a classical GPS device of a smartphone, is shown in red to prove the precision of the developed solution. Finally, the figure 6 shows the block diagram of the e-Pasto geolocation device, including the accelerometer.

Conclusion
This paper has presented a solution, based on accelerometers, that is able to identify the steps of an individual. This technique is useful to collect animal behaviour information and also to use in a more efficiently manner the energy of geolocation devices dedicated to PLF applications. Nevertheless, several aspects must be discussed.
Concerning the impact over the autonomy, the proposed solution improves the energy efficiency because of the optimization of the geolocation positions collection procedure: the GPS module is only activated if a significant movement of the animal is detected by the accelerometer. In addition, the energy consumption due to accelerometers is not very high, and the computational load of the moving average algorithm is moderate, because it is applied to only one acceleration axis. However, the impact of the energy consumption due to both the accelerometer and the processing algorithm over the geolocation device autonomy must be analysed more in detail and, specially, in a high mountain pasture scenario.
The proposed solution has been validated with humans and it is necessary to study its application to animals. The correct positioning of the electronic device over the animal is crucial to achieve the step detection. Related to the interpretation of the acceleration curves, the scientific literature [5] shows that the results obtained for different kinds of animals are similar to those obtained for humans. Finally, it would be desirable to detect, with an adapted algorithm, other kind of animal movements and activities (eating, rumination…), respecting the trade-off with the autonomy. This type of information could be used by the farmers in order to determine the well-being of their cattle.