Skip to main content

Node fault diagnosis algorithm for wireless sensor networks based on BN and WSN


Wireless sensor networks, as an emerging information exchange technology, have been widely applied in many fields. However, nodes tend to become damaged in harsh and complex environmental conditions. In order to effectively diagnose node faults, a Bayesian model-based node fault diagnosis model was proposed. Firstly, a comprehensive analysis was conducted into the operative principles of wireless sensor systems, whereby fault-related features were then extrapolated. A Bayesian diagnostic model was constructed using the maximum likelihood method with sufficient sample features, and a joint tree model was introduced for node diagnosis. Due to the insufficient accuracy of Bayesian models in processing small sample data, a constrained maximum entropy method was proposed as the prediction module of the model. The use of small sample data to obtain the initial model parameters leads to improved performance and accuracy of the model. During parameter learning tests, the limited maximum entropy model outperformed the other two learning models on a smaller dataset of 35 with a distance value of 2.65. In node fault diagnosis, the diagnostic time of the three models was compared, and the average diagnostic time of the proposed diagnostic model was 41.2 seconds. In the node diagnosis accuracy test, the proposed model has the highest node fault diagnosis accuracy, with an average diagnosis accuracy of 0.946, which is superior to the other two models. In summary, the node fault diagnosis model based on Bayesian model proposed in this study has important research significance and practical application value in wireless sensor networks. By improving the reliability and maintenance efficiency of the network, this model provides strong support for the development and application of wireless sensor networks.

1 Introduction

In the era of data informatization, data collection is one of the main ways to obtain information. Wireless sensor networks have been widely used in many fields due to their advantages such as low cost, strong adaptability, and small size. However, in complex and harsh environments, WSN nodes are prone to damage, such as node energy depletion, node hardware damage, etc. [1]. These faults can hinder the functionality of nodes and reduce the efficiency of the entire system. In order to help system administrators, detect node failures in a timely manner, it is necessary to take timely measures to repair or replace nodes. The traditional rule-based sensor fault detection method uses predefined rules and thresholds to determine whether a node has failed [2]. Based on rules and threshold methods, when the output value of a sensor exceeds a certain threshold or is not within a predetermined range, it is considered that the sensor has failed. These rules and thresholds are usually based on experience or expert knowledge. In addition, there are also fault detection methods based on pattern matching. This method establishes a statistical model by analyzing historical data and prior knowledge, and determines whether a node has faults by calculating the probability of each type of fault. The fault diagnosis effect of this technology is average, but the diagnostic efficiency is poor [3]. At present, machine learning has good applications in the field of sensor fault node diagnosis. For example, the latest machine learning fault diagnosis method adopts a data-driven approach, which identifies fault patterns by analyzing a large amount of data [4].

Compared with traditional methods, it does not rely on predefined rules and thresholds, has higher automation capabilities, and has higher diagnostic accuracy [5]. However, data-driven node diagnosis methods are not suitable for low data feature scenarios and harsh scenarios. Therefore, an improved Bayesian network (BN) node fault diagnosis model is innovatively proposed. This study analyzed the working principle of wireless sensor networks, extracted node fault features, constructed a Bayesian diagnostic model using maximum likelihood method, and introduced a joint tree model to jointly achieve node diagnosis. However, Bayesian models face the problem of insufficient accuracy when dealing with small data. Therefore, this study also proposes a method of constraining maximum entropy as the prediction module of the model, which obtains the initial parameters of the model through small data, thereby improving the performance of the model. The proposed diagnostic technology can detect and diagnose node faults in a timely manner, ensuring the stability and reliability of the system. The research content provides technical reference for fault diagnosis and prevention of wireless sensor network nodes.

The research content is divided into four sections. The first introduces the application and effectiveness of WSN technology in different fields, and discusses and analyzes the relevant cutting-edge technologies of machine learning in WSN node fault diagnosis. The second analyzes the types and characteristics of WSN node faults, introduces machine learning for constructing a node fault diagnosis model, and optimizes the training problem under small data of the model. The third is to apply the mentioned technology to specific scenarios and verify the application effect of the proposed fault diagnosis model in actual node fault diagnosis. The fourth summarizes and analyzes the entire article, and elaborates on the improvement direction of the research.

2 Related work

