Application of Fault Tree Analysis and Fuzzy Neural Networks to Fault Diagnosis in the Internet of Things (IoT) for Aquaculture

In the Internet of Things (IoT) equipment used for aquaculture is often deployed in outdoor ponds located in remote areas. Faults occur frequently in these tough environments and the staff generally lack professional knowledge and pay a low degree of attention in these areas. Once faults happen, expert personnel must carry out maintenance outdoors. Therefore, this study presents an intelligent method for fault diagnosis based on fault tree analysis and a fuzzy neural network. In the proposed method, first, the fault tree presents a logic structure of fault symptoms and faults. Second, rules extracted from the fault trees avoid duplicate and redundancy. Third, the fuzzy neural network is applied to train the relationship mapping between fault symptoms and faults. In the aquaculture IoT, one fault can cause various fault symptoms, and one symptom can be caused by a variety of faults. Four fault relationships are obtained. Results show that one symptom-to-one fault, two symptoms-to-two faults, and two symptoms-to-one fault relationships can be rapidly diagnosed with high precision, while one symptom-to-two faults patterns perform not so well, but are still worth researching. This model implements diagnosis for most kinds of faults in the aquaculture IoT.


Introduction
The Internet of Things (IoT) has made a remarkable contributions to aquaculture production, scientific breeding, early warning and intelligent remote control. The aquaculture IoT through which we can monitor dissolved oxygen (DO) content [1], track crab behavior [2] and predict DO [3] in water has been applied in several provinces in China such as Jiangsu, Shandong and Tianjin. These applications have begun to change traditional aquaculture into intensive aquaculture [4]. However, the equipment of the aquaculture IoT is often deployed in outdoor ponds located in remote areas. Faults occurs frequently in these tough environments. Furthermore, the staff generally lacks professional knowledge and pays a low degree of attention in the remote areas. Once faults happen, expert personnel have to check the IoT on the field and carry out maintenance outdoors. This traditional fault diagnosis method causes enormous losses of resources, economic and environment [5], so effective fault diagnosis methods to guarantee the safety of the aquaculture IoT are urgently needed in this sector.
In the literature three kinds of methods have been used to diagnose faults: signal-based methods, analytical-based methods and knowledge-based methods. Rafaat proposed a signal-based method to detect faults at an early stage. The method can identify outer-race faults using stator current signals [6].

Fault Definition in the Aquaculture IoT
Faults are complex, and each part in each layer in the overall system can fail. Because of the harsh environment, outdoor equipment can failed in the data acquisition layer or the communication layer. Sensors can be eroded by pollution and microorganisms. Wireless communications can also be disturbed or fail easily due to the environment or human errors in the complex application environment. In the storage layer and application layer, faults like software crashes occur. Power supply faults because of different power sources, like batteries, main power or photovoltaic panel power can happen. Once faults happen, it could lead to wrong decisions, waste

