Abstract
Keywords
Introduction
One of the main environmental problems in Brazil is the high rates of wildfires caused by human occupation, placing the country among the main responsible for the increase in greenhouse gas emissions in the world. Besides contributing to global warming and causing climatic changes, fires cause social and economic losses and precipitate the process of deforestation and loss of biodiversity of the country. Although government measures attempt to minimize this problem and punish those responsible for environmental disasters, the demand for land is currently the biggest reason of intense wildfire occurrences. Also, fires may also occur naturally in conservation areas due to increased drought and high-temperature events.
According to statistics from the National Institute for Space Research (INPE/Brazil) (http://www.inpe.br/queimadas/estatisticas.php), only in the year 2015 the reference satellite detected 236,371 fires. These fire outbreaks occurred 203,411 in conservation areas, with most of the biome Mata Atlântica (51%) and the biome Cerrado (37%)—see the full distribution in Figure 1. The average annual outbreaks detected since the start of monitoring (1998) is 175,870. These numbers may be even greater because the satellites detect fires from just 30 m long by 1 m wide. Figure 2 shows a comparison of the current year’s data with the maximum, medium, and minimum values, from 1998 to 21 January 2016. During the months from July to October, it is perceived that there is a greater number of fires, this is due to low humidity and high temperatures, very common in this season. However, the existence of satellite detection system is prominent to have approaches such as WSNs which perform the early detection of outbreaks of fires and notify in a timely manner managers and combat staff of the affected area.

Distribution of fire outbreaks per biome of Brazil.a

Comparison of the current year’s data with the maximum, medium, and minimum values, from 1998 until 21 January 2016. 1
WSN can be defined as a large number of sensor devices connected through a wireless communicative technology in order to perform monitoring of an area in a cooperative manner, and it has been employed in various scenarios such as control, monitoring of environment and traffic, security, medicine, and biology. It is peculiar of a WSN to depend on the self-organization and adaptive algorithms, as this makes them less dependent on a centralized control, making it the most scalable, adaptable, and robust. 2
This article aims to discuss the main research challenges related to the development of self-organizing and fault-tolerant WSN applications, especially some fire detection applications. Moreover, it presents a model that aims to fill the gap in the area, which is a model that responds to both low-level concerns and challenges regarding the application itself. As far it is known, research papers do not deal with both characteristics, or concentrate on the development of routing protocols or applications that do not take into account the fault tolerance and self-organization. The approach discussed in this article aims to address these two research challenges with a model that integrates both research areas.
Background and research challenges
With the continuous evolution of technology and the increasing software demand, computer systems have operated in more changeable environments, resulting in a continued increase in the administrative burden for managing these systems. The implication of this continuous evolution is that software systems need to become more versatile and flexible, more efficient in terms of energy consumption, fault tolerance, and self-optimization, adapting themselves according to the context they are inserted. This concern has been demonstrated by Garlan et al. 3 and Cheng et al. 4 and further increased over the years, due to high demand. Nevertheless, they need innovative approaches for building, running, and managing these systems.
WSNs can suffer several changes, which can be caused by (1) destruction or lack of energy of nodes, (2) problems in communication between the sensors, and (3) the network management algorithm, for example, to save energy or to have a neighboring node which already collects the same required data. Furthermore, inactive sensors can become active and new sensors can be inserted into the network. However, to manage all these changes and the WSN continue perform its function, it is essential to have self-organizing and fault-tolerant mechanisms. Section “Self-organizing mechanisms” presents the concepts and self-organization mechanisms while section “Fault-tolerant mechanisms” describes the fault-tolerance approaches.
Self-organizing mechanisms
Self-organization is a concept that enables systems made up of many subsystems operate autonomously to perform a group task. Moreover, self-organizing systems demonstrate an overall behavior, which can hardly be predicted or pre-programmed in a scalable manner. Investigations of properties of self-organization in natural systems began in the 1960 and since then have developed many techniques intrinsic to the fundamental concepts of self-organization. 5
The general technological systems become organized by external commands, such as human intentions leading to the construction of machines and structures. However, self-organizing systems are those that become structured through their own internal processes, in which the emergence of order in itself is a complex event that intrigues scientists from different fields. 6
Afterward, self-organization is defined as a standard process in which the overall level of a system arises only from the many interactions between the lower level elements of the system. Furthermore, it is specified by rules that the interactions between system components only be performed using only local information, that is, without reference to the overall pattern. 7
This section summarizes the idea of self-organization as the creation of a global behavior from local interactions between system elements. In all, some self-organizing properties are summarized in Table 1 by Dressler. 5
Properties of self-organizing systems. 5
As seen above, the WSN can be used in various scenarios and applications, and the sensors can be distributed manually at predetermined sites or thrown in the area that you want to monitor. The latter one should be applied where the network contains hundreds of sensors or in case that the monitored site is remote and inaccessible. WSNs can change their constantly topology for various reasons, such as lack of battery or destruction of nodes, new sensors can be inserted, and sensors can switch on and off to save power, among others. Therefore, these networks need to be self-organizing, that is, you must have the ability to adjust to change without human interference. 2
The main difficulties of a WSN in terms of self-organization would be easily solved with a global view of the network, so it would be possible to manage groups of sensors that need to interact, establish more intelligent data transmission routes, and check the sensors, which they can be turned off at certain times in order to save energy and therefore allow the long suffering of the network.
However, with respect to most of the applications in WSN, in practice it is required that they have autonomy, that is, work without human intervention as long as possible, and are scalable and robust. Thus, it is considered to be most beneficial to use algorithms located in the design of these networks, in which the sensors interact only with each other and collectively to achieve the overall goal. 2 Thus, self-organization in WSN is characterized by Loureiro et al. 2 as the ability to make changes in its structure without human action, so make them scalable and robust before the dynamic characteristics intrinsic to the type of the network.
In general, the methods of self-organization try to reduce or even extinguish the centralized control, taking into account the power constraints, processing power, storage, and mobility. 5 However, the most important concerns that must be addressed are scalability and network lifetime, briefly described below:
In context of complex and massively distributed systems, approaches such as feedback cycles, interactions between system components, and probabilistic techniques can be applied to achieve self-organization. 5 Considering that the domain of WSN and ad hoc network is very specific, a brief description of possible applications of these methodologies is given. Furthermore, some works related to this topic are presented in section “Related work”:
Fault-tolerant mechanisms
At the beginning of computer science, the concern in developing fault-tolerant systems were exclusively of critical system designers, such as industrial control systems, aircraft, and aerospace. However, with the popularization of the services offered on the network, the simplest of computers must present a minimum of reliability. In the case of WSN applications, it is crucial due to changes that may occur in the network and also the inherent applications.
The main goal of fault tolerance is to achieve dependability, which indicates the quality and confidence in the service delivered by a system. The concept of tolerance failure was first presented by Avizienis, 8 which says the following: a system is fault-tolerant if its programs can be run properly, despite the occurrence of logical flaws. That is, with fault tolerance can deliver the same service expected in the presence of faults.
All fault-tolerance techniques involve some type of redundancy, requiring additional components or special algorithms. They are generally divided into two categories: (1) masking or (2) detection, location, and reconfiguration. Adopted for critical real-time systems, often the first category is more employed than the second form of redundancy because it does not involve the time spent to detection, localization, and reconfiguration.
Replication hardware identical components to achieve fault tolerance are interesting, but in the case of software component, this approach is inadequate because identical software components will present identical errors. Therefore, copying a program and running it in parallel or running the same program twice does not achieve fault tolerance. Among the proposed techniques of redundancy to achieve software fault tolerance, it is worth to mention the N-Version Programming Technique proposed by Avizienis 9 and Recovery Blocks, 10 devised by Randell. 11 The first consists in the implementation of different alternatives, so that the system response is defined by vote. This technique does not take into account that errors in alternative solutions may originate from the same cause, such as error in the interpretation of the specification. Thus, so that errors are detected, it is necessary to express differently from other implementations. Second, though it is similar to the previous one, it differs in the fact that it involves an acceptance test. In this case, the minor versions will only be performed if an error is detected in the primary version, that is, the algorithms are executed one by one until the first pass the acceptance test.
Related work
This section presents the research work related to self-organization and fault tolerance, as well as wildfire detection applications developed for WSNs.
Works on self-organization and fault tolerance in WSNs
D Chen et al.
12
presented a model of a WSN application for monitoring emergency events. The model operates in two states,
K Tatara et al. 13 propose a decentralized solution to handle with the self-organization problem in many applications composed of a multitude of autonomous robotic sensors. This decentralized solution allows each robot to build and maintain the network, through local communication interactions with their neighbors, allowing robots choose as neighbors those with greater connectivity, adapting to the topological changes of the network through the robot’s movements. The proposal was validated through extensive simulations and realistic considering communication delays and robot failures.
M Vilela and R Araujo’s 14 work proposes a routing solution for mobile WSN consisting of fixed nodes and mobile. The solution aims to collect data from sensor nodes that send data to the sink, through intermediate nodes and different mobility. Basically, the solution consists of three phases: in the network training phase, all nodes receive the sink location information. In the second phase, an election of cluster-head is performed when an event occurs, considering the levels of mobility, away from the sink and energy. Thus, all data collected by the sensors are sent to the cluster-head. In the third phase, the data received by cluster-head are delivered to the sink. According to the research, the solution can be efficient in terms of messages of overhead and transmission of data packets. In addition, the main goal is that this solution is adaptable to different domains.
Y Joshi and M Younis 15 presented a distributed algorithm for autonomous repair (AUR) of damaged WSN topologies due to failures of sensor nodes. First, it is assumed that the nodes are aware of its position monitored area and by means of contemporary location schemes. It also assumes that all nodes have the same transmission range, which is much smaller than the monitored area. Failure of a node of the network may result in loss of connectivity and coverage. From this, the algorithm focuses on reestablishing connectivity, and the recovery process is started locally in the neighboring of failed nodes, moving them in the direction of loss, to reconnect with the other nodes. Moreover, to restore some coverage is used in self-propagation optimized by moving them to the center of the monitored zone. The simulation results show that the AUR exceeds the current solutions in terms of recovery of average degree of fault nodes and overhead coverage.
LA Villas et al. 16 present a Data Aggregation Aware Routing Protocol (DAARP) to select routes with the highest aggregation rate and perform reliable data aggregation transmission. The protocol considers four types of roles that sensor nodes can have: Collaborator, Coordinator, Sink, and Relay. It performs three phases: first, the node starts sink building the hop tree, which will later be used by the Coordinator to forward the data. The second phase consists of the cluster formation between nodes that detected the same event on the network; thereafter, it is held the election of Coordinator of the cluster, responsible for gathering the data of Collaborator and notifies them. The last stage is in charge of creating a new route for reliable transmission of data and updating the hop tree.
Wildfire detection applications of WSNs
M Hefeeda and M Bagheri 17 present a WSN project for early detection of fires from an analysis of the Fire Weather Index System (FWI), one of the most comprehensive systems risk notification of forest fires in North America. From this analysis, this work emphasizes the main aspects that should be considered in the modeling of fires and how different components of the FWI can be used in the design of efficient fire detection systems. The fire detection problem is solved with a distributed algorithm with K-coverage. Furthermore, a data aggregation scheme is proposed that extends the life of the network. The project was validated by simulation.
Y Liu et al. 18 propose a fire detection system that uses WSN application of multi-criteria to increase the detection accuracy of a wildfire because an alarm decision needs many attributes of a fire. The multi-criteria detection is implemented by an artificial neural network that combines the sensed data of various attributes of a fire into an alarm decision. The use of neural network allows self-learning and low network overhead. They assume that each node is aware of its location, provided by base station or Global Positioning System (GPS) device, and has various sensors, such as humidity and temperature. Using the prototype developed, experiments were conducted to evaluate the performance of the proposed system. The results show that the prototype fire alarm with high accuracy. Furthermore, a solar battery has been developed and proved to be able to meet the network for years.
In Yoon et al. 19 is presented a reliable monitoring system based on WSN deployed in adverse conditions, wherein asymmetric, irregular, and unreliable wireless links, routing problems, among others. Reliable communication systems is used in a fault-tolerant topology, ensuring the delivery of data to the base station and allowing real-time data display. In this work, 20 sensors were implanted very sparsely to collect temperature and humidity data. The nodes are designed to turn off their transceivers to save power and synchronize their sleep and wake-up cycles to simplify communication. Nodes that are awake may operate in normal mode or in warning mode. Alert mode implies that the fire was detected, which requires that the sensory data should be delivered as quickly as possible even though it consumes more energy. The end-to-end delay in data transmission to the sink node is reduced using a modified PISA-I routing algorithm (A priority-based routing algorithm for solar-powered WSNs). 20
Table 2 presents a summary of the related work highlighting the objectives, main approaches, and whether or not there was an application. Through the related works, it is possible to perceive that some of them employ common technical approaches, for example, it is noticed that the location of the sensor nodes is used in all the works, by exploring the routing tree or by GPS, as in case of Y Liu et al. 18
Summary of related work.
WSN: wireless sensor network.
In addition, the works of D Chen et al. 12 and I Yoon et al., 19 in order to achieve self-organization, use features such as switching status of sensor nodes and timing mechanisms, that is, sensors alternate between on and off, reducing the consumption of energy.
The works of M Vilela and R Araujo 14 and LA Villas et al., 16 in addition to the location, employ clustering of sensor nodes and leader election approaches. While the first one performs the clustering considering the connectivity of the mobile or fixed nodes, the second performs clustering based on the routing tree. In addition, the second one stands out because we can assume several roles and have a data aggregation mechanism based on routing.
This section emphasizes that it is scarce to find a WSN-related work that reunites self-organization and fault tolerance concerns in the same project, especially at different levels, such as in network and application layer. Also it is worth to mention that self-organization in WSN is firmly linked to exchange of sensor node states (or roles) and fault tolerance at the application level is achieved through diversity. Thus, the proposed model attempts fill this gap—a model to guide the development of WSN applications taking into account concerns at different levels, such as routing and application. In critical applications, such as fire detection, this is crucial.
Among the related works presented, those that allow some comparison with the following proposal, that is, the most similar works, are Hefeeda and Bagheri 17 and Liu et al. 18 by the application in fire detection and Villas et al. 16 by the self-organized communication protocol. All these works use aspects of location and aggregation in some way. As for the solution, while Hefeeda and Bagheri 17 use an algorithm distributed with k-coverage, Liu et al. 18 use a multi-criteria approach in conjunction with an artificial neural network. In our proposal, a fault-tolerance technique based on diversity of solutions and majority voting is applied. In addition, unlike the previous approaches in which the detection solution is located on the server, our solution is allocated on all sensor nodes and are started on demand, that is, the processing occurs in the network. Details of our proposal can be found in the next section.
A self-organized and fault-tolerant model
This section presents the model to achieve a WSN self-organizing and fault tolerant in wildfire detection applications in forests. The model consists of the following phases: (1) implementation and establishment of the network; (2) announcement event, clustering, and coordinator election; (3) coordination tasks and detection of wildfires, and (4) aggregation and sending data to the sink. Each step is explained in detail below.
Implementation and establishment of network
Initially, the nodes are randomly dropped on the area of interest and awaken to network formation. For this, the sink sends a control message on broadcast to the entire network in order to build the routing tree. That is, each node that receives the message calculates and stores the number of hops and sends the message to their neighbors. They continue doing this until the entire network is achieved. In accordance with Busulu et al.,
21
the recommended density of a WSN is close to 21.7 and its distribution, that is, the number of nodes required to monitor a region, can be calculated as
Announcement event, clustering, and coordinator election
The trigger event can occur in various ways depending on application requirements. An example of a fire detection application is when there is a considerable increase in temperature. A characteristic of WSNs, especially those applied in environmental monitoring, is to be dense networks, which increases network reliability and guarantees packet delivery even in case of failure of some nodes. However, it is common that multiple nodes detect the same event. Thus, an approach to prevent this and sending duplicate data to the Sink is the clustering of these nodes and the election of a node with the coordinating role. Thus, each node after collecting the data send them for analysis coordinator (Figure 3).

Announcement event, clustering, and coordinator election.
The election of a coordinator to be given in different ways. The model proposes a new algorithm for coordinator election (Algorithm 1). This algorithm is based on the leader election algorithm proposed by the DAARP protocol, 16 with the differential to consider the energy level of nodes in the choice for a better network load balancing.
Initially, the algorithm takes as input all nodes belonging to the cluster, that is, nodes which have detected the same event, since all are eligible. If the first event of the network will be elected Coordinator, the node has the shortest distance to the Sink. If the number of hops is equal, the node that has higher energy level will be elected. Finally, if there is a tie in both instances, the ID will be used as tiebreaker. Already from the second occurrence of the event, will be elected coordinator node, the node that has the smallest number of hops in the existing routing tree. Similarly, the first event will be considered the energy level and the ID to tiebreak, if necessary. All other nodes that detect the same event are nodes that own the collaborator role. The collaborators nodes transmit data detected for evaluation coordinator.
In this way, it is possible to ensure a better network energy balancing, because as the coordination tasks consume more energy, which is considered in the election. Thus, hardly a node will be elected coordinator more than once in a row.
Coordination tasks and detection of wildfires
In most of the research papers found in the literature, coordinating tasks are summarized to just collect data from collaborators aggregate and send to Sink, and send to Sink that is in charge of data analysis. This is due to the application being allocated only in the sink or the base station, not distributed by the network. Consequently, many data end up being sent to the sink, consuming unnecessary energy, since not all announced events are actually considered fire, as false alarms may occur and the application must be prepared for this.
In addition to the common tasks relevant to the coordinator, the model suggests that the detection of fire is performed on the coordinator, that is, the solution would be allocated to the sensors that are not in the base station. To do this, it is assumed that the solution was previously deployed in all sensors. However, it will only be instantiated only when the sensor is in the role of coordinator. Once the sensor is back to collaborator role, the application will be deallocated from memory. It is worth to say that this happens in an adaptive approach.
After all, in order to avoid overloading the network and make possible low power consumption, the proposed model encourages the utilization of software componentization. It is understood that solutions are prone to failure and therefore fault tolerance must be considered since the design of application. One way to implement fault tolerance in software is through diversity. That is, different algorithms address the same problem.
However, it is proposed that the fire detection is performed by various solutions, where in each solution is built as a component, which would
Aggregation and sending data
After completion of the consensus, that is, the final decision, the coordinator might or might not send the data to the Sink. The domain expert can set up as desired. For example, the configuration should be to send only positive results. As a consequence, there is a network energy saving, since there is no transmission of false alarms. However, if the coordinator wants to store all data for future statistical studies, it can be configured to send all events, trues and falses.
Furthermore, identical results may be aggregated to reduce the number of duplicate transmissions. Finally, Figure 4 summarizes the main activities of the proposed model steps.

Summary of the phases that comprise the model self-organizing and fault tolerant for fire detection.
Implementation details and evaluation
To evaluate and validate the model, a simulation was implemented in Sinalgo v. 0.75.3, 22 a framework developed in Java (https://www.java.com/) for testing and validating network algorithms.
The simulation was performed on the area of environmental preservation of the Botanical Garden of Brasilia, which is a nature conservation unit attached to the Secretariat of Environment and Water Resources of the Federal District. The institution owned 500 hectares of public visitation, covering various vegetation types Cerrado biome. It also has 4500 hectares of ecological reserve for research and conservation of the Cerrado. To achieve the density 21.7 and applying the density calculation presented in section “Implementation and establishment of network” for an area of 4500 hectares with radio communication of 100 m each node, approximately 31,082 nodes were necessary to monitor all ecological reserve.
Initially, the model sensors were able to monitor
At coordination of task phase (section “Coordination tasks and detection of wildfires”) resides the main differential of this work—to implement the solutions as components, allowing them to be loaded (and unloaded) at runtime and employing the N-version technique through the framework FlexFT.
23
FlexFT consists of a general structure, based on components and written in Java, for the construction of adaptive fault-tolerant system that integrates the various devices and technologies, both software and hardware. The framework consists of a small core where fault-tolerance policies are inserted on demand, as they are implemented as components and are instantiated as needed. FlexFT is built on the OpenCom,
24
which allows for the
As shown in Figure 5(a), the architecture of FlexFT is composed of two layers, fault-tolerant component frameworks and Component Runtime Kernel Layer. The first layer provides mechanisms for the development of systems based on reliable components. The second layer supports the development of reliable systems based on components. As shown in Figure 5(b), the approach implements different versions of reliable components. 23

FlexFT Framework: (a) FlexFT Arquitecture and (b) FlexFT Reliable Component. 23
The versions (FirstVariant, SecondVariant, …) are functionally similar components, which are constructed independently based on the same initial specification. ReliableComponent has the task of coordinating the implementation of the versions and call the relevant operations such the vote operation employed by the N-Version technique (section “Fault-tolerant mechanisms”). The binding mechanism has the task of calling the provided and required interfaces. 23
Prototype fire detection solution
The fire detection solution consists of three decision trees that were implemented as components: (1) DT1—Figure 6(a), (2) DT2—Figure 6(b), and (3) DT3—Figure 6(c).

Decision trees for fire detection: (a) DT1, (b) DT2, and (c) DT3.
These decision trees will be only loaded when the sensor node is playing the coordinator role, as mentioned before (section “A self-organized and fault-tolerant model”). In order to develop the decision trees, Forest Fires Data Set was used with 517 instances of UCI Machine Learning Repository 25 and the data mining tool Weka. 26
The first step was to classify the database together with a specialist in forest fire detection, that is, a manager responsible for the control team, management, and firefighting in the Brasilia Botanical Garden. Of all attributes of the dataset, it used only those that our sensor model is intended to detect, that is, wind, relative humidity, and temperature. The rain attribute was not used because it does not have any impact on decision trees, that is, it is an irrelevant attribute. The decision trees have been generated with different instances. Decision trees have different cross-validation rates, which are, respectively, 84.05%, 61.24%, and 73.66%. Details about the accuracy are presented in Tables 3–5. Their confusion matrix is presented in Tables 6–8, respectively.
Detailed accuracy by Class DT1.
TP rate: true positives; FP rate: false positives.
Detailed accuracy by Class DT2.
TP rate: true positives; FP rate: false positives.
Detailed accuracy by Class DT3.
TP rate: true positives; FP rate: false positives.
Confusion matrix DT1.
Confusion matrix DT2.
Confusion matrix DT3.
The purpose was to demonstrate that the decision trees can be different solutions with different classification rates, built by groups of features and levels of knowledge and different specialties. Without a doubt, the best solution is that built by a set of domain experts. Therefore, it is emphasized that the proposed model is effective in case of solutions built by these experts. However, these detection models can work together in order to increase the dependability.
As shown in Figure 7, the proposed component model diagram contains the DecisionTreeNV component and its variants DecisionTreeVariantOne, DecisionTreeVariantTwo, and DecisionTreeVariantThree. Each of these variants consists of the implementation of a fire detection solution, that is, respectively, the decision trees DT1, DT2, and DT3.

Proposed component model diagram.
As shown in Figure 8, the class diagram model contains the class DecisionTreeNV that represents the FlexFT ReliableComponent (Figure 5(a)) by extending the abstract class NVComponent and implementing the execute() method, taking into account the peculiarities inherent to N-Version programming technique. In addition to invoking the variants (

Solution class diagram.
Since the FlexFT framework offers a standard decide algorithm (majority) implemented by the NVComponent class, to meet the application requirements the method decide has been overridden in DecisionTreeNV class, which is responsible for calling the static method decide() in the class of interface IDecisionTree passing a list of results.
This results list is built by the algorithm decision() in DecisionTreeNV, which receives the data from the sensors and invokes the method run() passing as parameters the data for each variant. The returned results are stored, which subsequently are passed as parameters to the method decide(). In this case, the latter method counts the number of
Solution deployment in DAARP sensor node
To comply with the application requirements, it was necessary to reimplement a method of sensor node class implemented by the DAARP protocol. Previously, only the node received the data and headed for the sink node through the route established by the protocol.
Because the application is allocated on the sensor node when the SentInformationEvents method is called, it is verified if the node has the role of coordinator and if it has already received all the data, that is, when the variable send data equals true. If this is true, the application will start running. First, create the OpenCOM runtime environment and request the IOpenCOM interface. Soon after, the DecisionNV component and decision components are created, that is, decision trees. Afterward, the IDecisionTree interface is required and finally the decisions are executed, considering values of wind, humidity, and temperature provided by the sensor nodes. In this case, the message was passed by parameter to the method.
Subsequently, the results of the consensus are stored in a list and only positive results are sent to the Sink node. Note that this should be configured by the domain expert. In addition, you can configure to send all results or some adaptation taking into account expert guidance.
Results and discussion
The simulation was replicated 10 times with 6 events each, generating a total of 60 events. The values of wind, humidity, and temperature of each node were also generated randomly, considering a range of minimum and maximum values of the database.
The simulation was performed on a Notebook with Intel i5 2.4 GHz and 8 GB of RAM. A large number of sensors were dedicated 4 GB of RAM for the Java virtual machine and the simulation was performed via console, that is, without using the graphical interface Sinalgo. The simulation setup parameters are shown in Table 9.
Initial settings of Sinalgo project.
For analysis purposes, it was chosen by sending all results. The consensus of each event was analyzed and classified as:
The results of the consensus, presented in Figure 9, show that there are two kinds of decisions: (1) unanimous and (2) consensual majority:

Simulation results for 60 events.
In addition, if the application was configured in a such way that the coordinator node only send to the sink the events that produced
Furthermore, by looking at Figures 10 and 11, it is possible to see the effectiveness of the N-Version fault tolerance technique by means of observing (1) the variation of each consensus per round and (2) the variation of each consensus in all rounds respectively. It is possible to see that in almost all rounds there is the presence of partial consensus, that is, at least one detection model (decision tree) disagreed with the others, indicating a possible detection failure. Moreover, it is possible to note that in regard to the 10 rounds, the partial false appeared in 9 of them. Similarly, the true partial consensus appeared in 5 of them, showing a large distribution and high amount of consensus by majority votes, that is, without unanimity.

Variation of each consensus per round.

Variation of each consensus in all rounds.
For the purposes of comparison and considering the accuracy rates, the work of M Hefeeda and M Bagheri 17 presents in their approach a 95% fire detection rate, considering only the temperature. However, our work shows that analyzing only temperature data in the fire detection process is not enough and can lead to unequivocal detection. This is due to the fact that 20% of the events initially announced, considering the increase in temperature, were considered false events, when wind and relative humidity data became part of the detection. In addition, Y Liu et al., 18 using infrared camera and multi-criteria approaches, achieved detection rates of up to 100% when at a distance of 10 cm from the focus. However, this accuracy rate decreased dramatically as the distance between the sensor node and focus increases. For example, the accuracy decreases to 30% when the sensor is within 30 cm of the focus, showing to be an inefficient approach in monitoring large areas. Regarding the other related works presented, they are focused on the self-organizing mechanisms in the protocol or low-level layers, focusing on increasing network lifetime and saving energy. Considering the different aspects, this work contributes to the fact that in this sensory context, if one considers the application of the network, it is possible to obtain an economy in the number of transmissions of up to 65%.
In addition, unlike the approaches presented in section “Related work,” this work stands out for presenting a fire detection model that uses a set of decision trees, which consider data of wind, humidity, and temperature for decision making. Beyond which, it stands out for fault tolerance in the WSN application.
Concluding remarks and future works
This article presents a self-organizing and fault-tolerant model for wildfire detection in areas of environmental preservation. The main objective was to develop a model which aggregates concerns at various levels in a WSN. The main differential of this study was to explore how the componentization of software, mixed with software diversity techniques (N-Versions programming), can be used in WSN both to create self-adaptive low-power applications and to develop fault-tolerant applications.
To achieve different levels of self-organization and fault tolerance, it was necessary to integrate various approaches and solutions previously proposed, among them, the protocol DAARP 16 and the frameworks: FlexFT, 23 OpenCOM, 24 and Sinalgo. 22
The objective of this work was not to develop the best fire detection solution, considering that a strong group of heterogeneous professionals is required in the development process. However, this can be considered a step of every journey. Moreover, the differential of this application is to be allocated in the sensor nodes that form the network, being instantiated when the node assumes the coordinator role, avoiding the unnecessary sending of data to the base station, where a large part of the applications are allocated in the literature.
Through the simulation on the area of the Botanical Garden of Brasilia, it was possible to show the model of implementation feasibility in a real scenario. Using the N-Version Programming technique through FlexFT framework, it was possible to demonstrate that there are possible evidence of failures in decision trees, which is true, since the class rate are not very high. Moreover, it was considered that the general solutions can not perfect and that the organization of different solutions can increase confidence in the application.
It is also noticed that many of the detected events were just false alarms, considering that the announcements of events took into account only an increase in temperature. That is, wind and relative humidity will greatly contribute to the process of wildfire detection. Thus, no transmission of alarms can have a considerable saving of energy and hence an increase in network lifetime.
Finally, by what is known in the literature, it is possible to list the following contributions of this work:
A self-organized and fault-tolerant model of WSN for wildfire detection. So far it is known that a model in fire detection context has not been reported in the literature that systematizes the process of a WSN.
A software solution prototype for fire detection. The proposed solution stands out for the following reasons: (1) is allocated in the sensor nodes, not on the server as the work in the literature, allowing early detection and saving transmissions, given that false alarms are not sent to the sink node and base station; (2) use of wind, temperature, and humidity data, which makes the process less expensive than the solutions using video, in which case the majority are in the literature; (3) constructed using an adaptive approach; (4) has a higher fire detection range and accuracy compared to infrared camera-based approaches.
Brings together aspects of self-organization and fault tolerance at different levels. So far it is known in the literature that there are no studies that address together aspects at different levels in WSN for fire detection. The proposed model addresses both these aspects in the routing and the application level.
Application of component redundancy technique, in particular, N-Version Programming, whose development was based on components in a sensor network application. Through the consensus of different solutions implemented as components was possible to identify possible evidence of failures in the application level, increasing confidence in the service.
Framework Integration FlexFT 23 to Sinalgo 22 can be used in the construction of new fault-tolerant solutions in Sinalgo. This goes for the application and routing levels.
Classification of Forest Fires Date Set. 25 Instances were classified as “Fire” and “No Fire” with monitoring and validation of a domain expert. In this case, the manager of a firefighting team.
Simulation on the environmental reserve of the Botanical Garden of Brasilia. The simulation took place over an area of 4500 hectares. This enabled to be aware of the number of nodes necessary by the distribution density calculation.
Finally, the following studies and future works are suggested:
Within the scope of fire detection application, develop solutions to analyze the side that the fire is growing. This greatly helps the team fight to take action and prevent at risk to human life.
To develop other applications using the model, such as flood monitoring applications, pollution, and various applications of smart cities.
Using other data mining models and artificial intelligence in our detection model, such as Bayesian networks and neural networks.
Building an application server side, to analyze statistical data to assist in the development of new applications and facilitate the management of environmental preservation.