WSN is a distributed sensor network and a brand-new platform for information data acquisition. Currently, WSN technology is widely used in medical, industrial manufacturing, military and other fields. Chowdhury et al. found that WSN has been promoted in a large number of scenarios, but nodes are limited, but some regions cannot effectively replace node batteries. It is necessary to introduce a duty cycle method to reduce nodes and achieve node energy conservation. The technology proposed after testing has good energy-saving effects and is suitable for different fields [6]. Jamshed et al. conducted a study on optimizing system performance through WSN node design. Through the analysis and definition of nodes, the application of WSN technology in various scenarios was discussed, and the actual deployment effect of WSN technology was improved through analysis of different technologies. By examining the relationship between WSN technology and its ability to meet the demands of future network technology progress [7]. To solve the energy consumption problem of WSN nodes, Verma et al. used cluster routing strategy to optimize nodes, and selected intelligent clustering method to optimize the scheduling of the entire transportation system, so as to improve node energy efficiency and security. Through testing, the node energy consumption has been significantly improved, while the system security has been significantly improved compared to the original system [8].

Singh et al. found that WSN deployment is limited by energy factors. To address energy issues, they proposed an energy harvesting method; This method adjusts and optimizes the system by utilizing multiple power sources. Subsequently, through experimental analysis, the proposed approach improved the sensor performance in different scenarios, lowered the cost of WSN usage, and enhanced the system’s stability [9]. Keerthika et al. conducted research on existing WSN technology, which is widely used in medical, military, transportation, and other environments. However, the growing deployment of WSN technology is amplifying the severity of network security concerns. To address the security risks associated with WSN deployment and improve the communication effectiveness of WSN technology in unmanned scenarios, research was conducted on active and passive defense technologies in WSN scenarios, and relevant experiments were conducted. Through testing, it has been shown that selecting appropriate system defense technologies in different scenarios will improve the communication security of WSN and ensure the effectiveness of WSN technology usage [10].

WSN technology is prone to node failures in large-scale deployment, and machine learning technology has a large number of applications in WSN fault diagnosis. Vazhuthi et al. conducted research on existing IoT systems and widely used WSN technology under the IoT, but the limited impact of battery energy hindered the deployment of WSN technology. To address the above issues, a clustering scheme is introduced in the design of WSN systems. Considering the impact of faulty nodes on WSN performance, a hybrid crawling method is adopted to optimize the problem. Subsequently, the proposed solution is assessed on 1000 nodes, with the final test indicating that the suggested method significantly minimizes system energy usage [11]. Liu Y and others proposed a edge computing for industrial IoT, which also adapts to the development of the industrial IoT. However, implementation challenges such as network attacks and privacy concerns have led to costly communication expenses. In this regard, an efficient communication and privacy enhanced asynchronous security framework for edge computing in the Internet of Things is proposed. Firstly, an asynchronous model update scheme was introduced to reduce the computational time for edge nodes to wait for global model aggregation. Secondly, based on an asynchronous local differential privacy mechanism, this mechanism improves communication efficiency and alleviates gradient leakage attacks by adding carefully designed noise to the gradients of edge nodes. Experimental testing has demonstrated this technology’s exceptional safety and stability advantages. However, the scale of complex data nodes was not considered, and further optimization is needed in the later stage [12]. Cai Br et al. conducted research on existing fault diagnosis models, and Bayesian networks are probability graph models that effectively handle various uncertainty problems. The application of this model in fault diagnosis is increasing. Based on Bayesian networks, a diagnostic model is constructed, which includes BN parameter modeling, BN inference, fault identification, verification, and validation. The model is employed in network classification scenarios. The experimental results show that it has excellent classification and diagnostic performance, but the convergence and accuracy of Bayesian networks still need to be improved [13].

Wireless sensor network technology has been widely applied in many fields due to its advantages of low energy consumption, small size, and high performance. The above research analyzes the application scenarios and effects of wireless sensors. At the same time, different sensor fault diagnosis techniques were introduced based on the characteristics of the sensors. Although the above research has proposed various diagnostic techniques for sensor faults, sensors are susceptible to environmental interference, especially in scenarios such as insufficient data, which poses significant limitations. Therefore, a fault diagnosis algorithm for wireless sensor networks based on BN and WSN is proposed to adapt to more complex sensor fault diagnosis environments and provide important insights for identifying and managing faults in WSN technology.

3 Construction of node fault diagnosis model in view of BN and WSN

This section mainly analyzes the types of WSN node faults and constructs a fault mathematical model. Meanwhile, this study introduces BN network to construct fault diagnosis. Considering the impact of the dataset on the diagnostic model, an improved diagnostic model is developed with the inclusion of constrained maximum entropy.

3.1 Analysis of WSN node fault characteristics

The WSN system is composed of a large number of sensor nodes, gateways, and information centers. Among them, the sensor nodes have a primary responsibility to monitor physical characteristic information such as temperature and pressure of system nodes, and these data will be transported to the coordinator service station, and ultimately uniformly input into information processing [14]. The basic framework of the entire WSN system is shown in Fig. 1.

