This repo holds the code of TransFuse: Fusing Transformers and CNNs for Medical Image Segmentation

Overview

TransFuse

This repo holds the code of TransFuse: Fusing Transformers and CNNs for Medical Image Segmentation

Requirements

  • Pytorch>=1.6.0, <1.9.0 (>=1.1.0 should work but not tested)
  • timm==0.3.2

Model Overview


Experiments

ISIC2017 Skin Lesion Segmentation Challenge

GPUs of memory>=4G shall be sufficient for this experiment.

  1. Preparing necessary data:

    • downloading ISIC2017 training, validation and testing data from the official site, put the unzipped data in ./data.
    • run process.py to preprocess all the data, which generates data_{train, val, test}.npy and mask_{train, val, test}.npy.
    • alternatively, the processed data is provided in Baidu Pan, pw:ymrh and Google Drive.
  2. Testing:

    • downloading our trained TransFuse-S from Baidu Pan, pw:xd74 or Google Drive to ./snapshots/.
    • run test_isic.py --ckpt_path='snapshots/TransFuse-19_best.pth'.
  3. Training:

    • downloading DeiT-small from DeiT repo to ./pretrained.
    • downloading resnet-34 from timm Pytorch to ./pretrained.
    • run train_isic.py; you may also want to change the default saving path or other hparams as well.

Code of other tasks will be comming soon.

Reference

Some of the codes in this repo are borrowed from:

Citation

Please consider citing us if you find this work helpful:

@article{zhang2021transfuse,
  title={TransFuse: Fusing Transformers and CNNs for Medical Image Segmentation},
  author={Zhang, Yundong and Liu, Huiye and Hu, Qiang},
  journal={arXiv preprint arXiv:2102.08005},
  year={2021}
}

Questions

Please drop an email to [email protected]

You might also like...
Copy Paste positive polyp using poisson image blending for medical image segmentation
Copy Paste positive polyp using poisson image blending for medical image segmentation

Copy Paste positive polyp using poisson image blending for medical image segmentation According poisson image blending I've completely used it for bio

The Medical Detection Toolkit contains 2D + 3D implementations of prevalent object detectors such as Mask R-CNN, Retina Net, Retina U-Net, as well as a training and inference framework focused on dealing with medical images.
The Medical Detection Toolkit contains 2D + 3D implementations of prevalent object detectors such as Mask R-CNN, Retina Net, Retina U-Net, as well as a training and inference framework focused on dealing with medical images.

The Medical Detection Toolkit contains 2D + 3D implementations of prevalent object detectors such as Mask R-CNN, Retina Net, Retina U-Net, as well as a training and inference framework focused on dealing with medical images.

Build a medical knowledge graph based on Unified Language Medical System (UMLS)

UMLS-Graph Build a medical knowledge graph based on Unified Language Medical System (UMLS) Requisite Install MySQL Server 5.6 and import UMLS data int

Semi Supervised Learning for Medical Image Segmentation, a collection of literature reviews and code implementations.

Semi-supervised-learning-for-medical-image-segmentation. Recently, semi-supervised image segmentation has become a hot topic in medical image computin

Code base for
Code base for "On-the-Fly Test-time Adaptation for Medical Image Segmentation"

On-the-Fly Adaptation Official Pytorch Code base for On-the-Fly Test-time Adaptation for Medical Image Segmentation Paper Introduction One major probl

GAN-generated image detection based on CNNs

GAN-image-detection This repository contains a GAN-generated image detector developed to distinguish real images from synthetic ones. The detector is

[CVPRW 2022] Attentions Help CNNs See Better: Attention-based Hybrid Image Quality Assessment Network
[CVPRW 2022] Attentions Help CNNs See Better: Attention-based Hybrid Image Quality Assessment Network

Attention Helps CNN See Better: Hybrid Image Quality Assessment Network [CVPRW 2022] Code for Hybrid Image Quality Assessment Network [paper] [code] T

CoTr: Efficiently Bridging CNN and Transformer for 3D Medical Image Segmentation

CoTr: Efficient 3D Medical Image Segmentation by bridging CNN and Transformer This is the official pytorch implementation of the CoTr: Paper: CoTr: Ef

