当前位置:网站首页>[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-25 16:12:00 【Matlab scientific research studio】
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 .
边栏推荐
猜你喜欢

基于Caffe ResNet-50网络实现图片分类(仅推理)的实验复现

聊聊如何用 Redis 实现分布式锁?

General test case writing specification

【服务器数据恢复】HP EVA服务器存储意外断电导致RAID信息丢失的数据恢复案例

leetcode:528. 按权重随机选择【普通随机失效 + 要用前缀和二分】

Ice 100g network card fragment message hash problem

【故障诊断】基于贝叶斯优化支持向量机的轴承故障诊断附matlab代码

如何构建面向海量数据、高实时要求的企业级OLAP数据引擎?

Wavelet transform --dwt2 and wavedec2

tkinter模块高级操作(一)—— 透明按钮、透明文本框、自定义按钮及自定义文本框
随机推荐
【故障诊断】基于贝叶斯优化支持向量机的轴承故障诊断附matlab代码
如何构建面向海量数据、高实时要求的企业级OLAP数据引擎?
邮件的收发的展现逻辑之收件箱发件箱以及回复断链的问题
Shared lock
Implementation of recommendation system collaborative filtering in spark
Basic usage of MFC thread afxbeginthread, passing multiple parameters
Simple rotation map and hamster beating
Leetcode:154. find the minimum value II in the rotation sort array [about the middle and rear positioning dichotomy of the rotation sort array]
C# 音乐
MySQL 悲观锁
泰山OFFICE技术讲座:英寸,厘米,磅,派卡,提,行,字行,像素的换算关系
Record locks
Mysql读写锁
今天去 OPPO 面试,被问麻了
ServletConfig 类和ServletContext 类
EMQX Cloud 更新:日志分析增加更多参数,监控运维更省心
01.一个更简单的方法来传递大量的props
Equivalent change of resistance circuit (Ⅱ)
What is a physical firewall? What's the effect?
记得那两句话