# TransMed: Transformers Advance Multi-modal Medical Image Classification

TransMed：Transformerによるマルチモーダル医療画像分類の発展

Yin Dai, Yifan Gao · arXiv · 2021年3月10日

- **課題** マルチモーダル医療画像の分類では、CNNは局所的な特徴に強いものの、長距離の関係を扱うのが難しいです。既存の融合手法も、モダリティ間の関係と計算コストの面で限界があります。
- **手法** CNNで低水準のパッチ埋め込みを作り、Transformerでパッチ列の長距離関係を学習する、ハイブリッド構造のTransMedを提案します。
- **結果** 耳下腺腫瘍データセットでは、TransMed-Tが平均精度87.0%を記録しました。アブレーション実験では、Transformer分岐を除くと71.3%、CNN分岐を除くと51.3%に下がりました。

## マルチモーダル医療画像分類の課題

医療画像分類では、CNNは局所的な特徴を抽出するのに優れていますが、畳み込み演算は局所的であるため、長距離の関係を扱うのは難しいです。一方、マルチモーダル医療画像には、モダリティ、スライス、パッチの間に明示的で重要な長距離依存性があります。既存の融合手法は、入力レベル、特徴レベル、決定レベルに分けられます。入力レベルの融合では、同じ患者のモダリティ間の関係を十分に作りにくいです。特徴レベルの融合では、モダリティごとにニューラルネットワークを置くため、計算コストが大きくなります。決定レベルの融合では、各モダリティの出力が互いに独立しているため、モダリティ間の内部関係を作りにくいです。

純粋なTransformerは自然画像で大きな成果を上げましたが、大規模データセットを前提とするため、規模の小さい医療画像データにはそのまま適用しにくいです。この論文は、この隙間を埋めるために、CNNとTransformerを組み合わせたTransMedを提案します。

## TransMedの構造とTransformerの演算

TransMedは、CNN分岐とTransformer分岐を併せ持つハイブリッドモデルです。入力のマルチモーダル画像は、3つの隣接する2Dスライスを重ねて3チャネルの画像にしたのち、K×Kのパッチに分割します。このパッチ列を2D CNNに入力すると、CNNが低水準の特徴を抽出します。最後の全結合層の代わりに置かれた線形射影層が、各パッチを潜在埋め込み空間へ写します。ここで作られたパッチ埋め込みが、Transformerのパッチトークンを構成します。

Transformer分岐では、パッチトークンに位置埋め込みを加え、パッチトークンの前にclass tokenを付けます。各層は、self-attentionを計算するMSAと、GeLUを挟んだ線形層からなるMLPを通ります。どちらの構成要素もskip-connectionとlayer normalizationを持ちます。最後に、class tokenが全結合層を通ってクラスを予測します。著者らは、この設計が、CNNで低水準の特徴を得て、Transformerでモダリティ間の長距離関係をモデル化するためのものだと説明しています。

Self-attentionでは、入力をquery、key、valueに変換したのち、Attention(Q,K,V)=Softmax(QK^T/√d\_k)Vで計算します。ここで、d\_kはkeyベクトルの次元であり、√d\_kは勾配をより安定させる正則化項だと説明されています。

\\\[\\mathrm{Attention}(Q,K,V)=\\mathrm{Softmax}\\left(\\frac{QK^{T}}{\\sqrt{d\_k}}\\right)V\\\]

## データと学習の設定

実験データは、協力病院で収集された耳下腺腫瘍データセットです。T1とT2の2つのモダリティからなるMRI 344名分のデータと、生検に基づく正解ラベルで構成されます。腫瘍はPA、WT、MT、BCA、OBLの5つのカテゴリに分けられます。前処理では、OTSUで前景領域を抽出し、同じ患者のモダリティ画像を位置合わせしたのち、各画像を(18, 448, 448)にリサンプリングします。その後、T1とT2を重ねて、(36, 448, 448)サイズの画像を作ります。

