Model or dataset
Tencent/MedicalNet avatar
Tencent/MedicalNet

MedicalNet ships 3D-ResNet weights pretrained on 23 datasets, with a PyTorch 0.4.1 era setup

Many studies have shown that the performance on deep learning is significantly affected by volume of training data. The MedicalNet project provides a series of 3D-ResNet pre-trained models and relative code.

2,280 stars467 forksPythonNOASSERTION

At a glance

What is it?
Tencent's PyTorch code for Med3D transfer learning: seven 3D-ResNet depths, four checkpoints trained on 23 datasets, and a training script demonstrated on MRBrainS18. The documented environment is old and the dependency files disagree with it.
Who is it for?
MedicalNet fits a researcher who wants 3D-ResNet initial weights for a volumetric segmentation or classification task and is willing to untangle an environment from 2019. It does not fit anyone expecting a maintained library with releases, a clean install and a clear license.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 26 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 7, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • Tencent/MedicalNet2,280 ★ · +8
Star history
Repository2026-10-162026-11-07
Tencent/MedicalNet2.3k2.3k

8 Stars in the last 22 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Weights come from one zip on Google Drive or Tencent Weiyun

MedicalNet is a PyTorch implementation of the paper Med3D: Transfer Learning for 3D Medical Image Analysis (arXiv 1904.00625). Its premise is that deep learning performance depends heavily on the volume of training data. The project aggregated datasets with diverse modalities, target organs and pathologies into a larger collection, then trained a series of 3D-ResNet models on it and published the transfer-learning code.

The weights are not in the repository. The demo tells you to download data and pre-trained models from Google Drive or Tencent Weiyun as a single archive, then run:

code
mv MedicalNet_pytorch_files.zip MedicalNet/.
cd MedicalNet
unzip MedicalNet_pytorch_files.zip

So the actual checkpoints sit behind two third-party share links. If either link dies, nothing in the repository can regenerate them, and the documentation offers no checksum to confirm what you downloaded. The top-level files you do get are train.py, test.py, test_ci.py, model.py, setting.py and the datasets, models and utils directories.

Seven depths, each with its own shortcut flag

The network is selected by command-line flags. The documented mapping is resnet_10.pth with --model resnet --model_depth 10 --resnet_shortcut B, resnet_18.pth and resnet_34.pth with shortcut A, and resnet_50.pth, resnet_101.pth, resnet_152.pth and resnet_200.pth with shortcut B. Getting the shortcut letter wrong for a given depth is a mismatch with the checkpoint, so copy the flag pairs exactly.

A July 2019 update added four more checkpoints trained on 23 datasets: resnet_10_23dataset.pth, resnet_18_23dataset.pth, resnet_34_23dataset.pth and resnet_50_23dataset.pth. Their flags match the plain versions: depth 10 and 50 use shortcut B, depth 18 and 34 use shortcut A. The 23-dataset family stops at depth 50. If you want the 101, 152 or 200 layer variants, the only listed weights are the earlier ones.

The cost table was measured on an NVIDIA Tesla P40. Parameters range from 14.36 million for 3D-ResNet10 to 126.74 million for 3D-ResNet200, with running times of 0.18 seconds and 0.45 seconds. Depth 34 has more parameters (63.31 million) than depth 50 (46.21 million).

The lung segmentation numbers compare pretraining against training from scratch

Two tables carry the evidence. In the 23-dataset update, the models were transferred to a multi-class segmentation task with left lung, right lung and background on the Visceral dataset. Dice scores from scratch against MedicalNet pretraining were 69.31% against 96.56% for 3D-ResNet10, 70.89% against 94.68% for depth 18, 75.25% against 94.14% for depth 34, and 52.94% against 89.25% for depth 50.

A second table covers lung segmentation (Dice) and pulmonary nodule classification (accuracy). Depth 10 goes from 71.30% to 87.16% Dice and from 79.80% to 86.87% accuracy. Depth 50 goes from 71.75% to 93.31% Dice and from 84.85% to 89.90% accuracy. Depth 101 goes from 72.10% to 92.79% Dice and from 81.82% to 90.91% accuracy.

These are the authors' figures for their own splits. The README does not say how many runs were averaged or give a variance, and the table is cut off after the depth 101 row in the text available here. Treat the gap as a reason to try the checkpoints on your data, not as a number you will reproduce.

The README pins PyTorch 0.4.1 while requirements.txt asks for torch 2.6 or newer

The Requirements section lists Python 3.7.0, PyTorch-0.4.1, CUDA Version 9.0 and CUDNN 7.0.5. Installation says to install Python 3.7.0 and run pip install -r requirements.txt.