Fig. 1
figure 1

Basic framework of WSN system

In the WSN system, the sensor node area, it can serve as the monitoring area of the system. In the monitoring area, each sensor node module is very susceptible to external environmental influences, leading to node failures [15]. It can be seen that wireless sensor systems collect environmental information through sensors. Various sensors record data information from which fault features can be extracted. In the research, the main consideration is to use physical quantities measured by sensors, such as temperature, humidity, and light intensity, as feature extraction objects. The main extracted fault features include multiple faults, bias faults, fixed faults, etc. In order to effectively analyze node sensor faults, the sensor node monitoring signals are converted, and the mathematical model is expressed as eq. (1) [16].

$$f(t)={\alpha}_1r(t)+{\alpha}_0+\varepsilon (t)$$

In eq. (1), α0 represents sensor bias; α1 represents the amplification factor of the sensor; r(t) represents the actual collected value; ε(t) represents the error value. It conducts research on common fault problems of WSN nodes, and the main fault characteristics of sensor module faults include multiple faults, bias faults, fixed faults, and insufficient accuracy faults [17]. Using a constant output value as a reference, it performs fault analysis on the module. The fixed fault expression is shown in eq. (2).

$${f}^{\prime }(t)={\beta}_0(t)$$

In eq. (2), β0(t) represents the output value. The analysis of bias faults is mainly determined by the current and voltage, as shown in eq. (3).

$${f}^{\prime }(t)={a}_1\gamma (t)+{a}_0+s(t)+{a}_0^{\prime }(t)$$

For multiple faults, it is necessary to judge the sensor circuit, mainly due to drift issues, and mainly analyze the growth mode of sensor data; The expression is shown in eq. (4).

$${f}^{\prime }(t)={a}_1^{\prime }(t)\left({a}_1\gamma (t)+{a}_0\right)+\varepsilon (t)$$

For the issue of accuracy degradation, sensors usually have a threshold range, and below a certain standard value, it can be determined that the aging of the parts is causing the decrease in sensor accuracy. After analyzing the sensor module fault, the analysis of the power module fault is usually in view of the power supply voltage to determine whether the power module is faulty. Figure 2 illustrates the three voltage levels [18].

Fig. 2
figure 2

Schematic diagram of voltage levels

The first level is the normal working voltage, and the second level is the incomplete voltage; Some sensor nodes are limited in operation, while the third type is at an inoperable voltage, making the entire WSN system inoperable. After considering the power module failure, it is necessary to continue analyzing the communication module failure, which is also one of the most prone places for the entire system to malfunction. Communication failures need to be considered from two aspects, one is the reception of communication data, and the other is the transmission of data [19]. Communication data receiving is mainly for sensors to obtain the required data from other nodes. Whether there is an error can be established based on the ratio between the ideal and actual values. Through comparison, it can be concluded whether there is a fault in the current WSN system communication. The state model is shown in eq. (5).

$$r=\frac{\sum \limits_{i=1}^{\phi }{C}_i}{\phi_i{C}_r},\phi =\frac{T_r}{T}$$

In eq. (5), T represents the signal sampling period; Cr represents receiving data in an ideal state; Tr is the receiving observation time; Ci represents the received data in the observation state. If the r value is large and the numerical fluctuation is small, then the current data reception is normal, otherwise there is a fault. The analysis of communication data transmission faults is similar to that of reception, and judgment is made by comparing the ideal value with the actual value, as expressed in eq. (6).

$$s=\frac{\sum \limits_{j=1}^{\phi }{K}_j}{\phi_i{K}_T},\phi =\frac{T_{\textrm{s}}}{T}$$

In eq. (5), T represents the signal sampling period; KT represents sending data in an ideal state; Kj represents the data sent out during the observation period; Ts represents the observation duration. Similarly, if the s-value of the data sent by the node communication is large and the fluctuation is small, it indicates that the data transmission is normal, and vice versa, there is a fault. Finally, this section presents a comprehensive analysis of the central processing module faults in WSN. High temperature is identified as one of the most pervasive faults. Due to excessively high ambient temperature, the operating temperature of the node exceeds its normal operating range, resulting in a processor frequency reduction of the node and causing performance degradation or restart.

3.2 Construction of node fault diagnosis model in view of BN

Node faults have uncertainty and complexity. To effectively diagnose node faults, Bayesian network (BN) is introduced for diagnosis; This model effectively handles uncertain data and accurately detects common node faults in WSN systems. The entire WSN node fault diagnosis process is shown in Fig. 3.