Fault Definition in the Aquaculture IoT
Faults are complex, and each part in each layer in the overall system can fail. Because of the harsh environment, outdoor equipment can failed in the data acquisition layer or the communication layer. Sensors can be eroded by pollution and microorganisms. Wireless communications can also be disturbed or fail easily due to the environment or human errors in the complex application environment. In the storage layer and application layer, faults like software crashes occur. Power supply faults because of different power sources, like batteries, main power or photovoltaic panel power can happen. Once faults happen, it could lead to wrong decisions, waste of resources, even threaten the security of aquatic products, which would result in significant economic and human resource losses.
Thus faults definition is important and necessary for fault diagnosis in the aquaculture IoT. The faults are classified based on the fault location and numerical characteristics. In fact, a fault can occur at different locations. The red spots in Figure 2 show the possible locations where a fault can occur. of resources, even threaten the security of aquatic products, which would result in significant economic and human resource losses.
Thus faults definition is important and necessary for fault diagnosis in the aquaculture IoT. The faults are classified based on the fault location and numerical characteristics. In fact, a fault can occur at different locations. The red spots in Figure 2 show the possible locations where a fault can occur. First, the faults are classified into six groups based on the fault location. Table 1 shows the six groups: sensor faults, collector faults, environmental interference, software faults, communication faults and power faults.  First, the faults are classified into six groups based on the fault location. Table 1 shows the six groups: sensor faults, collector faults, environmental interference, software faults, communication faults and power faults. The hardware faults often refers to node faults, which means the loss of part or all the specified function of a node. Sensor, collector and power supplies belong to the hardware in the IoT: Second, the faults can be divided into six types based on their numerical characteristics. The six fault types are constant output, constant gain, constant deviation, numerical mutation, missing data, and supply voltage faults. The numerical characteristics are extracted from a deviation that the fault data differs from the normal historic data. The fault output value is represented as f (t), and the normal output value is represented as β 0 (t). The six kinds of faults are as follows: • Constant output. Output is a constant value, and expressed by the following equation: where C is a constant value.
Take the dissolved oxygen (DO) for example. A comparison between a constant failure and a normal output is shown in Figure 3. Normal DO ranges from 4-9 mg/L (blue line), while the collected value remains unchanged at 13 mg/L, and this faulty constant output is represented by the red line. The hardware faults often refers to node faults, which means the loss of part or all the specified function of a node. Sensor, collector and power supplies belong to the hardware in the IoT: operating systems or application software, respectively. The software fault symptoms include "-" readings, unchanged data and collectors refusing to transfer logger data. (f) Environmental interferences might affect the normal operation of the IoT, because the equipment is placed outdoors. The symptoms include missing data, zero readings and reading distortion not being "-".
Second, the faults can be divided into six types based on their numerical characteristics. The six fault types are constant output, constant gain, constant deviation, numerical mutation, missing data, and supply voltage faults. The numerical characteristics are extracted from a deviation that the fault data differs from the normal historic data. The fault output value is represented as f(t), and the normal output value is represented as β0(t). The six kinds of faults are as follows:


Constant output. Output is a constant value, and expressed by the following equation: where C is a constant value. Take the dissolved oxygen (DO) for example. A comparison between a constant failure and a normal output is shown in Figure 3. Normal DO ranges from 4-9 mg/L (blue line), while the collected value remains unchanged at 13 mg/L, and this faulty constant output is represented by the red line.

•
Constant gain. Constant gain occurs when the data maintains an unchanged multiple of the normal data, expressed by the following equation: where k denotes the gain coefficient. Figure 4 shows that there is a similar variation between the fault data represented by the red line and the normal data represented by the blue line, where b = 1.5.
where k denotes the gain coefficient. Figure 4 shows that there is a similar variation between the fault data represented by the red line and the normal data represented by the blue line, where b = 1.5.


Constant deviation. The collected data shows a constant bias when the sensor generates a slow drift for a long time. This fault can be expressed by the equation: where ∆S denotes the deviation value. As shown in Figure 5, the fault data represented by the red line and the sample data represented by the blue line differ by a constant, where ∆S = 5.  Numerical mutation. The acquired value becomes overrun or is much less than normal. The fault can be expressed by the following equation: • Constant deviation. The collected data shows a constant bias when the sensor generates a slow drift for a long time. This fault can be expressed by the equation: where ∆S denotes the deviation value. As shown in Figure 5, the fault data represented by the red line and the sample data represented by the blue line differ by a constant, where ∆S = 5.
where k denotes the gain coefficient. Figure 4 shows that there is a similar variation between the fault data represented by the red line and the normal data represented by the blue line, where b = 1.5.


Constant deviation. The collected data shows a constant bias when the sensor generates a slow drift for a long time. This fault can be expressed by the equation: where ∆S denotes the deviation value. As shown in Figure 5, the fault data represented by the red line and the sample data represented by the blue line differ by a constant, where ∆S = 5.  Numerical mutation. The acquired value becomes overrun or is much less than normal. The fault can be expressed by the following equation: • Numerical mutation. The acquired value becomes overrun or is much less than normal. The fault can be expressed by the following equation: where ∂ denotes the mutation value and δ(t) is a random function representing the time a numerical mutation occurs. In Figure 6, the fault sample represented by the red line is randomly generated, and there is no law at all.
where  denotes the mutation value and δ t ( ) is a random function representing the time a numerical mutation occurs. In Figure 6, the fault sample represented by the red line is randomly generated, and there is no law at all.  Supply voltage fault. A remarkable feature of power failures is that the supply voltage continues to decline, even down to 3600 mV. As shown in Figure 7, the voltage fault data represented by the red line continues to decrease to 3600 mV, and even less.  Missing data. Missing data is caused by a collector refusing to transfer data or software errors.

