基于神经网络识别抑郁症附matlab代码

简介: 基于神经网络识别抑郁症附matlab代码

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

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

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

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

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

⛄ 内容介绍

在如今生活节奏快,工作竞争激烈的社会环境的影响下,抑郁症已成为人群中一种常见的精神疾病,并成为了全球性公共卫生问题.对抑郁症进行准确的诊断以及预测病情能否通过药物有效控制(不同类型细分),对于确定合适的诊疗方案具有重要的意义.但是,目前临床上对抑郁症的诊断方式主要是通过对患者进行量表问询.该方式下患者回答的真实性有待考量且受医生经验和水平等因素的影响,诊断结果较为主观且易发生误诊的情况.近年来,已有大量的研究从大脑医学影像的角度寻找抑郁症的生物学诊断指标

⛄ 部分代码

% @=============================================================================

% Reference: Identifying Neuroimaging Biomarkers of Major Depressive Disorder

%            from Cortical Hemodynamic Responses

%            Using Machine Learning Approaches

% =============================================================================@

%

function main()

   clc; clear; close all;

   

   % Add current path and all subfolders to the path.

   addpath(genpath(pwd));

   

   % -----------------------------------------------------------------

   % Pre-processed NIRS signals by: linear fitting, moving average, and

   %   removing artifact channels.

   % The generated ∆HbO dataset:

   %   samples_52ch_HbO.mat

   

   

   % -----------------------------------------------------------------

   % Three steps of fNRIS signals analysis for differing MDDs from HCs

   step = 3;

   

   if step == 1

       Method1_RankingFeatures();

       

   elseif step == 2

       Method2_GASelection();

       

   elseif step == 3

       Validation();

       

   end

   

end




%% ===================================================================

% Feature Selection Method I: Ranking Features by Statistical Test

%

function Method1_RankingFeatures()

   %   (1) A data matrix consists of 52 channels × 16 variables was extracted.

   %   (2) Statistical test was applied to find the significantly different

   %       channels on each variable, and subsequently generate feature channels

   %       as predictors for a classifier.

   stat_result = statistics_test_feature();

   % Results:

   %           Supplementary Figure 1 - Color Map

   %           Supplementary Figure 2 - count_sigdiff_channels

   %           Supplementary Table 3 - hc_cf_mstd, mdd_cf_mstd, pvalues_cluster

   

   

%     % generate feature set with significant difference

%     generate_sigdiff_feature(stat_result.feature_names, ...

%                               stat_result.diff_feature_cluster, ...

%                               stat_result.count_sigdiff_channels);

   


   %   (3) Five supervised models were implemented to learn pattern

   %       from feature channels

   %   (6)(10) Performances were evaluated by five-fold cross-validation and

   %       prediction accuracy

   data_type       = 'sigdiff_feature_topsigch';   % 'sigdiff_feature_topcluster'

   feature_type    = 'feature_channel';

   feature_fname   = 'featureset_sigdiff_5ch.mat';

   integral_type   = '';

   centroid_type   = '';

   model_type      = 'funcfit_nb';

   [pred_train, pred_test] = test_feature_performance(data_type, ...

                               feature_type, feature_fname, ...

                               integral_type, centroid_type, ...

                               model_type);

   % Result: Supplementary Table 6

   

   %   (10) performances were estimated by nested cross-validation

   [result_inner_cv, result_outer_train, result_outer_test] =      ...

                             nested_crossvalidation(data_type,     ...

                               feature_type, feature_fname,        ...

                               '', '', model_type);

   % Result: Supplementary Table 6

end



%% ===================================================================

% Feature Selection Method II: Two-phase Feature Selection by Genetic Algorithm

%    

function Method2_GASelection()

   % -------------- Phase-One --------------

   % The input is the candidate channels from one of the 10 significant variables,

   % while the output is a channel subset of the specific variable.

   % The optimization of channel selection was performed over all 10 variables.

   data_type       = 'integral';

   feature_type    = 'feature_channel';

   feature_fname   = '';

   integral_type   = 'integral_stim';

   centroid_type   = '';

   model_type      = 'funcfit_svm';

   func_pop        = @func_population_rand;

   binary_ga(data_type, feature_type, feature_fname, ...

               integral_type, centroid_type, model_type, func_pop);

   % Result: ga_ma50_integral_stim__svm_0.7316_0.7363.mat, etc.

   

   % -------------- Phase-Two --------------

   % The selected channel subsets from 10 significant variables were then

   % combined into a feature set, i.e., fusion features.

   generate_fusion_feature('svm');

   % Result: fusion_10variants_svm.mat, etc.

   

   % GA learned which feature channels contributed best to the accuracy

   % of a supervised model.

   data_type       = 'fusion_feature';

   feature_type    = 'feature_channel';

   feature_fname   = 'fusion_10variants_svm.mat';

   model_type      = 'funcfit_svm';

   func_pop        = @func_population_optm;

   binary_ga(data_type, feature_type, feature_fname, ...

                '', '', model_type, func_pop);

   % Results:  

   %           ga_fusion_features_svm_0.8053_0.7802.mat, etc.

   %           Supplementary Figure 3

end



%% ===================================================================

% Validate the Performance of Optimal Features

%