Fig. 3
figure 3

WSN node fault diagnosis process

Structural learning is necessary for obtaining logical relationships between variables in a specific domain when using the BN model. Structural learning is the process of optimizing the structure of a model through a large amount of modeling data. To reduce computational complexity and improve efficiency, sparsity research is usually used to solve the problem of Bayesian structure learning. The set of variables is shown in eq. (7).

$$V=\left\{{X}_1,{X}_2,\dots, {X}_n\right\}$$

In eq. (7), Xi represents the i-th variable; In the BN model, the variable node Xi of the node has ri × qi parameters and forms an ri × qi-dimensional matrix, represented by the Node Probability Table (NPT) of the variable node Xi. Meanwhile, if the variable distribution is discrete, its child node and parent node have different Conditional probability Table (CPT) values. The goal of the study is to find an optimal network structure G, so that the Conditional probability distribution in the structure meets the requirements of the study. This study uses the constraint set Ω to represent the constraint conditions for network structure G [20]. This study can use different evaluation criteria to measure the quality of structural fitting,, such as using the Bayesian Information Criterion, as shown in eq. (8).

$$BIC(G)=\log \left(L\left(D|G\right)\right)-\frac{k\cdot \log (n)}{2}$$

In formula (8), L(D| G) represents the Likelihood function value of dataset D under given network structure G; k represents the number of parameters in the network structure G; n represents the sample size of dataset D. Then, parameter learning is a process of solving the Conditional probability distribution function corresponding to BN structure through prior knowledge and sample data. In this study, P(Xi| Pa(Xi)) is assumed to represent the Conditional probability distribution of variable Xi given its parent node set Pa(Xi). The goal of parameter learning is to estimate the parameters for each conditional probability distribution. In BN model, its assumption has some prior knowledge and sample data D, and research can estimate Conditional probability distribution through Posterior probability probability. The Posterior probability can be expressed as shown in Formula (9).

$$P\left(\theta |D,G,\Omega \right)=\frac{P\left(D|\theta, G,\Omega \right)\cdot P\left(\theta |G,\Omega \right)}{P\left(D|G,\Omega \right)}$$

In eq. (9), P(θ| G, Ω) represents the prior distribution of the parameter; P(D| θ, G, Ω) represents the Likelihood function of dataset D; P(D| G, Ω) represents the Marginal likelihood of dataset D with a given network structure. After structural and parameter learning, the BN model can be used to predict the distribution probability of faulty nodes. This study assumes that node Xi represents a possible faulty node, which can obtain the Conditional probability distribution P(Xi| Pa(Xi)) of node X through BN model. The hypothesis posits that the study possesses a predetermined set of input observations, as shown in eq. (10).

$$E=\left\{{e}_1,{e}_2,\dots, {e}_m\right\}$$

In eq. (10), ej represents the observed value of group j. This study can calculate the predicted probability distribution of node Xi, as shown in eq. (11).

$$P\left({X}_i|E\right)=\frac{P\left(E|{X}_i\right)\cdot P\left({X}_i\right)}{P(E)}$$

In eq. (11), P(E| Xi) represents the probability of observing input data E at node Xi; P(Xi) is the Prior probability of node Xi; P(E) represents the probability of observing input data E. In actual node prediction, effective inference needs to be made in view of the distribution results to effectively diagnose node faults. The BN model utilizes two primary forms of reasoning, as shown in Fig. 4.

Fig. 4
figure 4

BN model reasoning method

Considering the characteristics of node faults, it is necessary to accurately locate the fault type, while possessing the characteristics of low energy consumption and high efficiency. Therefore, the joint tree method is the preferred method of inference for the model. This study defines the two adjacent nodes of the joint tree as Ci and Cj, defines the interval set between the two as Ssepi, j, and defines the corresponding potential functions of the two adjacent nodes as \({\Phi}_{c_i}\) and \({\Phi}_{c_j}\). Firstly, it updates \({\Phi}_{c_j}\) as shown in eq. (12).


In eq. (12), Lmev represents cluster likelihood. Next, it calculates the message received by Ssepi, j, as shown in eq. (13).

$${\Phi}_{S_{sepi,j}^{new}}=\sum \limits_{c_i/{S}_{sepi,j}}{\psi}_{C_j}{\Phi}_{C_i}^{mew}$$

Then, \({\Phi}_{c_j}\) absorbs the message, as shown in eq. (14).


The training fault feature samples are fed into the joint Tree model, which results in the node fault condition being obtained through the aforementioned reasoning process. This process leads to the diagnosis of node sensor fault, power fault, central processor fault and other problems.