Fault Tree Analysis
A fault tree displays a logic structure of a physical system using event symbols and logic symbols. The input and the output of the network should be determined by "IF-THEN" rules before the ANN training. Furthermore, rules acquisition becomes difficult in this complex nonlinear system, which causes redundancy and combinatorial explosion of rules. Therefore, fault trees are • Supply voltage fault. A remarkable feature of power failures is that the supply voltage continues to decline, even down to 3600 mV. As shown in Figure 7, the voltage fault data represented by the red line continues to decrease to 3600 mV, and even less.
where  denotes the mutation value and δ t ( ) is a random function representing the time a numerical mutation occurs. In Figure 6, the fault sample represented by the red line is randomly generated, and there is no law at all.  Supply voltage fault. A remarkable feature of power failures is that the supply voltage continues to decline, even down to 3600 mV. As shown in Figure 7, the voltage fault data represented by the red line continues to decrease to 3600 mV, and even less.  Missing data. Missing data is caused by a collector refusing to transfer data or software errors.

Fault Tree Analysis
A fault tree displays a logic structure of a physical system using event symbols and logic symbols. The input and the output of the network should be determined by "IF-THEN" rules before the ANN training. Furthermore, rules acquisition becomes difficult in this complex nonlinear system, which causes redundancy and combinatorial explosion of rules. Therefore, fault trees are

•
Missing data. Missing data is caused by a collector refusing to transfer data or software errors.

Fault Tree Analysis
A fault tree displays a logic structure of a physical system using event symbols and logic symbols. The input and the output of the network should be determined by "IF-THEN" rules before the ANN training. Furthermore, rules acquisition becomes difficult in this complex nonlinear system, which causes redundancy and combinatorial explosion of rules. Therefore, fault trees are developed first to solve these difficulties. Then the "IF-THEN" rules are extracted from the fault trees. Figure 8 shows the symbols used in a fault tree. The rectangle represents an intermediate or a top event, and the circle represents a bottom event. The AND gate defines the situation that the output event will exist if all the input events exist in the same time. An OR gate presents the logical operation in the situation where one or more of the input events is required to produce the output event [23]. developed first to solve these difficulties. Then the "IF-THEN" rules are extracted from the fault trees. Figure 8 shows the symbols used in a fault tree. The rectangle represents an intermediate or a top event, and the circle represents a bottom event. The AND gate defines the situation that the output event will exist if all the input events exist in the same time. An OR gate presents the logical operation in the situation where one or more of the input events is required to produce the output event [23]. Step 1: Fault-tree establishment begins with the statement of a most undesired event-fault as the top event; Step 2: Input events need to be found, from which can be referred to higher output events; Step 3: Repeat step 2 until the bottom events (basic events) are obtained; Step 4: Connect all levels events with appropriate logical symbols to form the fault tree.
The rules in the qualitative knowledge base are extracted from the fault tree. The rules are expressed as: where P is a set of prerequisites connected by "AND" and "OR", i p P  . Q is a set of conclusions, i q Q  . The conclusion launches when the rule meets the prerequisites.
If the logic gate is "AND", the rule is expressed as: If the logic gate is "OR", the rule is expressed as:  Step 1: Fault-tree establishment begins with the statement of a most undesired event-fault as the top event; Step 2: Input events need to be found, from which can be referred to higher output events; Step 3: Repeat step 2 until the bottom events (basic events) are obtained; Step 4: Connect all levels events with appropriate logical symbols to form the fault tree.
The rules in the qualitative knowledge base are extracted from the fault tree. The rules are expressed as: IF P, THEN Q where P is a set of prerequisites connected by "AND" and "OR", p i ∈ P. Q is a set of conclusions, q i ∈ Q. The conclusion launches when the rule meets the prerequisites. If the logic gate is "AND", the rule is expressed as: If the logic gate is "OR", the rule is expressed as: 3.

