【故障诊断】基于KNN、SVM、RF、DT、ET多种算法实现制冷系统故障诊断附Matlab代码

简介: 【故障诊断】基于KNN、SVM、RF、DT、ET多种算法实现制冷系统故障诊断附Matlab代码

✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。

🍎个人主页:Matlab科研工作室

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

智能优化算法       神经网络预测       雷达通信      无线传感器        电力系统

信号处理              图像处理               路径规划       元胞自动机        无人机

⛄ 内容介绍

制冷系统故障可由多种模型进行模拟诊断.为了提高其诊断性能,将包括K近邻模型(KNN),支持向量机(SVM),决策树模型(DT),随机森林模型(RF)及逻辑斯谛回归模型(LR)在内的5种成员诊断器,通过绝对多数投票方法集成为一个集成模型,并采用美国采暖,制冷与空调工程师学会(ASHRAE)故障数据对1台90冷吨的离心式冷水机组进行建模及验证,数据包含制冷系统的7类典型故障及一类正常运行.结果表明:集成模型在所选数据集上总体诊断正确率达到99.58%,较各成员诊断器(94.55%~99.05%)均有显著提升,对正常运行,局部故障及全局故障的诊断性能亦有改善.此外,对比分析了不同集成模型及成员诊断器的诊断性能,从中找到诊断正确率与时间成本最佳的集成模型(99.41%,1.34 s).可见,集成模型较单一模型性能更佳,在制冷系统故障诊断中具有更好的应用前景.

⛄ 部分代码

% Gaussian Mixture Model (10/12/2020)function GMM = mGaussianMixtureModel(feat,label,opts)% Defaultkfold = 10;tf    = 2;if isfield(opts,'kfold'), kfold = opts.kfold; endif isfield(opts,'ho'), ho = opts.ho; endif isfield(opts,'tf'), tf = opts.tf; end% Number of classnum_class = numel(unique(label)); % [Hold-out]if tf == 1  fold = cvpartition(label,'HoldOut',ho);  % Call train & test data  xtrain = feat(fold.training,:); ytrain = label(fold.training);  xtest  = feat(fold.test,:);     ytest2 = label(fold.test);  % Train model  My_Model = fitgmdist(xtrain,num_class,...    'Options',statset('MaxIter',1000),...    'Regularize',1e-5,...    'Start',ytrain);  % Test using cluster  pred2 = cluster(My_Model,xtest);   % Accuracy  Afold = sum(pred2 == ytest2) / length(ytest2);    % [Cross-validation] elseif tf == 2  fold   = cvpartition(label,'KFold',kfold);  Afold  = zeros(kfold,1);   pred2  = [];  ytest2 = [];   for i = 1:kfold    % Call train & test data    trainIdx = fold.training(i); testIdx = fold.test(i);    xtrain   = feat(trainIdx,:); ytrain  = label(trainIdx);    xtest    = feat(testIdx,:);  ytest   = label(testIdx);     % Train model    My_Model = fitgmdist(xtrain,num_class,...      'Options',statset('MaxIter',1000),...      'Regularize',1e-5,...      'Start',ytrain);    % Test using cluster    pred = cluster(My_Model,xtest);     % Accuracy    Afold(i) = sum(pred == ytest) / length(ytest);    % Store temporary    pred2  = [pred2(1:end); pred];    ytest2 = [ytest2(1:end); ytest];   end  % [Leave-one out]elseif tf == 3  fold     = cvpartition(label,'LeaveOut');  % Size of data  num_data = length(label);   Afold    = zeros(num_data,1);   pred2    = [];  ytest2   = [];   for i = 1:num_data    % Call train & test data    trainIdx = fold.training(i); testIdx = fold.test(i);    xtrain   = feat(trainIdx,:); ytrain  = label(trainIdx);    xtest    = feat(testIdx,:);  ytest   = label(testIdx);     % Train model    My_Model = fitgmdist(xtrain,num_class,...      'Options',statset('MaxIter',1000),...      'Regularize',1e-5,...      'Start',ytrain);    % Test using cluster    pred = cluster(My_Model,xtest);     % Accuracy    Afold(i) = sum(pred == ytest) / length(ytest);    % Store temporary    pred2  = [pred2(1:end); pred];    ytest2 = [ytest2(1:end); ytest];   endend% Confusion matrixconfmat = confusionmat(ytest2,pred2); % Overall accuracyacc = mean(Afold); % Store resultGMM.acc  = acc;GMM.con  = confmat;if tf == 1  fprintf('\n Accuracy (GMM-HO): %g %%',100 * acc);elseif tf == 2  fprintf('\n Accuracy (GMM-CV): %g %%',100 * acc);elseif tf == 3  fprintf('\n Accuracy (GMM-LOO): %g %%',100 * acc);endend