3.3 Construction of node fault diagnosis model in view of improved small data BN

In actual WSN node fault detection, obtaining detailed fault sample features is difficult due to external uncertainty factors, resulting in various types of node faults. In order to solve the problem of complex and small feature data, a Constrained Data Maximum Entropy (CDME) training method is proposed to apply to the BN model inference process and construct a CM-BN node fault diagnosis model. In BN networks, the conditional probability between nodes is estimated through observed data. However, on small-scale datasets, the conditional probabilities between nodes may be inaccurate, resulting in unreliable inference results for BN. To address this problem, the CDME method adds constraints to improve accuracy. Specifically, CDME can utilize prior or domain knowledge to introduce constraints to ensure that the estimated probability distribution meets expectations. The improved CM-BN node fault diagnosis process is shown in Fig. 5.

Fig. 5
figure 5

CM-BN node fault diagnosis process

To solve the problem of insufficient fault diagnosis in small feature datasets using BN model, CDME model is introduced as an inference model to solve the problem of small feature datasets. Firstly, the fault characteristics of the small data nodes are analyzed to determine the initial training parameters of the BN model [21]. Meanwhile, the diagnostic model diagnosis constraint conditions are obtained through the node fault diagnosis expert experience knowledge base, and a candidate set of fault parameters with constraints is generated; Then it uses the CDME model idea to conduct weighted calculations, optimizing the training information of the BN. The definition of pC with the maximum entropy H(p) in the CDME model can be described using a mathematical model, as shown in eq. (15).

$${p}_{\ast }=\underset{p\in c}{\mathit{\arg}\max }H(p)$$

In eq. (15), C represents the set of distributions that meet the probability requirements. In the model, p can also be represented by a conditional distribution, as shown in eq. (16).

$${p}_{\ast }=\underset{p\in c}{\mathit{\arg}\max }-\sum \limits_{x,y}p(x)p\left(y|x\right)\log p\left(y|x\right)$$

In eq. (16), x and y both represent events that occur under random variables; p(y| x) represents conditional distribution, and its mathematical measurement is obtained through Conditional entropy. In constructing a model, it is crucial to choose the maximum entropy model to achieve recognition and analysis of sample data features. Also, during model construction, there is no need to take into account the prior distribution of the data, as it has no effect on the consistency of model estimation. Meanwhile, the BN model parameter smoothing problem will be optimized during model construction. When constructing the maximum entropy model, it is necessary for the BN parameter to meet the Ω-constraint set requirements. This study defines T reference candidate sets that satisfy the constraints of expert knowledge. Given the idea of the CDME model, the reference selection set is likely to have probability approximating the true BN model parameters. Consequently, this enables the inference of small data feature samples. The incorporation of the model’s prior constraints facilitates the BN model’s ability to achieve improved node fault diagnosis performance in smaller datasets. It determines whether the T candidate reference set is less than 1, and when it is less than 1, it can output the final trained BN learning parameters, as shown in eq. (17).

$${\theta}_{ijk}^{CDME}=\frac{a{\sum}_{B=1}^{T-1}{\theta}_{ijk}^B\left(\Omega \right)+\left(1-a\right){\theta}_{ijk}^{\ast }(S)}{T}$$

In eq. (17), \({\theta}_{ijk}^B\left(\Omega \right)\) represents the candidate set of constrained parameters after parameter expansion; \({\theta}_{ijk}^{\ast }(S)\) represents the initial parameters obtained from the calculation of small sample feature diagnostic data; a represents the weight factor. In the training of the CDME model, when a = 0 is set, the value of T is 1, and the sample parameters are consistent with the BN training parameters in the sufficient state. When the value of a is large, expert constraints have an impact on model training and optimize the impact of small dataset training on model accuracy.

4 Simulation testing of node fault diagnosis model

This section mainly verifies the application effect of the proposed node fault diagnosis model in practical scenarios, and creates an experimental running environment. The key metrics for testing encompass parameter learning proficiency, diagnostic time utilization, diagnostic accuracy, etc.

4.1 Parameter learning performance analysis

In order to verify the performance of the proposed fault diagnosis model, experimental testing will be conducted on the Windows 10 64 bit platform, and simulation experimental analysis will be completed on the Matlab platform. Additionally, node fault data will be collected in the real operating setting of wireless sensor networks via on-site observation, system recording, and other methods. The system obtains fault data by monitoring the operating status of nodes, collecting error logs or fault reports, and other methods. Then, organize and extract these data to obtain a fault dataset. To create a training data set for the model, different types of node faults are selected, while the first 300 data sets are considered sufficient. The initialization parameters of the experimental model are shown in Table 1.