Fuzzy Neural Network
FNN has the advantages of both ANN and fuzzy theory. The inputs are the fault symptoms and the outputs are the faults. Parameters of the sample are chosen to describe the fault symptoms: water temperature, dissolved oxygen (DO), communication signals, etc. However, these parameters are sometimes unstable in the IoT, and cannot be expressed in a uniform way, which costs lots of memory and time in model establishment. Therefore, fuzzy set theory is used combined with a back propagation neural network (BPNN) to handle the problems. The input vector as the fault symptom vector can be expressed as X = [x 1 , x 2 , . . . , x n ] T . The output vector as the fault vector can be expressed as Y = [y 1 , y 2 , . . . , y n ] T .
For the fuzzification layer, rules are converted into fuzzy sets in the form of degree of membership. Rules can be divided into numerical rules and non-numerical rules. The numerical fault symptoms are converted into three fuzzy sets for the input: 'increase', 'steady' and 'decrease' corresponding to the membership degree {f1, f2, f3}. The non-numerical fault symptoms are converted into two fuzzy sets: 'exists' and 'does not exist' corresponding to the membership degrees {f4, f5}. The values of f1~f5 all range from 0 to 1, which are based on experimental and historical data of each fault symptom.
For the output layer, the conversion is similar to the fuzzfication of the input layer. The fault situation can be expressed by five fuzzy sets: 'exists', 'may exist', 'not sure exist or not exist', 'not likely to exist' and 'does not exist', corresponding to specific membership degrees {d1, d2, d3, d4, d5}. Values of d1~d5 all range from 0 to 1, which are based on experimental and historical data of each fault.

Fault Diagnosis Using Fault Tree Analysis
The fault tree of the IoT is divided into six sub-modules based on fault definitions: power fault tree, collector fault tree, sensor fault tree, software fault tree, environmental interference fault tree and communication modules fault tree. Figure  For the output layer, the conversion is similar to the fuzzfication of the input layer. The fault situation can be expressed by five fuzzy sets: 'exists', 'may exist', 'not sure exist or not exist', 'not likely to exist' and 'does not exist', corresponding to specific membership degrees {d1, d2, d3, d4, d5}. Values of d1~d5 all range from 0 to 1, which are based on experimental and historical data of each fault.

Fault Diagnosis Using Fault Tree Analysis
The fault tree of the IoT is divided into six sub-modules based on fault definitions: power fault tree, collector fault tree, sensor fault tree, software fault tree, environmental interference fault tree and communication modules fault tree. Figure

•
Damaged sensor probes can be inferred from the basic symptoms high dissolved oxygen values and sensor away from aquatic plants.

•
Sensor sinking to the bottom can be inferred from the basic symptom dissolved oxygen value changing linearly or low dissolved oxygen values.

•
Other sensor fault symptoms can be inferred from the basic symptoms abnormal rate of change in value, below the threshold, higher than the threshold or high temperature.


Other communication faults can be inferred from the basic symptoms device offline, high network energy signals and weak communicational signal.  SIM card failures can be inferred from the basic symptoms device offline, high network energy signals and strong communicational signal.
Environmental interference can be inferred from the basic symptom data missing, reading "0" or reading distortion non "-". Software faults can be inferred from the basic symptom reading "-", collector refusing to transfer data from a logger or unchanged data. Collector faults can be inferred from the basic symptoms reading 0, reading distortion non "-" and abnormal rates of change in a value.

Fault Diagnosis by Fuzzy Neural Network
The FNN includes input layer, fuzzification layer, hidden layer and output layer. In the input layer, the input vector X = [x1, x2, …, xn] T , where n equals 22, is the fault symptom. The input layer includes 22 nodes corresponding to the fault symptoms X1~X22. These fault symptoms are listed in Table 2. In the fuzzification layer, the quantitative value is converted from the fault symptoms. The  numerical fault symptoms, such as X1, X2, X3, X4, X8, X9, X10, X12, X16, X17, are converted into three fuzzy sets: "increase", "steady" and "decrease". The fuzzy sets are then represented by degree

•
Other communication faults can be inferred from the basic symptoms device offline, high network energy signals and weak communicational signal. • SIM card failures can be inferred from the basic symptoms device offline, high network energy signals and strong communicational signal.
Environmental interference can be inferred from the basic symptom data missing, reading "0" or reading distortion non "-". Software faults can be inferred from the basic symptom reading "-", collector refusing to transfer data from a logger or unchanged data. Collector faults can be inferred from the basic symptoms reading 0, reading distortion non "-" and abnormal rates of change in a value.