患者は、訓練グループ275名と独立したテストグループ69名に、4:1でランダムに分割されます。モデルはSGDのオプティマイザ、学習率10^-3、モメンタム0.7、最大100ラウンドで学習し、各モデルは実験ごとにランダムに分けたデータで10回繰り返しました。評価指標は、全体精度ACCと、カテゴリごとの適合率P(i)です。ACCは、全サンプル数Tに対する正しい予測数Tcの割合です。P(i)は、正しくiと予測された数Ticを、Ticと誤ってiと予測された数Tifの和で割った値です。

## 既存の融合手法との比較

表1は、P3D、C3D、ResNet系列の入力レベル融合、特徴レベル融合、決定レベル融合のベースラインと、TransMedの変種を比較したものです。この比較では、TransMed-TがResNet18とDeiT-Tinyをバックボーンとして用い、平均精度87.0%、パラメータ17M、TFlops 0.09でした。TransMed-SはResNet34とDeiT-Smallを使い、平均精度88.9%を記録しました。

![Table 1: Comparison on the parotid gland tumors dataset (average accuracy % and precision % for each disease. IF , FF and DF represent input-level fusion, feat…](https://refivu.com/papers/23fc0792-8c66-4fa5-9842-427e13e4215b/figures/figure-2756f9fe5b892e01fe9539d92fbc22f2.png?thumb=512)

**TABLE 1** . Comparison on the parotid gland tumors dataset (average accuracy % and precision % for each disease. IF , FF and DF represent input-level fusion, feature-level fusion and decision-level fusion, respectively.).

[出典](https://arxiv.org/abs/2103.05940v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Yin Dai, Yifan Gao · TransMed: Transformers Advance Multi-modal Medical Image Classification · 論文の図を引用 · 元のPDFの6ページ目から図の部分を抽出しています。

著者らは、TransMedが従来のマルチモーダル融合戦略より大きな差で高い性能が出たと報告しています。TransFuse-Sという表現で記した平均精度の向上12.8%は、P3D比の値です。より大きいTransMed-BとTransMed-Lは、データセットで過学習を示したと解釈されています。この比較は、このデータセットと10回の反復実験の条件で得られた結果で、パラメータと演算量も同じ表に併せて報告されています。

## CNN分岐とTransformer分岐の除去実験

アブレーション実験は、TransMed-Tから1つの分岐を除き、ほかの条件は変えずに行いました。Transformer分岐を除いたモデルは、パラメータ12M、TFlops 0.01、平均精度71.3%で、CNN分岐を除いたモデルは、パラメータ5M、TFlops 0.07、平均精度51.3%です。TransMed-T全体は、17M、0.09 TFlops、87.0%です。

![Table 2: Ablation study on the effectiveness of CNN branch and transformer branch](https://refivu.com/papers/23fc0792-8c66-4fa5-9842-427e13e4215b/figures/figure-a968983ea0eb4f749ec2f162de31f8ac.png?thumb=512)

**TABLE 2** . Ablation study on the effectiveness of CNN branch and transformer branch.

[出典](https://arxiv.org/abs/2103.05940v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Yin Dai, Yifan Gao · TransMed: Transformers Advance Multi-modal Medical Image Classification · 論文の図を引用 · 元のPDFの7ページ目から図の部分を抽出しています。

この結果は、Transformer分岐を残すと精度が高まるという観察として読み取れます。著者らは、Transformerがパラメータと演算量をわずかに増やしながら、モダリティ間の関係をより適切に探索すると解釈しています。反対に、CNN分岐を除くと精度が大きく下がり、小規模データセットでは純粋なTransformer構造の性能が低いという著者の主張と一致します。

## パッチサイズKによる結果

パッチサイズの実験は、TransMed-TでKの値を1、2、4、8、16に変え、ほかの条件は変えずに行いました。Kの値が大きくなると、各パッチが小さくなるのではなく、論文の表の設定のとおりKが大きい場合になります。K=2のとき平均精度は87.0%で、K=16のときは65.2%と低いです。

著者らは、Kが大きい場合に性能が低いことを根拠に、小さすぎる画像パッチが画像の意味情報を損なう可能性を挙げています。この解釈は著者の仮説であり、パッチ内の情報損失を直接測定した結果ではないと考えられます。

## 適用範囲と限界

この論文の結果は、協力病院の耳下腺腫瘍MRIデータセット、T1とT2の2つのモダリティ、344名分のデータから得られたものです。データセットの規模が小さいため、純粋なTransformerはCNNとの性能差を示しましたが、著者らはこれを小規模な医療画像データセットの限界として報告しています。また、著者らはTransMedを腫瘍のセグメンテーションや病変検出など、ほかの医療画像タスクに適用することと、純粋なTransformer構造の改善を今後の課題として挙げています。

大きいTransMed-BとTransMed-Lで過学習が見られたという観察は、このデータセットで確認された結果であり、ほかのデータセットに対する一般的な結論としては扱えません。

## 論文情報

- **著者**: Yin Dai, Yifan Gao
- **学会・ジャーナル**: arXiv · プレプリント
- **公開日**: 2021年3月10日
- **登録日**: 2026年11月6日
- **更新日**: 2021年3月10日
- **バージョン**: v1
- **arXiv**: 2103.05940
- **カテゴリ**: cs.CV
- **ライセンス**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **掲載内容**: 論文情報・解説・論文の図

[元論文 ↗](https://arxiv.org/abs/2103.05940v1) · [PDF ↗](https://arxiv.org/pdf/2103.05940v1)

この解説は、Refivuの韓国語解説をAIで翻訳したものです。不正確な翻訳や誤りが含まれる可能性があります。論文と図の利用条件は各出典に従います。

## アブストラクト

Over the past decade, convolutional neural networks (CNN) have shown very competitive performance in medical image analysis tasks, such as disease classification, tumor segmentation, and lesion detection. CNN has great advantages in extracting local features of images. However, due to the locality of convolution operation, it can not deal with long-range relationships well. Recently, transformers have been applied to computer vision and achieved remarkable success in large-scale datasets. Compared with natural images, multi-modal medical images have explicit and important long-range dependencies, and effective multi-modal fusion strategies can greatly improve the performance of deep models. This prompts us to study transformer-based structures and apply them to multi-modal medical images. Existing transformer-based network architectures require large-scale datasets to achieve better performance. However, medical imaging datasets are relatively small, which makes it difficult to apply pure transformers to medical image analysis. Therefore, we propose TransMed for multi-modal medical image classification. TransMed combines the advantages of CNN and transformer to efficiently extract low-level features of images and establish long-range dependencies between modalities. We evaluated our model for the challenging problem of preoperative diagnosis of parotid gland tumors, and the experimental results show the advantages of our proposed method. We argue that the combination of CNN and transformer has tremendous potential in a large number of medical image analysis tasks. To our best knowledge, this is the first work to apply transformers to medical image classification.

## この論文を引用

Yin Dai, Yifan Gao (2021). TransMed: Transformers Advance Multi-modal Medical Image Classification. arXiv:2103.05940v1. https://arxiv.org/abs/2103.05940v1

**BibTeX**

```
@misc{dai2021transmed,
  title = {{TransMed: Transformers Advance Multi-modal Medical Image Classification}},
  author = {Yin Dai and Yifan Gao},
  year = {2021},
  eprint = {2103.05940},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2103.05940v1}
}
```

## この論文の用語

- [accuracy](https://refivu.com/ja/terms/1995c0cd6282-accuracy)
- [Transformer](https://refivu.com/ja/terms/515e8433c447-transformer)
- [ResNet](https://refivu.com/ja/terms/ca7e0121c7a8-resnet)
- [precision](https://refivu.com/ja/terms/29bee1303774-precision)
- [self-attention](https://refivu.com/ja/terms/426589b81077-self-attention)
- [layer normalization](https://refivu.com/ja/terms/7af9eccdb60d-layer-normalization)
- [DeiT](https://refivu.com/ja/terms/24b9f164881b-deit)
- [Multi-Layer Perceptron](https://refivu.com/ja/terms/835dd4f24c91-multi-layer-perceptron)
- [class token](https://refivu.com/ja/terms/5290d74b3faf-class-token)
- [GeLU](https://refivu.com/ja/terms/8897c492bcfe-gelu)
- [Multi-Head Self-Attention](https://refivu.com/ja/terms/075f5cbf9073-multi-head-self-attention)
- [Patch Embedding](https://refivu.com/ja/terms/29de7fe43e42-patch-embedding)
- [position embedding](https://refivu.com/ja/terms/240915f7a95a-position-embedding)

## ほかの論文解説

- [Fine-Grained Image Analysis with Deep Learning: A Survey](https://refivu.com/ja/papers/225ddd40-96a5-4a36-bb16-28857f71c737-fine-grained-image-analysis-with-deep-learning-a.md)
- [Multimodal Fusion Transformer for Remote Sensing Image Classification](https://refivu.com/ja/papers/5115f05f-19f9-447c-ab75-0ba016db652e-multimodal-fusion-transformer-for-remote-sensing-image.md)
- [A Generalized Deep Learning Framework for Whole-Slide Image Segmentation and Analysis](https://refivu.com/ja/papers/17229723-709e-4a8a-9857-8cd6f0d14883-a-generalized-deep-learning-framework-for-whole-slide.md)
- [Fast R-CNN](https://refivu.com/ja/papers/cf1d88ea-f632-4173-bcfd-eec504e5c175-fast-r-cnn.md)
- [End-to-End Training of Deep Visuomotor Policies](https://refivu.com/ja/papers/67bd34bf-8571-4d8e-9691-251431e21af1-end-to-end-training-of-deep-visuomotor-policies.md)
- [Unsupervised Deep Anomaly Detection for Multi-Sensor Time-Series Signals](https://refivu.com/ja/papers/878b018b-6c5e-4a6c-9708-982ce4d20f8a-unsupervised-deep-anomaly-detection-for-multi-sensor-time.md)
- [Anomaly Detection on Attributed Networks via Contrastive Self-Supervised Learning](https://refivu.com/ja/papers/c20bdbfe-b419-4df5-8f33-b1066c4f4576-anomaly-detection-on-attributed-networks-via-contrastive.md)
- [Machine Learning Advances for Time Series Forecasting](https://refivu.com/ja/papers/b577b23e-c68c-4e83-81bd-b145dfbcd066-machine-learning-advances-for-time-series-forecasting.md)
- [Graph Self-Supervised Learning: A Survey](https://refivu.com/ja/papers/3b8a4279-c849-4f49-8e2f-9d1981c1e87d-graph-self-supervised-learning-a-survey.md)
- [BEHRT: Transformer for Electronic Health Records](https://refivu.com/ja/papers/cadb146f-6d4d-4255-8058-89ac62ed2dc8-behrt-transformer-for-electronic-health-records.md)
- [A review of ensemble learning and data augmentation models for class imbalanced problems: combination, implementation and evaluation](https://refivu.com/ja/papers/4ac33ac8-dbb4-4221-91b4-b7ce10be936d-a-review-of-ensemble-learning-and-data-augmentation.md)
- [Spatio-Temporal Graph Neural Networks for Predictive Learning in Urban Computing: A Survey](https://refivu.com/ja/papers/94c424e3-5876-43b1-91cd-0fb89356f95a-spatio-temporal-graph-neural-networks-for-predictive.md)

---

AI解説には誤りが含まれることがあります。 [Refivu](https://refivu.com/ja/papers/23fc0792-8c66-4fa5-9842-427e13e4215b-transmed-transformers-advance-multi-modal-medical-image)