Table 1 Model initial parameters

In the experiment, the CDME model, the Quality Maximum Posterior (QMAP) model and the Maximum likelihood estimation (MLE) model were selected to learn the node parameters. To effectively evaluate the effectiveness of the BN model parameter construction, the KL distance in Bayesian models was introduced in the experiment to reflect the model construction accuracy. The smaller the KL distance value, the higher the accuracy of the model construction was. The learning node parameters under the small dataset are shown in Fig. 6 for the KL distance training results of the three models.

Fig. 6
figure 6

KL distance training results of three models

Figures 6 (a), (b), and (c) represent the KL distance box plots of MLE, QMAP, and CDME models, respectively. The results demonstrate that increasing the dataset for feature learning leads to a gradual decline in training KL distance. The worst performing model is the MLE model, with a KL distance of 2.65 when the dataset is 35; The QMAP model performs second, with a KL distance of 1.65 when the data is 35; The CDME model outperforms the others with a KL distance of 0.65 for a data of 35. It compares the KL distance between the real parameters and the CPT parameters, as shown in Fig. 7.

Fig. 7
figure 7

Comparison of model KL distance under different scale data

Figures 7(a) and (c) show the KL distance results for small and sufficient datasets, respectively. The CDME model outperforms the other models in small datasets. When the dataset is 35, the KL distances of MLE, QMAP, and CDME models are 2.65, − 1.65, and − 9.65, respectively. The CDME model demonstrates a more apparent advantage in the comparison of adequate group data. At lower data levels, the CDME model is significantly superior to the other two models. However, when the dataset reaches 300, the learning parameter ability of the MLE model is significantly improved. The KL distances for the MLE, QMAP, and CDME models on the 300 dataset are − 9.65, − 1.65, and − 9.86, respectively. The CPT of two types of scale data node learning is statistically analyzed, as shown in Table 2.

Table 2 CPT for node parameter learning

In Table 2, the CDME model performed best among the 8 node CPTs by selecting small data feature sets and sufficient feature sets for parameter learning; In small datasets, the MLE model’s KL distance for parameter learning is relatively large, while the KL distance of CDME and QMAP is significantly smaller, with more obvious advantages; And the CDME model is closer to the standard CPT. In a large and sufficient dataset, the sample size increases and the accuracy of the MLE model gradually improves, giving it more advantages compared to QMAP; CDME is close to the standard CPT, and the CDM model’s adaptability and precision are superior.

4.2 Experimental analysis of node fault diagnosis

The experiment for diagnosing node faults continues to use the same computer configuration and includes 35 small datasets. Its sufficient dataset consists of 300 sets for node fault diagnosis. This study prioritizes establishing a BN model and obtaining model diagnostic results through inference diagnosis. The parameter weight value is set at 0.3, with a candidate parameter value of 500, taking into account expert and actual scene factors. It introduces the Radial Basis Function (RBF) model and compares it with the traditional BN model and experiments. The comparison of model diagnostic testing time is shown in Fig. 8.

Fig. 8
figure 8

Comparison of diagnostic time consumption

There are three types of situations where fault diagnosis is time-consuming, as indicated by the horizontal axis representing the number of learning iterations and the red dashed line marking the annotated value. Within 60 seconds, it indicates that the fault diagnosis is within the annotated time range and meets the requirements. The RBD model takes more than 60 seconds for 7, 12, and 15 learning cycles; Overall comparison, both the BR model and the CM-BN model are within 60 seconds, with an average time consumption of 49.6 seconds and 41.2 seconds, respectively. The proposed CM-BN model is overall better. Meanwhile, two scale datasets were selected for testing the model’s ability to diagnose losses, as shown in Fig. 9.

Fig. 9
figure 9

Model fault diagnosis loss situation

Figures 9(a) and (b) show the test results under small and sufficient datasets, respectively. As iterations increase in small datasets, diagnostic loss progressively decreases to reach convergence values. The loss values for RBF, BN, and CM-BN are 0.116, 0.085, and 0.075, respectively. The RBF model has significant losses and diagnostic losses. In the recombination data testing, the RBF model showed significant improvement in loss, with a loss of 0.062 during convergence, 0.032 for BN and 0.023 for CM-BN models, respectively. It is noticeable that CM-BN has the lowest loss in fault diagnosis and the best performance in loss interruption. It selects 500 nodes to test the diagnostic effectiveness of different models, as shown in Fig. 10.

Fig. 10
figure 10

Fault diagnosis accuracy under 500 nodes