Those two instructions contradict each other. requirements.txt contains torch>=2.6.0, plus pins numpy==1.15.4, nibabel==2.4.1, scipy==1.1.0 and argparse==1.1, with pip>=9.0.1 at the top and a commented-out logging==0.4.9.6 line. A modern torch release and a numpy from 2018 sit in the same file, and the README names a Python version that predates torch 2.6. The documentation does not say which combination was verified, so the first job is reconciling them on your machine.

The practical consequence is that following the Installation section as written may fail at the pip step, and following the Requirements section means hunting down PyTorch 0.4.1 with CUDA 9.0. Neither path is confirmed in the text. Budget time for a container or virtual environment, and test that a checkpoint loads before building anything around it.

Training and testing run through two scripts with a GPU id flag

After the clone and the unzip, training is a single command, with the comment text exactly as given:

code
python train.py --gpu_id 0 1    # multi-gpu training on gpu 0,1
or
python train.py --gpu_id 0    # single-gpu training on gpu 0

Testing needs a checkpoint path and an image list:

code
python test.py --gpu_id 0 --resume_path trails/models/resnet_50_epoch_110_batch_0.pth.tar --img_list data/val.txt

Both examples use 3D-ResNet-50. The path trails/models/ is the one written in the documentation, so a different spelling in your output directory means your resume path will not match. The demo dataset is MRBrainS18, with datasets/brains18.py as its preprocessing script and resnet.py under models/ building the 3D-ResNet. Data sits under data/MRBrainS18/ in an images folder named with patient ID and a labels folder holding masks named the same way.

A different dataset needs its own preprocessing script along the lines of brains18.py. The documentation includes no generic loader, so applying the weights to a new modality is code you write yourself.

No GitHub releases, a NOASSERTION license field and a contradictory MIT statement

The repository has no GitHub releases, so there are no tagged versions to pin. The last push was on 13 October 2026, and the repository is not archived. The code itself carries a Python 3.7 and PyTorch 0.4.1 description, so the recent activity does not tell you the environment has been refreshed.

Licensing needs a second look before use. The README states that MedicalNet is released under the MIT License and points to the LICENSE file, but the repository's license field reads NOASSERTION. That mismatch means automated license checkers will not recognise a standard license even though the README names one. If you are shipping this in a product, read the LICENSE file yourself and ask whoever handles your compliance.

The README also asks you to cite the paper if you use the code or pre-trained models, with a BibTeX entry for chen2019med3d by Sihong Chen, Kai Ma and Yefeng Zheng. Academic users should plan for that citation. The repository has CI configuration files (.drone.yml and .orange-ci.yml) and a test_ci.py that works against the toy_data directory.

What the documentation does not cover

Nothing in the text says how to use the pretrained weights in your own code beyond the train.py and test.py scripts. There is no documented Python API, no pip package, and no example for loading a checkpoint into a custom model. The model.py and setting.py files exist at the top level, but their contents and options are not described here.

Clinical use is not discussed at all. The results are research benchmarks on lung segmentation and nodule classification, and no accuracy claim is made for any other organ or modality. The 23 datasets are described only by count and by the categories of modality, organ and pathology, with no list of which ones. Without that list you cannot tell whether the pretraining data overlaps with the dataset you plan to fine-tune on.

The contents list in the README also references a TODO and an Acknowledgement section that are cut off in the available text, so any known limitations the authors list there are not covered in this article. Read those sections in the repository.

Editorial conclusion

MedicalNet fits a researcher who wants 3D-ResNet initial weights for a volumetric segmentation or classification task and is willing to untangle an environment from 2019. It does not fit anyone expecting a maintained library with releases, a clean install and a clear license. Before spending GPU time, resolve three things: which of the README's MIT statement and the repository's NOASSERTION license field applies to you, whether the weights from the Drive or Weiyun link load under your PyTorch, and what the toy_data check in test_ci.py actually exercises.

Frequently asked questions

What is MedicalNet (medical net) from Tencent?

MedicalNet is a PyTorch implementation of Med3D: Transfer Learning for 3D Medical Image Analysis. It provides a series of 3D-ResNet pre-trained models and the corresponding transfer-learning training code.

Which 3D-ResNet depths does MedicalNet provide?

Depths 10, 18, 34, 50, 101, 152 and 200 are listed, each with a documented --resnet_shortcut value. Four additional checkpoints trained on 23 datasets cover depths 10, 18, 34 and 50.

How do you run MedicalNet training on a GPU?

After downloading and unzipping MedicalNet_pytorch_files.zip, run python train.py --gpu_id 0 for a single GPU or python train.py --gpu_id 0 1 for two GPUs.

Official sources

  1. Issues
  2. README
  3. Tencent/MedicalNet on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/tencent-medicalnet.svg)](https://hysenlabs.com/projects/tencent-medicalnet)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/tencent-medicalnet.svg)](https://hysenlabs.com/projects/tencent-medicalnet)

Was this useful?