**3. Results**

#### *3.1. Weight Patterns Detection and Analysis*

Results of the monthly analysis showed that negative slopes were linked to the extraction of honey and the number of bees declining in summer/spring whereas it symbolized the death of bees in winter/fall. Positive slopes showed honey production, adult bees forming and occasionally beekeeper intervention in the summer/spring. Figure 6 shows normal variation over one month in spring, moisture changes (in red), adult bees forming and honey production (in blue), and some loss in the number of bees and honey store (in green).

**Figure 6.** Weight analysis over the month of April showing dryness and food consumption, outgoing bees, and incoming bees with nectar collection during spring season.

Regarding the daily analysis, for temperatures lower than 12 ◦C, results showed that weight fluctuations were often linked to ventilation, food consumption or beekeeper intervention during active periods, or dryness and moisture during inactive periods since it is considered too cold for the bees to leave the hive. Temperatures between 12 and 35 ◦C were found to be optimal for foraging activities. In the active period, weight fluctuations were mainly due to bees leaving and entering the hive, whereas dryness and moisture changes affected the weight in the inactive period. As for temperatures higher than 35 ◦C, the weight fluctuations would mostly be limited to ventilation and beekeeper intervention in active periods, and water vaporization and moisture change during inactive periods. Figure 7 shows a day with a normal temperature where dryness and food consumption (in magenta) occurred in the inactive period, while during the day, bees' foraging activity (in blue) was observed.

**Figure 7.** Hourly analysis showing moisture changes in the beehive, adult bees forming and honey production and number of bees declining summer season.

#### *3.2. Artificial Intelligence (AI) and Neural Network*

In our datasets, a timestamp is associated with each weight sample. Thus, weight variations of monitored hives can be seen as time series that can be learned by AI models. Such models can be used to complement scarce weight samples obtained from the nomad scale for different hives (c.f. Section 2.2.1), thus inferring continuous weight variations that can be analyzed to identify patterns of anomalies or action-triggering events. Furthermore, AI models can be used to predict future weight variations following an initial observation interval, such that the beekeeper can be alerted about any potential anomaly or trigger ahead of time, allowing for an early intervention whenever necessary. This can also be of utmost importance whenever the monitoring device goes down, due to a power failure or defective sensor for example, thus providing an uninterrupted flow of hive weight data which can reduce the risk of unreliable pattern detection and faulty triggers.

In its early stage of development, a recurrent neural network, namely long short-term memory (LSTM) [58], was designed to predict future weight variations for a beehive. Our model consists of three LSTM layers of 32 units each, separated by a dropout layer with dropout probability of 25%. A sliding window feeds the input layer with a number of consecutive input weight samples to predict the next sample value at the output layer which consists of a single node. The LSTM architecture is shown in Figure 8.

The model was trained and tested with weight measurements from Wurzburg and Schwartau in Germany and Villefranche de Rouergue in France. For each hive, the first 50% of weight samples are used to train the model. Training is performed for 100 epochs with Adam optimizer [59]. Figure 9 highlights a significant weight loss over two months in the late summer-fall be-ginning causing the beekeeper intervention to provide nourishment to the bees, based on Schwartau hive data. After roughly one month of continuous weight loss, the next five-day measurements are fed to the model. Following this initial observation time, the model is used to predict weight variations for the next two weeks. A sliding window considers 10 most recent samples (i.e., five-day peri-od, two samples/day) to predict the expected hive weight within the next 12 h. This window is moved repetitively until a critical weight requiring the beekeeper's intervention is detected. The figure shows that the model was able to predict on 17-08-02 that the hive weight might reach 59 Kg on 17-08-26, with an error of 1 Kg compared to the real measured weight, representing a total loss of 9 Kg within a period of 2 months. The model also predicted a beekeeper's intervention to occur on 17-08-27, one day earlier than the real beekeeper's intervention, as it was trained on data with such beekeeping practice after a significant weight loss within a hive. Without any intervention, further weight loss would be expected for the hive. Therefore, the model allows the system to trigger an early alarm, alerting the beekeeper of a required intervention ahead of time.

**Figure 8.** LSTM architecture.

**Figure 9.** Two months analysis showing significant weight change triggering the beekeeper intervention to provide nourishment in early fall season, with both real and AI-predicted data.

#### *3.3. Process Models and Gamification Approach*

3.3.1. Gamification

"Getting things done" (GTD) [60] planning will provide the user with an easy and smooth experience whereby he will receive step-by-step notification on his mobile or tablet concerning where he will be interacting respectively with each move in a simple, gamified, and clear way (Figure 9). In addition to its superfast speed, the application will be designed to generate statistics, work in offline mode, and synchronize across multiple devices.

The system is designed to gain users engagemen<sup>t</sup> in the beekeeping domain, regardless of their previous experience in the field, in a consistent, easy, and joyful experience based on a rich data base system (Figure 1a), with a game-like user interface, and a collaborative ecosystem that will be developed later as part of future work.

The novelty of our gamified approach resides in the workflow engine that drives users' actions. The workflow is described in BPMN language and detailed in Section 3.3.2.

#### 3.3.2. BPMN Model

As previously stated in Section 3.3.1, the BPMN is driving the gamification concept by involving the user in the process and guiding the activities to be done. For each event, a series of respective actions will be triggered and pushed on the user's mobile in the form of a notification, in a step-by-step gamified way, similar to the gaming environment, wherein the user can achieve a level only by completing all required steps.

As previously discussed in (Section 2.3.2) for simplicity, a simple BPMN model (Figure 10) was built after the pseudo code (Figure 5) provided by Connecthive [31].

Discovered patterns from the processed data, previously discussed in Section 3.1, will trigger events on the BPMN model and the user will be notified on his mobile phone and respective action will proposed either to perform a daily task or to countermeasure any malfunction occurring in the beehive, as shown in Figures 10 and 11. Moreover, this model will not only be used to trigger events according to the present time data, but it can also be used later in simulation to forecast future anomalies or simply to predict the hive's needs for wax and other supplies.

**Figure 10.** A Simple BPMN model illustrating simple apiarist work.

**Figure 11.** Showing messages 1,2,3,4 and 5.

The red arrow in Figure 10 indicates a critical decrease in the hive weight previously detected and discussed in Section 3.2 as well as shown in Figures 9 and 11. This critical decrease will trigger on the BPMN model an event to feed with liquid nourishment. This event will be communicated to the apiarist in the form of a message displayed on his mobile as shown in Figure 11.

In the above suggested model, an apiarist receives an informative message (1) about the provisions status at the hive, and if sufficient, the system will inform the user to enter the wintering mode (4). If insufficient provisions are detected, the system will enter in weight measurement mode. In this case, the assessment will be based on the date. In case the date is less or equal to 28 August, the apiarist will be alerted in a message (3) to nourish the hive with 6 kg of liquid feeding. After that, the beekeeper will check for the absorption of the nourishment, and if the weight is not reached, the process will be forwarded to candyboard feeding, where the colony is provided at one time with a sufficient quantity to reach 35 kg. The weight will be checked, and the hive will enter the winter mode without waiting for absorption. In contrast, if the date is exceeding 28 August, the apiarist will be alerted in message (5) to feed with solid food (candyboard), check the weight without waiting for absorption, and finally enter wintering mode. Messages 1–5 are illustrated in Figure 11.

To obtain a quick and clear insight about what the output and the messages could look like, Bonita software was used, as illustrated in Figure 12. It has been already deployed on smartphones for test and validation, as presented in Figure 11, on pilot hive farms. Access and response time are already satisfactory in case the cellular network is sufficient.

**Figure 12.** Simulation using Bonita software.
