当前位置:网站首页>[fault diagnosis] bearing fault diagnosis based on Bayesian optimization support vector machine with matlab code
[fault diagnosis] bearing fault diagnosis based on Bayesian optimization support vector machine with matlab code
2022-07-26 06:32:00 【matlab_ dingdang】
1 Content introduction
Bayesian network (Bayesian Network or BN) It is an effective tool for modeling and uncertainty reasoning in the field of artificial intelligence . The basic task of Bayesian network reasoning is : Given a set of evidence variable observations , The posterior probability distribution of a set of query variables is calculated by searching the conditional probability table . In practical applications , The observed evidence value can be any value , That is, the evidence value may not be included in the conditional probability table . therefore , It is necessary to propose a method that can calculate the posterior probability distribution when any evidence value is given . In response to this question , This paper mainly discusses the construction and reasoning of Bayesian network with learning function : When constructing Bayesian network structure from samples , Also learn the maximum likelihood parameter from the sample ( Maximum likelihood hypothesis ), To replace the corresponding conditional probability table , That is, the maximum likelihood parameter is regarded as a part of Bayesian Network . After constructing Bayesian network structure from samples using traditional methods , This paper mainly focuses on how to learn maximum likelihood parameters from samples . Bayesian network contains two reasoning methods : Forward reasoning and reverse reasoning . For forward reasoning , We propose a method based on support vector machine and Sigmoid Function to learn maximum likelihood parameters . For reverse reasoning , First, based on Bayesian formula , Turn the reverse reasoning problem into the forward reasoning problem ; Then the maximum likelihood parameters are linearly interpolated . However , For the constructed Bayesian Network , They probably don't have the original samples . In this case , This paper presents a method of mapping the existing conditional probability table into samples , Then learn the maximum likelihood hypothesis from the obtained samples . further , In order to apply Bayesian network with maximum likelihood assumption to approximate reasoning , This paper gives the corresponding Gibbs Sampling algorithm . Last , We give an application example , The accuracy and verification of the test learning maximum likelihood hypothesis algorithm are given Gibbs Experiments on the convergence of sampling algorithm . Preliminary experimental results show that our method is feasible .
The main contributions of this paper are as follows : ● This paper presents a method of learning Bayesian networks with learning function , That is, when using existing methods to construct Bayesian network structure from samples , Based on support vector machine and Sigmoid function , Also learn the maximum likelihood hypothesis from the sample , To replace the corresponding conditional probability table . Then based on Bayesian network with maximum likelihood assumption , This paper further proposes the corresponding forward and reverse reasoning methods . This solves the problem of reasoning given any evidence value . ● This paper presents a method of mapping the existing conditional probability table into samples , The maximum likelihood hypothesis can also be learned from the existing conditional probability table , It solves the problem of Bayesian network that has been constructed ( There may be no original sample ), The problem that reasoning can be carried out even given any evidence value . ● further , In order to apply Bayesian network with maximum likelihood assumption to approximate reasoning , This paper gives the corresponding Gibbs Sampling algorithm . To a certain extent, it solves the inefficient problem of Bayesian network accurate reasoning .
2 Simulation code
clcclear allclose alladdpath(genpath(pwd))% Generate 3 Class sample ( Two dimensional Gaussian distribution )?sigma = [0.6 0; 0 0.6];numData = 100;mu = [6 5];X_1 = mvnrnd(mu, sigma, numData);label_1 = ones(numData, 1);mu = [3 9];X_2 = mvnrnd(mu, sigma, numData);label_2 = 2*ones(numData, 1);mu = [-2 7];X_3 = mvnrnd(mu, sigma, numData);label_3 = 3*ones(numData, 1);data = [X_1; X_2; X_3];label = [label_1; label_2; label_3];%% Bayesian optimization parameters% Upper and lower limits of variables and type settingsc = optimizableVariable('c', [1e-2 1e2], 'Type', 'real');g = optimizableVariable('g', [2^-7 2^7], 'Type', 'real');parameter = [c, g];% Cross validation parameter settings ( Set to... When cross validation is turned off [])?kfolds = 5;% kfolds = [];% Objective functionobjFun = @(parameter) getObjValue(parameter, data, label, kfolds);% Bayesian optimizationiter = 30;points = 10;results = bayesopt(objFun, parameter, 'Verbose', 1, ...'MaxObjectiveEvaluations', iter,...'NumSeedPoints', points);% Optimization results[bestParam, ~, ~] = bestPoint(results, 'Criterion', 'min-observed');%% Retrain with optimal parameters SVM Modelc = bestParam.c;g = bestParam.g;% Training and testingcmd = ['-s 0 -t 2 ', '-c ', num2str(c), ' -g ', num2str(g), ' -q'];model = libsvmtrain(label, data, cmd);[~, acc, ~] = libsvmpredict(label, data, model);%% SVM Boundary visualization ?d = 0.02;[X1, X2] = meshgrid(min(data(:, 1)):d:max(data(:, 1)), min(data(:, 2)):d:max(data(:, 2)));X_grid = [X1(:), X2(:)];grid_label = ones(size(X_grid, 1), 1);[pre_label, ~, ~] = libsvmpredict(grid_label, X_grid, model);% Keep the number g Point diagram ?figurecolor_p = [150, 138, 191;12, 112, 104; 220, 94, 75]/255; % The data goes back Plutonium ?color_b = [218, 216, 232; 179, 226, 219; 244, 195, 171]/255; % In the branch area, you can see the smoke in advancehold onax(1:3) = gscatter(X_grid (:,1), X_grid (:,2), pre_label, color_b);% Continue to control Data ?ax(4:6) = gscatter(data(:,1), data(:,2), label);set(ax(4), 'Marker','o', 'MarkerSize', 7, 'MarkerEdgeColor','k', 'MarkerFaceColor', color_p(1,:));set(ax(5), 'Marker','o', 'MarkerSize', 7, 'MarkerEdgeColor','k', 'MarkerFaceColor', color_p(2,:));set(ax(6), 'Marker','o', 'MarkerSize', 7, 'MarkerEdgeColor','k', 'MarkerFaceColor', color_p(3,:));set(gca, 'linewidth', 1.1)title('Decision boundary (gaussian kernel function)')axis tightlegend('off')box onset(gca, 'linewidth', 1.1)
3 Running results

