Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

TransMed: Transformers Advance Multi-modal Medical Image Classification

  • Problem Pure transformers need large training sets, while medical imaging collections are small, and multi-modal MRI fusion has mostly relied on CNN schemes that model cross-modality relations weakly.
  • Method Stacks three adjacent slices into a three-channel image, cuts it into K×K patches, extracts patch embeddings with a 2D CNN, and models them with a DeiT-based transformer whose class token output is classified.
  • Results TransMed-S reached 88.9±3.0 ACC on the parotid gland tumors dataset, against 76.1±5.5 for P3D, the best baseline row.

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…

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.).

Original paper · CC BY 4.0 · Yin Dai, Yifan Gao · TransMed: Transformers Advance Multi-modal Medical Image Classification · Original paper figure · Extracted the figure area from page 6 of the original PDF.

Why pure transformers fall short here

Transformers model relations across a sequence through self-attention, which is why they suit images as well as text. Natural images expose their sequence structure only implicitly, once they are cut into patches. The authors argue that medical scans show clearer sequence structure across modality, slice and patch, and that this structure carries information a model can use over long distances.

Pure transformers generally need large datasets, and medical imaging collections are comparatively small. The authors state that pure transformer networks based on ViT and DeiT perform unsatisfactorily on multi-modal medical classification, which they link to the small dataset size and to too little information about low-level features.

The design answer is to keep a CNN for low-level features and give the transformer the job of relating the resulting sequence elements across modalities and positions. The authors state that TransMed is the first transformer-based framework for multi-modal medical image classification known to them.

Three fusion strategies and their costs

Existing deep multi-modal work sorts fusion into three types: input-level, feature-level and decision-level. Input-level fusion stacks the modalities as channels of one network before training, so the network learns a joint representation from the start. Feature-level fusion gives each modality its own path and combines their representations inside the network, while decision-level fusion combines the outputs of separate networks.

Each type has a cost. Input-level fusion struggles to model the relation between the modalities of one patient, which the authors link to weaker performance. Feature-level designs need a network for each modality, and the computational cost grows with the number of modalities. Decision-level outputs stay independent of one another, so the model cannot link the modalities of one patient.

Prior studies vary in how they fuse. Hyper DenseNet built dual networks for MRI modalities and linked features across the streams, and another work fused final features from modality-specific paths. Some decision-level designs add a gate network that weights each decision, and others use modality-specific encoders with a decoder that fuses low-level and high-level features.

Work that compares several fusion types at once still shows poor scalability, heavy computation and difficulty with long-range connections, according to the authors.

Turning MRI volumes into a sequence

The input is a multi-modal image with batch size B, M modalities, C channels, depth D and spatial resolution H×W. \[ x \in \mathbb{R}^{B\times M\times C\times D\times H\times W} \]

Before the CNN, three adjacent 2D slices are superimposed into one three-channel image, so each image carries three neighbouring slices. Each such image is then divided into K×K patches, and a larger K gives smaller patches.

The CNN is a 2D network whose last fully connected layer is replaced by a linear projection, which maps each patch's features into an embedding space. In this role the CNN extracts low-level features from the image sequence and encodes them before the transformer sees them. The length P of each patch embedding is set to fit the input size of the transformer.

Transformer blocks and embeddings

The transformer branch follows the original DeiT implementation as closely as possible, so its design and pre-trained weights are easy to reuse. Compared with DeiT, the linear projection layer and the distillation token are removed.

Self-attention projects each input vector into query, key and value vectors. The output is a weighted sum of the values, with each weight given by the dot product of a query and a key. \[ \mathrm{Attention}(Q,K,V)=\mathrm{Softmax}\left(\frac{QK^{T}}{\sqrt{d_k}}\right)V \] Here d_k is the dimension of the key vector. The authors say dividing by its square root keeps the gradients more stable.

Multi-head Self-Attention splits the projections into several heads that run in parallel, each with its own trainable projection matrices. The head outputs are concatenated and multiplied by an output projection. \[ \mathrm{head}_i=\mathrm{Attention}(QW^{Q}_{i},\,KW^{K}_{i},\,VW^{V}_{i}) \] \[ \mathrm{MSA}(Q,K,V)=\mathrm{Concat}(\mathrm{head}_i,\ldots,\mathrm{head}_i)\,W^{O} \] The printed concatenation repeats the index i, and the paper defines h as the number of transformer layers, although the formula concatenates over heads; the text does not settle which index runs over which set.

The MLP is made of linear layers separated by a GeLU activation, and it sits after the MSA layer in each block. Each sub-block has a skip connection and layer normalization, which the paper writes as LN in the formulas. \[ \hat{x}_t=\mathrm{MSA}(\mathrm{LN}(x_{t-1}))+x_{t-1} \] \[ x_t=\mathrm{MLP}(\mathrm{LN}(\hat{x}_t))+\hat{x}_t \] Here x_{t-1} is the input of layer t, and the skip connections add the block input back after each sub-block.

The patch tokens are the CNN patch embeddings with a position embedding added, so the spatial location of each patch is kept. \[ x^{pt}=\mathrm{Conv}(x)+x^{po} \] A trainable class token is attached to the patch tokens before the transformer layers. \[ x^{ct}=W^{c} \] After the transformer layers, the class token output passes through a fully connected layer that predicts the class.

