生活随笔
收集整理的這篇文章主要介紹了
基于肌电信号(sEMG) 的深度学习手势分类
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
在過去的幾年里,科研界對使用基于表面肌電信號 (sEMG) 的深度學習方法進行手勢分類產生了濃厚的興趣。根據該領域的最新工作,我的工作目標是設計一種新穎的卷積神經網絡架構,用于手勢分類。我的模型雖然避免了過度擬合,但與更淺的網絡相比,性能并沒有顯著提高。結果表明,某些手勢之間的 sEMG 記錄缺乏多樣性,從而限制了 ML 模型的性能。
然而,我使用商業設備 (Myo Armband) 開發的數據集的分類準確度明顯高于使用相同設備記錄的類似基準數據集(約 24%)。
MyoUP 數據集
為了有助于獲取 sEMG 數據,特別是從不需要專業校準的設備中獲取,我開發了一個相當大的 sEMG 數據集。我們的數據集 MyoUP 受到 Ninapro 數據集的啟發,所有記錄的手勢都與 Ninapro 中的一些 ( http://ninaweb.hevs.ch ) 相同。我們使用的錄音設備是 Thalmic 實驗室的 Myo Armband。Myo Armband 是一種相對便宜且易于佩戴的設備,其采樣頻率為 200Hz,8 個干式 sEMG 通道已在科學研究中廣泛采用。
MyoUP 數據集包含來自 8 名完整受試者的記錄(3 名女性,5 名男性;1 名左撇子,7 名右手;年齡 22.38 ± 1.06 歲)。采集過程分為三個部分:5 個基本手指動作、12 個等張和等長手部配置以及 5 個抓握手勢。在進行每組練習之前,志愿者已經習慣了該程序。指示受試者重復每個手勢 5 次,持續 5 秒,中間有 5 秒的中斷,以避免肌肉疲勞。一名主管協助受試者將 Myo Armband 戴在他們的慣用手上,以便將設備放置在受試者舒適的位置,并且設備將準確檢測 sEMG 信號。受試者可以在屏幕上看到 sEMG 以及必須執行的手勢圖片。
實時手勢識別
通過使用來自 MyoUP 數據集的 sEMG 記錄訓練我們的 CNN,我設法開發了一個實時手勢識別軟件。
數據處理的matlab文件
%% Training signals
- creation
- Myo
- step #
1
clc
;
clear all
;START
= 's';
END
= 'e1.mat';
filename
= "s";for subject
= 1 : 8%_________________________________________code
= strcat(START
,int2str(subject
),END
);disp(code
);struct = load(code
);rep
= struct.pulse
;emg
= struct.emg
;%_________________________________________counter
= 1;points
= zeros(1, 50);for i
= 2 : length(rep
)if(rep(i
- 1) == 0 && rep(i
) > 0)points(counter
) = i
;counter
= counter
+ 1;end
if(rep(i
- 1) > 0 && rep(i
) == 0)points(counter
) = i
- 1;counter
= counter
+ 1;end endcounter
= 1;repeat
= 0;exercise
= 0;exe_number
= 1;for i
= 1 : length(points
) / 2starting_point
= points(counter
);counter
= counter
+ 1;finishing_point
= points(counter
);counter
= counter
+ 1;disp(starting_point
)disp(finishing_point
)disp('______________')repeat
= repeat
+ 1;exercise
= exercise
+ 1;columns
= finishing_point
- starting_point
+ 1;matrix
= zeros(8, columns
);column
= 1;for pointer
= starting_point
: finishing_point
for channel
= 1 : 8matrix(channel
, column
) = emg(pointer
, channel
);endcolumn
= column
+ 1;endfile
= filename
+ subject
+ "e" + exe_number
+ "rep" + repeat
+ ".mat";save(file
, 'matrix')if(repeat
== 5)repeat
= 0;end
if(exercise
== 5)exercise
= 0;exe_number
= exe_number
+ 1;endend
end
%% Maximum Size Matrix
- step #
2clc
;maximum_size
= 0;emg_sizes
= zeros(1, 3400);
counter
= 0;for subject
= 1 : 8for exercise
= 1 : 5for repetition
= 1 : 5counter
= counter
+ 1;filename
= strcat('s', int2str(subject
), 'e', int2str(exercise
), 'rep', int2str(repetition
));path
= 'Myo_training\E1\'
;load_path
= strcat(path
, filename
);load_path
= strcat(load_path
, '.mat');signal
= load(load_path
); matrix
= signal
.matrix
;matrix_size
= size(matrix
); matrix_size
= matrix_size(2);emg_sizes(1, counter
) = matrix_size
;if(matrix_size
> maximum_size
)maximum_size
= matrix_size
;endendend
end
%% Training Images
- creation II
- step #
3clear all
;
clc
;for subject
= 1 : 8disp('Subject: ');disp(subject
)for exercise
= 1 : 12for repetition
= 1 : 5filename
= strcat('s', int2str(subject
), 'e', int2str(exercise
), 'rep', int2str(repetition
));path
= 'Myo_training\E2\'
;load_path
= strcat(path
, filename
);load_path
= strcat(load_path
, '.mat');signal
= load(load_path
); original_matrix
= signal
.matrix
;noisy_matrix
= awgn(original_matrix
,25);matrix_size
= size(original_matrix
); matrix_size
= matrix_size(2);window_type_one
= matrix_size
/ 6;window_type_one
= int16(fix(window_type_one
));window_type_two
= 226 - window_type_one
;if(window_type_one
> 226)window_type_one
= 225;endstart_index
= 1;end_index
= 15;%________
%: Normal Windows
. for div
= 1 : window_type_one
if(exercise
~= 10 && exercise
~= 11 && exercise
~= 12)filename
= strcat('X2_e0', int2str(exercise
), '_s', int2str(subject
), '_E2_rep', int2str(repetition
));fn
= strcat('X2_e0', int2str(exercise
), '_s', int2str(subject
), '_E2_rep', int2str(repetition
));elsefilename
= strcat( 'X2_e', int2str(exercise
), '_s', int2str(subject
), '_E2_rep', int2str(repetition
));fn
= strcat( 'X2_e', int2str(exercise
), '_s', int2str(subject
), '_E2_rep', int2str(repetition
));endcounter
= 1;if(end_index
<= matrix_size
) filename
= strcat(filename
, '_image', int2str(div
));if(repetition
== 1 || repetition
== 3 || repetition
== 5)save_matrix_path
= strcat('EMG_data\train_set\' , filename, '.mat'
);save_matrix_path_gaussian
= strcat('EMG_data\train_set\' , filename, '_GAUSSIAN
.mat'
); end
if(repetition
== 2)save_matrix_path
= strcat('EMG_data\test_set\' , filename, '.mat'
);save_matrix_path_gaussian
= strcat('EMG_data\test_set\' , filename, '_GAUSSIAN
.mat'
);end
if(repetition
== 4)save_matrix_path
= strcat('EMG_data\val_set\' , filename, '.mat'
);save_matrix_path_gaussian
= strcat('EMG_data\val_set\' , filename, '_GAUSSIAN
.mat'
); endimage
= zeros(8, 15);image
= original_matrix(1:8, start_index
: end_index
);save(save_matrix_path
, 'image')image
= zeros(8, 15);image
= noisy_matrix(1:8, start_index
: end_index
);save(save_matrix_path_gaussian
, 'image')start_index
= start_index
+ 6;end_index
= end_index
+ 6;elsediv
= div
- 1;endend
%________
%: Random Windows
.for index
= div
: 226limit
= matrix_size
- 20;random_number
= randi([1,limit
]);index_start_random
= random_number
;index_end_random
= index_start_random
+ 14;if(repetition
== 1 || repetition
== 3 || repetition
== 5)save_path
= strcat('EMG_data\train_set\' , fn, '_image
', int2str(index), '.mat'
);save_path_gaussian
= strcat('EMG_data\train_set\' , fn, '_image
', int2str(index), '_GAUSSIAN
.mat'
);end
if(repetition
== 2)save_path
= strcat('EMG_data\test_set\' , fn, '_image
', int2str(index), '.mat'
);save_path_gaussian
= strcat('EMG_data\test_set\' , fn, '_image
', int2str(index), '_GAUSSIAN
.mat'
);end
if(repetition
== 4)save_path
= strcat('EMG_data\val_set\' , fn, '_image
', int2str(index), '.mat'
);save_path_gaussian
= strcat('EMG_data\val_set\' , fn, '_image
', int2str(index), '_GAUSSIAN
.mat'
);endimage
= zeros(8, 15); image
= original_matrix(1:8, index_start_random
: index_end_random
);save(save_path
, 'image');image
= zeros(8, 15);image
= noisy_matrix(1:8, index_start_random
: index_end_random
);save(save_path_gaussian
, 'image')endendend
end
總結
以上是生活随笔為你收集整理的基于肌电信号(sEMG) 的深度学习手势分类的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。