Figures 10(a), (b), and (c) show the diagnostic results of RBF, BN, and CM-BN models, respectively. From the diagnostic data, it can be seen that the RBF model has significant fluctuations during diagnosis, with an average diagnostic accuracy of 0.756. The BN model has less overall fluctuation in diagnosis compared to the RBF model, with an average diagnostic accuracy of 0.821. The best model for node fault diagnosis is the CM-BN model, which boasts an average diagnostic accuracy of 0.946 and minimal fluctuations. It demonstrates that the proposed CM-BN model has good fault diagnosis performance. To evaluate the actual diagnostic effectiveness of various methods, specific fault types were used as detection benchmarks with sufficient data sets, as depicted in Table 3.

Table 3 Comparison of Fault Diagnosis Effects for Different Node Types

Table 3 shows the diagnostic results under different actual faults. Among the three types of node faults, the proposed CM-BN model has the best comprehensive judgment effect. Among the 100 validation faults, the accurate number of comprehensive judgments is above 90, surpassing other approaches. At the same time, the actual fault diagnosis performance of the three models was tested, and the CM-BN model was also significantly better than the other two, with fault diagnosis results higher than 93.01% in all three nodes. These results demonstrate that the proposed approach excels in fault detection performance.

5 Conclusion

In complex and harsh environments, WSN nodes are prone to damage, including node energy depletion and hardware damage. These failures can lead to nodes being unable to function properly and reduce the performance of the entire system. To promptly address WSN node faults, a BN network is examined to create a model for diagnosing node faults. Firstly, it studies the common fault characteristics and problems of nodes and constructs a fault model. Then it constructs a node fault model for BN and introduces a joint tree for diagnostic inference. Considering the impact of a small dataset on parameter learning, this study introduces the CDME model for parameter learning to optimize model diagnosis. In the parameter learning test, sufficient datasets were selected for testing. The KL distances of the MLE, QMAP, and CDME models on the 300 dataset were − 9.65, − 1.65, and − 9.86, respectively. The CDME model utilized in this study displayed improved parameter learning. In the model fault diagnosis testing, the diagnostic time of three diagnostic models was tested. The average time of RBF model, BN model, and CM-BN model was 75.8 seconds, 49.6 seconds, and 41.2 seconds, respectively. The proposed CM-BN model performed better in fault node diagnosis efficiency. Meanwhile, the study selected 500 fault nodes to test the diagnostic accuracy of the model, and the RBF model had the worst diagnostic accuracy, with significant fluctuations in the diagnostic process, with an average diagnostic accuracy of 0.756. The BN model and CM-BN model have better diagnostic stability, with an average diagnostic accuracy of 0.821 and 0.946, respectively. It illustrates that the proposed fault diagnosis model performs better in stability, time consumption, and fault diagnosis accuracy, meeting the fault diagnosis requirements of WSN nodes. While the node fault diagnosis model introduced in this study demonstrates relative superiority concerning stability, time consumption, and diagnostic accuracy, enhancing the diagnostic effectiveness of the model may be achievable through enlarging the dataset and incorporating more comprehensive expert databases in future research.

Availability of data and materials

The datasets generated during and/or analyzed during the current study are available from the corresponding author on reasonable request.



Bayesian network


Condition Probability Table


Constrained Data Maximum Entropy


Qualitative Maximum Posterior