4 reference
[1] Wang Junyu . Research on fault diagnosis of rolling bearing based on wavelet packet and optimized support vector machine .
[2] SuXiaoJie . Research on Bearing Fault Diagnosis Based on support vector machine under large-scale data .
[3] Yang Zhengyou , Peng Tao , Li Jianbao , etc. . Based on Bayesian inference LSSVM Rolling bearing fault diagnosis [J]. Journal of electronic measurement and instrumentation , 2010, 24(5):5.
About bloggers : Good at intelligent optimization algorithms 、 Neural networks predict 、 signal processing 、 Cellular automata 、 The image processing 、 Path planning 、 UAV and other fields Matlab Simulation , relevant matlab Code problems can be exchanged by private letter .
Some theories cite network literature , If there is infringement, contact the blogger to delete .
边栏推荐
- 【无标题】
- 【pytorch】微调技术
- Cdga | how to build data asset catalogue?
- 力扣5: 最长回文子串
- Servlet无法直接获取request请求中的JSON格式数据
- [day_060423] no two
- RNN recurrent neural network
- Mobile web
- Convolutional neural network (IV) - special applications: face recognition and neural style transformation
- Servlet cannot directly obtain JSON format data in request request
猜你喜欢
随机推荐
Jz36 binary search tree and bidirectional linked list
09 eth smart contract
CCTV dialogue ZTE: why must the database be in your own hands?
【pytorch】CNN实战-花朵种类识别
Leetcode:741. picking cherries
【Day_07 0425】Fibonacci数列
[nanny level] package volume optimization tutorial
[Hangzhou][15k-20k] medical diagnosis company recruits golang development engineers without overtime! No overtime! No overtime!
【Day_03 0420】字符串中找出连续最长的数字串
Interpretation of TPS motion (cvpr2022) video generation paper
[day_030420] find the longest consecutive number string in the string
If I want to listen to Jay Chou with you, I want you to listen to my whole youth
English sentence pattern reference exclusive Edition - adverbial clause
Leetcode 42. rainwater connection
Workflow activiti5.13 learning notes (I)
Map集合继承结构
flex布局
Leetcode:940. How many subsequences have different literal values
[1]数学建模基础入门知识
Map collection inheritance structure



![[1] Basic knowledge of mathematical modeling](/img/29/90b1c7533e9443852758d10080e239.png)





![[nanny level] package volume optimization tutorial](/img/45/4ca66b10bb96efeb47501c07972d66.png)