function Validation()

   % -----------------------------------------------------------------

   % Classification performances were reported by the

   % 5-fold cross-validation in training set and

   % prediction accuracy in test set.

   data_type       = 'ga_optimal_feature';

   feature_type    = 'feature_channel';

   feature_fname   = 'ga_fusion_features_svm_0.8053_0.7802.mat';

   model_type      = 'funcfit_svm';

   [pred_train, pred_test] = test_feature_performance(data_type,   ...

                               feature_type, feature_fname,        ...

                               '', '', model_type);

   % Result: TABLE 1 of main text

   

   % ----------------------------------------------------------------------

   % Classification performances were estimated by nested cross-validation

   [result_inner_cv, result_outer_train, result_outer_test] =      ...

                             nested_crossvalidation(data_type,     ...

                               feature_type, feature_fname,        ...

                               '', '', model_type);

   % Result: TABLE 1 of main text

   

   

   % -------------- Characteristics of optimal feature --------------

   p1_fus_feature_fname = 'fusion_10variants_svm.mat';

   p2_opt_feature_fname = 'ga_fusion_features_svm_0.8053_0.7802.mat';

   [pvalues_optfeatures, pvalues_roifeatures, ...

           hc_roi, mdd_roi, count_common_channels] = ...

       test_optimalfeature(p1_fus_feature_fname, p2_opt_feature_fname);

   % Results:

   %           Figure 2 of main text -- hc_roi, mdd_roi

   %           Figure 3 of main text -- count_common_channels

   %           Supplementary Table 4 -- hc_roi, mdd_roi, pvalues_roifeatures

   

   

   % -------------- Common features between different models --------------

%     test_common_features();

end

⛄ 运行结果

⛄ 参考文献

[1]江筱, 邵珠宏, 尚媛园,等. 基于级联深度神经网络的抑郁症识别[J]. 计算机应用与软件, 2019, 36(10):7.

⛄ 完整代码

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


相关文章
|
6天前
|
机器学习/深度学习 Python
【Python实战】——神经网络识别手写数字(三)
【Python实战】——神经网络识别手写数字
|
6天前
|
机器学习/深度学习 数据可视化 Python
【Python实战】——神经网络识别手写数字(二)
【Python实战】——神经网络识别手写数字(三)
|
2天前
|
机器学习/深度学习 编解码 算法
YOLOv5改进 | 主干网络 | 将backbone替换为MobileNetV3【小白必备教程+附完整代码】
本文介绍了将YOLOv5的backbone替换为MobileNetV3以提升目标检测性能的教程。MobileNetV3采用倒残差结构、Squeeze-and-Excitation模块和Hard-Swish激活函数,实现更高性能和更低计算成本。文中提供了详细的代码实现,包括MobileNetV3的关键组件和YOLOv5的配置修改,便于读者实践。此外,还分享了完整代码链接和进一步的进阶策略,适合深度学习初学者和进阶者学习YOLO系列。
|
4天前
|
算法
MATLAB|【免费】融合正余弦和柯西变异的麻雀优化算法SCSSA-CNN-BiLSTM双向长短期记忆网络预测模型
这段内容介绍了一个使用改进的麻雀搜索算法优化CNN-BiLSTM模型进行多输入单输出预测的程序。程序通过融合正余弦和柯西变异提升算法性能,主要优化学习率、正则化参数及BiLSTM的隐层神经元数量。它利用一段简单的风速数据进行演示,对比了改进算法与粒子群、灰狼算法的优化效果。代码包括数据导入、预处理和模型构建部分,并展示了优化前后的效果。建议使用高版本MATLAB运行。
|
6天前
|
网络安全 数据安全/隐私保护 计算机视觉
2024蓝桥杯网络安全-图片隐写-缺失的数据(0基础也能学会-含代码解释)
2024蓝桥杯网络安全-图片隐写-缺失的数据(0基础也能学会-含代码解释)
|
6天前
|
机器学习/深度学习 数据可视化 Python
【Python实战】——神经网络识别手写数字(一)
【Python实战】——神经网络识别手写数字
|
6天前
|
数据安全/隐私保护
地震波功率谱密度函数、功率谱密度曲线,反应谱转功率谱,matlab代码
地震波格式转换、时程转换、峰值调整、规范反应谱、计算反应谱、计算持时、生成人工波、时频域转换、数据滤波、基线校正、Arias截波、傅里叶变换、耐震时程曲线、脉冲波合成与提取、三联反应谱、地震动参数、延性反应谱、地震波缩尺、功率谱密度
|
6天前
|
数据安全/隐私保护
耐震时程曲线,matlab代码,自定义反应谱与地震波,优化源代码,地震波耐震时程曲线
地震波格式转换、时程转换、峰值调整、规范反应谱、计算反应谱、计算持时、生成人工波、时频域转换、数据滤波、基线校正、Arias截波、傅里叶变换、耐震时程曲线、脉冲波合成与提取、三联反应谱、地震动参数、延性反应谱、地震波缩尺、功率谱密度
基于混合整数规划的微网储能电池容量规划(matlab代码)
基于混合整数规划的微网储能电池容量规划(matlab代码)
|
6天前
|
算法 调度
面向配电网韧性提升的移动储能预布局与动态调度策略(matlab代码)
面向配电网韧性提升的移动储能预布局与动态调度策略(matlab代码)

热门文章

最新文章