《Using recurrent neural network models for early detection of heart failure onset》阅读笔记

一、简介

这篇文章是AIMA于2017年收录的一篇文章。在这篇文章中,作者利用GRU来对EHR数据的时序关系进行建模,并在对HF早期诊断的任务上取得了较好的结果。

电子健康记录(Electronic health record,EHR)是个人的健康记录,其中包含了丰富的可用于医疗诊断的信息,如diagnosis codes,medication codes,以及procedure codes。虽然EHR数据中包含 了丰富的信息,但是由于其捕获的信息结构较为复杂,广度更大,因此,很难有效利用上述信息。

在此之前的大多数利用EHR数据的模型都是基于aggregate features,例如event count,event average等,并没有考虑aggregate features之间的时序关系,如medication ordered at one time and procedure performed at another。因此,作者借鉴了NLP广泛使用的RNN模型,来对aggregate features之间的时序关系进行建模,并在对HF早期诊断的任务上超过了以往的模型,证明了aggregate features之间的时序关系对于HF早期诊断的重要性。

二、相关工作

  • linear models for low-dimensional data
  • Cox proportional hazard model
  • hidden Markov model
  • 2-dimensional continuous-time hidden Markov model
  • graphical models with the Gaussian process
  • Markov jump process
  • Hawkes process

三、方法

在具体模型选择上,作者选择了GRU来对EHR数据的时序关系建模。模型结构较为简单,这里主要介绍一下作者如何在模型中表达medical concepts。

  • one-hot encode

最简单的方法就是借鉴NLP的方法,即采用one-hot的方法来表达相关的medical concepts,如图所示:
在这里插入图片描述

  • Grouped code vectors

  • Medical concept vector

在构建medical concept vectors时,作者借鉴了NLP中的embedding技术,基于训练语料采用skip-gram的方法来获取medical vector。
在这里插入图片描述

三、Experiment

  • Dataset

From random samples of 265 336 Sutter-PAMF patients, 4178 incident HF cases and 29 139 control patients were identified. The average number of clinical codes assigned to each patient was approximately 72, and there were 18 181 unique clinical codes (6910 diagnosis codes, 6897 medication codes, and 4374 procedure codes) in total. The full sample of 265 336 was used for training the medical concept vectors, and the incident HF cases and controls were used for all other model training and evaluation tasks.

  • Baseline

实验中采用的基线模型包括:logistic regression,MLP,SVM,以及KNN

  • Result

在这里插入图片描述

### 多模态融合与循环神经网络在微博谣言检测中的代码实现 以下是基于多模态融合和循环神经网络(RNN/LSTM/GRU)进行微博谣言检测的一个简化代码框架。此代码旨在展示如何通过文本和其他模态数据(如图像或用户行为)联合训练模型。 #### 数据预处理 为了有效利用多模态信息,通常需要对不同类型的输入数据进行标准化处理。 ```python import numpy as np from tensorflow.keras.preprocessing.text import Tokenizer from tensorflow.keras.preprocessing.sequence import pad_sequences def preprocess_text(texts, max_len=100): tokenizer = Tokenizer(num_words=10000) tokenizer.fit_on_texts(texts) sequences = tokenizer.texts_to_sequences(texts) padded_sequences = pad_sequences(sequences, maxlen=max_len, padding='post') return padded_sequences # 示例:假设我们有两条微博文本 texts = ["这是一条真实的微博", "这条微博可能是假的"] padded_sequences = preprocess_text(texts) print(padded_sequences.shape) # 输出形状应为 (样本数, 序列长度) ``` #### 构建多模态融合模型 以下是一个简单的多模态融合架构,结合了文本特征提取模块(使用 LSTM 或 GRU)以及可能的其他模态(例如图片特征)。这里仅提供了一个基本版本。 ```python import tensorflow as tf from tensorflow.keras.models import Model from tensorflow.keras.layers import Input, Embedding, LSTM, Dense, concatenate, Flatten # 文本分支 text_input = Input(shape=(100,), name="text_input") # 输入维度由最大序列长度决定 embedding_layer = Embedding(input_dim=10000, output_dim=128)(text_input) lstm_output = LSTM(units=64, return_sequences=False)(embedding_layer) # 图像或其他模态分支(假设已有的 CNN 提取器) image_input = Input(shape=(7, 7, 512), name="image_input") # 假设来自预训练 CNN 的特征图大小 flatten_image = Flatten()(image_input) dense_image = Dense(64, activation='relu')(flatten_image) # 融合层 concatenated_features = concatenate([lstm_output, dense_image]) output = Dense(1, activation='sigmoid', name="rumor_detection")(concatenated_features) model = Model(inputs=[text_input, image_input], outputs=output) model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy']) model.summary() ``` 上述代码展示了如何构建一个多模态模型,其中: - **文本部分** 使用嵌入层和 LSTM 层来捕捉语义信息[^1]。 - **图像部分** 利用预训练的卷积神经网络提取的空间特征[^2]。 - **融合策略** 将两种模态的信息拼接在一起并通过全连接层完成最终预测。 #### 训练过程 对于实际应用而言,还需要准备相应的标签数据并调整超参数以获得最佳性能。 ```python # 假设有如下训练集 X_train_text = ... # 预处理后的文本数据 X_train_images = ... # 对应的图像特征矩阵 y_train = ... # 标签数组 history = model.fit( {"text_input": X_train_text, "image_input": X_train_images}, y_train, epochs=10, batch_size=32, validation_split=0.2 ) ``` --- ### 注意事项 尽管以上代码提供了基础思路,但在真实场景下还需考虑更多因素,比如传播树结构的影响[^3]、早期检测需求等。此外,具体效果取决于高质量的数据标注和合理的调参工作。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值