{"id":19020729,"url":"https://github.com/librauee/sd_ecg","last_synced_at":"2026-03-04T20:32:17.885Z","repository":{"id":107435207,"uuid":"451096834","full_name":"librauee/SD_ECG","owner":"librauee","description":"山东赛第三届数据应用创新创业大赛-心电图智能事件识别-亚军方案","archived":false,"fork":false,"pushed_at":"2022-04-27T09:38:56.000Z","size":27,"stargazers_count":15,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-23T07:35:14.007Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://data.sd.gov.cn/cmpt/cmptDetail.html?id=53","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/librauee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-23T12:26:45.000Z","updated_at":"2025-03-24T02:40:17.000Z","dependencies_parsed_at":"2023-03-23T23:18:33.925Z","dependency_job_id":null,"html_url":"https://github.com/librauee/SD_ECG","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/librauee/SD_ECG","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/librauee%2FSD_ECG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/librauee%2FSD_ECG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/librauee%2FSD_ECG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/librauee%2FSD_ECG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/librauee","download_url":"https://codeload.github.com/librauee/SD_ECG/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/librauee%2FSD_ECG/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30091774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T19:41:02.502Z","status":"ssl_error","status_checked_at":"2026-03-04T19:40:05.550Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T20:18:24.766Z","updated_at":"2026-03-04T20:32:16.536Z","avatar_url":"https://github.com/librauee.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 心电图智能事件识别 把杰泥牛逼打在公屏上-Writeup \u0026 Reproduce\n\n* A榜第2、B榜第2\n\n## 环境配置\n\n* numpy==1.19.5\n* pandas==1.1.5\n* scipy==1.5.4\n* scikit-learn==0.24.2\n* torch==1.7.1+cu101\n* tqdm==4.62.3\n* iterative-stratification==0.1.7\n\n## 数据预处理\n\n### 方案1\n* 考虑到数据存在不同长度的问题，以多数类长度16001为基准长度，这里采用长度不足16001在末尾补零，长度超过16001的末尾截断的处理。\n* 另外考虑到读取csv速度慢，这里完成上述操作之后均转化为mat矩阵文件保存。\n\n### 方案2\n* 使用重采样统一将心电信号变为长度6666，并以字典形式保存所有数据，方便快速读取【减少dataset的IO, 以空间换时间】。\n\n## 算法模型\n\n### 模型一、se_resnet34（方案基线模型）\n\n把经典的神经网络模型resnet34中的二维卷积修改为一维卷积，并添加注意力模块SE，使用该注意力机制有助于提取通道之间相关性，增强模型性能。\n\n### 模型二、se_resnet34_plus（核心模型）\n\n在模型一的基础上添加maxpooling层，将maxpooling层的输出与原网络平均池化的输出拼接，再经过全连接层输出最终结果，提取最大值特征有助于识别心电图的异常。\n\n\n### 模型三、se_resnet34_plus2\n\n在模型二的基础上，在模型输入处并行四个大小不同的卷积核，以获取不同感受野的心电图特征，然后将其通过1x1卷积缩减通道数，再将他们拼接起来输出到下一层，模型输出端采用和模型二同样的思路，添加maxpooling层，有助于识别心电图的异常。\n\n### 模型四、se_resnet34_plus3（单模最高分模型）\n\n在模型三的基础上，在模型输出处添加一个head包含两个全连接层和hardSwish激活函数。\n\n## 训练方法\n\n* 以评价指标f1-macro作为早停指标，训练得到总指标得分最高的单模型；\n* 以每个类别的f1得分作为保存模型的依据，一次同时保存18个在每个类别中的最佳模型。\n\n## 模型融合\n\n* 多模型生成oof以及pred文件（我这里模型很多，把顺序迭代的部分模型都用于集成）\n* 使用贝叶斯调参搜索模型权重，最终加权融合\n\n## 后处理\n\n* 根据oof进行阈值后处理（常规操作，百分位提升）\n* 根据标签分析进行互斥后处理（千分位提升）\n\n## 代码运行\n\n* 安装上述环境\n* 把ecg_data以及label_and_example两个文件夹放到当前路径\n* 运行命令 sh infer.sh\n* 生成提交文件sub_final.csv即为最终提交文件\n* 【注】如需重新训练，请将命令中的所有train设置为1\n\n## 运行要求\n\n* 训练最多需要约40G内存，12G显存\n* 推理最多需要约40G内存，4G显存\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibrauee%2Fsd_ecg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibrauee%2Fsd_ecg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibrauee%2Fsd_ecg/lists"}