2022
Time series numerical association rule mining variants in smart agriculture
Abstract
Numerical association rule mining offers a very efficient way of mining association rules, where algorithms can operate directly with categorical and numerical attributes. These methods are suitable for mining different transaction databases, where data are entered sequentially. However, little attention has been paid to the time series numerical association rule mining, which offers a new technique for extracting association rules from time series data. This paper presents a new algorithmic method for time series numerical association rule mining and its application in smart agriculture. We offer a concept of a hardware environment for monitoring plant parameters and a novel data mining method with practical experiments. The practical experiments showed the method’s potential and opened the door for further extension.
keywords
Association rule mining; Smart agriculture; Optimization; Evolutionary algorithms; Internet of things.1 Introduction
Global food consumption is now at the highest level that it has ever been in history. Population growth (up to 9 billions till 2050 according to the FAO prediction FAO, Rome, Italy (2009)) and severe climate changes increase the need for food. Until recently, this problem was solved by increasing the role of crop production using mechanization, improved genetics, and increased inputs Colizzi et al. (2020). However, these increases have resulted mainly in depletion of soil, water scarcity, widespread deforestation and high levels of greenhouse gas emissions FAO, Rome, Italy (2017); Bajželj et al. (2014).
Despite the several negative reasons that impact the production of food, farmers are nowadays looking for a new and sustainable way for increasing food production. Smart farming is a paradigm for overtaking today’s challenges to integrate two modern technologies, i.e., Information and Communication Technologies (ICT) Sahitya et al. (2016), and the Internet of Things (IoT), in order to reorganize farming such that these disciplines and technologies could be involved in the smart way Colizzi et al. (2020). In the smart farming/agriculture vision, the land is equipped with different kinds of IoT sensors Mohapatra and Rath (2022); Agrawal et al. (2020), capable of acquiring heterogeneous data. These data are transferred via sensor’s rural networks to the Internet, where they are collected into complex databases, in which the knowledge necessary for analyzing the land characteristics is hidden. The intelligent algorithms, based on Artificial Intelligence (AI) Issad et al. (2019); Dabre et al. (2018), are employed for analyzing mined data in order to make rational decisions for the observed situations Mishra et al. (2021); Torres-Tello and Ko (2021); Fister Jr. et al. (2022). The decisions are transmitted either to the farmer’s system in the form of actions or to the farmers in the form of messages Ouafiq et al. (2022).
In this paper, we develop a hardware and software environment focused on computer vision for smart agriculture, where a Time Series Numerical Association Rule Mining (TS-NARM) algorithm is proposed and applied to tackle different problems arising in smart agriculture. The data are acquired from IoT sensors, which will measure different variables such as temperature, humidity, moisture, and light. On a time basis, these measurements are collected to time series frames that are mapped to features, with which the plant is monitored. Thus, each time series frame represents a transaction in a database. The transaction database serves as an origin for data analysis, in which time series data are identified and processed using TS-NARM. The algorithm mined a set of time base association rules that are ready to be explained to users by using the Explainable AI (XAI) Arrieta et al. (2020).
The purpose of the study is therefore twofold: (1) to develop the data collection and preprocessing method, and (2) to propose a TS-NARM based system to process the data and knowledge extraction. This paper is distinguished by the following main novel contributions:
- •
a lightweight method for data acquisition based on an ESP32 micro-controller is developed, which includes several sensors for capturing significant data and environmental variables.
- •
a comprehensive collected dataset has been obtained, which allows a further treatment of the data via AI techniques.
- •
stochastic nature-inspired algorithms for TS-NARM construction are developed, while a comprehensive comparative study is performed, in order to show their advantages and shortcomings.
The structure of the remainder of the paper is as follows: Section 2 is dedicated to explain the background information necessary to potential readers for understanding the topics that follow, including concepts on association rules mining and evolutionary algorithms. In Section 3, the experimental setup is illustrated, where the concept of the proposed smart agriculture is introduced, together with the laboratory setup of the hardware, as well as the developed algorithms for TS-NARM. The results of the experiments are the subject of Section 4. The paper concludes with a discussion in Section 5, which summarizes the performed work and outlines directions for the future.
2 Background information
2.1 Association rule mining
This section briefly presents the formal definition of ARM. Let us suppose a set of objects , where denotes the number of attributes, and transaction set are given, where each transaction is a subset of objects, in other words . Then, an association rule can be defined as implication:
| (1) |
where , , in . The following two measures are defined for evaluating the quality of the association rule Agrawal et al. (1994):
| (2) |
| (3) |
where denotes confidence and support of the association rule . Thus, in Eq. (3) represent the number of transactions in transaction database and is the number of repetitions of a particular rule within . Here, denotes minimum confidence and minimum support. This means that only those association rules with confidence and support higher than and are taken into consideration, respectively.
In order to control the quality of the mined association rules in more detail, two additional measures are defined, i.e., inclusion and amplitude. Inclusion is defined as the ratio between the number of attributes of the rule and all the attributes in the database Hahsler and Hornik (2007):
| (4) |
where is the total number of attributes in the transaction database. Amplitude measures the quality of a rule, preferring attributes with smaller intervals, in other words Fister Jr. et al. (2021):
| (5) |
where and are the upper and lower bounds of the selected attribute, and and are the maximum and minimum feasible values of the attribute in the transaction database.
2.2 Stochastic population-based nature-inspired algorithms
Stochastic population-based nature-inspired algorithms are a common name comprising two families of optimization algorithms under the same umbrella, i.e., Evolutionary Algorithms (EAs) and Swarm Intelligence (SI) based algorithms. The characteristics of these are already hidden in their name. This means that they are stochastic in nature, due to employing a random generator by constructing new, potentially better solutions. In place of searching for a single solution, they explore the knowledge hidden within the whole population of solutions. The final characteristic, i.e., nature-inspired, refers to an inspiration taken from nature, on which their search process is found Del Ser et al. (2019); Tzanetos and Dounias (2021).
In our study, both kinds of algorithms are applied for solving the TS-ARM in smart agriculture. Therefore, the similarity and differences of both families are discussed in a nutshell in the remainder of the paper.
2.2.1 Evolutionary algorithms
EAs are metaheuristic approaches based on the evolution of natural species Del Ser et al. (2019). According to this theory, the fitter individuals have more chances to survive in unpleasant environmental conditions due to their better adaptation to them. Thus, the less fit ones are eliminated by the natural selection. Indeed, all individuals’ characteristics are written in their genes (i.e., genotype) that are inherited from generation to generation, while their traits (i.e., phenotype) are reflected from the genotype. The genetic material is transferred to the next generations via a process of reproduction consisting of crossover and mutation Eiben and Smith (2015). In this way, the crossover serves for mixing the genetic material between parents, while the mutation takes care of the diversity of the material.
The evolutionary process has became an inspiration for developing the EAs. Similar to natural processes, EAs also consist of populations of individuals representing solutions of the problem to be solved. The natural population suffers under conditions of dynamical environment changing constantly over time. This environment is presented in EAs by the problem, to which optimal solutions are drawn nearer by exploring the problem’s search space. Thus, the offspring solutions undergo the effects of acting the crossover and mutation operators. Finally, the quality of each individual is estimated using the evaluation function.
Algorithm 1 illustrates a pseudo-code of the common EAs. As can be seen from the pseudo-code,
An evolutionary cycle starts with an initialization of a population of solutions, normally, represented as binary, integer, or real-valued vectors (line 1). After initialization, the evaluation of solutions is launched (line 2). Then, the while loop introduces the evolutionary cycle (lines 3-9). that is terminated with the termination condition. In each evolutionary cycle, the parent selection operator selects two parents, which contribute to mixing their genetic material with the crossover and mutation operators by creating new offspring (lines 5-6). Next, the quality of offspring is evaluated with the fitness function (line 7). Finally, the survival selection operator determines those members of the current population that will transfer their genetic material to the next generations.
Moreover, the family of EA-based approaches is large, and consist of many different approaches Del Ser et al. (2019), among others:
- •
Genetic Algorithms (GA) Goldberg (2013),
- •
Genetic Programming (GP) Koza (1992),
- •
Evolution Strategies (ES) Rechenberg (1973),
- •
Evolutionary Programming (EP) Fogel et al. (1966),
- •
Differential Evolution (DE) Storn and Price (1997).
Although all the aforementioned algorithms follow the common principle of EAs as illustrated in Algorithm 1, they differ between each other regarding the representation of individuals. For instance, the individuals in GAs are represented as binary strings, while, in the GP, as programs in the Lisp programming language. The final state automata form a population of solutions in EP, while the real-valued vectors appear in the role of population members in ES and DE.
2.2.2 Swarm intelligence-based algorithms
Inspiration for SI-based algorithms has also been drawn from the nature, precisely, from collective behavior in biological systems Blum and Merkle (2008). For, instance, some kinds of insects (e.g., honeybees and ants) and animals (e.g., fishes and birds) live in a society, e.g., honeybee’s combs, ant colonies, schools of fish, and flocks of birds. Thus, they expose the swarm intelligence in the following sense: Although the particles (also agents) of swarms are capable of performing only simple tasks, they can deal with complex problems together as a group. In line with this, decision-making in a swarm is decentralized, while the particles are capable of self-organization. They interact between each other using some kind of communication that can be either direct or indirect Fister et al. (2015). In the former case, information is transmitted without the intervention of the environment, while, in the latter case, individuals are not in direct contact, because the communication is conducted via environmental data.
Similar as in EAs, the SI-based algorithms also operate with a population of solutions that is called a swarm of particles in the sense of SI. The particles represent solutions of the problem to be solved, and are, typically, defined as real-valued vectors Fister et al. (2022). During the optimization cycle, they move within the problem search space towards the better ones, and, in this way, discover new, potentially better solutions. Normally, the moves are described regarding the physical equations that mimic the moves of particles in natural biological systems. Also here, only the best particles are selected for the next generations, while the optimization cycle is terminated using a termination condition.
The pseudo-code of the SI-based algorithms is illustrated in Algorithm 2 Engelbrecht (2005), from which it can be seen
that it differs from Algorithm 1 in line 4, where the move operator is applied in place of parent selection and variation operators as in EAs (lines 4-6).
Until end of the last decade, a flood of newly developed SI-based algorithms has been emerging that raised criticism in the nature-inspired community Sörensen (2015) about the question how novel these algorithms were and if they did not hide behind their famous metaphor taken from nature’s inspiration. The critics slowed down the flood, and, nowadays, only the more valuable algorithms can find a way to the research community. Although the majority of the SI-based algorithms are represented with real-valued vectors Fister et al. (2022) and, therefore, the classification to this criteria, as by EAs, is not possible, one of the first tries to classify them was proposed in Fister Jr et al. (2013). Actually, this classification was based on their inspirations from nature.
2.3 NiaPy framework
A NiaPy library Vrbančič et al. (2018) is a framework of nature-inspired algorithms implemented in Python programming language. This package is distributed under the MIT licence, and enable potential developers to avoid the implementation of these algorithms, which can sometimes be a difficult, complex, and tedious task. The implementations of algorithms in the library are verified, while their codes comply with the last Python standards. Currently, the library consists of 29 original nature-inspired, 7 modified, and 6 other algorithms.
Together with the aforementioned algorithms, a lot of test problems are also appended into the library. This fact enables the users to compare various algorithms between each other easily, and helps them to decide which algorithm to apply for solving their practical problems. Due to its simplicity of use, this library has also become an unavoidable tool for comparing the different nature-inspired algorithms at various universities around the world.
3 Experimental environment
In this section, we present our experimental environment, that involved a hardware unit consisting of three sensors, which allowed us to acquire data, all software and hardware components used for data collection, and the data preprocessing techniques applied to them.
The concept of the smart agriculture in our study is illustrated in Fig. 1, from which it can be seen
that different IoT sensors monitor the land characteristics. Via a rural network, they are connected to a network access point, that serves for data collection and enables them access to the Internet. The collected data are reduced and preprocessed, in order to map only those indicators to extracted features that refer to soil monitoring. Obviously, each data entry is supplemented with its date and time information. Such data then enter into data analysis, in which interesting patterns (also knowledge) are mined. The decision-making process is started based on the interesting patters. The results of this process can be represented in two ways: (1) to explain unexplained data, and (2) to propose clues for performing actions. The former serve as an input to the XAI that suggests to the farmer what to do in a specific situation, while the latter proposes an action that could to be performed by the agriculture controlled system (e.g., start to irrigate a plant for 10 minutes). Let us notice that the study is focused only on the data collection, preprocessing, and data analysis. Due to the complexity of XAI, the last step remains a subject of the future work.
Implementing the concept of smart agriculture demands hardware and software components that must be integrated into a control system. In summary, the system in smart agriculture consist of the following components:
- •
hardware unit,
- •
data collection,
- •
data preprocessing,
- •
TS-ARM with nature-inspired algorithms.
In the remainder of the paper, the aforementioned components are illustrated in detail.
3.1 Hardware unit
The hardware unit consists of sensors connected into a rural network, and an access point for acquiring data from the sensors and transmitting them to the Internet. Thus, the prototype hardware unit was built. Table 1 lists all the hardware components that were used in our solution.
| Ind. | Component | Function |
|---|---|---|
| 1 | ESP32 NodeMCU Module | microcontroller |
| 2 | Adafruit BH1750 | light intensity sensing |
| 3 | DHT22 AM2302 | air temperature and humidity sensing |
| 4 | Soil Moisture Hygrometer Module | soil moisture sensing |
All the applicable sensors have been welded permanently to a simple perfboard for the sake of proof-of-concept, and wired to the ESP32 NodeMCU module. Standard communication protocols were utilized. Figure 2 visualizes a collage of the individual elements.
Actually, the ESP32 module represents the heart of the system and enables processing power for the data collection. The data are obtained via an Adafruit BH1750 light intensity sensor, DHT22 AM2302 air temperature and humidity sensor, and Soil Moisture Hygrometer sensors. Data are transferred to the webserver in predefined time periods, where the data are stored in a database.
3.2 Data collection
Data from the sensors, also Sensor Data (SD), are acquired as a tuple:
| (6) | ||||
where the light, temperature, humidity, and moisture indicators are obtained from the corresponding sensors.
Actually, the tuples are acquired in a specific time period that are defined by the user. Thus, it holds, the shorter the time period, the more detailed acquired data. These are transmitted to the Internet server using a straightforward Python application running on the web server, pprocessing the HTTP requests utilizing a web.py library.
3.3 Data preprocessing
Data preprocessing is usually one of the most critical steps in the whole data science process. Data preprocessing can be defined as a set of methods that enhance the overall quality of the raw data and try to enrich it Fan et al. (2021); Fister et al. (2022); Fister Jr. et al. (2022). Essentially, two tasks are required in time series data preprocessing phase:
- •
data reduction,
- •
feature extraction.
The first preprocessing task enables grouping the data in time frames, while the second is devoted to data enrichment.
Time series is defined as a sequence of the collected data tuples for :
| (7) |
where denotes the number of data tuples in time series (also time series size).
The lack of measured indicators prevents the TS-NARM to produce any specific insights. Therefore, we must enrich collected data by additional features reflecting a better outlook on time-series data. Time series Frame is obtained by a data reduction ML preprocessing method, where it is expected that the method analyzing provides the same results as analyzing the original . In line with this, a set of indicators collected in :
| (8) | ||||
is reduced by a set of modifiers:
| (9) |
In order to determine a set of compound features, a Cartesian product of sets and is calculated except for the indicators and . The results of the feature extraction is illustrated in Table 2,
| Nr. | Feature | Attribute domain | Short description |
|---|---|---|---|
| 1 | AVG_TEMPERATURE | NUMERIC | Average temperature of data in the TF |
| 2 | MAX_TEMPERATURE | NUMERIC | Maximum temperature of data in the TF |
| 3 | MIN_TEMPERATURE | NUMERIC | Minimum temperature of data in the TF |
| 4 | DIF_TEMPERATURE | NUMERIC | Temperature interval of data in the TF |
| 5 | AVG_HUMIDITY | NUMERIC | Average humidity of data in the TF |
| 6 | MAX_HUMIDITY | NUMERIC | Maximum humidity of data in the TF |
| 7 | MIN_HUMIDITY | NUMERIC | Minimum humidity of data in the TF |
| 8 | DIF_HUMIDITY | NUMERIC | Humidity interval of data in the TF |
| 9 | AVG_MOISTURE | NUMERIC | Average moisture of data in the TF |
| 10 | MAX_MOISTURE | NUMERIC | Maximum moisture of data in the TF |
| 11 | MIN_MOISTURE | NUMERIC | Minimum moisture of data in the TF |
| 12 | DIF_MOISTURE | NUMERIC | Moisture interval of data in the TF |
| 13 | AVG_LIGHT | NUMERIC | Average light of data in the TF |
| 14 | MAX_LIGHT | NUMERIC | Maximum light of data in the TF |
| 15 | MIN_LIGHT | NUMERIC | Minimum light of data in the TF |
| 16 | DIF_LIGHT | NUMERIC | Light interval of data in the TF |
| 17 | SEQUENCE | NUMERIC | Time series sequence |
| 18 | CLASS | NUMERIC | Class of the time series |
where each compound feature is represented as a concatenation of denoted by a character ’_’, while indicator is mapped to the feature and the indicator to the feature . Thus, the modifiers are mathematically defined as follows:
| (10) | ||||
where for specifies particular indicator collected by -th frame of the specific TS. While the definition of the first three modifiers is self-explanatory, the modifier is expressed as an difference of the indicator measured at the end and the beginning the time period and thus highlights a variance of the values within the TS. The feature is calculated such that the starting date is attached to value , and then the value is incremented by one for each next date. The indicator in the form is mapped firstly to a timestamp as:
| (11) |
and then to the proper feature according to the following equation:
| (12) |
where denotes the number of time intervals, into which the 24-hour period (i.e., 86,400 sec) is divided. The selection of the proper value of is crucial for the results of the optimization.
In summary, the time series database of dimension , where denotes the number of transactions in the database, and is the number of features, where each transaction is defined as a sequence of the features defined in Table 2.
3.4 Time Series Association Rule Mining with nature-inspired algorithms
The purpose of this section is to present the mathematical foundations of TS-ARM and the necessary modifications that must be applied to nature-inspired algorithms for implementing TS-ARM. In our study, the following nature-inspired algorithms are applied:
- •
Differential Evolution (DE) Storn and Price (1997),
- •
Genetic Algorithm (GA) Goldberg (2013),
- •
Particle Swarm Optimization (PSO) Kennedy and Eberhart (1995),
- •
Success-history based adaptive differential evolution using linear population size reduction (LSHADE) Tanabe and Fukunaga (2014),
- •
self-adaptive differential evolution (jDE) Brest et al. (2006).
Actually, two components of nature-inspired algorithms need to be modified by implementation of the TS-ARM, i.e., representation of solutions and fitness function. Let us mention that the implementations of the original aforementioned algorithms are taken from NiaPy library.
3.5 Time Series Association Rule Mining
TS-ARM is a new paradigm, which treats a transaction database as a time series data. In line with this, the formal definition of the NARM problem needs to be redefined. In the TS-ARM, the association rule is defined as an implication:
| (13) |
where , , and . The variable determines the sequence of the transactions arisen within the interval and , where denotes the start and the end time of the observation. The measures of support and confidence are redefined as follows:
| (14) |
| (15) |
where and denotes the confidence and support of the association rule within the same time interval .
Let us highlight Eq. (15) with the following example: Let us assume the itemset is given as follows:
and the transaction database captures features of passed 5 days, where each day is divided into 24 classes (i.e., total 120 transactions). If 2 matches in temperatures between and are are found in 5 days within the specified time interval , the itemset has support .
The other aforementioned NARM measures (i.e., inclusion and amplitude) are independent on time and, consequently, they are employed in their original form.
3.5.1 Representation of solutions
The individuals in the nature-inspired algorithms for are encoded as a real-valued vector (genotype):
| (16) | ||||
where each element for determines four quadruples determining the compound features for into the transaction database, denotes the -th time interval, the cutting point, and is the generation number. Thus, each numerical feature consists of four real-valued elements decoded (phenotype) as:
| (17) |
where permutation served for modifying the position of the feature within the association rules. Technically, all first elements denoting the corresponding features are sorted in descendent order,
while their ordinal values determine their position in the permutation.
The two middle elements within quadruple encode a real-valued interval of feasible values expressed as:
and
where and denote the lower and the upper values of the particular feature as found in the transaction database.
The threshold value denotes the presence or absence of the feature in the observed association rule according to the following equation:
where draws a value from uniform distribution in interval .
The time interval is calculated according to the following expression:
| (18) |
where denotes the number of classes.
As the last element, the so-called cutting point is added to each vector that distinguishes the antecedent of the rule from the consequent ones. The cutting point is expressed as:
| (19) |
where .
Finally, the results of this so-called genotype-phenotype mapping, where the values encoded into genotype are decoded into phenotype, is association rule consisting of antecedent and consequent separated by an implication sign positioned at the point determined by the variable .
3.5.2 Definition of the fitness function
We tailored the fitness function presented in Fister et al. (2018) to deal with time series data as follows:
| (20) | ||||
where , , , and denote weights of the support, the confidence, the inclusion, and the amplitude of the association rule decoded from the vector .
4 Results
The goal of the experimental study was two-fold: (1) to analyse a behavior of the system in smart agriculture, and (2) to show that the nature-inspired algorithms for TS-NARM can be applied in smart agriculture. In line with this, an experimental environment was established as illustrated in the last section, which enable creating a transaction database. Then, the nature-inspired algorithms for TS-NARM were applied to searching for hidden relationships between features in the transaction database.
Two experiments were conducted in order to justify our hypotheses:
- •
analysis of a behavior of the system in smart agriculture,
- •
comparative study of five nature-inspired algorithms for TS-ARM.
In the remainder of the paper, the experimental setup is reviewed, then the algorithm configurations are discussed, and finally, the results of the aforementioned experiments are illustrated.
4.1 Experimental setup
For the purpose of our study, Aloe Vera plant served as a plant for simulation of our smart agriculture concept. As can be seen at the Fig 3, a rural network is built using sensors connected directly to the ESP32 NodeMCU control process unit. The unit is powered by a power bank of 20000 mAh capacity.
Three sensors for light, air temperature and humidity, and moisture sense land characteristics and transmit sensor data in approximately 5 sec intervals. The sensor data form time series of duration 1 hour. This means, that each time frame (also transactions) bears characteristics of sensor data, in other words .
In summary, the transaction database contains data accumulated in 14 days. Consequently, it consists of different transactions.
4.2 Algorithm configurations
In our study, five nature-inspired algorithms were applied as follows: DE, GA, PSO, LSHADE and jDE. Thus, all implementations of algorithms were taken from the NiaPy library, where default parameters were taken from NiaPy examples Vrbančič et al. (2018) (Table 3).
| Algorithm | Parameter setting |
|---|---|
| DE | . |
| GA | , |
| PSO | , , |
| LSHADE | , , , , |
| jDE | , , |
The number of function evaluations for all algorithms was set to and all algorithms had the population size of 50. We performed ten independent runs for each algorithm in test.
4.3 Analysis of a behavior of the system in smart agriculture
The system presents a cost-effective solution in smart agriculture that supports: data acquiring, data collection, and data preprocessing. Therefore, the purpose of the test was to analyse how the system behaves in the sense of the following system’s quality metrics:
- •
reliability,
- •
robustness,
- •
accuracy,
- •
scalability.
Indeed, the test comprises of evaluating three system components: hardware unit (data acquiring), data collection, and preprocessing. In line with this, the system underwent to continuous operating in duration of 14 days (Table 4).
| Attribute | Value |
|---|---|
| Number of collected records transmitted onto the web | 233,980 |
| Start time of collecting data | 2022-09-15, 00:00:04 |
| End time of collecting data | 2022-09-28,23:59:57 |
| Collecting time period | approximately every 5 seconds |
| Average collected records per day | 16,712 |
Thus, the acquired data from sensors are collected approximately each 5 seconds. In total, the system transmitted 233,980 records onto the web.
The results of data collection are depicted in Table 5,
| MP | Light | Temperature | Humidity | Moisture | Date | Time |
|---|---|---|---|---|---|---|
| n1 | 0 | 24.70 | 57.90 | 1995 | 2022-09-15 | 00:00:04 |
| n1 | 0 | 24.70 | 58.00 | 1991 | 2022-09-15 | 00:00:09 |
| n1 | 0 | 24.70 | 58.20 | 1994 | 2022-09-15 | 00:00:14 |
| n1 | 0 | 24.60 | 58.00 | 1993 | 2022-09-15 | 00:00:19 |
| n1 | 0 | 24.60 | 58.00 | 1986 | 2022-09-15 | 00:00:25 |
| n1 | 0 | 24.60 | 58.00 | 1991 | 2022-09-15 | 00:00:30 |
| n1 | 0 | 24.60 | 58.00 | 1995 | 2022-09-15 | 00:00:35 |
| n1 | 0 | 24.60 | 58.20 | 1993 | 2022-09-15 | 00:00:40 |
from which it can be seen time series consisting of eight sensor data records acquired in 15.9.2022 starting at 00:00:04 AM. Each record consists of indicators obtained by light, temperature, humidity, and moisture sensors. The BH1750 light sensor provides 16-bit light measurements in lux, and measures light from 0 (night) to 100K lux (day). Temperature sensor senses temperature in range to . Humidity measuring range is in interval RH to RH with measurement accuracy of RH. Soil moisture is detected by a simple water sensor, while the moisture values ranging from 0 to 2300. Data and time values are added by the web server.
As can be seen from Table 5, all data were obtained from measuring point number 1 during the night due to value 0 measured by light sensor. The values from other sensors remained almost constantly, while the variances of their values could be ascribed to the measurement accuracy of the particular sensor.
Due to the big number of features obtained as a result of preprocessing, the illustration of the transactions saved into transaction database is omitted in the paper. Instead of this, the statistics of the preprocessed transactions is summarized in Table 6,
| Total records in transaction database | 336 |
| Total number of features | 18 |
| Type of features | numeric |
from which it can be seen that 336 transactions (time frames) emerged as a result of preprocessing.
4.4 Comparative study
The experiments was focused on evaluating the proposed nature-inspired algorithms for TS-ARM according to the standard ARM measures. The algorithms in the comparative study used parameter settings as illustrated in Table 3. The results of the experiments are illustrated in Table 7
| \topruleAlgorithm | Measures | Lengths | Numrules | Intervals | ||||
|---|---|---|---|---|---|---|---|---|
| supp | conf | incl | ampl | antlen | conlen | |||
| \midruleDE | 0.69 | 0.87 | 0.20 | 0.54 | 1.72 | 1.51 | 2,707 | 100 % |
| GA | 0.19 | 0.63 | 0.30 | 0.53 | 2.55 | 2.30 | 40 | 96 % |
| PSO | 0.64 | 0.82 | 0.16 | 0.77 | 1.28 | 1.24 | 3,386 | 100 % |
| LSHADE | 0.59 | 0.84 | 0.16 | 0.74 | 1.27 | 1.24 | 2,588 | 96 % |
| jDE | 0.57 | 0.85 | 0.24 | 0.37 | 2.09 | 1.73 | 664 | 100 % |
| \bottomrule | ||||||||
depicting the achieved values according to four measures (i.e., support, confidence, inclusion, and amplitude), and average lengths of corresponding antecedent and consequent per each observed algorithm. Columns ’Numrules’ and ’Intervals’ are added to the table and denote the number of mined rules and the percentage of intervals covered by the rule, respectively.
Interestingly, the best results according to support and confidence are distinguished by the DE, while the best results according to inclusion are achieved by the GA, and according to amplitude by the PSO. The longer length of features in antecedent and consequent are mined by the GA, where the length of both measures overcome the value of 2.30. The maximum number of rules were mined by the PSO (i.e., ), while the minimum by the GA (only ). As a matter of fact, all algorithms excellent cover the intervals in the rules.
5 Discussion, Conclusions and further research
The following conclusions can be obtained, according to the results of the first test: In general, the conducted test showed that the system is reliable due to the continuous operating over 14 days. During this period, it underwent different conditions (e.g., stormy, rain, sunny, etc.), and more day-night cycles. This fact justify that the system is also robust. Although the applied sensor are low-cost, the acquired data are accurate, especially, by considering the fact that errors can be compensated by averaging values of the big number of measurements. Finally, the system is scalable, because more sensors can be connected to the hardware unit and thus improve capturing of the land conditions.
The following conclusions may summarize the results of the second test carried out: The DE is excellent in searching for rules, where there exist good relationships between features regarding either other feature or the total number of transactions, respectively. The best use of the number of features in antecedent and consequent is identified by the GA, while the best covering of the numeric intervals is achieved by the PSO. On the other hand, the GA discovered the less number of association rules comparing with the other algorithm in test. Indeed, the highest number of rules is mined by the PSO. Consequently, the higher the number of mined rules, the better support and confidence, and contrary, the smaller the number of mined rules, the richer the association rules in the sense of the number of features in antecedent and consequent.
However, there are also several bottlenecks that were found when running experiments. All blockages are summarized as follows:
- •
Some intervals are occasionally omitted, and after the run, there are no rules linked to a specific interval.
- •
Sometimes algorithms identify a rule with very high fitness, consequently, the algorithm falls within the local optimum, and after that, it is tough to find good rules in the other intervals.
- •
After the initial experiments, we found that it is essentially to ensure more evaluations since they ensure that we find rules in different intervals.
In the future, it would be necessary to find a better local search or switch between different intervals to capture as much association rules as possible. It is recommended that a new metric being added to the fitness function, which would also control how much of the intervals are covered in the final results.
Declarations
Funding
This work was supported by the Slovenian Research Agency (Research Core Funding Nos. P2-0057, P5-0027). This work has also been partially supportted through project PID2020-115454GB-C21 of the Spanish Ministry of Science and Innovation (MICINN).
Code and data availability
The datasets and source codes are available from the corresponding author on reasonable request.
Conflict of interest
The authors declare that they have no potential conflict of interest.
References
- Agrawal et al. [2020] Himanshu Agrawal, Ruchi Dhall, KSS Iyer, and Vijayalakshmi Chetlapalli. An improved energy efficient system for iot enabled precision agriculture. Journal of ambient intelligence and humanized computing, 11(6):2337–2348, 2020.
- Agrawal et al. [1994] Rakesh Agrawal, Ramakrishnan Srikant, et al. Fast algorithms for mining association rules. In Proc. 20th int. conf. very large data bases, VLDB, volume 1215, pages 487–499. Citeseer, 1994.
- Arrieta et al. [2020] Alejandro Barredo Arrieta, Natalia Díaz-Rodríguez, Javier Del Ser, Adrien Bennetot, Siham Tabik, Alberto Barbado, Salvador García, Sergio Gil-López, Daniel Molina, Richard Benjamins, et al. Explainable artificial intelligence (xai): Concepts, taxonomies, opportunities and challenges toward responsible ai. Information fusion, 58:82–115, 2020.
- Bajželj et al. [2014] Bojana Bajželj, Keith S Richards, Julian M Allwood, Pete Smith, John S Dennis, Elizabeth Curmi, and Christopher A Gilligan. Importance of food-demand management for climate mitigation. Nature Climate Change, 4(10):924–929, 2014.
- Blum and Merkle [2008] C. Blum and D. Merkle. Swarm Intelligence: Introduction and Applications. Natural Computing Series. Springer Science & Business Media, 2008.
- Brest et al. [2006] Janez Brest, Sašo Greiner, Borko Bošković, Marjan Mernik, and Viljem Žumer. Self-adapting control parameters in differential evolution: A comparative study on numerical benchmark problems. IEEE transactions on evolutionary computation, 10(6):646–657, 2006.
- Colizzi et al. [2020] Lucio Colizzi, Danilo Caivano, Carmelo Ardito, Giuseppe Desolda, Annamaria Castrignanò, Maristella Matera, Raj Khosla, Dimitrios Moshou, Kun-Mean Hou, François Pinet, Jean-Pierre Chanet, Gao Hui, and Hongling Shi. Introduction to agricultural iot. In Annamaria Castrignanò, Gabriele Buttafuoco, Raj Khosla, Abdul M. Mouazen, Dimitrios Moshou, and Olivier Naud, editors, Agricultural Internet of Things and Decision Support for Precision Smart Farming, pages 1–33. Academic Press, 2020.
- Dabre et al. [2018] Kanchan Rufus Dabre, Hezal Rahul Lopes, and Silviya Simpson D’monte. Intelligent decision support system for smart agriculture. In 2018 International Conference on Smart City and Emerging Technology (ICSCET), pages 1–6. IEEE, 2018.
- Del Ser et al. [2019] Javier Del Ser, Eneko Osaba, Daniel Molina, Xin-She Yang, Sancho Salcedo-Sanz, David Camacho, Swagatam Das, Ponnuthurai N Suganthan, Carlos A Coello Coello, and Francisco Herrera. Bio-inspired computation: Where we stand and what’s next. Swarm and Evolutionary Computation, 48:220–250, 2019.
- Eiben and Smith [2015] A E Eiben and James E Smith. Introduction to Evolutionary Computing. Springer Publishing Company, Incorporated, 2nd edition, 2015.
- Engelbrecht [2005] A.P. Engelbrecht. Fundamentals of Computational Swarm Intelligence. Wiley, 2005.
- Fan et al. [2021] Cheng Fan, Meiling Chen, Xinghua Wang, Jiayuan Wang, and Bufu Huang. A review on data preprocessing techniques toward efficient and reliable knowledge discovery from building operational data. In Frontiers in Energy Research, 2021.
- FAO, Rome, Italy [2009] FAO, Rome, Italy. The state of food and agriculture. http://www.fao.org/3/a-i0680e.pdf, 2009. Accessed: 2022-11-05.
- FAO, Rome, Italy [2017] FAO, Rome, Italy. Soil organic carbon: The hidden potential. http://www.fao.org/3/a-i6937e.pdf, 2017. Accessed: 2022-11-05.
- Fister et al. [2022] Dušan Fister, Iztok Fister, and Sašo Karakatič. Dynfs: dynamic genotype cutting feature selection algorithm. Journal of Ambient Intelligence and Humanized Computing, pages 1–14, 2022.
- Fister et al. [2015] Iztok Fister, Damjan Strnad, Xin-She Yang, and Iztok Fister Jr. Adaptation and hybridization in nature-inspired algorithms. In Adaptation and Hybridization in Computational Intelligence, pages 3–50. Springer, 2015.
- Fister et al. [2018] Iztok Fister, Andres Iglesias, Akemi Galvez, Javier Del Ser, and Eneko Osaba. Differential evolution for association rule mining using categorical and numerical attributes. In International conference on intelligent data engineering and automated learning, pages 79–88. Springer, 2018.
- Fister Jr et al. [2013] Iztok Fister Jr, Xin-She Yang, Iztok Fister, Janez Brest, and Dušan Fister. A brief review of nature-inspired algorithms for optimization. Electrotechnical review, 80(3):116–122, 2013.
- Fister Jr. et al. [2021] Iztok Fister Jr., Vili Podgorelec, and Iztok Fister. Improved nature-inspired algorithms for numeric association rule mining. In Pandian Vasant, Ivan Zelinka, and Gerhard-Wilhelm Weber, editors, Intelligent Computing and Optimization, pages 187–195, Cham, 2021. Springer International Publishing.
- Fister Jr. et al. [2022] Iztok Fister Jr., Iztok Fister, and Sancho Salcedo-Sanz. Time series numerical association rule mining for assisting smart agriculture. In 2022 International Conference on Electrical, Computer and Energy Technologies (ICECET), pages 1–6. IEEE, 2022.
- Fogel et al. [1966] Lawrence J Fogel, Alvin J Owens, and Michael J Walsh. Artificial intelligence through simulated evolution. John Wiley, 1966.
- Goldberg [2013] D.E. Goldberg. Genetic Algorithms. Pearson Education, 2013.
- Hahsler and Hornik [2007] Michael Hahsler and Kurt Hornik. New probabilistic interest measures for association rules. Intelligent Data Analitics, 11(5):437–455, oct 2007.
- Issad et al. [2019] Hassina Ait Issad, Rachida Aoudjit, and Joel JPC Rodrigues. A comprehensive review of data mining techniques in smart agriculture. Engineering in Agriculture, Environment and Food, 12(4):511–525, 2019.
- Kennedy and Eberhart [1995] J. Kennedy and R. Eberhart. Particle swarm optimization. In Proceedings of ICNN’95 - International Conference on Neural Networks, volume 4, pages 1942–1948 vol.4, 1995.
- Koza [1992] John R Koza. Genetic programming: on the programming of computers by means of natural selection. MIT press, 1992.
- Mishra et al. [2021] Monalisa Mishra, Prasenjit Choudhury, and Bibudhendu Pati. Modified ride-nn optimizer for the iot based plant disease detection. Journal of Ambient Intelligence and Humanized Computing, 12(1):691–703, 2021.
- Mohapatra and Rath [2022] Hitesh Mohapatra and Amiya Kumar Rath. Ioe based framework for smart agriculture. Journal of ambient intelligence and humanized computing, 13(1):407–424, 2022.
- Ouafiq et al. [2022] El Mehdi Ouafiq, Rachid Saadane, and Abdellah Chehri. Data management and integration of low power consumption embedded devices iot for transforming smart agriculture into actionable knowledge. Agriculture, 12(3):329, 2022.
- Rechenberg [1973] Ingo Rechenberg. Evolutionsstrategie Optimierung technischer Systeme nach Prinzipien der biologishen Evolution. Optimierung technischer Syste Frommann-Holzboog, Stuttgart, 1973.
- Sahitya et al. [2016] G Sahitya, N Balaji, and CD Naidu. Wireless sensor network for smart agriculture. In 2016 2nd International Conference on Applied and Theoretical Computing and Communication Technology (iCATccT), pages 488–493. IEEE, 2016.
- Storn and Price [1997] Rainer Storn and Kenneth Price. Differential evolution–a simple and efficient heuristic for global optimization over continuous spaces. Journal of global optimization, 11(4):341–359, 1997.
- Sörensen [2015] Kenneth Sörensen. Metaheuristics—the metaphor exposed. International Transactions in Operational Research, 22(1):3–18, 2015.
- Tanabe and Fukunaga [2014] Ryoji Tanabe and Alex S. Fukunaga. Improving the search performance of SHADE using linear population size reduction. In Proceedings of the 2014 IEEE Congress on Evolutionary Computation, CEC 2014, pages 1658–1665, 2014.
- Torres-Tello and Ko [2021] Julio Torres-Tello and Seok-Bum Ko. Interpretability of artificial intelligence models that use data fusion to predict yield in aeroponics. Journal of Ambient Intelligence and Humanized Computing, pages 1–12, 2021.
- Tzanetos and Dounias [2021] Alexandros Tzanetos and Georgios Dounias. Nature inspired optimization algorithms or simply variations of metaheuristics? Artificial Intelligence Review, 54(3):1841–1862, 2021.
- Vrbančič et al. [2018] Grega Vrbančič, Lucija Brezočnik, Uroš Mlakar, Dušan Fister, and Iztok Fister. Niapy: Python microframework for building nature-inspired algorithms. Journal of Open Source Software, 3(23):613, 2018.