Maximum Likelihood Estimation


  1. W. Chen, X. Wang, Coal mine safety intelligent monitoring based on wireless sensor network. IEEE. Sensors. J. 21(22), 25465–25471 (2020)

    Article  Google Scholar 

  2. M. Abdulkarem, K. Samsudin, F.Z. Rokhani, M.F. Rasid, Wireless sensor network for structural health monitoring: A contemporary review of technologies, challenges, and future direction. Struct. Health. Monit. 19(3), 693–735 (2020)

    Article  Google Scholar 

  3. S. Sharma, V.K. Verma, An integrated exploration on internet of things and wireless sensor networks. Wirel. Pers. Commun. 124(3), 2735–2770 (2022)

    Article  Google Scholar 

  4. R.R. Swain, T. Dash, P.M. Khilar, Automated fault diagnosis in wireless sensor networks: A comprehensive survey. Wirel. Pers. Commun. 127(4), 3211–3243 (2022)

    Article  Google Scholar 

  5. M.S. Rajan, G. Dilip, N. Kannan, Diagnosis of fault node in wireless sensor networks using adaptive neuro-fuzzy inference system. Appl. Nanosci. 13(2), 1007–1015 (2023)

    Article  Google Scholar 

  6. S.M. Chowdhury, A. Hossain, Different energy saving schemes in wireless sensor networks: A survey. Wirel. Pers. Commun. 114(3), 2043–2062 (2020)

    Article  Google Scholar 

  7. M.A. Jamshed, K. Ali, Q.H. Abbasi, M. Ali Imran, M. Ur-Rehman, Challenges, applications, and future of wireless sensors in internet of things: A review. IEEE. Sensors. J. 22(6), 5482–5494 (2022)

    Article  Google Scholar 

  8. S. Verma, S. Zeadally, S. Kaur, A. Sharma, Intelligent and secure clustering in wireless sensor network (WSN)-based intelligent transportation systems. IEEE. Trans. Intell. Transp. Syst. 23(8), 13473–13481 (2021)

    Article  Google Scholar 

  9. J. Singh, R. Kaur, D. Singh, Energy harvesting in wireless sensor networks: A taxonomic survey. Int. J. Energy. Res. 45(1), 118–140 (2021)

    Article  Google Scholar 

  10. M. Keerthika, D. Shanmugapriya, Wireless sensor networks: Active and passive attacks-vulnerabilities and countermeasures. Global. Transit. Proceed. 2(2), 362–367 (2021)

    Article  Google Scholar 

  11. P.P.I. Vazhuthi, A. Prasanth, S.P. Manikandan, K. Sowndarya, A hybrid ANFIS reptile optimization algorithm for energy-efficient inter-cluster routing in internet of things-enabled wireless sensor networks. Peer-to-Peer Netw. Appl. 16(2), 1049–1068 (2023)

    Article  Google Scholar 

  12. Y. Liu, R. Zhao, J. Kang, et al., Towards communication-efficient and attack-resistant federated edge learning for industrial internet of things. ACM. Transact. Inter. Technol (TOIT). 22(3), 1–22 (2021)

    Google Scholar 

  13. B. Cai, L. Huang, M. Xie, Bayesian networks in fault diagnosis. IEEE. Transact. indust. inform. 13(5), 2227–2240 (2017)

    Article  Google Scholar 

  14. S. Iqbal, I. Hussain, Z. Sharif, et al., Reliable and energy-efficient routing scheme for underwater wireless sensor networks (UWSNs)[J]. Int. J. Cloud Appl. Comput (IJCAC). 11(4), 42–58 (2021)

    Google Scholar 

  15. V.K. Chawra, G.P. Gupta, Optimization of the wake-up scheduling using a hybrid of memetic and tabu search algorithms for 3D-wireless sensor networks. Int. J. Softw. Sci. Computat. Intellig (IJSSCI). 14(1), 1–18 (2022)

    Article  Google Scholar 

  16. S. Sen, L. Sahoo, K. Tiwary, V. Simic, T. Senapati, Wireless sensor network lifetime extension via K-Medoids and MCDM techniques in uncertain environment. Appl. Sci. 13(5), 3196 (2023)

    Article  Google Scholar 

  17. X. Zhang, K.P. Rane, I. Kakaravada, Research on vibration monitoring and fault diagnosis of rotating machinery based on internet of things technology. Nonlinear. Eng. 10(1), 245–254 (2021)

    Article  Google Scholar 

  18. G. Kaur, P. Chanak, M. Bhattacharya, Obstacle-aware intelligent fault detection scheme for industrial wireless sensor networks. IEEE. Transact. Indust. Inform. 18(10), 6876–6886 (2021)

    Article  Google Scholar 

  19. Z. Chen, Research on internet security situation awareness prediction technology based on improved RBF neural network algorithm. J. Computat. Cognit. Eng. 1(3), 103–108 (2022)

    MathSciNet  Google Scholar 

  20. J. Song, L. Lin, Y. Huang, L. Lin, Y. Huang, S.Y. Hsieh, Intermittent fault diagnosis of Split-star networks and its applications. IEEE. Transact. Parall. Distrib. Syst. 34(4), 1253–1264 (2023)

    Article  Google Scholar 

  21. X.M. Long, Y.J. Chen, J. Zhou, Development of AR Experiment on Electric-Thermal Effect by Open Framework with Simulation-Based Asset and User-Defined Input. Artif. Intellig. Appl. 1(1), 52–57 (2023)

    Google Scholar 

Download references


Not applicable.


Not applicable.

Author information

Authors and Affiliations



Maing Li Writing - original draft preparation.

Corresponding author

Correspondence to Ming Li.

Ethics declarations

Competing interests

The author declares that there is no conflict of interest.

Additional information

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Li, M. Node fault diagnosis algorithm for wireless sensor networks based on BN and WSN. EURASIP J. on Info. Security 2023, 12 (2023).

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: