├── Bearing_Features_Extract ├── FeaturesAcc_B_1.mat ├── FeaturesAcc_B_10.mat ├── FeaturesAcc_B_11.mat ├── FeaturesAcc_B_12.mat ├── FeaturesAcc_B_13.mat ├── FeaturesAcc_B_14.mat ├── FeaturesAcc_B_15.mat ├── FeaturesAcc_B_2.mat ├── FeaturesAcc_B_3.mat ├── FeaturesAcc_B_4.mat ├── FeaturesAcc_B_5.mat ├── FeaturesAcc_B_6.mat ├── FeaturesAcc_B_7.mat ├── FeaturesAcc_B_8.mat ├── FeaturesAcc_B_9.mat ├── FeaturesFinal_B_1.mat ├── FeaturesFinal_B_10.mat ├── FeaturesFinal_B_11.mat ├── FeaturesFinal_B_12.mat ├── FeaturesFinal_B_13.mat ├── FeaturesFinal_B_14.mat ├── FeaturesFinal_B_15.mat ├── FeaturesFinal_B_2.mat ├── FeaturesFinal_B_3.mat ├── FeaturesFinal_B_4.mat ├── FeaturesFinal_B_5.mat ├── FeaturesFinal_B_6.mat ├── FeaturesFinal_B_7.mat ├── FeaturesFinal_B_8.mat ├── FeaturesFinal_B_9.mat ├── FeaturesVel_B_1.mat ├── FeaturesVel_B_10.mat ├── FeaturesVel_B_11.mat ├── FeaturesVel_B_12.mat ├── FeaturesVel_B_13.mat ├── FeaturesVel_B_14.mat ├── FeaturesVel_B_15.mat ├── FeaturesVel_B_2.mat ├── FeaturesVel_B_3.mat ├── FeaturesVel_B_4.mat ├── FeaturesVel_B_5.mat ├── FeaturesVel_B_6.mat ├── FeaturesVel_B_7.mat ├── FeaturesVel_B_8.mat ├── FeaturesVel_B_9.mat ├── GuoPaperFeaturesAcc_B_1.mat ├── GuoPaperFeaturesAcc_B_10.mat ├── GuoPaperFeaturesAcc_B_11.mat ├── GuoPaperFeaturesAcc_B_12.mat ├── GuoPaperFeaturesAcc_B_13.mat ├── GuoPaperFeaturesAcc_B_14.mat ├── GuoPaperFeaturesAcc_B_15.mat ├── GuoPaperFeaturesAcc_B_2.mat ├── GuoPaperFeaturesAcc_B_3.mat ├── GuoPaperFeaturesAcc_B_4.mat ├── GuoPaperFeaturesAcc_B_5.mat ├── GuoPaperFeaturesAcc_B_6.mat ├── GuoPaperFeaturesAcc_B_7.mat ├── GuoPaperFeaturesAcc_B_8.mat ├── GuoPaperFeaturesAcc_B_9.mat ├── concatenate_features.m ├── get_RSFeature.m ├── get_features_acc.m ├── get_features_acc_LGUO.m └── get_features_vel.m ├── HImethods ├── get_liumetrics.m ├── get_metaprobability.m ├── get_metrics.m ├── get_mod_monotonicity.m ├── get_snr.m ├── lhsdesignbnd.m ├── paper_HIconstruct_Chen.m ├── paper_HIconstruct_Guo1.m ├── paper_HIconstruct_Guo2.m ├── paper_HIconstruct_Liu1.m └── paper_HIconstruct_Liu2.m ├── README.md └── Raw_Data └── readme.md /Bearing_Features_Extract/FeaturesAcc_B_1.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesAcc_B_1.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesAcc_B_10.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesAcc_B_10.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesAcc_B_11.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesAcc_B_11.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesAcc_B_12.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesAcc_B_12.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesAcc_B_13.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesAcc_B_13.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesAcc_B_14.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesAcc_B_14.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesAcc_B_15.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesAcc_B_15.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesAcc_B_2.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesAcc_B_2.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesAcc_B_3.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesAcc_B_3.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesAcc_B_4.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesAcc_B_4.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesAcc_B_5.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesAcc_B_5.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesAcc_B_6.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesAcc_B_6.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesAcc_B_7.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesAcc_B_7.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesAcc_B_8.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesAcc_B_8.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesAcc_B_9.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesAcc_B_9.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesFinal_B_1.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesFinal_B_1.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesFinal_B_10.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesFinal_B_10.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesFinal_B_11.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesFinal_B_11.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesFinal_B_12.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesFinal_B_12.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesFinal_B_13.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesFinal_B_13.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesFinal_B_14.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesFinal_B_14.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesFinal_B_15.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesFinal_B_15.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesFinal_B_2.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesFinal_B_2.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesFinal_B_3.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesFinal_B_3.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesFinal_B_4.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesFinal_B_4.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesFinal_B_5.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesFinal_B_5.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesFinal_B_6.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesFinal_B_6.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesFinal_B_7.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesFinal_B_7.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesFinal_B_8.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesFinal_B_8.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesFinal_B_9.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesFinal_B_9.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesVel_B_1.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesVel_B_1.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesVel_B_10.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesVel_B_10.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesVel_B_11.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesVel_B_11.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesVel_B_12.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesVel_B_12.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesVel_B_13.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesVel_B_13.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesVel_B_14.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesVel_B_14.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesVel_B_15.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesVel_B_15.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesVel_B_2.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesVel_B_2.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesVel_B_3.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesVel_B_3.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesVel_B_4.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesVel_B_4.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesVel_B_5.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesVel_B_5.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesVel_B_6.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesVel_B_6.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesVel_B_7.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesVel_B_7.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesVel_B_8.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesVel_B_8.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/FeaturesVel_B_9.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/FeaturesVel_B_9.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/GuoPaperFeaturesAcc_B_1.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/GuoPaperFeaturesAcc_B_1.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/GuoPaperFeaturesAcc_B_10.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/GuoPaperFeaturesAcc_B_10.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/GuoPaperFeaturesAcc_B_11.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/GuoPaperFeaturesAcc_B_11.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/GuoPaperFeaturesAcc_B_12.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/GuoPaperFeaturesAcc_B_12.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/GuoPaperFeaturesAcc_B_13.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/GuoPaperFeaturesAcc_B_13.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/GuoPaperFeaturesAcc_B_14.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/GuoPaperFeaturesAcc_B_14.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/GuoPaperFeaturesAcc_B_15.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/GuoPaperFeaturesAcc_B_15.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/GuoPaperFeaturesAcc_B_2.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/GuoPaperFeaturesAcc_B_2.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/GuoPaperFeaturesAcc_B_3.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/GuoPaperFeaturesAcc_B_3.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/GuoPaperFeaturesAcc_B_4.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/GuoPaperFeaturesAcc_B_4.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/GuoPaperFeaturesAcc_B_5.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/GuoPaperFeaturesAcc_B_5.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/GuoPaperFeaturesAcc_B_6.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/GuoPaperFeaturesAcc_B_6.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/GuoPaperFeaturesAcc_B_7.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/GuoPaperFeaturesAcc_B_7.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/GuoPaperFeaturesAcc_B_8.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/GuoPaperFeaturesAcc_B_8.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/GuoPaperFeaturesAcc_B_9.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VNemani14/HIconstruct_optimize/45f190129676c84e81ef665b9a328c28879955d5/Bearing_Features_Extract/GuoPaperFeaturesAcc_B_9.mat -------------------------------------------------------------------------------- /Bearing_Features_Extract/concatenate_features.m: -------------------------------------------------------------------------------- 1 | % Combine features from acceleration domain and velocity domain 2 | % The final feature foe each bearing will be subject to feature fusion 3 | 4 | clear all 5 | for mybid=1:15 6 | load("FeaturesAcc_B_"+string(mybid)+".mat") 7 | FA=Fnet; 8 | load("FeaturesVel_B_"+string(mybid)+".mat") 9 | FV = Fnet; 10 | Fnet = [FA,FV]; 11 | save("FeaturesFinal_B_"+string(mybid)+".mat",'Fnet') 12 | 13 | clear Fnet FA FV 14 | end -------------------------------------------------------------------------------- /Bearing_Features_Extract/get_RSFeature.m: -------------------------------------------------------------------------------- 1 | function myRSF = get_RSFeature(myf) 2 | % gives RS features at t 3 | [t, k] = size(myf); 4 | f_0_tilda = mean(myf(1,:)); 5 | f_t_tilda = mean(myf(end,:)); 6 | 7 | N=0; 8 | D1 = 0; D2 =0; 9 | 10 | for i = 1:k 11 | N = N+(myf(1,i)-f_0_tilda)*(myf(t,i)-f_t_tilda); 12 | D1 = D1+(myf(1,i)-f_0_tilda).^2; 13 | D2 = D2+(myf(t,i)-f_t_tilda).^2; 14 | end 15 | 16 | myRSF = abs(N)/sqrt(D1*D2); 17 | 18 | end -------------------------------------------------------------------------------- /Bearing_Features_Extract/get_features_acc.m: -------------------------------------------------------------------------------- 1 | % This code is written by Venkat Nemani from ISU 2 | % The code extracts the features from the raw acceleration vibration signal 3 | % in both time and frequency domain 4 | 5 | clear all 6 | 7 | %Bearing Dimensions for XJTU bearing dataset 8 | d=7.92; %Ball diameter in mm 9 | D=34.55;%Mean bearing diameter 10 | nballs=8;%Number of ball bearings 11 | 12 | %operating/ measurement conditions 13 | sf=25.6e3; %sampling frequency 14 | shaftfr=[35*ones(1,5),37.5*ones(1,5),40*ones(1,5)]; %shaft freq in Hz for the 15 bearings 15 | 16 | for mybid=1:15 17 | load("../Raw_Data/bearing"+ num2str(mybid) +'.mat') 18 | [~,~,ntime]=size(rawnet); %rawnet contains ndatapoints*axis*time 19 | 20 | % determine the fault freq 21 | BPFO=nballs*shaftfr(mybid)/2*(1-d/D); 22 | BPFI=nballs*shaftfr(mybid)/2*(1+d/D); 23 | FTF=shaftfr(mybid)/2*(1-d/D); 24 | BSF=D/2/d*(1-d*d/D/D)*shaftfr(mybid); 25 | 26 | tt=linspace(0,1.28,32768); 27 | for mytime=1:ntime 28 | raw=rawnet(:,:,mytime); 29 | tsize=size(raw); 30 | ha=raw(:,1); %horizontal axis time-series 31 | va=raw(:,2); %vertical axis 32 | vib=ha; % replace with va for other axis 33 | %time domain features 34 | FTh(mytime,1)=max(abs(vib)); % max amplitude 35 | FTh(mytime,2)=rms(vib); % rms value 36 | FTh(mytime,3)=kurtosis(vib); % kurtosis 37 | FTh(mytime,4)=rms(vib)/mean(abs(vib)); %shape factor 38 | FTh(mytime,5)=skewness(vib); % skewness 39 | FTh(mytime,6)=max(abs(vib))/mean(abs(vib)); %Impulse factor 40 | FTh(mytime,7)=max(abs(vib))/rms(vib); %crest factor 41 | 42 | [N,edges]= histcounts(abs(vib),'Normalization','probability'); 43 | edges=edges(1:end-1); 44 | FTh(mytime,8)=sum(N(edges>1).*edges(edges>1)); 45 | FTh(mytime,9)=sum(N(edges>5).*edges(edges>5)); 46 | % convert to Frequency domain 47 | [m,~]=size(vib); 48 | myf = sf*(0:floor(m/2))/m; % frequency 49 | df=sf/m; % frequency resolution 50 | Y=fft(abs(vib)); 51 | P2=abs(Y/tsize(1)); 52 | P1=P2(1:tsize(1)/2+1); % double sided spectrum 53 | P1(2:end-1)=2*P1(2:end-1); % single sided spectrum 54 | 55 | %BPFO 1x, 2x and 3x si = start index, ei=end index 56 | % We look at a 5% error around the fault frequency. Then 57 | % calculate energy in that frequency range using Parseval's 58 | % theorem 59 | si=floor(0.95*BPFO/df);ei=floor(1.05*BPFO/df); 60 | FF(mytime,1)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 61 | si=floor(2*0.95*BPFO/df);ei=floor(2*1.05*BPFO/df); 62 | FF(mytime,2)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 63 | si=floor(3*0.95*BPFO/df);ei=floor(3*1.05*BPFO/df); 64 | FF(mytime,3)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 65 | FF(mytime,4)=sqrt(FF(mytime,1)^2+FF(mytime,2)^2+FF(mytime,3)^2);%Energy within first 3 bands 66 | 67 | %BPFI 1x, 2x and 3x 68 | si=floor(0.95*BPFI/df);ei=floor(1.05*BPFI/df); 69 | FF(mytime,5)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 70 | si=floor(2*0.95*BPFI/df);ei=floor(2*1.05*BPFI/df); 71 | FF(mytime,6)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 72 | si=floor(3*0.95*BPFI/df);ei=floor(3*1.05*BPFI/df); 73 | FF(mytime,7)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 74 | FF(mytime,8)=sqrt(FF(mytime,5)^2+FF(mytime,6)^2+FF(mytime,7)^2);%Energy within first 3 bands 75 | 76 | %BSF 1x, 2x and 3x 77 | si=floor(0.95*BSF/df);ei=floor(1.05*BSF/df); 78 | FF(mytime,9)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 79 | si=floor(2*0.95*BSF/df);ei=floor(2*1.05*BSF/df); 80 | FF(mytime,10)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 81 | si=floor(3*0.95*BSF/df);ei=floor(3*1.05*BSF/df); 82 | FF(mytime,11)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 83 | FF(mytime,12)=sqrt(FF(mytime,9)^2+FF(mytime,10)^2+FF(mytime,11)^2);%Energy within first 3 bands 84 | 85 | %overall energy 86 | si=floor(shaftfr(mybid)*0.8/df); 87 | FF(mytime,13)=sqrt(sum(P1(si:end).*P1(si:end))/2); 88 | %bearing related energy 89 | si=floor(shaftfr(mybid)*2.1/df); 90 | FF(mytime,14)=sqrt(sum(P1(si:end).*P1(si:end))/2); 91 | %low freq energy 92 | si=floor(shaftfr(mybid)*0.5/df);ei=floor(400/df); 93 | FF(mytime,15)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 94 | si=floor(shaftfr(mybid)*2.1/df);ei=floor(400/df); 95 | FF(mytime,16)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 96 | FFh=FF; 97 | 98 | %wavelet energies 99 | P1(1)=0; % removing the DC component 100 | for nwave = 1:8 101 | si=floor((nwave-1)*sf/8/df/2)+1;ei=floor((nwave)*sf/8/df/2); 102 | FFwh(mytime,nwave)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 103 | end 104 | 105 | 106 | % do the same as above for vibration in different axis 107 | vib=va; % replace with va for other axis 108 | 109 | FTv(mytime,1)=max(abs(vib)); % max amplitude 110 | FTv(mytime,2)=rms(vib); % rms value 111 | FTv(mytime,3)=kurtosis(vib); % kurtosis 112 | FTv(mytime,4)=rms(vib)/mean(abs(vib)); %shape factor 113 | FTv(mytime,5)=skewness(vib); % skewness 114 | FTv(mytime,6)=max(abs(vib))/mean(abs(vib)); %Impulse factor 115 | FTv(mytime,7)=max(abs(vib))/rms(vib); %crest factor 116 | 117 | [N,edges]= histcounts(abs(vib),'Normalization','probability'); 118 | edges=edges(1:end-1); 119 | FTv(mytime,8)=sum(N(edges>1).*edges(edges>1)); % kurtosis 120 | FTv(mytime,9)=sum(N(edges>2).*edges(edges>2)); % kurtosis 121 | 122 | [m,~]=size(vib); 123 | myf = sf*(0:floor(m/2))/m; % frequency 124 | df=sf/m; % frequency resolution 125 | Y=fft(abs(vib)); 126 | P2=abs(Y/tsize(1)); 127 | P1=P2(1:tsize(1)/2+1); % double sided spectrum 128 | P1(2:end-1)=2*P1(2:end-1); % single sided spectrum 129 | 130 | %BPFO 1x, 2x and 3x 131 | si=floor(0.95*BPFO/df);ei=floor(1.05*BPFO/df); 132 | FF(mytime,1)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 133 | si=floor(2*0.95*BPFO/df);ei=floor(2*1.05*BPFO/df); 134 | FF(mytime,2)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 135 | si=floor(3*0.95*BPFO/df);ei=floor(3*1.05*BPFO/df); 136 | FF(mytime,3)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 137 | FF(mytime,4)=sqrt(FF(mytime,1)^2+FF(mytime,2)^2+FF(mytime,3)^2);%Energy within first 3 bands 138 | 139 | %BPFI 1x, 2x and 3x 140 | si=floor(0.95*BPFI/df);ei=floor(1.05*BPFI/df); 141 | FF(mytime,5)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 142 | si=floor(2*0.95*BPFI/df);ei=floor(2*1.05*BPFI/df); 143 | FF(mytime,6)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 144 | si=floor(3*0.95*BPFI/df);ei=floor(3*1.05*BPFI/df); 145 | FF(mytime,7)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 146 | FF(mytime,8)=sqrt(FF(mytime,5)^2+FF(mytime,6)^2+FF(mytime,7)^2);%Energy within first 3 bands 147 | 148 | %BSF 1x, 2x and 3x 149 | si=floor(0.95*BSF/df);ei=floor(1.05*BSF/df); 150 | FF(mytime,9)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 151 | si=floor(2*0.95*BSF/df);ei=floor(2*1.05*BSF/df); 152 | FF(mytime,10)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 153 | si=floor(3*0.95*BSF/df);ei=floor(3*1.05*BSF/df); 154 | FF(mytime,11)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 155 | FF(mytime,12)=sqrt(FF(mytime,9)^2+FF(mytime,10)^2+FF(mytime,11)^2);%Energy within first 3 bands 156 | 157 | %overall energy 158 | si=floor(shaftfr(mybid)*0.8/df); 159 | FF(mytime,13)=sqrt(sum(P1(si:end).*P1(si:end))/2); 160 | %bearing related energy 161 | si=floor(shaftfr(mybid)*2.1/df); 162 | FF(mytime,14)=sqrt(sum(P1(si:end).*P1(si:end))/2); 163 | %low freq energy 164 | si=floor(shaftfr(mybid)*0.5/df);ei=floor(400/df); 165 | FF(mytime,15)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 166 | si=floor(shaftfr(mybid)*2.1/df);ei=floor(400/df); 167 | FF(mytime,16)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 168 | FFv=FF; 169 | 170 | %wavelet energies 171 | P1(1)=0; % removing the DC component 172 | for nwave = 1:8 173 | si=floor((nwave-1)*sf/8/df/2)+1;ei=floor((nwave)*sf/8/df/2); 174 | FFwv(mytime,nwave)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 175 | end 176 | 177 | Fnet(mytime,:)=[FTh(mytime,:),FFh(mytime,:),FFwh(mytime,:),FTv(mytime,:),FFv(mytime,:),FFwv(mytime,:)]; 178 | end 179 | mybid 180 | 181 | save("FeaturesAcc_B_"+string(mybid)+".mat",'Fnet','FTh','FFh','FTv','FFv') %This save file is input in other scripts. 182 | clear P1 P2 Y FF myfft df Fnet FF FFv FTh FFh FTv FFv FFwv FFwh 183 | end 184 | 185 | -------------------------------------------------------------------------------- /Bearing_Features_Extract/get_features_acc_LGUO.m: -------------------------------------------------------------------------------- 1 | % This code is written by VPN from ISU 2 | % The code extracts the features from the raw acceleration vibration signal 3 | % in both time and frequency domain 4 | 5 | clear all 6 | %Bearing Dimensions 7 | d=7.92; %Ball diameter in mm 8 | D=34.55;%Mean bearing diameter 9 | nballs=8; 10 | 11 | %operating/ measurement conditions 12 | sf=25.6e3; %sampling frequency 13 | shaftfr=[35*ones(1,5),37.5*ones(1,5),40*ones(1,5)]; %shaft freq in Hz for the 15 bearings 14 | 15 | for mybid=1:15 16 | load("../Raw_Data/bearing"+ num2str(mybid) +'.mat') 17 | [~,~,ntime]=size(rawnet); %rawnet contains ndatapoints*axis*time 18 | 19 | % determine the fault freq 20 | BPFO=nballs*shaftfr(mybid)/2*(1-d/D); 21 | BPFI=nballs*shaftfr(mybid)/2*(1+d/D); 22 | FTF=shaftfr(mybid)/2*(1-d/D); 23 | BSF=D/2/d*(1-d*d/D/D)*shaftfr(mybid); 24 | 25 | tt=linspace(0,1.28,32768); 26 | for mytime=1:ntime 27 | raw=rawnet(:,:,mytime); 28 | tsize=size(raw); 29 | ha=raw(:,1); %horizontal axis time-series 30 | va=raw(:,2); %vertical axis 31 | vib=ha; % replace with va for other axis 32 | %time domain features 33 | FTh(mytime,1)=max(vib); % max vibration 34 | FTh(mytime,2)=rms(vib); % rms value 35 | FTh(mytime,3)=kurtosis(vib); % kurtosis 36 | FTh(mytime,4)=skewness(vib); % skewness 37 | FTh(mytime,5)=abs(max(vib))+ abs(min(vib)); % peak to peak 38 | FTh(mytime,6)=var(vib); % variance 39 | FTh(mytime,7)=entropy(vib); %entropy 40 | FTh(mytime,8)=max(abs(vib))/rms(vib); %crest factor 41 | FTh(mytime,9)=rms(vib)/mean(abs(vib)); %shape factor 42 | FTh(mytime,10)=max(abs(vib))/mean(abs(vib)); %Impulse factor 43 | FTh(mytime,11)=max(abs(vib))/(mean(sqrt(abs(vib)))).^2; %Margin factor 44 | RS(mytime,1) = get_RSFeature(FTh); 45 | % convert to Frequency domain 46 | [m,~]=size(vib); 47 | myf = sf*(0:floor(m/2))/m; % frequency 48 | df=sf/m; % frequency resolution 49 | Y=fft(abs(vib)); 50 | P2=abs(Y/tsize(1)); 51 | P1=P2(1:tsize(1)/2+1); % double sided spectrum 52 | P1(2:end-1)=2*P1(2:end-1); % single sided spectrum 53 | ALLP(mytime,:)=P1; 54 | 55 | 56 | RS(mytime,2) = get_RSFeature(ALLP); % 0 - 12.8kHz 57 | si=1;ei=floor(3200/df); % 0 - 3200Hz 58 | RS(mytime,3) = get_RSFeature(ALLP(:,si:ei)); 59 | si=floor(3200/df);ei=floor(6400/df);% 3200 - 6400Hz 60 | RS(mytime,4) = get_RSFeature(ALLP(:,si:ei)); 61 | si=floor(6400/df);ei=floor(9600/df);% 6400 - 9600Hz 62 | RS(mytime,5) = get_RSFeature(ALLP(:,si:ei)); 63 | si=floor(9600/df);ei=floor(12800/df);% 9600 - 12800Hz 64 | RS(mytime,6) = get_RSFeature(ALLP(:,si:ei)); 65 | 66 | 67 | % do the same as above for vibration in different axis 68 | vib=va; % replace with va for other axis 69 | %time domain features 70 | FTv(mytime,1)=max(vib); % max vibration 71 | FTv(mytime,2)=rms(vib); % rms value 72 | FTv(mytime,3)=kurtosis(vib); % kurtosis 73 | FTv(mytime,4)=skewness(vib); % skewness 74 | FTv(mytime,5)=abs(max(vib))+ abs(min(vib)); % peak to peak 75 | FTv(mytime,6)=var(vib); % variance 76 | FTv(mytime,7)=entropy(vib); %entropy 77 | FTv(mytime,8)=max(abs(vib))/rms(vib); %crest factor 78 | FTv(mytime,9)=rms(vib)/mean(abs(vib)); %shape factor 79 | FTv(mytime,10)=max(abs(vib))/mean(abs(vib)); %Impulse factor 80 | FTv(mytime,11)=max(abs(vib))/(mean(sqrt(abs(vib)))).^2; %Margin factor 81 | 82 | RSv(mytime,1) = get_RSFeature(FTv); 83 | % convert to Frequency domain 84 | [m,~]=size(vib); 85 | myf = sf*(0:floor(m/2))/m; % frequency 86 | df=sf/m; % frequency resolution 87 | Y=fft(abs(vib)); 88 | P2=abs(Y/tsize(1)); 89 | P1=P2(1:tsize(1)/2+1); % double sided spectrum 90 | P1(2:end-1)=2*P1(2:end-1); % single sided spectrum 91 | ALLPy(mytime,:)=P1; 92 | 93 | RSv(mytime,2) = get_RSFeature(ALLPy); % 0 - 12.8kHz 94 | si=1;ei=floor(3200/df); % 0 - 3200Hz 95 | RSv(mytime,3) = get_RSFeature(ALLPy(:,si:ei)); 96 | si=floor(3200/df);ei=floor(6400/df); % 3200 - 6400Hz 97 | RSv(mytime,4) = get_RSFeature(ALLPy(:,si:ei)); 98 | si=floor(6400/df);ei=floor(9600/df); % 6400 - 9600Hz 99 | RSv(mytime,5) = get_RSFeature(ALLPy(:,si:ei)); 100 | si=floor(9600/df);ei=floor(12800/df); % 9600 - 12800Hz 101 | RSv(mytime,6) = get_RSFeature(ALLPy(:,si:ei)); 102 | 103 | 104 | end 105 | mybid 106 | Fnet = [RS, RSv]; 107 | save("GuoPaperFeaturesAcc_B_"+string(mybid)+".mat",'Fnet') 108 | clear P1 P2 Y FF myfft df FTh RS FTv RSv ALLP ALLPy 109 | end 110 | 111 | -------------------------------------------------------------------------------- /Bearing_Features_Extract/get_features_vel.m: -------------------------------------------------------------------------------- 1 | % This code is written by Venkat Nemani from ISU 2 | % The code extracts the features from the raw Velocity vibration signal 3 | % in both time and frequency domain 4 | 5 | clear all 6 | %Bearing Dimensions 7 | d=7.92; %Ball diameter in mm 8 | D=34.55;%Mean bearing diameter 9 | nballs=8; 10 | 11 | %operating/ measurement conditions 12 | sf=25.6e3; %sampling frequency 13 | shaftfr=[35*ones(1,5),37.5*ones(1,5),40*ones(1,5)]; %shaft freq in Hz for the 15 bearings 14 | 15 | for mybid=1:15 16 | load("../Raw_Data/VBearing_"+ num2str(mybid) +'.mat') 17 | rawnet = permute(vbearing,[3,2,1]); 18 | [~,~,ntime]=size(rawnet); %rawnet contains ndatapoints*axis*time 19 | 20 | % determine the fault freq 21 | BPFO=nballs*shaftfr(mybid)/2*(1-d/D); 22 | BPFI=nballs*shaftfr(mybid)/2*(1+d/D); 23 | FTF=shaftfr(mybid)/2*(1-d/D); 24 | BSF=D/2/d*(1-d*d/D/D)*shaftfr(mybid); 25 | 26 | tt=linspace(0,1.28,32768); 27 | for mytime=1:ntime 28 | raw=rawnet(:,:,mytime); 29 | tsize=size(raw); 30 | ha=raw(:,1); %horizontal axis time-series 31 | va=raw(:,2); %vertical axis 32 | vib=ha; % replace with va for other axis 33 | %time domain features 34 | FTh(mytime,1)=max(abs(vib)); % max amplitude 35 | FTh(mytime,2)=rms(vib); % rms value 36 | FTh(mytime,3)=kurtosis(vib); % kurtosis 37 | FTh(mytime,4)=rms(vib)/mean(abs(vib)); %shape factor 38 | FTh(mytime,5)=skewness(vib); % skewness 39 | FTh(mytime,6)=max(abs(vib))/mean(abs(vib)); %Impulse factor 40 | FTh(mytime,7)=max(abs(vib))/rms(vib); %crest factor 41 | 42 | [N,edges]= histcounts(abs(vib),'Normalization','probability'); 43 | edges=edges(1:end-1); 44 | FTh(mytime,8)=sum(N(edges>1).*edges(edges>1)); 45 | FTh(mytime,9)=sum(N(edges>5).*edges(edges>5)); 46 | % convert to Frequency domain 47 | [m,~]=size(vib); 48 | myf = sf*(0:floor(m/2))/m; % frequency 49 | df=sf/m; % frequency resolution 50 | Y=fft(abs(vib)); 51 | P2=abs(Y/tsize(1)); 52 | P1=P2(1:tsize(1)/2+1); % double sided spectrum 53 | P1(2:end-1)=2*P1(2:end-1); % single sided spectrum 54 | 55 | %BPFO 1x, 2x and 3x si = start index, ei=end index 56 | % We look at a 5% error around the fault frequency. Then 57 | % calculate energy in that frequency range using Parseval's 58 | % theorem 59 | si=floor(0.95*BPFO/df);ei=floor(1.05*BPFO/df); 60 | FF(mytime,1)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 61 | si=floor(2*0.95*BPFO/df);ei=floor(2*1.05*BPFO/df); 62 | FF(mytime,2)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 63 | si=floor(3*0.95*BPFO/df);ei=floor(3*1.05*BPFO/df); 64 | FF(mytime,3)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 65 | FF(mytime,4)=sqrt(FF(mytime,1)^2+FF(mytime,2)^2+FF(mytime,3)^2);%Energy within first 3 bands 66 | 67 | %BPFI 1x, 2x and 3x 68 | si=floor(0.95*BPFI/df);ei=floor(1.05*BPFI/df); 69 | FF(mytime,5)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 70 | si=floor(2*0.95*BPFI/df);ei=floor(2*1.05*BPFI/df); 71 | FF(mytime,6)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 72 | si=floor(3*0.95*BPFI/df);ei=floor(3*1.05*BPFI/df); 73 | FF(mytime,7)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 74 | FF(mytime,8)=sqrt(FF(mytime,5)^2+FF(mytime,6)^2+FF(mytime,7)^2);%Energy within first 3 bands 75 | 76 | %BSF 1x, 2x and 3x 77 | si=floor(0.95*BSF/df);ei=floor(1.05*BSF/df); 78 | FF(mytime,9)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 79 | si=floor(2*0.95*BSF/df);ei=floor(2*1.05*BSF/df); 80 | FF(mytime,10)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 81 | si=floor(3*0.95*BSF/df);ei=floor(3*1.05*BSF/df); 82 | FF(mytime,11)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 83 | FF(mytime,12)=sqrt(FF(mytime,9)^2+FF(mytime,10)^2+FF(mytime,11)^2);%Energy within first 3 bands 84 | 85 | %overall energy 86 | si=floor(shaftfr(mybid)*0.8/df); 87 | FF(mytime,13)=sqrt(sum(P1(si:end).*P1(si:end))/2); 88 | %bearing related energy 89 | si=floor(shaftfr(mybid)*2.1/df); 90 | FF(mytime,14)=sqrt(sum(P1(si:end).*P1(si:end))/2); 91 | %low freq energy 92 | si=floor(shaftfr(mybid)*0.5/df);ei=floor(400/df); 93 | FF(mytime,15)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 94 | si=floor(shaftfr(mybid)*2.1/df);ei=floor(400/df); 95 | FF(mytime,16)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 96 | FFh=FF; 97 | 98 | %wavelet energies 99 | P1(1)=0; % removing the DC component 100 | for nwave = 1:8 101 | si=floor((nwave-1)*sf/8/df/2)+1;ei=floor((nwave)*sf/8/df/2); 102 | FFwh(mytime,nwave)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 103 | end 104 | 105 | 106 | % do the same as above for vibration in different axis 107 | vib=va; % replace with va for other axis 108 | 109 | FTv(mytime,1)=max(abs(vib)); % max amplitude 110 | FTv(mytime,2)=rms(vib); % rms value 111 | FTv(mytime,3)=kurtosis(vib); % kurtosis 112 | FTv(mytime,4)=rms(vib)/mean(abs(vib)); %shape factor 113 | FTv(mytime,5)=skewness(vib); % skewness 114 | FTv(mytime,6)=max(abs(vib))/mean(abs(vib)); %Impulse factor 115 | FTv(mytime,7)=max(abs(vib))/rms(vib); %crest factor 116 | 117 | [N,edges]= histcounts(abs(vib),'Normalization','probability'); 118 | edges=edges(1:end-1); 119 | FTv(mytime,8)=sum(N(edges>1).*edges(edges>1)); % kurtosis 120 | FTv(mytime,9)=sum(N(edges>2).*edges(edges>2)); % kurtosis 121 | 122 | [m,~]=size(vib); 123 | myf = sf*(0:floor(m/2))/m; % frequency 124 | df=sf/m; % frequency resolution 125 | Y=fft(abs(vib)); 126 | P2=abs(Y/tsize(1)); 127 | P1=P2(1:tsize(1)/2+1); % double sided spectrum 128 | P1(2:end-1)=2*P1(2:end-1); % single sided spectrum 129 | 130 | %BPFO 1x, 2x and 3x 131 | si=floor(0.95*BPFO/df);ei=floor(1.05*BPFO/df); 132 | FF(mytime,1)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 133 | si=floor(2*0.95*BPFO/df);ei=floor(2*1.05*BPFO/df); 134 | FF(mytime,2)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 135 | si=floor(3*0.95*BPFO/df);ei=floor(3*1.05*BPFO/df); 136 | FF(mytime,3)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 137 | FF(mytime,4)=sqrt(FF(mytime,1)^2+FF(mytime,2)^2+FF(mytime,3)^2);%Energy within first 3 bands 138 | 139 | %BPFI 1x, 2x and 3x 140 | si=floor(0.95*BPFI/df);ei=floor(1.05*BPFI/df); 141 | FF(mytime,5)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 142 | si=floor(2*0.95*BPFI/df);ei=floor(2*1.05*BPFI/df); 143 | FF(mytime,6)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 144 | si=floor(3*0.95*BPFI/df);ei=floor(3*1.05*BPFI/df); 145 | FF(mytime,7)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 146 | FF(mytime,8)=sqrt(FF(mytime,5)^2+FF(mytime,6)^2+FF(mytime,7)^2);%Energy within first 3 bands 147 | 148 | %BSF 1x, 2x and 3x 149 | si=floor(0.95*BSF/df);ei=floor(1.05*BSF/df); 150 | FF(mytime,9)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 151 | si=floor(2*0.95*BSF/df);ei=floor(2*1.05*BSF/df); 152 | FF(mytime,10)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 153 | si=floor(3*0.95*BSF/df);ei=floor(3*1.05*BSF/df); 154 | FF(mytime,11)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 155 | FF(mytime,12)=sqrt(FF(mytime,9)^2+FF(mytime,10)^2+FF(mytime,11)^2);%Energy within first 3 bands 156 | 157 | %overall energy 158 | si=floor(shaftfr(mybid)*0.8/df); 159 | FF(mytime,13)=sqrt(sum(P1(si:end).*P1(si:end))/2); 160 | %bearing related energy 161 | si=floor(shaftfr(mybid)*2.1/df); 162 | FF(mytime,14)=sqrt(sum(P1(si:end).*P1(si:end))/2); 163 | %low freq energy 164 | si=floor(shaftfr(mybid)*0.5/df);ei=floor(400/df); 165 | FF(mytime,15)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 166 | si=floor(shaftfr(mybid)*2.1/df);ei=floor(400/df); 167 | FF(mytime,16)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 168 | FFv=FF; 169 | 170 | %wavelet energies 171 | P1(1)=0; % removing the DC component 172 | for nwave = 1:8 173 | si=floor((nwave-1)*sf/8/df/2)+1;ei=floor((nwave)*sf/8/df/2); 174 | FFwv(mytime,nwave)=sqrt(sum(P1(si:ei).*P1(si:ei))/2); 175 | end 176 | 177 | Fnet(mytime,:)=[FTh(mytime,:),FFh(mytime,:),FFwh(mytime,:),FTv(mytime,:),FFv(mytime,:),FFwv(mytime,:)]; 178 | end 179 | mybid 180 | 181 | save("FeaturesVel_B_"+string(mybid)+".mat",'Fnet','FTh','FFh','FTv','FFv') 182 | clear P1 P2 Y FF myfft df Fnet FF FFv FTh FFh FTv FFv FFwv FFwh 183 | end 184 | 185 | -------------------------------------------------------------------------------- /HImethods/get_liumetrics.m: -------------------------------------------------------------------------------- 1 | % Postprocessing HI to get 2 | % sigmalEOL: end of life variance 3 | % mon_violation_count: count of violations in monotonicity 4 | % based on % Liu, Kaibo, and Shuai Huang. "Integration of data fusion 5 | % methodology and degradation modeling process to improve prognostics." 6 | % IEEE Transactions on Automation Science and Engineering 13.1 (2014): 7 | % 344-354. 8 | 9 | function [sigmaEOL, mon_violation_count] = get_liumetrics(HI, FPT, Fmax, Fmin) 10 | [~, Nbearing] = size(HI); 11 | 12 | mon_violation_count = 0; 13 | for i=1:Nbearing 14 | myHI = HI{i}(FPT(i):end); 15 | myHI = (myHI-Fmin)/(Fmax-Fmin); 16 | endHI(i) = myHI(end); 17 | for j = 1:length(myHI)-1 18 | mon_violation_count = mon_violation_count + max(myHI(j)-myHI(j+1),0); 19 | end 20 | end 21 | endHI_avg = mean(endHI); 22 | 23 | sigmaEOL=0; 24 | for i=1:Nbearing 25 | sigmaEOL = sigmaEOL + (endHI(i)-endHI_avg)^2/(Nbearing-1); 26 | end 27 | 28 | end -------------------------------------------------------------------------------- /HImethods/get_metaprobability.m: -------------------------------------------------------------------------------- 1 | % Calculates the meta probability 2 | % Input: 3 | % mymetric - set of metrics 4 | % cutoff - lower and upper cutoffs 5 | % Output: 6 | % Pr - meta probability 7 | % Cutoff_vec - cutoff vector 8 | % metric_vec - curve for meta probability 9 | 10 | function [Pr,cutoff_vec,metric_vec] = get_metaprobability(mymetric, cutoff) 11 | Nbearings=length(mymetric); 12 | cutoff_vec = linspace(cutoff(1), cutoff(2), 100); 13 | metric_vec = zeros(length(cutoff_vec),1); 14 | for j=1:length(cutoff_vec) 15 | metric_vec(j)=sum(mymetric>cutoff_vec(j)); 16 | end 17 | Pr = trapz(cutoff_vec,metric_vec)/(cutoff(2)-cutoff(1))/Nbearings; 18 | end 19 | 20 | -------------------------------------------------------------------------------- /HImethods/get_metrics.m: -------------------------------------------------------------------------------- 1 | % get metrics for healthindex 2 | % Pearson correlation: mypear_corr 3 | % Spearman correlation: mysp_corr 4 | % Original monotonicity: old_mon 5 | % Modified monotonicity: new_mon 6 | % Robustness : myrob 7 | 8 | function [mypear_corr, mysp_corr, old_mon, new_mon, myrob] = get_metrics(myf_org, FPT) 9 | 10 | myf = myf_org(FPT:end,:); 11 | [ntime,nfeatures]=size(myf); 12 | a=(0:ntime-1)'; 13 | 14 | %calculate correlation - pearson and spearman 15 | for i=1:nfeatures 16 | C=corrcoef(myf(:,i),a); %pearson correlation 17 | mypear_corr(i)=abs(C(2,1)); 18 | C=corr(myf(:,i),a,'Type','Spearman'); %spearman 19 | mysp_corr(i)=abs(C); 20 | end 21 | 22 | %calculate monotonicity (original definition) 23 | for i=1:nfeatures 24 | M=diff(myf(:,i)); 25 | old_mon(i)=abs(sum(M>=0)-sum(M<0))/(ntime-1); 26 | end 27 | 28 | %calculate robustness 29 | for i=1:nfeatures 30 | fsmooth=movmean(myf(:,i),[4,0]); %moving average smoothing 31 | myrob(i)=mean(exp(-abs((myf(:,i)-fsmooth)./myf(:,i)))); 32 | end 33 | 34 | %modified monotonicity def 35 | for i =1:nfeatures 36 | f_before_fpt=myf_org(FPT-7:FPT-1, i); %time series before FPT 37 | mysigma=std(f_before_fpt); %calculate sigma from feature before FPT 38 | new_mon(i)=get_mod_monotonicity(myf(:,i), mysigma); %new definition of monotonicity 39 | end 40 | 41 | % New SNR defition based on: Liu, Kaibo - DOI: 10.1109/TASE.2015.2446752 42 | % Optimize the Signal Quality of the Composite Health Index Via Data Fusion for Degradation Modeling and Prognostic Analysis 43 | 44 | end 45 | -------------------------------------------------------------------------------- /HImethods/get_mod_monotonicity.m: -------------------------------------------------------------------------------- 1 | % proposed modified monotonicity 2 | 3 | function [mymon]=get_mod_monotonicity(myf, mysigma) 4 | % this function gives the modified monotonicity while accounting for noise 5 | % in measurement 6 | % myf is the feature time series 7 | % mysigma is the noise level in the time series measurement 8 | if (myf(end)+myf(end-1))/2>= (myf(1)+myf(2))/2 %generally increasing HI 9 | myf = myf; 10 | else 11 | myf = max(myf)-myf; %just inverting to make it monotonically increasing 12 | end 13 | 14 | epsilon = 1e-2; 15 | dF=diff(myf); 16 | myalpha=atanh(1-epsilon)/(epsilon+mysigma); 17 | allc=tanh((dF+mysigma)*myalpha); 18 | mymon=sum(allc)/sum(abs(allc)); 19 | 20 | end 21 | 22 | -------------------------------------------------------------------------------- /HImethods/get_snr.m: -------------------------------------------------------------------------------- 1 | % get modified SNR proposed by 2 | % Paper: 3 | % Liu, Kaibo, Abdallah Chehade, and Changyue Song. "Optimize the signal 4 | % quality of the composite health index via data fusion for degradation 5 | % modeling and prognostic analysis." IEEE Transactions on Automation 6 | % Science and Engineering 14.3 (2015): 1504-1514. 7 | 8 | % Input: 9 | % HI- Health Index set for multiple units 10 | % FPT- First Prediction Time set. 11 | % Output: 12 | % mysnr- modified SNR 13 | function mysnr = get_snr(HI, FPT) 14 | [~, Nbearing] = size(HI); 15 | 16 | for i=1:Nbearing 17 | myHI = HI{i}(FPT(i):end); 18 | endHI(i) = myHI(end); 19 | end 20 | endHI_avg = mean(endHI); 21 | 22 | R=0; v=0; sigma_sq=0; 23 | for i=1:Nbearing 24 | myHI = HI{i}(FPT(i):end); 25 | R=R+(myHI(end)-myHI(1))/Nbearing; 26 | v=v+(myHI(end)-endHI_avg)^2/(Nbearing-1); 27 | 28 | HI_smooth = movmean(myHI,[3,0]); 29 | er = myHI - HI_smooth; 30 | sigma_sq = sigma_sq + sum(er.^2)/Nbearing; 31 | 32 | end 33 | 34 | mysnr = R*R/(sigma_sq+v); 35 | 36 | end -------------------------------------------------------------------------------- /HImethods/lhsdesignbnd.m: -------------------------------------------------------------------------------- 1 | % Function obtained from https://github.com/rikblok/matlab-lhsdesigncon 2 | 3 | function X = lhsdesignbnd(n,p,lb,ub,isexp,varargin) 4 | %LHSDESIGNBND Generate a NxP latin hypercube sample with bounds 5 | % constraints and optional exponential distribution. 6 | % X=LHSDESIGNBND(N,P,LB,UB,ISEXP) generates a latin hypercube sample X 7 | % containing N values on each of P variables. For each column, if ISEXP 8 | % is FALSE the N values are randomly distributed with one from each 9 | % of N intervals, between LB and UB, of identical widths (UB-LB)/N, and 10 | % they are randomly permuted. For columns with ISEXP=TRUE, the logarithm 11 | % of the intervals have identical widths. 12 | % 13 | % X=LHSDESIGNBND(...,'PARAM1',val1,'PARAM2',val2,...) specifies parameter 14 | % name/value pairs to control the sample generation. See LHSDESIGN for 15 | % valid parameters. 16 | % 17 | % Latin hypercube designs are useful when you need a sample that is 18 | % random but that is guaranteed to be relatively uniformly/exponentially 19 | % distributed over each dimension. 20 | % 21 | % Example: The following command generates a latin hypercube sample X 22 | % containing 100 values for each of 2 variables. The first 23 | % variable is uniformly sampled between -10 and +10, the 24 | % second is exponentially sampled between 10^2 and 10^5 (ie. 25 | % the exponent is uniformly sampled between 2 and 5). 26 | % 27 | % x = LHSDESIGNBND(100,2,[-10 1e2],[10 1e5],[false true]); 28 | % % Show samples are well distributed. 29 | % figure; 30 | % semilogy(x(:,1),x(:,2),'.'); 31 | % 32 | % See also LHSDESIGN, LHSDESIGNCON. 33 | % Release History: 34 | % 2015-01-01 35 | % * initial release with lhsdesigncon 36 | % Copyright (c) 2014, Rik Blok (rik.blok@ubc.ca) 37 | % All rights reserved. 38 | % 39 | % Redistribution and use in source and binary forms, with or without 40 | % modification, are permitted provided that the following conditions are met: 41 | % 42 | % 1. Redistributions of source code must retain the above copyright notice, this 43 | % list of conditions and the following disclaimer. 44 | % 2. Redistributions in binary form must reproduce the above copyright notice, 45 | % this list of conditions and the following disclaimer in the documentation 46 | % and/or other materials provided with the distribution. 47 | % 48 | % THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 49 | % ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 50 | % WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 51 | % DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 52 | % ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 53 | % (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 54 | % LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 55 | % ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 56 | % (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 57 | % SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 58 | % 59 | % The views and conclusions contained in the software and documentation are those 60 | % of the authors and should not be interpreted as representing official policies, 61 | % either expressed or implied, of the FreeBSD Project. 62 | % Defaults 63 | if nargin < 5, isexp = false(size(lb)); end 64 | % Error traps. 65 | if any(ub 0.3; 41 | nselect_features = sum(select_features); 42 | 43 | 44 | %get feature max and min based on training dataset - for select 45 | %features 46 | Fmax = max(Fmax_all(trainb,select_features)); 47 | Fmin = min(Fmin_all(trainb,select_features)); 48 | 49 | lb = zeros(nselect_features, 1); 50 | ub = lb+1; 51 | Wts1=lhsdesignbnd(nlhs,nselect_features,lb,ub,boolean(zeros(1,nselect_features))); %linearly spread samples 52 | Wts2=lhsdesignbnd(nlhs,nselect_features,lb+1e-8,ub,boolean(ones(1,nselect_features))); %exp spread samples 53 | Wts=[Wts1;Wts2]; 54 | nlhs = 2*nlhs; 55 | pr_corrf=zeros(nlhs,Nbearing); sp_corrf=pr_corrf; old_monf=pr_corrf; new_monf=pr_corrf; robf=pr_corrf; 56 | sp_corr_Pr=zeros(nlhs,1); new_mon_Pr = sp_corr_Pr; mysnr=sp_corr_Pr; 57 | obj1 = zeros(nlhs,1); 58 | 59 | for mylhs = 1:nlhs 60 | for bid = 1:15 61 | File = load("FeaturesFinal_B_"+string(bid)+".mat"); 62 | Fnet = File.Fnet; 63 | Fnorm = (Fnet(:,select_features)-Fmin)./(Fmax-Fmin); 64 | % weighted HI 65 | mywt = Wts(mylhs,:); 66 | mywt = mywt/sum(mywt); 67 | ALLHI{mylhs, bid} = sum(mywt.*Fnorm,2); 68 | [pr_corrf(mylhs, bid), sp_corrf(mylhs, bid), old_monf(mylhs, bid), new_monf(mylhs, bid), robf(mylhs, bid)]=get_metrics(ALLHI{mylhs, bid}, FPT(bid)); 69 | end 70 | obj1(mylhs) = mean(1/3*(pr_corrf(mylhs, trainb)+old_monf(mylhs, trainb)+robf(mylhs, trainb))); 71 | end 72 | [max_val,lhs_max_ind] = max(obj1); 73 | w_best = Wts(lhs_max_ind,:); 74 | 75 | ALLHI = cell(Nbearing); 76 | pr_corrf=zeros(Nbearing); sp_corrf=pr_corrf; old_monf=pr_corrf; new_monf=pr_corrf; robf=pr_corrf; 77 | for bid = 1:15 78 | File = load("FeaturesFinal_B_"+string(bid)+".mat"); 79 | Fnet = File.Fnet; 80 | Fnorm = (Fnet(:,select_features)-Fmin)./(Fmax-Fmin); 81 | 82 | % weighted HI 83 | mywt = w_best; 84 | mywt = mywt/sum(mywt); 85 | ALLHI{bid} = sum(mywt.*Fnorm,2); 86 | [pr_corrf(bid), sp_corrf(bid), old_monf(bid), new_monf(bid), robf(bid)]=get_metrics(ALLHI{bid}, FPT(bid)); 87 | end 88 | 89 | HI_save{cv} = ALLHI(testb); 90 | 91 | %get cri - score by averaging pearson and old monotonicity among the test bearings 92 | trainb_HI_cri(cv) = mean((pr_corrf(trainb)+old_monf(trainb))/2); 93 | testb_HI_cri(cv) = mean((pr_corrf(testb)+old_monf(testb))/2); 94 | 95 | % More comprehensive approach - evaluate the probability that a test 96 | % bearing has good metrics. 97 | %pearson corr 98 | [pr_corr_Pr_test(cv), pr_cutoff_vec(cv,:), pr_metric_vec(cv,:)]=get_metaprobability(pr_corrf(testb), [0.8, 1.0]); 99 | %spearman corr 100 | [sp_corr_Pr_test(cv), sp_cutoff_vec(cv,:), sp_metric_vec(cv,:)]=get_metaprobability(sp_corrf(testb), [0.8, 1.0]); 101 | %old_mon 102 | [old_mon_Pr_test(cv), old_mon_cutoff_vec(cv,:), old_mon_metric_vec(cv,:)]=get_metaprobability(old_monf(testb), [0.5, 1.0]); 103 | %new_mon 104 | [new_mon_Pr_test(cv), new_mon_cutoff_vec(cv,:), new_mon_metric_vec(cv,:)]=get_metaprobability(new_monf(testb), [0.5, 1.0]); 105 | %robustness 106 | [rb_corr_Pr_test(cv), rb_cutoff_vec(cv,:), rb_metric_vec(cv,:)]=get_metaprobability(robf(testb), [0.85, 1.0]); 107 | 108 | %SNR of test HI 109 | mysnr_test(cv) = get_snr(ALLHI(testb),FPT(testb)); 110 | cv 111 | 112 | end 113 | 114 | %% Postprocess results 115 | % all_probs = [pr_corr_Pr_test', sp_corr_Pr_test', old_mon_Pr_test',new_mon_Pr_test',rb_corr_Pr_test',testb_HI_cri']; 116 | % figure() 117 | % names = {'Pearson>0.8','Spearman>0.8','Old_mon>0.5','New_mon>0.5','Robustness>0.85', 'Cri_score'}; 118 | % h = boxplot(all_probs,'Labels', names); 119 | % xlabel('Metrics') 120 | % ylabel('Probability') 121 | % set(gca,'fontsize', 16) 122 | % 123 | % figure() 124 | % h_snr = boxplot(mysnr_test, 'Labels','SNR'); 125 | % xlabel('Metrics') 126 | % ylabel('SNR') 127 | % set(gca,'fontsize', 16) 128 | 129 | %save data for comparison later 130 | % FinalResult{1,1}=pr_corr_Pr_test; FinalResult{1,2}=pr_cutoff_vec; FinalResult{1,3}=pr_metric_vec; 131 | % FinalResult{2,1}=sp_corr_Pr_test; FinalResult{2,2}=sp_cutoff_vec; FinalResult{2,3}=sp_metric_vec; 132 | % FinalResult{3,1}=old_mon_Pr_test; FinalResult{3,2}=old_mon_cutoff_vec; FinalResult{3,3}=old_mon_metric_vec; 133 | % FinalResult{4,1}=new_mon_Pr_test; FinalResult{4,2}=new_mon_cutoff_vec; FinalResult{4,3}=new_mon_metric_vec; 134 | % FinalResult{5,1}=rb_corr_Pr_test; FinalResult{5,2}=rb_cutoff_vec; FinalResult{5,3}=rb_metric_vec; 135 | % save('optimization_CHEN_LHS_new.mat') 136 | 137 | % all_probs = [pr_corr_Pr_test', sp_corr_Pr_test', old_mon_Pr_test',new_mon_Pr_test',rb_corr_Pr_test',testb_HI_cri']; 138 | % figure() 139 | % names = {'Pearson>0.8','Spearman>0.8','Old_mon>0.5','New_mon>0.5','Robustness>0.85', 'Cri_score'}; 140 | % h = boxplot(all_probs,'Labels', names); 141 | % xlabel('Metrics') 142 | % ylabel('Probability') 143 | % set(gca,'fontsize', 16) 144 | % 145 | % figure() 146 | % h_snr = boxplot(mysnr_test, 'Labels','SNR'); 147 | % xlabel('Metrics') 148 | % ylabel('SNR') 149 | % set(gca,'fontsize', 16) -------------------------------------------------------------------------------- /HImethods/paper_HIconstruct_Guo1.m: -------------------------------------------------------------------------------- 1 | % This Code finds the HI based on the paper: 2 | % Guo, Liang, et al. "A recurrent neural network based health indicator for 3 | % remaining useful life prediction of bearings." Neurocomputing 240 (2017): 4 | % 98-109. 5 | 6 | clear all 7 | FPT=[79,55,60,106,26,456,50,316,32,123,2404,2450,343,1420,8]; % first prediction times 8 | Nbearing = 15; 9 | addpath('../Bearing_Features_Extract/') 10 | 11 | %evaluate the metrics on all the individual features 12 | for bid=1:Nbearing % bearing number 13 | load("GuoPaperFeaturesAcc_B_"+string(bid)+".mat"); 14 | Fmax_all(bid,:) = max(Fnet); 15 | Fmin_all(bid,:) = min(Fnet); 16 | [mypear_corr(bid,:), mysp_corr(bid,:), old_mon(bid,:), new_mon(bid,:), myrob(bid,:)]=get_metrics(Fnet, FPT(bid)); 17 | 18 | end 19 | 20 | %create test set for the random CV 21 | rng(123) 22 | all_test_combs = nchoosek(1:Nbearing,3); 23 | rand_arr = randperm(length(all_test_combs)); 24 | TESTB = all_test_combs(rand_arr,:); 25 | ncv = 100; % number of random validations. 26 | 27 | for cv = 1:ncv 28 | testb = TESTB(cv,:); 29 | trainb = setdiff(1:Nbearing,testb); 30 | 31 | %get feature max and min based on training dataset 32 | Fmax = max(Fmax_all(trainb,:)); 33 | Fmin = min(Fmin_all(trainb,:)); 34 | avg_pcorr = mean(mypear_corr(trainb,:)); 35 | avg_oldmon = mean(old_mon(trainb,:)); 36 | cri = (avg_pcorr+avg_oldmon)/2; 37 | select_features = cri > 0.5; 38 | 39 | if sum(select_features)==0 % If not feature is selected 40 | select_features = cri > 0.4; 41 | if sum(select_features)==0 42 | select_features = cri > 0.3; 43 | end 44 | end 45 | 46 | for bid = 1:15 47 | load("GuoPaperFeaturesAcc_B_"+string(bid)+".mat"); 48 | Fnorm = (Fnet(:,select_features)-Fmin(select_features))./(Fmax(select_features)-Fmin(select_features)); 49 | ALLHI{bid} = mean(Fnorm,2); 50 | [mypr_corrf(bid), mysp_corrf(bid), old_monf(bid), new_monf(bid), myrbf(bid)]=get_metrics(ALLHI{bid}, FPT(bid)); 51 | end 52 | HI_save{cv} = ALLHI(testb); 53 | 54 | %get cri - score by averaging pearson and old monotonicity def among the test bearings 55 | trainb_HI_cri(cv) = mean((mypr_corrf(trainb)+old_monf(trainb))/2); 56 | testb_HI_cri(cv) = mean((mypr_corrf(testb)+old_monf(testb))/2); 57 | 58 | RES(cv,1)=cri(1); % max amp 59 | RES(cv,2)=cri(2); % RMS 60 | RES(cv,3)=trainb_HI_cri(cv); % train cri 61 | RES(cv,4)=testb_HI_cri(cv); % test cri 62 | 63 | % More comprehensive approach - evaluate the probability that a test 64 | % bearing has good metrics. 65 | %pearson corr 66 | [pr_corr_Pr_test(cv), pr_cutoff_vec(cv,:), pr_metric_vec(cv,:)]=get_metaprobability(mypr_corrf(testb), [0.8, 1.0]); 67 | %spearman corr 68 | [sp_corr_Pr_test(cv), sp_cutoff_vec(cv,:), sp_metric_vec(cv,:)]=get_metaprobability(mysp_corrf(testb), [0.8, 1.0]); 69 | %old_mon 70 | [old_mon_Pr_test(cv), old_mon_cutoff_vec(cv,:), old_mon_metric_vec(cv,:)]=get_metaprobability(old_monf(testb), [0.5, 1.0]); 71 | %new_mon 72 | [new_mon_Pr_test(cv), new_mon_cutoff_vec(cv,:), new_mon_metric_vec(cv,:)]=get_metaprobability(new_monf(testb), [0.5, 1.0]); 73 | %robustness 74 | [rb_corr_Pr_test(cv), rb_cutoff_vec(cv,:), rb_metric_vec(cv,:)]=get_metaprobability(myrbf(testb), [0.85, 1.0]); 75 | 76 | %SNR of test HI 77 | mysnr_test(cv) = get_snr(ALLHI(testb), FPT(testb)); 78 | 79 | end 80 | 81 | save('optimization_Guo1.mat') 82 | 83 | %save data for comparison later 84 | % FinalResult{1,1}=pr_corr_Pr_test; FinalResult{1,2}=pr_cutoff_vec; FinalResult{1,3}=pr_metric_vec; 85 | % FinalResult{2,1}=sp_corr_Pr_test; FinalResult{2,2}=sp_cutoff_vec; FinalResult{2,3}=sp_metric_vec; 86 | % FinalResult{3,1}=old_mon_Pr_test; FinalResult{3,2}=old_mon_cutoff_vec; FinalResult{3,3}=old_mon_metric_vec; 87 | % FinalResult{4,1}=new_mon_Pr_test; FinalResult{4,2}=new_mon_cutoff_vec; FinalResult{4,3}=new_mon_metric_vec; 88 | % FinalResult{5,1}=rb_corr_Pr_test; FinalResult{5,2}=rb_cutoff_vec; FinalResult{5,3}=rb_metric_vec; 89 | 90 | %% Postprocess plots 91 | % all_probs = [pr_corr_Pr_test', sp_corr_Pr_test', old_mon_Pr_test',new_mon_Pr_test',rb_corr_Pr_test',testb_HI_cri']; 92 | % figure() 93 | % names = {'Pearson>0.8','Spearman>0.8','Old_mon>0.5','New_mon>0.5','Robustness>0.85', 'Cri_score'}; 94 | % h = boxplot(all_probs,'Labels', names); 95 | % xlabel('Metrics') 96 | % ylabel('Probability') 97 | % set(gca,'fontsize', 16) 98 | % 99 | % figure() 100 | % h_snr = boxplot(mysnr_test, 'Labels','SNR'); 101 | % xlabel('Metrics') 102 | % ylabel('SNR') 103 | % set(gca,'fontsize', 16) 104 | 105 | -------------------------------------------------------------------------------- /HImethods/paper_HIconstruct_Guo2.m: -------------------------------------------------------------------------------- 1 | % This Code finds the HI based on the paper: 2 | % "A recurrent neural network based health indicator for remaining useful life prediction of bearings" by L. Guo et al. 3 | % But use a more exhaustive feature set 4 | 5 | clear all 6 | FPT=[79,55,60,106,26,456,50,316,32,123,2404,2450,343,1420,8]; %these are the first prediction times 7 | Nbearing = 15; 8 | addpath('../Bearing_Features_Extract/') 9 | 10 | %evaluate the metrics on all the individual features 11 | for bid=1:Nbearing % bearing number 12 | load("FeaturesFinal_B_"+string(bid)+".mat"); 13 | [~,nfeatures] = size(Fnet); 14 | Fmax_all(bid,:) = max(Fnet); 15 | Fmin_all(bid,:) = min(Fnet); 16 | [mypear_corr(bid,:), mysp_corr(bid,:), old_mon(bid,:), new_mon(bid,:), myrob(bid,:)]=get_metrics(Fnet, FPT(bid)); 17 | for nf = 1:nfeatures 18 | AllFeatures{nf,bid}=Fnet(:,nf); 19 | end 20 | end 21 | 22 | %create test set for the random CV 23 | rng(123) 24 | all_test_combs = nchoosek(1:Nbearing,3); 25 | rand_arr = randperm(length(all_test_combs)); 26 | TESTB = all_test_combs(rand_arr,:); 27 | ncv = 100; 28 | 29 | for cv = 1:ncv 30 | testb = TESTB(cv,:); 31 | trainb = setdiff(1:Nbearing,testb); 32 | 33 | %get feature max and min based on training dataset 34 | Fmax = max(Fmax_all(trainb,:)); 35 | Fmin = min(Fmin_all(trainb,:)); 36 | avg_pcorr = mean(mypear_corr(trainb,:)); 37 | avg_oldmon = mean(old_mon(trainb,:)); 38 | cri = (avg_pcorr+avg_oldmon)/2; 39 | select_features = cri > 0.5; 40 | 41 | if sum(select_features)==0 % If not feature is selected 42 | select_features = cri > 0.4; 43 | if sum(select_features)==0 44 | select_features = cri > 0.3; 45 | end 46 | end 47 | 48 | for bid = 1:15 49 | load("FeaturesFinal_B_"+string(bid)+".mat"); 50 | Fnorm = (Fnet(:,select_features)-Fmin(select_features))./(Fmax(select_features)-Fmin(select_features)); 51 | ALLHI{bid} = mean(Fnorm,2); 52 | [mypr_corrf(bid), mysp_corrf(bid), old_monf(bid), new_monf(bid), myrbf(bid)]=get_metrics(ALLHI{bid}, FPT(bid)); 53 | end 54 | HI_save{cv} = ALLHI(testb); 55 | %get cri - score by averaging pearson and old monotonicity def among the test bearings 56 | trainb_HI_cri(cv) = mean((mypr_corrf(trainb)+old_monf(trainb))/2); 57 | testb_HI_cri(cv) = mean((mypr_corrf(testb)+old_monf(testb))/2); 58 | RMS_cri(cv) = cri(2); 59 | 60 | RES(cv,1)=cri(1); % max amp 61 | RES(cv,2)=cri(2); % RMS 62 | RES(cv,3)=trainb_HI_cri(cv); % train cri 63 | RES(cv,4)=testb_HI_cri(cv); % test cri 64 | 65 | % More comprehensive approach - evaluate the probability that a test 66 | % bearing has good metrics. 67 | %pearson corr 68 | [pr_corr_Pr_test(cv), pr_cutoff_vec(cv,:), pr_metric_vec(cv,:)]=get_metaprobability(mypr_corrf(testb), [0.8, 1.0]); 69 | %spearman corr 70 | [sp_corr_Pr_test(cv), sp_cutoff_vec(cv,:), sp_metric_vec(cv,:)]=get_metaprobability(mysp_corrf(testb), [0.8, 1.0]); 71 | %old_mon 72 | [old_mon_Pr_test(cv), old_mon_cutoff_vec(cv,:), old_mon_metric_vec(cv,:)]=get_metaprobability(old_monf(testb), [0.5, 1.0]); 73 | %new_mon 74 | [new_mon_Pr_test(cv), new_mon_cutoff_vec(cv,:), new_mon_metric_vec(cv,:)]=get_metaprobability(new_monf(testb), [0.5, 1.0]); 75 | %robustness 76 | [rb_corr_Pr_test(cv), rb_cutoff_vec(cv,:), rb_metric_vec(cv,:)]=get_metaprobability(myrbf(testb), [0.85, 1.0]); 77 | 78 | %SNR of test HI 79 | mysnr_test(cv) = get_snr(ALLHI(testb), FPT(testb)); 80 | 81 | end 82 | 83 | save('optimization_YGLEE2.mat') 84 | 85 | %% Postproeess plots 86 | % all_probs = [pr_corr_Pr_test', sp_corr_Pr_test', old_mon_Pr_test',new_mon_Pr_test',rb_corr_Pr_test',testb_HI_cri']; 87 | % figure() 88 | % names = {'Pearson>0.8','Spearman>0.8','Old_mon>0.5','New_mon>0.5','Robustness>0.85', 'Cri_score'}; 89 | % h = boxplot(all_probs,'Labels', names); 90 | % xlabel('Metrics') 91 | % ylabel('Probability') 92 | % set(gca,'fontsize', 16) 93 | % 94 | % figure() 95 | % h_snr = boxplot(mysnr_test, 'Labels','SNR'); 96 | % xlabel('Metrics') 97 | % ylabel('SNR') 98 | % set(gca,'fontsize', 16) 99 | 100 | %save data for comparison later 101 | % FinalResult{1,1}=pr_corr_Pr_test; FinalResult{1,2}=pr_cutoff_vec; FinalResult{1,3}=pr_metric_vec; 102 | % FinalResult{2,1}=sp_corr_Pr_test; FinalResult{2,2}=sp_cutoff_vec; FinalResult{2,3}=sp_metric_vec; 103 | % FinalResult{3,1}=old_mon_Pr_test; FinalResult{3,2}=old_mon_cutoff_vec; FinalResult{3,3}=old_mon_metric_vec; 104 | % FinalResult{4,1}=new_mon_Pr_test; FinalResult{4,2}=new_mon_cutoff_vec; FinalResult{4,3}=new_mon_metric_vec; 105 | % FinalResult{5,1}=rb_corr_Pr_test; FinalResult{5,2}=rb_cutoff_vec; FinalResult{5,3}=rb_metric_vec; -------------------------------------------------------------------------------- /HImethods/paper_HIconstruct_Liu1.m: -------------------------------------------------------------------------------- 1 | % Paper: 2 | % Liu, Kaibo, and Shuai Huang. "Integration of data fusion methodology and 3 | % degradation modeling process to improve prognostics." IEEE Transactions 4 | % on Automation Science and Engineering 13.1 (2014): 344-354. 5 | 6 | clear all 7 | FPT=[79,55,60,106,26,456,50,316,32,123,2404,2450,343,1420,8]; %these are the first prediction times 8 | Nbearing = 15; 9 | addpath('../Bearing_Features_Extract/') 10 | 11 | for bid=1:Nbearing % bearing number 12 | load("FeaturesFinal_B_"+string(bid)+".mat"); 13 | [~,nfeatures] = size(Fnet); 14 | Fmax_all(bid,:) = max(Fnet); 15 | Fmin_all(bid,:) = min(Fnet); 16 | for nf = 1:nfeatures 17 | AllFeatures{nf,bid}=Fnet(:,nf); 18 | end 19 | end 20 | 21 | %create test set for the random CV 22 | rng(123) 23 | all_test_combs = nchoosek(1:Nbearing,3); 24 | rand_arr = randperm(length(all_test_combs)); 25 | TESTB = all_test_combs(rand_arr,:); 26 | ncv = 100; 27 | 28 | parfor cv = 1:ncv 29 | nlhs = 2000; %number of LHS samples for optimization - we will double it for linearly and exp spaced LHS samples 30 | testb = TESTB(cv,:); 31 | trainb = setdiff(1:Nbearing,testb); 32 | 33 | %get feature max and min based on training dataset 34 | Fmax = max(Fmax_all(trainb,:)); 35 | Fmin = min(Fmin_all(trainb,:)); 36 | 37 | %feature selection based on training 38 | %pre feature selection with low violation of monotonicity and sigmaEOL 39 | sigmaEOL=zeros(nfeatures,1); mon_violation_count=zeros(nfeatures,1); 40 | for nf = 1:nfeatures 41 | [sigmaEOL(nf), mon_violation_count(nf)] = get_liumetrics(AllFeatures(nf,trainb), FPT(trainb), Fmax(nf), Fmin(nf)); 42 | end 43 | 44 | EOL_index = sigmaEOL < quantile(sigmaEOL, 0.6); % top sigmaEOL based features 45 | mon_violation_count_index = mon_violation_count < quantile(mon_violation_count, 0.6); % top mon violations based features 46 | 47 | select_features = (EOL_index & mon_violation_count_index); 48 | nselect_features = sum(select_features); 49 | 50 | %get feature max and min based on training dataset - for select 51 | %features 52 | Fmax = max(Fmax_all(trainb,select_features)); 53 | Fmin = min(Fmin_all(trainb,select_features)); 54 | 55 | %LHS wt samples 56 | lb = zeros(nselect_features, 1); 57 | ub = lb+1; 58 | Wts1=lhsdesignbnd(nlhs,nselect_features,lb,ub,boolean(zeros(1,nselect_features))); %linearly spread samples 59 | Wts2=lhsdesignbnd(nlhs,nselect_features,lb+1e-8,ub,boolean(ones(1,nselect_features))); %exp spread samples 60 | Wts=[Wts1;Wts2]; 61 | nlhs =2*nlhs; 62 | 63 | ALLHI = cell(nlhs,Nbearing); 64 | pr_corrf=zeros(nlhs,Nbearing); sp_corrf=pr_corrf; old_monf=pr_corrf; new_monf=pr_corrf; rbf=pr_corrf; 65 | sp_corr_Pr=zeros(nlhs,1); new_mon_Pr = sp_corr_Pr; mysnr=sp_corr_Pr; 66 | obj1 = zeros(nlhs,1); obj2 = zeros(nlhs,1); 67 | for mylhs = 1:nlhs 68 | for bid = 1:15 69 | File = load("FeaturesFinal_B_"+string(bid)+".mat"); 70 | Fnet = File.Fnet; 71 | Fnorm = (Fnet(:,select_features)-Fmin)./(Fmax-Fmin); 72 | % weighted HI 73 | mywt = Wts(mylhs,:); 74 | mywt = mywt/sum(mywt); 75 | ALLHI{mylhs, bid} = sum(mywt.*Fnorm,2); 76 | [pr_corrf(mylhs, bid), sp_corrf(mylhs, bid), old_monf(mylhs, bid), new_monf(mylhs, bid), rbf(mylhs, bid)]=get_metrics(ALLHI{mylhs, bid}, FPT(bid)); 77 | end 78 | 79 | % Get the probabilities for optimization metrics for each LHS sample 80 | %spearman corr 81 | [sp_corr_Pr(mylhs),~, ~]=get_metaprobability(sp_corrf(mylhs, trainb), [0.8, 1.0]); 82 | %new monotonicity 83 | [new_mon_Pr(mylhs), ~, ~]=get_metaprobability(new_monf(mylhs, trainb), [0.5, 1.0]); 84 | %SNR 85 | mysnr(mylhs) = get_snr(ALLHI(mylhs, trainb), FPT(trainb)); 86 | 87 | [obj1(mylhs), obj2(mylhs)] = get_liumetrics(ALLHI(mylhs,trainb), FPT(trainb), 1, 0); 88 | end 89 | 90 | % find the first index between the two 91 | for iter = 1:300 92 | obj1_index = obj1 < quantile(obj1, iter/300); 93 | obj2_index = obj2 < quantile(obj2, iter/300); 94 | if sum(obj1_index & obj2_index)>0 95 | lhs_max_ind = find((obj1_index & obj2_index)>0); 96 | lhs_max_ind = lhs_max_ind(1); 97 | break 98 | end 99 | end 100 | % HI_test = ALLHI(lhs_max_ind,testb); 101 | % save('HI_LIU1','HI_test'); 102 | HI_save{cv} = ALLHI(lhs_max_ind,testb); 103 | %get cri - score by averaging pearson and old monotonicity among the test bearings 104 | trainb_HI_cri(cv) = mean((pr_corrf(lhs_max_ind,trainb)+old_monf(lhs_max_ind, trainb))/2); 105 | testb_HI_cri(cv) = mean((pr_corrf(lhs_max_ind,testb)+old_monf(lhs_max_ind, testb))/2); 106 | 107 | % More comprehensive approach - evaluate the probability that a test 108 | % bearing has good metrics. 109 | %pearson corr 110 | [pr_corr_Pr_test(cv), pr_cutoff_vec(cv,:), pr_metric_vec(cv,:)]=get_metaprobability(pr_corrf(lhs_max_ind,testb), [0.8, 1.0]); 111 | %spearman corr 112 | [sp_corr_Pr_test(cv), sp_cutoff_vec(cv,:), sp_metric_vec(cv,:)]=get_metaprobability(sp_corrf(lhs_max_ind,testb), [0.8, 1.0]); 113 | %old_mon 114 | [old_mon_Pr_test(cv), old_mon_cutoff_vec(cv,:), old_mon_metric_vec(cv,:)]=get_metaprobability(old_monf(lhs_max_ind,testb), [0.5, 1.0]); 115 | %new_mon 116 | [new_mon_Pr_test(cv), new_mon_cutoff_vec(cv,:), new_mon_metric_vec(cv,:)]=get_metaprobability(new_monf(lhs_max_ind,testb), [0.5, 1.0]); 117 | %robustness 118 | [rb_corr_Pr_test(cv), rb_cutoff_vec(cv,:), rb_metric_vec(cv,:)]=get_metaprobability(rbf(lhs_max_ind,testb), [0.85, 1.0]); 119 | 120 | %SNR of test HI 121 | mysnr_test(cv) = get_snr(ALLHI(lhs_max_ind,testb), FPT(testb)); 122 | cv 123 | 124 | end 125 | %% postprocess plots 126 | % all_probs = [pr_corr_Pr_test', sp_corr_Pr_test', old_mon_Pr_test',new_mon_Pr_test',rb_corr_Pr_test',testb_HI_cri']; 127 | % figure() 128 | % names = {'Pearson>0.8','Spearman>0.8','Old_mon>0.5','New_mon>0.5','Robustness>0.85', 'Cri_score'}; 129 | % h = boxplot(all_probs,'Labels', names); 130 | % xlabel('Metrics') 131 | % ylabel('Probability') 132 | % set(gca,'fontsize', 16) 133 | % 134 | % figure() 135 | % h_snr = boxplot(mysnr_test, 'Labels','SNR'); 136 | % xlabel('Metrics') 137 | % ylabel('SNR') 138 | % set(gca,'fontsize', 16) 139 | 140 | %save data for comparison later 141 | % FinalResult{1,1}=pr_corr_Pr_test; FinalResult{1,2}=pr_cutoff_vec; FinalResult{1,3}=pr_metric_vec; 142 | % FinalResult{2,1}=sp_corr_Pr_test; FinalResult{2,2}=sp_cutoff_vec; FinalResult{2,3}=sp_metric_vec; 143 | % FinalResult{3,1}=old_mon_Pr_test; FinalResult{3,2}=old_mon_cutoff_vec; FinalResult{3,3}=old_mon_metric_vec; 144 | % FinalResult{4,1}=new_mon_Pr_test; FinalResult{4,2}=new_mon_cutoff_vec; FinalResult{4,3}=new_mon_metric_vec; 145 | % FinalResult{5,1}=rb_corr_Pr_test; FinalResult{5,2}=rb_cutoff_vec; FinalResult{5,3}=rb_metric_vec; 146 | 147 | % save('optimization_LIU1_LHS.mat') 148 | 149 | -------------------------------------------------------------------------------- /HImethods/paper_HIconstruct_Liu2.m: -------------------------------------------------------------------------------- 1 | % Paper: 2 | % Liu, Kaibo, Abdallah Chehade, and Changyue Song. "Optimize the signal 3 | % quality of the composite health index via data fusion for degradation 4 | % modeling and prognostic analysis." IEEE Transactions on Automation 5 | % Science and Engineering 14.3 (2015): 1504-1514. 6 | 7 | clear all 8 | FPT=[79,55,60,106,26,456,50,316,32,123,2404,2450,343,1420,8]; %First Prediction Times 9 | Nbearing = 15; 10 | for bid=1:Nbearing % bearing number 11 | load("FeaturesFinal_B_"+string(bid)+".mat"); 12 | [~,nfeatures] = size(Fnet); 13 | Fmax_all(bid,:) = max(Fnet); 14 | Fmin_all(bid,:) = min(Fnet); 15 | for nf = 1:nfeatures 16 | AllFeatures{nf,bid}=Fnet(:,nf); 17 | end 18 | end 19 | 20 | %create test set for the random CV 21 | rng(123) 22 | all_test_combs = nchoosek(1:Nbearing,3); 23 | rand_arr = randperm(length(all_test_combs)); 24 | TESTB = all_test_combs(rand_arr,:); 25 | ncv = 100; 26 | 27 | parfor cv = 1:ncv 28 | nlhs = 2000; %number of LHS samples for optimization - this will be doubled in the code 29 | testb = TESTB(cv,:); 30 | trainb = setdiff(1:Nbearing,testb); 31 | 32 | %get feature max and min based on training dataset 33 | Fmax = max(Fmax_all(trainb,:)); 34 | Fmin = min(Fmin_all(trainb,:)); 35 | 36 | %feature selection based on training 37 | %pre feature selection with low violation of monotonicity and sigmaEOL 38 | sigmaEOL=zeros(nfeatures,1); mon_violation_count=zeros(nfeatures,1); myfsnr=zeros(nfeatures,1); 39 | for nf = 1:nfeatures 40 | [sigmaEOL(nf), mon_violation_count(nf)] = get_liumetrics(AllFeatures(nf,trainb), FPT(trainb), Fmax(nf), Fmin(nf)); 41 | myfsnr(nf) = get_snr(AllFeatures(nf, trainb), FPT(trainb)); 42 | end 43 | 44 | mysnr_index = myfsnr > quantile(myfsnr, 0.4); % top snr based features 45 | mon_violation_count_index = mon_violation_count < quantile(mon_violation_count, 0.6); % top mon violations based features 46 | 47 | select_features = (mysnr_index & mon_violation_count_index); 48 | nselect_features = sum(select_features); 49 | 50 | %get feature max and min based on training dataset - for select 51 | %features 52 | Fmax = max(Fmax_all(trainb,select_features)); 53 | Fmin = min(Fmin_all(trainb,select_features)); 54 | 55 | %LHS wt samples 56 | lb = zeros(nselect_features, 1); 57 | ub = lb+1; 58 | Wts1=lhsdesignbnd(nlhs,nselect_features,lb,ub,boolean(zeros(1,nselect_features))); %linearly spread samples 59 | Wts2=lhsdesignbnd(nlhs,nselect_features,lb+1e-8,ub,boolean(ones(1,nselect_features))); %exp spread samples 60 | Wts=[Wts1;Wts2]; 61 | nlhs = 2*nlhs; 62 | ALLHI = cell(nlhs,Nbearing); 63 | pr_corrf=zeros(nlhs,Nbearing); sp_corrf=pr_corrf; old_monf=pr_corrf; new_monf=pr_corrf; rbf=pr_corrf; 64 | sp_corr_Pr=zeros(nlhs,1); new_mon_Pr = sp_corr_Pr; mysnr=sp_corr_Pr; 65 | obj1 = zeros(nlhs,1); obj2 = zeros(nlhs,1); 66 | for mylhs = 1:nlhs 67 | for bid = 1:15 68 | File = load("FeaturesFinal_B_"+string(bid)+".mat"); 69 | Fnet = File.Fnet; 70 | Fnorm = (Fnet(:,select_features)-Fmin)./(Fmax-Fmin); 71 | % weighted HI 72 | mywt = Wts(mylhs,:); 73 | mywt = mywt/sum(mywt); 74 | ALLHI{mylhs, bid} = sum(mywt.*Fnorm,2); 75 | [pr_corrf(mylhs, bid), sp_corrf(mylhs, bid), old_monf(mylhs, bid), new_monf(mylhs, bid), rbf(mylhs, bid)]=get_metrics(ALLHI{mylhs, bid}, FPT(bid)); 76 | end 77 | 78 | % Get the probabilities for optimization metrics for each LHS sample 79 | %spearman corr 80 | [sp_corr_Pr(mylhs),~, ~]=get_metaprobability(sp_corrf(mylhs, trainb), [0.8, 1.0]); 81 | %new monotonicity 82 | [new_mon_Pr(mylhs), ~, ~]=get_metaprobability(new_monf(mylhs, trainb), [0.5, 1.0]); 83 | %SNR 84 | obj1(mylhs) = get_snr(ALLHI(mylhs, trainb), FPT(trainb)); 85 | 86 | [~, obj2(mylhs)] = get_liumetrics(ALLHI(mylhs,trainb), FPT(trainb), 1, 0); 87 | end 88 | [max_val,lhs_max_ind] = max(obj1); % Just single objective here. 89 | w_best = Wts(lhs_max_ind,:); 90 | 91 | HI_save{cv} = ALLHI(lhs_max_ind,testb); 92 | 93 | %get cri - score by averaging pearson and old monotonicity among the test bearings 94 | trainb_HI_cri(cv) = mean((pr_corrf(lhs_max_ind,trainb)+old_monf(lhs_max_ind, trainb))/2); 95 | testb_HI_cri(cv) = mean((pr_corrf(lhs_max_ind,testb)+old_monf(lhs_max_ind, testb))/2); 96 | 97 | % More comprehensive approach - evaluate the probability that a test 98 | % bearing has good metrics. 99 | %pearson corr 100 | [pr_corr_Pr_test(cv), pr_cutoff_vec(cv,:), pr_metric_vec(cv,:)]=get_metaprobability(pr_corrf(lhs_max_ind,testb), [0.8, 1.0]); 101 | %spearman corr 102 | [sp_corr_Pr_test(cv), sp_cutoff_vec(cv,:), sp_metric_vec(cv,:)]=get_metaprobability(sp_corrf(lhs_max_ind,testb), [0.8, 1.0]); 103 | %old_mon 104 | [old_mon_Pr_test(cv), old_mon_cutoff_vec(cv,:), old_mon_metric_vec(cv,:)]=get_metaprobability(old_monf(lhs_max_ind,testb), [0.5, 1.0]); 105 | %new_mon 106 | [new_mon_Pr_test(cv), new_mon_cutoff_vec(cv,:), new_mon_metric_vec(cv,:)]=get_metaprobability(new_monf(lhs_max_ind,testb), [0.5, 1.0]); 107 | %robustness 108 | [rb_corr_Pr_test(cv), rb_cutoff_vec(cv,:), rb_metric_vec(cv,:)]=get_metaprobability(rbf(lhs_max_ind,testb), [0.85, 1.0]); 109 | 110 | %SNR of test HI 111 | mysnr_test(cv) = get_snr(ALLHI(lhs_max_ind,testb), FPT(testb)); 112 | 113 | end 114 | %save data for comparison later 115 | % FinalResult{1,1}=pr_corr_Pr_test; FinalResult{1,2}=pr_cutoff_vec; FinalResult{1,3}=pr_metric_vec; 116 | % FinalResult{2,1}=sp_corr_Pr_test; FinalResult{2,2}=sp_cutoff_vec; FinalResult{2,3}=sp_metric_vec; 117 | % FinalResult{3,1}=old_mon_Pr_test; FinalResult{3,2}=old_mon_cutoff_vec; FinalResult{3,3}=old_mon_metric_vec; 118 | % FinalResult{4,1}=new_mon_Pr_test; FinalResult{4,2}=new_mon_cutoff_vec; FinalResult{4,3}=new_mon_metric_vec; 119 | % FinalResult{5,1}=rb_corr_Pr_test; FinalResult{5,2}=rb_cutoff_vec; FinalResult{5,3}=rb_metric_vec; 120 | 121 | % save('optimization_LIU2_LHS.mat') 122 | 123 | % all_probs = [pr_corr_Pr_test', sp_corr_Pr_test', old_mon_Pr_test',new_mon_Pr_test',rb_corr_Pr_test',testb_HI_cri']; 124 | % figure() 125 | % names = {'Pearson>0.8','Spearman>0.8','Old_mon>0.5','New_mon>0.5','Robustness>0.85', 'Cri_score'}; 126 | % h = boxplot(all_probs,'Labels', names); 127 | % xlabel('Metrics') 128 | % ylabel('Probability') 129 | % set(gca,'fontsize', 16) 130 | % 131 | % figure() 132 | % h_snr = boxplot(mysnr_test, 'Labels','SNR'); 133 | % xlabel('Metrics') 134 | % ylabel('SNR') 135 | % set(gca,'fontsize', 16) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Optimized Health Index Construction 2 | 3 | This repository contains parts of code for the publication " 4 | Health Index Construction with Feature Fusion Optimization for Predictive Maintenance 5 | of Physical Systems" by _Venkat Nemani, Austin Bray, Adam Thelen, Chao Hu, Steve Daining_ submitted to **Structural and Multidiciplinary Optimization** (SMO) special issue on _Advanced Optimization Enabling Digital Twin Technology_. (accepted, currently in print as of Oct 15 2022) 6 | 7 | We use two publicly available datasets 8 | - XJTU-SY bearing run-to-failure dataset 9 | [Biao Wang et al. “A Hybrid Prognostics Approach for Estimating Remaining Useful Life of Rolling Element Bearings”, IEEE Transactions on Reliability](https://ieeexplore.ieee.org/document/8576668) 10 | - IEEE PHM 2012 bearing run-to-failure dataset [Nectoux, Patrick, et al. "PRONOSTIA: An experimental platform for bearings accelerated degradation tests." IEEE International Conference on Prognostics and Health Management, PHM'12.. IEEE Catalog Number: CPF12PHM-CDR, 2012.](https://hal.archives-ouvertes.fr/hal-00719503/) 11 | 12 | The XJTU data repositories can be downloaded at: https://data.mendeley.com/datasets/mpn45f4gxc/1 and placed in the `Raw_Data` Folder 13 | - `originaldata` contains the vibration data in .mat files. These are obtained from the original XJTU-SY Dataset with csv files: https://github.com/WangBiaoXJTU/xjtu-sy-bearing-datasets 14 | - `processeddata` contains vibration data processed into velocity domain 15 | 16 | ## Models for Comparison 17 | - Guo1/Guo2: [Guo, Liang, et al. "A recurrent neural network based health indicator for remaining useful life prediction of bearings." Neurocomputing 240 (2017): 98-109.](https://doi.org/10.1016/j.neucom.2017.02.045) with difference in feature set. 18 | - Liu1: [Liu, Kaibo, and Shuai Huang. "Integration of data fusion methodology and degradation modeling process to improve prognostics." IEEE Transactions on Automation Science and Engineering 13.1 (2014): 344-354.](https://ieeexplore.ieee.org/document/6902828) 19 | - Liu2: [Liu, Kaibo, Abdallah Chehade, and Changyue Song. "Optimize the signal quality of the composite health index via data fusion for degradation modeling and prognostic analysis." IEEE Transactions on Automation Science and Engineering 14.3 (2015): 1504-1514.](https://ieeexplore.ieee.org/document/7165684) 20 | - Chen: [Chen, Zhen, et al. "A Health Index Construction Framework for Prognostics Based on Feature Fusion and Constrained Optimization." IEEE Transactions on Instrumentation and Measurement 70 (2021): 1-15.](https://ieeexplore.ieee.org/document/9512068) 21 | - Our method: Code not provided due to restrictions from funding agency. 22 | 23 | Summary of the various methods 24 | ![image](https://user-images.githubusercontent.com/94071944/174451865-f68933ec-ae7f-4b28-a59d-2329f5434ff6.png) 25 | 26 | ## Code Description 27 | ### Bearing_Features_Extract: 28 | - `get_features_acc_Guo.m` - To extract features for Guo1 model 29 | - `get_features_acc.m` - To extract features in accleration domain 30 | - `get_features_vel.m` - To extract features in velocity domain 31 | - `concatenate_features.m` - To concatenate features in acceleration and velocity domains. This gives a final feature list. 32 | 33 | ### Bearing_Features_Extract: 34 | - `paper_HI_construct_Guo1.m` - To construct HI using Guo1 model and Guo-proposed features 35 | - `paper_HI_construct_Guo2.m` - To construct HI using Guo2 model on final feature set 36 | - `paper_HI_construct_Liu1.m` - To construct HI using Liu1 model on final feature set (multiple objectives) 37 | - `paper_HI_construct_Liu2.m` - To construct HI using Liu2 model on final feature set (single objective) 38 | - `paper_HI_construct_Chen.m` - To construct HI using Chen model on final feature set (single objective) 39 | #### Function files 40 | - `get_metrics.m` - To obtain pearson correlation, proposed monotonicity etc. 41 | - `get_metaprobability.m` - To obtain the proposed meta probability metric 42 | - `get_snr.m` - To obtain the modified signal-to-noise ratio as proposed in Liu2 model 43 | - `get_modified_monotonicity.m` - To obtain the proposed modified monotonicity 44 | - `get_liumetrics.m` - To get the objectives for Liu1 model 45 | - `lhsdesignbnd.m` - To generate LHS samples ([source](https://github.com/rikblok/matlab-lhsdesigncon)) 46 | 47 | 48 | 49 | NOTE: Please contact Venkat Nemani (nemani1401@gmail.com) or Chao Hu (huchaostu@gmail.com) for any queries. 50 | -------------------------------------------------------------------------------- /Raw_Data/readme.md: -------------------------------------------------------------------------------- 1 | The raw vibration files converted into .mat file can be obtained at https://data.mendeley.com//datasets/mpn45f4gxc/1 2 | --------------------------------------------------------------------------------