26. Using probabilistic neural network to classify and predict transformer fault diagnosis based on PNN (with matlab program)

1. Brief description

 

       Learning Objectives: Probabilistic Neural Network Classification Prediction Transformer Fault Diagnosis Based on PNN

       Probabilistic neural network was first proposed by Dr. Specht in 1989. It is a parallel algorithm closely related to many concepts of statistical signal processing. It is essentially a classifier that performs Bayesian decision-making based on the non-parametric estimation of the probability density function to obtain scores. The entire network is a radial network, which does not require reverse error transfer. It has the advantages of fast learning speed, strong fault tolerance, and the ability to complete any nonlinear transformation. At the same time, because the number of neurons in each layer is relatively fixed, it is easy to hardware implementation. In practical applications, especially in solving classification problems, PNN can not only use linear learning algorithms to complete the work of nonlinear learning algorithms, but also ensure the high precision of nonlinear algorithms in time, so it is widely used in fault detection and target Categorize the field of identification. Probabilistic neural networks usually consist of 4 layers.

The first layer is the input layer. This layer is responsible for inputting the feature vector into the neural network. The number of neurons in the input layer is the number of sample feature values. The function of this layer is only to use the input signal in a step-by-step manner. To represent.

 The second layer is the model layer, which is connected with the input layer through connection weights.

 The third layer is the accumulation and summation layer, which has a linear summation function. The number of neurons in this layer is the same as the number of patterns to be divided.

 The fourth layer is the accumulative output layer, which has a judgment function, and the outputs are discrete values ​​1 and 0, which respectively represent the category of the input mode.

Establishing a fault diagnosis model based on PNN
       When a transformer fails, it has various fault operating modes. Therefore, it is very important to be able to detect and deal with faults early to prevent heavy casualties and economic losses. On the basis of the collected status data, a suitable fault diagnosis model is trained to classify it.

 PNN design flow chart
 

 

2. Code

%% clear environment variable
clc;
clear all
close all
nntwarn off;
warning off;
%% load data
load data
%% select training data and test data

Train=data(1:23,:);
Test=data(24:end,:);
p_train=Train(:,1:3)';
t_train=Train(:,4)';
p_test=Test(:,1:3)';
t_test=Test(:,4)';

%% Convert the desired category to a vector
t_train=ind2vec(t_train);
t_train_temp=Train(:,4)';
%% Use the newpnn function to build a PNN SPREAD is selected as 1.5
Spread=1.5;
net=newpnn(p_train,t_train,Spread)

%% Training data back generation to check the classification effect of the network

%% Sim function for network prediction
Y=sim(net,p_train);
%% Convert network output vector to pointer
Yc=vec2ind(Y);

%% Observing the classification effect of the network on the training data by drawing
figure(1)
subplot(1,2,1)
stem(1:length(Yc),Yc,'bo')
hold on
stem(1:length(Yc), t_train_temp,'r*')
title('PNN network training effect')
xlabel('sample number')
ylabel('classification result')
set(gca,'Ytick',[1:5])
subplot(1, 2,2)
H=Yc-t_train_temp;
stem(H)
title('Error map after PNN network training')
xlabel('Sample number')


%% network prediction unknown data effect
Y2=sim(net,p_test);
Y2c=vec2ind(Y2)
figure(2)
stem(1:length(Y2c),Y2c,'b^')
hold on
stem(1:length( Y2c),t_test,'r*')
title('Prediction effect of PNN network')
xlabel('Prediction sample number')
ylabel('Classification result')
set(gca,'Ytick',[1:5])
 

3. Running results

 

 

 

Guess you like

Origin blog.csdn.net/m0_57943157/article/details/131002486