All Projects → M3DV → ACSConv

M3DV / ACSConv

Licence: Apache-2.0 license
[IEEE JBHI] Reinventing 2D Convolutions for 3D Images - 1 line of code to convert pretrained 2D models to 3D!

Programming Languages

python
139335 projects - #7 most used programming language
Jupyter Notebook
11667 projects

Projects that are alternatives of or similar to ACSConv

SegCaps
A Clone version from Original SegCaps source code with enhancements on MS COCO dataset.
Stars: ✭ 62 (-42.59%)
Mutual labels:  3d-images
CCD
Code for 'Constrained Contrastive Distribution Learning for Unsupervised Anomaly Detection and Localisation in Medical Images' [MICCAI 2021]
Stars: ✭ 30 (-72.22%)
Mutual labels:  medical-image-analysis
MorphoLibJ
Collection of mathematical morphology methods and plugins for ImageJ
Stars: ✭ 84 (-22.22%)
Mutual labels:  3d-images
GaNDLF
A generalizable application framework for segmentation, regression, and classification using PyTorch
Stars: ✭ 77 (-28.7%)
Mutual labels:  medical-image-analysis
pykale
Knowledge-Aware machine LEarning (KALE): accessible machine learning from multiple sources for interdisciplinary research, part of the 🔥PyTorch ecosystem
Stars: ✭ 381 (+252.78%)
Mutual labels:  medical-image-analysis
Radiomics-research-by-using-Python
Radiomics (here mainly means hand-crafted based radiomics) contains data acquire, ROI segmentation, feature extraction, feature selection, machine learning modeling, and stastical analysis.
Stars: ✭ 27 (-75%)
Mutual labels:  medical-image-analysis
pymia
pymia: A Python package for data handling and evaluation in deep learning-based medical image analysis
Stars: ✭ 46 (-57.41%)
Mutual labels:  medical-image-analysis
DigiPathAI
Digital Pathology AI
Stars: ✭ 43 (-60.19%)
Mutual labels:  medical-image-analysis
DAF3D
Deep Attentive Features for Prostate Segmentation in 3D Transrectal Ultrasound
Stars: ✭ 60 (-44.44%)
Mutual labels:  medical-image-analysis
DeepAtlas
Joint Semi-supervised Learning of Image Registration and Segmentation
Stars: ✭ 38 (-64.81%)
Mutual labels:  medical-image-analysis
covid19.MIScnn
Robust Chest CT Image Segmentation of COVID-19 Lung Infection based on limited data
Stars: ✭ 77 (-28.7%)
Mutual labels:  medical-image-analysis
DOSMA
An AI-powered open-source medical image analysis toolbox
Stars: ✭ 45 (-58.33%)
Mutual labels:  medical-image-analysis
matImage
Image Processing library for Matlab
Stars: ✭ 75 (-30.56%)
Mutual labels:  3d-images
chunkflow
Compose chunk operators to create a pipeline for local or distributed petabyte-scale computation
Stars: ✭ 36 (-66.67%)
Mutual labels:  3d-images

ACSConv

Reinventing 2D Convolutions for 3D Images (arXiv)

IEEE Journal of Biomedical and Health Informatics (IEEE JBHI), 2021 (DOI)

News:

  • 2022.01.26 - ACS ConvNeXt supported.
  • 2021.12.17 - torch 1.10 supported & pip installation supported.
  • 2021.4.19 - torch 1.8 supported.

Key contributions

  • ACS convolution aims at a plug-and-play replacement of standard 3D convolution, for 3D medical images.
  • ACS convolution enables 2D-to-3D transfer learning, which consistently provides significant performance boost in our experiments.
  • Even without pretraining, ACS convolution is comparable to or even better than 3D convolution, with smaller model size and less computation.

Package Installation

If you want to use this class, you have two options:

A) Install ACSConv as a standard Python package from PyPI:

pip install ACSConv

Alternatively, via conda:

conda install acsconv -c conda-forge

B) Simply copy and paste it in your project;

You could run the test.py to validate the installation. (If you want to test the validity of pip installation, please move this test.py file outside of this git project directory, otherwise it is testing the code inside the project instead of pip installation.)

Requirements

Recommended PyTorch versions

torch>=1.0.0 and torch<=1.10.0

Compatibility of other PyTorch versions are not guaranteed. They should be compatible if the relevant APIs are consistent. Feel free to try.

Other requirements

All libraries needed to run the included experiments (base requirements included).

fire
jupyterlab
matplotlib
pandas
tqdm
sklearn
tensorboardx

Code structure

  • acsconv the core implementation of ACS convolution, including the operators, models, and 2D-to-3D/ACS model converters.
    • operators: include ACSConv, SoftACSConv and Conv2_5d.
    • converters: include converters which convert 2D models to 3d/ACS/Conv2_5d counterparts.
    • models: Native ACS models.
  • experiments the scripts to run experiments.
    • mylib: the lib for running the experiments.
    • poc: the scripts to run proof-of-concept experiments.
    • lidc: the scripts to run LIDC-IDRI experiments.

Convert a 2D model into 3D with a single line of code

import torch
from torchvision.models import resnet18
from acsconv.converters import ACSConverter
# model_2d is a standard pytorch 2D model
model_2d = resnet18(pretrained=True)
B, C_in, H, W = (1, 3, 64, 64)
input_2d = torch.rand(B, C_in, H, W)
output_2d = model_2d(input_2d)

model_3d = ACSConverter(model_2d)
# once converted, model_3d is using ACSConv and capable of processing 3D volumes.
B, C_in, D, H, W = (1, 3, 64, 64, 64)
input_3d = torch.rand(B, C_in, D, H, W)
output_3d = model_3d(input_3d)

Usage of ACS operators

import torch
from acsconv.operators import ACSConv, SoftACSConv
B, C_in, D, H, W = (1, 3, 64, 64, 64)
x = torch.rand(B, C_in, D, H, W)
# ACSConv to process 3D volumnes
conv = ACSConv(in_channels=3, out_channels=10, kernel_size=3, padding=1)
out = conv(x)
# SoftACSConv to process 3D volumnes
conv = SoftACSConv(in_channels=3, out_channels=10, kernel_size=3, padding=1)
out = conv(x)

Usage of native ACS models

import torch
from acsconv.models.acsunet import ACSUNet
unet_3d = ACSUNet(num_classes=3)
B, C_in, D, H, W = (1, 1, 64, 64, 64)
input_3d = torch.rand(B, C_in, D, H, W)
output_3d = unet_3d(input_3d)

How to run the experiments

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].