⛄ 运行结果

⛄ 参考文献

Katırcıoğlu F, Cingiz Z. Fault diagnosis for overcharge and undercharge conditions in refrigeration systems using infrared thermal images. Proceedings of the Institution of Mechanical Engineers, Part E: Journal of Process Mechanical Engineering. 2023;0(0). doi:10.1177/09544089221148065

⛳️ 代码获取关注我

❤️部分理论引用网络文献,若有侵权联系博主删除
❤️ 关注我领取海量matlab电子书和数学建模资料


相关文章
|
8月前
|
机器学习/深度学习 算法 机器人
【水下图像增强融合算法】基于融合的水下图像与视频增强研究(Matlab代码实现)
【水下图像增强融合算法】基于融合的水下图像与视频增强研究(Matlab代码实现)
735 0
|
8月前
|
算法 定位技术 计算机视觉
【水下图像增强】基于波长补偿与去雾的水下图像增强研究(Matlab代码实现)
【水下图像增强】基于波长补偿与去雾的水下图像增强研究(Matlab代码实现)
1010 0
|
8月前
|
算法 机器人 计算机视觉
【图像处理】水下图像增强的颜色平衡与融合技术研究(Matlab代码实现)
【图像处理】水下图像增强的颜色平衡与融合技术研究(Matlab代码实现)
263 0
|
8月前
|
机器学习/深度学习 算法 机器人
使用哈里斯角Harris和SIFT算法来实现局部特征匹配(Matlab代码实现)
使用哈里斯角Harris和SIFT算法来实现局部特征匹配(Matlab代码实现)
362 8
|
8月前
|
机器学习/深度学习 编解码 算法
基于OFDM技术的水下声学通信多径信道图像传输研究(Matlab代码实现)
基于OFDM技术的水下声学通信多径信道图像传输研究(Matlab代码实现)
363 8
|
8月前
|
机器学习/深度学习 数据采集 测试技术
基于CEEMDAN-VMD-BiLSTM的多变量输入单步时序预测研究(Matlab代码实现)
基于CEEMDAN-VMD-BiLSTM的多变量输入单步时序预测研究(Matlab代码实现)
317 8
|
8月前
|
机器学习/深度学习 算法 自动驾驶
基于导向滤波的暗通道去雾算法在灰度与彩色图像可见度复原中的研究(Matlab代码实现)
基于导向滤波的暗通道去雾算法在灰度与彩色图像可见度复原中的研究(Matlab代码实现)
416 8
|
8月前
|
数据采集 分布式计算 并行计算
mRMR算法实现特征选择-MATLAB
mRMR算法实现特征选择-MATLAB
468 2
|
9月前
|
存储 编解码 算法
【多光谱滤波器阵列设计的最优球体填充】使用MSFA设计方法进行各种重建算法时,图像质量可以提高至多2 dB,并在光谱相似性方面实现了显著提升(Matlab代码实现)
【多光谱滤波器阵列设计的最优球体填充】使用MSFA设计方法进行各种重建算法时,图像质量可以提高至多2 dB,并在光谱相似性方面实现了显著提升(Matlab代码实现)
282 6
|
9月前
|
传感器 机器学习/深度学习 编解码
MATLAB|主动噪声和振动控制算法——对较大的次级路径变化具有鲁棒性
MATLAB|主动噪声和振动控制算法——对较大的次级路径变化具有鲁棒性
379 3

热门文章

最新文章