Parotid MRI dataset and training setup

The dataset comes from cooperating hospitals and contains T1 and T2 MRI of 344 patients, with ground-truth labels from biopsies. The paper cites an incidence of about 20% for malignant tumors among parotid gland tumors as the reason preoperative diagnosis matters. The labels cover five categories: Pleomorphic Adenoma (PA), Warthin Tumor (WT), Malignant Tumor (MT), Basal Cell Adenoma (BCA) and Other Benign Lesions (OBL).

Foreground is extracted with OTSU thresholding, the modalities of each patient are registered, and each image is resampled to (18, 448, 448). The text also gives (36, 448, 448) as the size of each stacked T1 and T2 volume, and it does not spell out how the per-image size becomes the stacked size.

Training-time augmentation flips each image with 50 % probability. It also adds Gaussian noise with mean 0 and variance 0.1 to each image.

Patients are split at random at a 4:1 ratio into 275 training patients and 69 independent test patients, and the training group fits the model parameters. The optimizer is SGD with learning rate 10−3 and momentum 0.7, for at most 100 training rounds. Each model is run in 10 independent experiments, each with its own random split, and the other settings are kept the same.

The runs use one NVIDIA 3080 GPU with 10GB memory, implemented in PyTorch and TorchIO.

Overall accuracy is ACC, the number of correctly predicted samples Tc divided by the total number of samples T. \[ \mathrm{ACC}=\frac{T_c}{T} \] Per-class precision P(i) divides the samples correctly predicted as class i, Tic, by all samples predicted as class i, which are Tic plus the wrongly predicted Tif. \[ P(i)=\frac{T_{ic}}{T_{ic}+T_{if}} \]

Accuracy against fusion baselines

The baselines cover input-level fusion with 2D and 3D networks, namely Resnet34, Resnet152, 3D Resnet34, P3D and C3D. Feature-level fusion uses the two methods of [11] and [12], which the authors modified for classification because the originals target segmentation. Decision-level fusion reuses the input-level backbones.

TransMed-T pairs ResNet18 with DeiT-Tiny, TransMed-S uses ResNet34 with DeiT-Small, TransMed-B uses ResNet50 with DeiT-Base, and TransMed-L uses ResNet152 with DeiT-B. Their ACC values are 87.0±2.6 for TransMed-T, 88.9±3.0 for TransMed-S, 87.4±2.1 for TransMed-B and 86.6±3.4 for TransMed-L.

The highest baseline ACC is 76.1±5.5, for P3D with input-level fusion, and every TransMed row exceeds every baseline row in ACC. Per class, TransMed is above every baseline on MT and OBL, but TransMed-T, TransMed-S and TransMed-L fall below the best baseline on BCA, and TransMed-T is below Resnet34 on PA. TransMed-T's PA value is 80.1±13.8 against 81.0±11.0 for Resnet34 under input-level fusion, and its BCA value is 82.5±15.3 against 83.2±16.3 for Resnet152 under decision-level fusion.

The text reports that TransMed-S gives about 12.8% higher average accuracy than the P3D baseline, but it names this model TransFuse-S, a name that matches no row in Table 1. TransMed-S's ACC of 88.9±3.0 against P3D's 76.1±5.5 is the comparison the table supports directly.

The authors say the larger TransMed-B and TransMed-L slightly suffer from overfitting on this dataset. Going from TransMed-T to TransMed-S improves average accuracy by 1.9% at a much larger computational cost.

Removing each branch and varying patch size

The ablation starts from TransMed-T, with either the transformer branch or the CNN branch removed and all other conditions unchanged.

Removing the transformer branch lowers ACC from 87.0±2.6 to 71.3±2.5, so keeping the transformer branch is the choice these numbers support. The authors say the transformer improves how the model explores relations between modalities with little extra parameters or computation. Removing the CNN branch gives the lowest ACC, 51.3±5.9, and the authors attribute the weak pure-transformer result to the small dataset.

The patch-size sweep changes K with the other conditions held fixed. The authors report poor performance when K is large and attribute it to image patches that become too small to keep semantic information. By the paper's own definition a larger K gives smaller patches, so the stated explanation and the stated condition describe the same setting from opposite ends, and the text does not reconcile them.

Limitations

The evidence comes from one dataset of 344 patients with T1 and T2 MRI, and from one five-category task on parotid gland tumors. The authors name tumor segmentation and lesion detection as tasks TransMed has not yet been applied to.

The ablations and the patch-size sweep were run on TransMed-T, which the authors chose because of computation cost. Whether the branch conclusions hold for TransMed-S, TransMed-B or TransMed-L was not tested.

The authors state that a gap remains between pure transformers and typical CNNs on small medical image datasets, based on their preliminary experiments. The feature-level baselines were built for segmentation and then changed for classification, so they are adapted rather than reproduced as published.

The table captions do not define the ± values, and the text does not say which TransMed parameters start from the DeiT pre-trained weights.

Paper info

Authors
Yin Dai, Yifan Gao
Venue
arXiv · Preprint
First published
2021-3-10
Added
2026-11-6
Updated
2021-3-10
Version
v1
arXiv
2103.05940
Category
cs.CV
Original paper terms
CC BY 4.0
What we show
Paper info, commentary and permitted figures from the original paper

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Abstract

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.

Quote from the paper

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}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up