Fault Diagnosis by Fuzzy Neural Network
The FNN includes input layer, fuzzification layer, hidden layer and output layer. In the input layer, the input vector X = [x 1 , x 2 , . . . , x n ] T , where n equals 22, is the fault symptom. The input layer includes 22 nodes corresponding to the fault symptoms X1~X22. These fault symptoms are listed in Table 2. In the fuzzification layer, the quantitative value is converted from the fault symptoms. The numerical fault symptoms, such as X1, X2, X3, X4, X8, X9, X10, X12, X16, X17, are converted into three fuzzy sets: "increase", "steady" and "decrease". The fuzzy sets are then represented by degree of membership, which depends on expert experience. Table 3 shows the distribution of the fault degree of membership. Take the degree of membership of DO for example. The value of the target DO sensor is compared with the value of other DO sensors in the same pond. All of the readings is still within the normal threshold in the same environment. Considering that change of DO content is in a certain scope in a pond, differences of DO ranging from 4 mg/L to 9 mg/L are normal, otherwise they are abnormal, so when the reading of the target DO sensor is 4 mg/L lower than the average of others, the membership degree is 0.1. When the difference is between 4 mg/L and 9 mg/L, the membership degree is 0.5. When the target reading is 9 mg/L higher than the average reading, the membership degree is 0.9.
The prerequisite is the fault symptom and the conclusion is the fault. The inputs of the hidden layer are the memberships converted from the fault symptoms. The hidden layer includes 10 nodes. The Tansig function is the transfer function.
In the output layer, the output vector Y = [y 1 , y 2 , . . . , y n ] T , where n = 13, is the faults. The output layer includes 13 nodes corresponding to the faults Y1~Y13. These fault symptoms are listed in Table 4.  Due to the complexity of the aquaculture IoT, one fault can cause various fault symptoms and one symptom can be caused by a variety of faults. Four types of fault patterns are chosen to test the fuzzy neural network using simulated data, such as one-to-one, one-to-many, many-to-many and many-to-one mapping relationships.

Discussion
The FNN is established using the Matlab r2013b back propagation neural network toolbox. The input layer includes 22 nodes corresponding to the fault symptoms X1~X22. The output layer includes 13 nodes corresponding to the faults Y1~Y13. According the analysis of the 22 fault symptoms as the input layer nodes and the 13 output layer nodes for the Internet of Things (IoT) in aquaculture, we selected 10 nodes as hidden layer nodes. In the Discussion section, the results show the 10 hidden layer nodes can satisfy the fault diagnosis for the Internet of Things (IoT) in aquaculture. Training samples are obtained from practical maintenance experience. Figure 11 shows the training results of the FNN. The network converges quickly and achieves the best accuracy in epoch 50. Due to the complexity of the aquaculture IoT, one fault can cause various fault symptoms and one symptom can be caused by a variety of faults. Four types of fault patterns are chosen to test the fuzzy neural network using simulated data, such as one-to-one, one-to-many, many-to-many and many-to-one mapping relationships.

