**1. Introduction**

**\***

> Beekeeping is a branch of agriculture that involves the breeding of bees (*Apis mellifera*) to exploit the products of the hive, mainly honey. *Apis mellifera* is a semi-domestic species that has been widely used since antiquity, not only to produce honey, wax, and pollen, but also for its prominent role in pollination, especially of vegetable and fruit crops [1,2].

> According to the European Professional Beekeepers Association [3], many statistics that pertain to beekeeping consider professional beekeepers as only full-timers. However, in common practice, we can mainly distinguish three categories of beekeepers according to the importance of their operation. The first, amateur beekeepers, who have a familyfriendly practice, own up to 50 beehives. The second category is made up of professional beekeepers who can own more than 150 beehives. Finally, beekeepers who own between 50 and 150 hives are considered as semi-professionals. Generally speaking, professional and semi-professional apiculturists reallocate their hives with respect to the blooms whereas amateurs do not necessarily.

> In his 2009 book, Nicola Bradbear [4] stated that pollination is an indirect use value that stems from apiculture. In fact, insects, either directly or indirectly, are responsible of

**Citation:** Kady, C.; Chedid, A.M.; Kortbawi, I.; Yaacoub, C.; Akl, A.; Daclin, N.; Trousset, F.; Pfister, F.; Zacharewicz, G. IoT-Driven Workflows for Risk Management and Control of Beehives. *Diversity* **2021**, *13*, 296. https://doi.org/10.3390/ d13070296

Academic Editor: Luc Legal

Received: 19 May 2021 Accepted: 23 June 2021 Published: 29 June 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 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/).

around one third of the pollination process of all plants, or plants products, consumed by humans. Among all pollinating insects, bees play the major role. In Western Europe, for instance, the worth of bee pollination is assessed to be 30–50 times the value of direct honeybees' production [5]. In Africa, bee pollination is sometimes estimated at 100 times the value of direct production. Thus, it is estimated that the economic value provided by bees during pollination is out of all proportion to that of bee products.

As a response to colony collapse disorder (CCD), where major decrease in honeybee colonies is reported all over the word [6–8], advancement in technology is playing a major role in preserving honeybee's species, pollination, and biodiversity sustainability [9,10]. In that context, Industry 4.0 and IoT technologies are playing a major role [11], where the use of sensors, networking, and artificial intelligence (AI) in addition to models, simulations, and process discovery are transforming current industrial processes [12–14]. In fact, the implementation of technology in Beekeeping dates to 1907 when Gates [15] measured temperature for many consecutives days.

With technology and IoT evolving, more accurate, small size, and low-price sensors became available in the market, ensuring a non-disturbing data collection environment [16,17]. Thus, more measurements related to the honeybee colony can now be collected, such as image [18], relative humidity [19], sounds, internal temperature, weight, forager traffic, and gases [20,21].

In 1990, Buchman and Thoenes [22] introduced continuous weight monitoring using a precision scale connected to a computer and collected data every 15 min for one month. Subsequently, many other studies showed a correlation between weight fluctuation and activities occurring inside the hives [23]. For instance, in 2008, according to Meikle et al. [24], the hourly weight, measured using electronic scales linked to data loggers, was calculated to derive the weekly running average weights. Later, the weights associated with the changes in food stores were correlated with humidity ratio changes and foraging activities, which were classified as daily fluctuations. In 2013, Human et al. [25] stated that the weight of full colonies can be measured to examine the nectar flow occurrence during the foraging season or daily gain in nectar stores, the decline of food stores during nonforaging periods [26], and the occurrence of swarming events [24]. In addition, the authors provided examples of applications of honey hives weight measurements networks in different countries, such as Germany, USA, Denmark, and Switzerland. In 2015, Sandra Kordi´c Evans [27] proposed an embedded hive system that measures weight, temperature, and movement using an accelerometer. Meikle et al. [28], in 2016, added to their previously mentioned work with a temperature analysis by installing sensors in different positions in the beehive and found the corresponding position by correlating each position's temperature variations with its exterior conditions. Anand [29], in 2018, proposed a system that uses many combinations of the weight with sounds, relative humidity, and brood temperature to detect honeybee swarms based on several techniques and methods.

The present study does not ye<sup>t</sup> contain complete results. The described items are examples of apiary data coming from an existing shared database [30] (Section 2.2.1) with other measurements provided by *Connecthive* [31]. Starting from such items, we propose a methodology based on pattern recognition within data recorded through both a static hive scale on one hand and a portable nomadic hive scale on the other hand. The proposed method focuses on weight measurements, and will be considered by introducing two types of measurement: an on-board IoT with richly measurements installed on one witness hive and a nomadic weight measurement scale system used for the adjacent hives. Later, the data collected will be assessed and combined on the server (Sections 2.2.2 and 2.2.3). Finally, this method will contribute to reduce the overall cost by proposing the nomad scale solution instead of installing a scale for each hive.