[CVPR'21] FedDG: Federated Domain Generalization on Medical Image Segmentation via Episodic Learning in Continuous Frequency Space
[CVPR'21] FedDG: Federated Domain Generalization on Medical Image Segmentation via Episodic Learning in Continuous Frequency Space

FedDG: Federated Domain Generalization on Medical Image Segmentation via Episodic Learning in Continuous Frequency Space by Quande Liu, Cheng Chen, Ji

Comments
  • Add large models and modify download link of resnet34

    Add large models and modify download link of resnet34

    Hello, your work helps me a lot while doing my research!

    To make this code easier to use, I made these changes:

    1. Add Large scale models, TransFuse_L, TransFuse_L_384, which were mentioned in the paper.
    2. Modify the download link of resnet34 in README, because the link writen in lib/TransFuse.py was different from the one in README.
    3. Add align_corners=True to F.interpolate, in order to avoid such WARNING
    /usr/local/miniconda3/lib/python3.7/site-packages/torch/nn/functional.py:3455: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
      "See the documentation of nn.Upsample for details.".format(mode)
    
    opened by xyn1201 2
  • Add PyTorch version upper bound

    Add PyTorch version upper bound

    timm==0.3.2 requires torch version less than 1.9 because timm depends on torch's internal collection_abcs in torch._six:

    https://github.com/rwightman/pytorch-image-models/blob/2ed8f247154870be7acc1908fde0a7f457f67456/timm/models/layers/helpers.py#L6

    which was removed in torch 1.9:

    https://github.com/pytorch/pytorch/blob/v1.9.0/torch/_six.py

    opened by dskkato 0
Owner
Rayicer
Rayicer
Pytorch Code for "Medical Transformer: Gated Axial-Attention for Medical Image Segmentation"

Medical-Transformer Pytorch Code for the paper "Medical Transformer: Gated Axial-Attention for Medical Image Segmentation" About this repo: This repo

Jeya Maria Jose 615 Dec 25, 2022
This repository holds code and data for our PETS'22 article 'From "Onion Not Found" to Guard Discovery'.

From "Onion Not Found" to Guard Discovery (PETS'22) This repository holds the code and data for our PETS'22 paper titled 'From "Onion Not Found" to Gu

Lennart Oldenburg 3 May 4, 2022
Medical Image Segmentation using Squeeze-and-Expansion Transformers

Medical Image Segmentation using Squeeze-and-Expansion Transformers Introduction This repository contains the code of the IJCAI'2021 paper 'Medical Im

askerlee 172 Dec 20, 2022
This repository holds the code for the paper "Deep Conditional Gaussian Mixture Model forConstrained Clustering".

Deep Conditional Gaussian Mixture Model for Constrained Clustering. This repository holds the code for the paper Deep Conditional Gaussian Mixture Mod

null 17 Oct 30, 2022
Official PyTorch Implementation of Unsupervised Learning of Scene Flow Estimation Fusing with Local Rigidity

UnRigidFlow This is the official PyTorch implementation of UnRigidFlow (IJCAI2019). Here are two sample results (~10MB gif for each) of our unsupervis

Liang Liu 28 Nov 16, 2022
The implemention of Video Depth Estimation by Fusing Flow-to-Depth Proposals

Flow-to-depth (FDNet) video-depth-estimation This is the implementation of paper Video Depth Estimation by Fusing Flow-to-Depth Proposals Jiaxin Xie,

null 32 Jun 14, 2022
(CVPR 2022 - oral) Multi-View Depth Estimation by Fusing Single-View Depth Probability with Multi-View Geometry

Multi-View Depth Estimation by Fusing Single-View Depth Probability with Multi-View Geometry Official implementation of the paper Multi-View Depth Est

Bae, Gwangbin 138 Dec 28, 2022
Many Class Activation Map methods implemented in Pytorch for CNNs and Vision Transformers. Including Grad-CAM, Grad-CAM++, Score-CAM, Ablation-CAM and XGrad-CAM

Class Activation Map methods implemented in Pytorch pip install grad-cam ⭐ Tested on many Common CNN Networks and Vision Transformers. ⭐ Includes smoo

Jacob Gildenblat 6.6k Jan 6, 2023
Study of human inductive biases in CNNs and Transformers.

Are Convolutional Neural Networks or Transformers more like human vision? This repository contains the code and fine-tuned models of popular Convoluti

Shikhar Tuli 39 Dec 8, 2022
Multi-atlas segmentation (MAS) is a promising framework for medical image segmentation

Multi-atlas segmentation (MAS) is a promising framework for medical image segmentation. Generally, MAS methods register multiple atlases, i.e., medical images with corresponding labels, to a target image;

NanYoMy 13 Oct 9, 2022