Discussion
The FNN is established using the Matlab r2013b back propagation neural network toolbox. The input layer includes 22 nodes corresponding to the fault symptoms X1~X22. The output layer includes 13 nodes corresponding to the faults Y1~Y13. According the analysis of the 22 fault symptoms as the input layer nodes and the 13 output layer nodes for the Internet of Things (IoT) in aquaculture, we selected 10 nodes as hidden layer nodes. In the Discussion section, the results show the 10 hidden layer nodes can satisfy the fault diagnosis for the Internet of Things (IoT) in aquaculture. Training samples are obtained from practical maintenance experience. Figure 11 shows the training results of the FNN. The network converges quickly and achieves the best accuracy in epoch 50.  Table 5 shows the test results of the two symptoms (X3, X5) to one fault (Y1) relationship, which means two symptoms caused by one fault. The fault symptoms low network energy signal (X3) and device offline (X5) exist in this situation, which are the inputs. After the tests, the output value of mains power breakdown (Y1) is 1, while the rest of the outputs are much less than 0.001. Power breakdown exists based on the membership function. The results are close to the reality, so this pattern is reliable. Table 6 shows the test results of a two symptoms (X2, X18) to two faults (Y8, Y9) relationship, which means two symptoms caused by two faults. The fault symptoms high temperature (X2) and data missing (X18) exist in this situation, which are the inputs. After the test, the output value of the sensor fault (Y8) is 0.861683, and the communication fault (Y9) is 0.99811, while the rest of the outputs are much less than 0.001. The faults exist based on the membership function. The results are close to the reality, so this pattern is reliable. Table 7 shows the test results of a one symptom (X20) to one fault (Y12) relationship, which means one symptom caused by one fault. The fault symptom reading "-" (X20) exists in this situation, which is the input. After the test, the output value of the software fault (Y12) is 1, while the rest of the outputs are much less than 0.001. A software fault exists based on the membership function. The results are close to the reality, so this pattern is reliable. Table 8 shows the test results of a one symptom (X19) to two faults (Y11, Y13) relationship, which means one symptom caused by two faults. The fault symptom reading 0 (X19) exists in this situation, which is the input. After the test, the output value of the environmental  Table 5 shows the test results of the two symptoms (X3, X5) to one fault (Y1) relationship, which means two symptoms caused by one fault. The fault symptoms low network energy signal (X3) and device offline (X5) exist in this situation, which are the inputs. After the tests, the output value of mains power breakdown (Y1) is 1, while the rest of the outputs are much less than 0.001. Power breakdown exists based on the membership function. The results are close to the reality, so this pattern is reliable. Table 6 shows the test results of a two symptoms (X2, X18) to two faults (Y8, Y9) relationship, which means two symptoms caused by two faults. The fault symptoms high temperature (X2) and data missing (X18) exist in this situation, which are the inputs. After the test, the output value of the sensor fault (Y8) is 0.861683, and the communication fault (Y9) is 0.99811, while the rest of the outputs are much less than 0.001. The faults exist based on the membership function. The results are close to the reality, so this pattern is reliable. Table 7 shows the test results of a one symptom (X20) to one fault (Y12) relationship, which means one symptom caused by one fault. The fault symptom reading "-" (X20) exists in this situation, which is the input. After the test, the output value of the software fault (Y12) is 1, while the rest of the outputs are much less than 0.001. A software fault exists based on the membership function. The results are close to the reality, so this pattern is reliable. Table 8 shows the test results of a one symptom (X19) to two faults (Y11, Y13) relationship, which means one symptom caused by two faults. The fault symptom reading 0 (X19) exists in this situation, which is the input. After the test, the output value of the environmental interference (Y11) is 0.37441; the output value of the collector fault (Y13) is 0.31786. The faults environmental interference and collector are both not likely to exist, while both faults should exist, so this pattern has some errors when diagnosing faults, however it's still worth researching, as the rest of the outputs are much less than 0.001.       In four relationships, the one to one, two to two, and two to one relationships perform better than the one to two relationship in the fuzzy neural network training. The one to many relationship is still worth researching. "One symptom to two faults" means that just one symptom is observed when two faults occur in the same time. This situation hardly occurs in reality, especially when a system just runs for couple of years, so that lack of data is the main reason for the worse performance.

Conclusions
This study present an intelligent method based on fault tree analysis and a fuzzy neural network to diagnose faults in the IoT of aquaculture. In this method, six fault trees are developed based on fault definition. These trees display clear logic relationships of symptoms and faults in the IoT. It also provides a basis for the fuzzy neural network modeling. The FNN model is trained to modify connection weights and thresholds, and obtain the nonlinear mapping relationships between fault pairs. The results obtained from experimental applications made on the aquaculture IoT show that this model implements diagnosis for most kinds of faults. By this study, the model provides users with fault information and maintenance suggestions. Furthermore, the application has reduced the reliance on experts, changed the traditional way of fault diagnosis, and guaranteed the safety of the aquaculture IoT.
Further work needs to be performed. First, as this aquaculture IoT has just been developed for a short time, the fault data in the aquaculture IoT is not sufficient. Thus, gathering more fault information and accumulating more experience are necessary to improve the knowledge base. Second, the one symptom to two fault symptoms relationship needs to be researched to make this method suitable for most situations. Data accumulation can improve the performance in some degree, and some algorithms may optimize the fuzzy neural network in future. Third, the choice of membership degree still relies on expert experience in this method. A proper fuzzy function should be considered to improve the model's accuracy in future work.