Moreover, the back-end server will be responsible for the processing and labeling of the collected raw data by discovering recurring patterns associated with events occurring inside the hive. Then, detected patterns will automatically trigger a series of predefined actions based on workflow rules and static models built with the help of experts in the

domain (the community of beekeepers using the system) (Section 2.3.2). Finally, all the above will be orchestrated within a user-friendly interface on a smartphone or a tablet where the beekeeper can easily monitor his colony, perform his daily tasks, respond to alerts for possible malfunctions, and forecast his future needs for supplies. As beekeeping tasks cannot be automated, and personal intervention is mandatory, the proposed system will help the beekeeper to plan several relevant tasks precisely: raising and breeding new colonies, feeding the colonies, adding supers, planning sanitary operations, controlling varroa mites, planning operations such as hibernation, etc.

As the system will not be dedicated only for professionals, but also for amateurs, it will encourage a larger number of people to be engaged in the beekeeping field, which can have a positive impact on the environment, biodiversity, and society. To achieve that purpose, a gamification approach will be followed by building a user-friendly interface with voice recognition and image capture features that facilitate the managemen<sup>t</sup> of a large numbers of hives.

Gamification as a term was introduced for the first time in 2002 by Nick Pelling but it did not gain people's attention until year 2010 [32]. Pelling originally defined gamification as "transferring game environment user interface to the electronic world by making it an entertaining and fast user experience". Nowadays, gamification can refer to "implement main game design features into a real-world application" [33] to motivate and attract users with a professional application in an engaging game-like context [34].

In this context, the system will propose step by step actions and countermeasures to be taken with respect to a set of notifications and alerts reflecting the beehive status in real time. Finally, precision beekeeping [35] is a method of beehive managemen<sup>t</sup> that relies on the monitoring of honeybee colonies for the reason to minimize supplies expenditure and maximize the honey yield production. Just like the principles already existing in precision agriculture, it is divided into three phases: data collection, data analysis, and the application of decision support for the beekeeper. While collecting the data, measurements are gathered directly from the hives: weight, temperature, and internal humidity, etc. The data analysis phase makes inferences from predefined models often based on artificial intelligence or on expert systems. During the decision support phase, recommendations are submitted to improve the performance of the apiary. Thus, beekeeping, like other fields of agriculture, must initiate a digital revolution. As the conditions of beehive exploitation becoming more and more complex, particularly due to environmental factors, the managemen<sup>t</sup> of the farms must be rationalized to remain profitable, to produce better quality honey, and to minimize the losses of livestock [36]. Indeed, it is essential to maintain the population of honeybees without which the pollination of crops could no longer be ensured, causing considerable economic and societal damage [37]. The goal here is to use technologies based on a workflow engine, including business rules, and deep learning to help the beekeeper to better manage his bee colonies by monitoring and automating some of his decisions. In this context, the decision support system makes it possible to predict the evolution of each colony and suggests certain breeding operations to be carried out to improve the productivity and survival of the colonies. The contribution of digital techniques should pave the way for precision beekeeping, to minimize invasive treatments and synthetic inputs [38].

#### **2. Materials and Methods**

#### *2.1. Experimental Scenario and Methodology*

A decision support system will be installed in two professional beekeeping farms (more than 200 hives), in 4 semi-professional farms (more than 50 beehives) and 4 amateur farms (less than 20 beehives).

Then, measurements carried out continuously are collected on the control hives by means of the static scales as well as the discontinuous measurements carried out by means of the mobile scales.

In addition, data will be collected from beehive visit reports entered by beekeepers using the apiary monitoring application on their smartphones. These reports are equivalent to the ground truth and are used to label the data.

Subsequently, a data mining phase will be intended to find emergences of the processes initiated by beekeepers. Therefore, the identified processes are formalized with BPMN. They are differentiated by the type of beekeeping (professional, semi-professional and amateur) and they are placed in a catalog. Processes are validated (method with expert observation, or through a simulator that will be developed using a multi-agent system) and this process catalog will be available to all beekeepers. The system uses it to issue detailed operational advice.

Figure 1 illustrates the proposed methodology which consists of the three main steps: data collection, build time, and run time. Each step, in addition to the relations between different pillars, will be fully discussed in the upcoming sections.

**Figure 1.** Illustration of the proposed methodology. Our proposed methodology is divided into three main parts: data collection (**a**), build time (**b**), and run time (**c**).

## *2.2. Data Collection*

As mentioned in Section 1, the proposed system is still under development, and although, only the weight measurement collection will be considered in this paper, it is planned to add other measurements as shown in Figure 1a. Data will be collected from different sources such as: hive's weight, weather, external temperature, vegetation and flowers maps, internal temperature, relative humidity, etc. In addition to the mentioned sources, collaborative data will be gathered from different users to enhance system's performance, especially in business rule discovery and simulation.

Whereas many data collection tools will be added to system in the future, the newly proposed weight measurement method will be fully discussed in the following paragraph. This method involves two types of weight measurements, namely continuous and discontinuous, as shown in Figure 2.

**Figure 2.** Implementation and Communication between different layers.
