TorchXRayVision: A library of chest X-ray datasets and models.

Overview

torchxrayvision

A library for chest X-ray datasets and models. Including pre-trained models.

( 🎬 promo video about the project)

Motivation: While there are many publications focusing on the prediction of radiological and clinical findings from chest X-ray images much of this work is inaccessible to other researchers.

  • In the case of researchers addressing clinical questions it is a waste of time for them to train models from scratch. To address this, TorchXRayVision provides pre-trained models which are trained on large cohorts of data and enables 1) rapid analysis of large datasets 2) feature reuse for few-shot learning.
  • In the case of researchers developing algorithms it is important to robustly evaluate models using multiple external datasets. Metadata associated with each dataset can vary greatly which makes it difficult to apply methods to multiple datasets. TorchXRayVision provides access to many datasets in a uniform way so that they can be swapped out with a single line of code. These datasets can also be merged and filtered to construct specific distributional shifts for studying generalization.

This code is still under development

Twitter: @torchxrayvision

Getting started

pip install torchxrayvision

import torchxrayvision as xrv

These are default pathologies:

xrv.datasets.default_pathologies 

['Atelectasis',
 'Consolidation',
 'Infiltration',
 'Pneumothorax',
 'Edema',
 'Emphysema',
 'Fibrosis',
 'Effusion',
 'Pneumonia',
 'Pleural_Thickening',
 'Cardiomegaly',
 'Nodule',
 'Mass',
 'Hernia',
 'Lung Lesion',
 'Fracture',
 'Lung Opacity',
 'Enlarged Cardiomediastinum']

Models (demo notebook)

Specify weights for pretrained models (currently all DenseNet121) Note: Each pretrained model has 18 outputs. The all model has every output trained. However, for the other weights some targets are not trained and will predict randomly becuase they do not exist in the training dataset. The only valid outputs are listed in the field {dataset}.pathologies on the dataset that corresponds to the weights.

## 224x224 models
model = xrv.models.DenseNet(weights="densenet121-res224-all")
model = xrv.models.DenseNet(weights="densenet121-res224-rsna") # RSNA Pneumonia Challenge
model = xrv.models.DenseNet(weights="densenet121-res224-nih") # NIH chest X-ray8
model = xrv.models.DenseNet(weights="densenet121-res224-pc") # PadChest (University of Alicante)
model = xrv.models.DenseNet(weights="densenet121-res224-chex") # CheXpert (Stanford)
model = xrv.models.DenseNet(weights="densenet121-res224-mimic_nb") # MIMIC-CXR (MIT)
model = xrv.models.DenseNet(weights="densenet121-res224-mimic_ch") # MIMIC-CXR (MIT)

# 512x512 models
model = xrv.models.ResNet(weights="resnet50-res512-all")

# DenseNet121 from JF Healthcare for the CheXpert competition
model = xrv.baseline_models.jfhealthcare.DenseNet() 

# Official Stanford CheXpert model
model = xrv.baseline_models.chexpert.DenseNet()

Benchmarks of the modes are here: BENCHMARKS.md

The performance of some of the models can be seen in this paper arxiv.org/abs/2002.02497.

Autoencoders

You can also load a pre-trained autoencoder that is trained on the PadChest, NIH, CheXpert, and MIMIC datasets.

ae = xrv.autoencoders.ResNetAE(weights="101-elastic")
z = ae.encode(image)
image2 = ae.decode(z)

Datasets (demo notebook)

Only stats for PA/AP views are shown. Datasets may include more.

transform = torchvision.transforms.Compose([xrv.datasets.XRayCenterCrop(),
                                            xrv.datasets.XRayResizer(224)])

d_kaggle = xrv.datasets.RSNA_Pneumonia_Dataset(imgpath="path to stage_2_train_images_jpg",
                                       transform=transform)
                
d_chex = xrv.datasets.CheX_Dataset(imgpath="path to CheXpert-v1.0-small",
                                   csvpath="path to CheXpert-v1.0-small/train.csv",
                                   transform=transform)

d_nih = xrv.datasets.NIH_Dataset(imgpath="path to NIH images")

d_nih2 = xrv.datasets.NIH_Google_Dataset(imgpath="path to NIH images")

d_pc = xrv.datasets.PC_Dataset(imgpath="path to image folder")


d_covid19 = xrv.datasets.COVID19_Dataset() # specify imgpath and csvpath for the dataset

d_siim = xrv.datasets.SIIM_Pneumothorax_Dataset(imgpath="dicom-images-train/",
                                                csvpath="train-rle.csv")

d_vin = xrv.datasets.VinBrain_Dataset(imgpath=".../train",
                                      csvpath=".../train.csv")

National Library of Medicine Tuberculosis Datasets paper

d_nlmtb = xrv.datasets.NLMTB_Dataset(imgpath="path to MontgomerySet or ChinaSet_AllFiles")

Using MontgomerySet data:
NLMTB_Dataset num_samples=138 views=['PA']
{'Tuberculosis': {0: 80, 1: 58}}
or using ChinaSet_AllFiles data:
NLMTB_Dataset num_samples=662 views=['PA', 'AP']
{'Tuberculosis': {0: 326, 1: 336}}

Dataset fields

Each dataset contains a number of fields. These fields are maintained when xrv.datasets.Subset_Dataset and xrv.datasets.Merge_Dataset are used.

Each dataset has a .pathologies field which is a list of the pathologies contained in this dataset that will be contained in the .labels field ].

Each dataset has a .labels field which contains a 1,0, or NaN for each label defined in .pathologies.

Each dataset has a .csv field which corresponds to pandas DataFrame of the metadata csv file that comes with the data. Each row aligns with the elements of the dataset so indexing using .iloc will work.

If possible, each dataset's .csv will have some common fields of the csv. These will be aligned when The list is as follows:

csv.patientid A unique id that will uniqely identify samples in this dataset

csv.offset_day_int An integer time offset for the image in the unit of days. This is expected to be for relative times and has no absolute meaning although for some datasets it is the epoch time.

Dataset tools

relabel_dataset will align labels to have the same order as the pathologies argument.

xrv.datasets.relabel_dataset(xrv.datasets.default_pathologies , d_nih) # has side effects

specify a subset of views (demo notebook)

d_kaggle = xrv.datasets.RSNA_Pneumonia_Dataset(imgpath="...",
                                               views=["PA","AP","AP Supine"])

specify only 1 image per patient

d_kaggle = xrv.datasets.RSNA_Pneumonia_Dataset(imgpath="...",
                                               unique_patients=True)

obtain summary statistics per dataset

d_chex = xrv.datasets.CheX_Dataset(imgpath="CheXpert-v1.0-small",
                                   csvpath="CheXpert-v1.0-small/train.csv",
                                 views=["PA","AP"], unique_patients=False)

CheX_Dataset num_samples=191010 views=['PA', 'AP']
{'Atelectasis': {0.0: 17621, 1.0: 29718},
 'Cardiomegaly': {0.0: 22645, 1.0: 23384},
 'Consolidation': {0.0: 30463, 1.0: 12982},
 'Edema': {0.0: 29449, 1.0: 49674},
 'Effusion': {0.0: 34376, 1.0: 76894},
 'Enlarged Cardiomediastinum': {0.0: 26527, 1.0: 9186},
 'Fracture': {0.0: 18111, 1.0: 7434},
 'Lung Lesion': {0.0: 17523, 1.0: 7040},
 'Lung Opacity': {0.0: 20165, 1.0: 94207},
 'Pleural Other': {0.0: 17166, 1.0: 2503},
 'Pneumonia': {0.0: 18105, 1.0: 4674},
 'Pneumothorax': {0.0: 54165, 1.0: 17693},
 'Support Devices': {0.0: 21757, 1.0: 99747}}

Pathology masks (demo notebook)

Masks are available in the following datasets:

xrv.datasets.RSNA_Pneumonia_Dataset() # for Lung Opacity
xrv.datasets.SIIM_Pneumothorax_Dataset() # for Pneumothorax
xrv.datasets.NIH_Dataset() # for Cardiomegaly, Mass, Effusion, ...

Example usage:

d_rsna = xrv.datasets.RSNA_Pneumonia_Dataset(imgpath="stage_2_train_images_jpg", 
                                            views=["PA","AP"],
                                            pathology_masks=True)
                                            
# The has_masks column will let you know if any masks exist for that sample
d_rsna.csv.has_masks.value_counts()
False    20672
True      6012       

# Each sample will have a pathology_masks dictionary where the index 
# of each pathology will correspond to a mask of that pathology (if it exists).
# There may be more than one mask per sample. But only one per pathology.
sample["pathology_masks"][d_rsna.pathologies.index("Lung Opacity")]

it also works with data_augmentation if you pass in data_aug=data_transforms to the dataloader. The random seed is matched to align calls for the image and the mask.

Distribution shift tools (demo notebook)

The class xrv.datasets.CovariateDataset takes two datasets and two arrays representing the labels. The samples will be returned with the desired ratio of images from each site. The goal here is to simulate a covariate shift to make a model focus on an incorrect feature. Then the shift can be reversed in the validation data causing a catastrophic failure in generalization performance.

ratio=0.0 means images from d1 will have a positive label ratio=0.5 means images from d1 will have half of the positive labels ratio=1.0 means images from d1 will have no positive label

With any ratio the number of samples returned will be the same.

d = xrv.datasets.CovariateDataset(d1 = # dataset1 with a specific condition
                                  d1_target = #target label to predict,
                                  d2 = # dataset2 with a specific condition
                                  d2_target = #target label to predict,
                                  mode="train", # train, valid, and test
                                  ratio=0.9)

Citation

Joseph Paul Cohen, Joseph Viviano, Paul Morrison, Rupert Brooks, Mohammad Hashir, Hadrien Bertrand 
TorchXRayVision: A library of chest X-ray datasets and models. 
https://github.com/mlmed/torchxrayvision, 2020

@article{Cohen2020xrv,
author = {Cohen, Joseph Paul and Viviano, Joseph and Morrison, Paul and Brooks, Rupert and Hashir, Mohammad and Bertrand, Hadrien},
journal = {https://github.com/mlmed/torchxrayvision},
title = {{TorchXRayVision: A library of chest X-ray datasets and models}},
url = {https://github.com/mlmed/torchxrayvision},
year = {2020}
}


and this paper https://arxiv.org/abs/2002.02497

Joseph Paul Cohen and Mohammad Hashir and Rupert Brooks and Hadrien Bertrand
On the limits of cross-domain generalization in automated X-ray prediction. 
Medical Imaging with Deep Learning 2020 (Online: https://arxiv.org/abs/2002.02497)

@inproceedings{cohen2020limits,
  title={On the limits of cross-domain generalization in automated X-ray prediction},
  author={Cohen, Joseph Paul and Hashir, Mohammad and Brooks, Rupert and Bertrand, Hadrien},
  booktitle={Medical Imaging with Deep Learning},
  year={2020},
  url={https://arxiv.org/abs/2002.02497}
}

Supporters/Sponsors

CIFAR (Canadian Institute for Advanced Research)

Mila, Quebec AI Institute, University of Montreal

Stanford University's Center for Artificial Intelligence in Medicine & Imaging

Carestream Health

Comments
  • taking gradients through the 'all' densenet

    taking gradients through the 'all' densenet

    Hi,

    I am trying to plug your 'all' densenet (in eval mode + fixed weights) to my generative pipeline. However I'm getting errors taking gradients. I saw that you updated the package with the 'op' util we discussed here a couple of weeks ago; so I updated the package myself as well. Now I'm getting a different error, which is:

    Warning: Error detected in AddBackward0. Traceback of forward call that caused the error:
      ...(some prints)...
      File "/home/ubuntu/DR-VAE/drvae/model/vae.py", line 233, in lossfun
        return vae_loss + disc_loss
     (print_stack at /pytorch/torch/csrc/autograd/python_anomaly_mode.cpp:60)
    Traceback (most recent call last):
    File "/home/ubuntu/DR-VAE/drvae/model/train.py", line 297, in train_epoch_xraydata
        loss.backward()
      File "/home/ubuntu/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/torch/tensor.py", line 198, in backward
        torch.autograd.backward(self, gradient, retain_graph, create_graph)
      File "/home/ubuntu/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/torch/autograd/__init__.py", line 100, in backward
        allow_unreachable=True)  # allow_unreachable flag
    **RuntimeError: Function AddBackward0 returned an invalid gradient at index 1 - expected type TensorOptions(dtype=float, device=cpu, layout=Strided, requires_grad=false) but got TensorOptions(dtype=float, device=cuda:0, layout=Strided, requires_grad=false) (validate_outputs at /pytorch/torch/csrc/autograd/engine.cpp:484)**
    frame #0: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x46 (0x7fbd188b5536 in /home/ubuntu/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/torch/lib/libc10.so)
    frame #1: <unknown function> + 0x2d84224 (0x7fbd57f1e224 in /home/ubuntu/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so)
    frame #2: torch::autograd::Engine::evaluate_function(std::shared_ptr<torch::autograd::GraphTask>&, torch::autograd::Node*, torch::autograd::InputBuffer&) + 0x548 (0x7fbd57f1fd58 in /home/ubuntu/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so)
    frame #3: torch::autograd::Engine::thread_main(std::shared_ptr<torch::autograd::GraphTask> const&, bool) + 0x3d2 (0x7fbd57f21ce2 in /home/ubuntu/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so)
    frame #4: torch::autograd::Engine::thread_init(int) + 0x39 (0x7fbd57f1a359 in /home/ubuntu/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/torch/lib/libtorch_cpu.so)
    frame #5: torch::autograd::python::PythonEngine::thread_init(int) + 0x38 (0x7fbd646594d8 in /home/ubuntu/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
    frame #6: <unknown function> + 0xee0f (0x7fbd65246e0f in /home/ubuntu/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/torch/_C.cpython-36m-x86_64-linux-gnu.so)
    frame #7: <unknown function> + 0x76ba (0x7fbd683996ba in /lib/x86_64-linux-gnu/libpthread.so.0)
    frame #8: clone + 0x6d (0x7fbd680cf41d in /lib/x86_64-linux-gnu/libc.so.6)
    

    I'm not sure why it expects cpu there.

    opened by danbider 14
  • Bad performance when making predictions with the CheXpert model

    Bad performance when making predictions with the CheXpert model

    Hi, thanks for making your work available! I'm trying to do a Fairness analysis and as a first step I need to obtain the model's predictions. I'm focusing on the CheXpert dataset and the CheXpert model. I reproduced the same split (seed=0) as you do, and then made predictions for the Test set using your CheXpert model. Computing AUC and other metrics on the Test set results to quite mediocre performance, far worse from what is reported on the paper. So I was wondering if I'm missing something big.

    Let me note here that I am using the 'small' version of CheXpert (same as you do) and that I am transforming the Test set data when I create the CheX_Dataset object in the following way: image

    Your feedback on what I might be doing wrong would be extremely helpful!

    opened by lkourti 10
  • The output of the kaggle densenet model

    The output of the kaggle densenet model

    Hi, I started playing with your cool package and wanted to make sure I follow. How do I work with the output of the final linear layer of the kaggle model?

    if model = xrv.models.DenseNet(weights="kaggle") d_kaggle = xrv.datasets.Kaggle_Dataset(..)

    and we push one image forward, sample = d_kaggle[92] out = model(torch.tensor(sample['PA']).unsqueeze(0))

    and given that the relevant labels in d_kaggle.pathologies appear in indices 8 and 16 of xrv.datasets.default_pathologies

    with out_softmax = torch.nn.functional.softmax(out[0,[8,16]], dim=0) (or sigmoid for that matter) I always get out_softmax = [~x, ~x] for every example that I've pushed forward, regardless of the label.

    opened by danbider 10
  • not match between CheX_Dataset and model with weights=

    not match between CheX_Dataset and model with weights="densenet121-res224-chex"

    I found that the summary of CheX_Dataset has 13 classes of disease ,but in the head of model.py ,model with weights="densenet121-res224-chex" provide 11 classes of disease, I think this is not matched. And as same as "mimic_ch" and "mimic_nb". this means the model will provide 7 useless dimensions for each sample. Is there any kind of disease missing?

    opened by catfish132 9
  • data loading

    data loading

    Hi,

    I use your kaggle dataset object (including all data points) and define a data loader to train my model on a AWS EC2 instance with a GPU. I am experiencing a volatile GPU-utility that flickers between 0% and 90%, but mostly at 0%. I tried to make my dataloader as efficient

        train_loader = torch.utils.data.DataLoader(train_data, 
            batch_size=batch_size, num_workers=8, pin_memory=True, shuffle=True)
    

    But I'm also double checking for other places in my code that might slow things down.

    I'm curious what was your experience of training using these datasets? did you encounter anything similar?

    opened by danbider 9
  • xrv.models.DenseNet(weights=

    xrv.models.DenseNet(weights="all").cuda() problem in new update

    Hello Thanks for great repo

    It seems you recently updated your codes, This error happens when i try to load pretrained net:

    xrv.models.DenseNet(weights="all").cuda()

    /usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py in getattr(self, name) 770 return modules[name] 771 raise ModuleAttributeError("'{}' object has no attribute '{}'".format( --> 772 type(self).name, name)) 773 774 def setattr(self, name: str, value: Union[Tensor, 'Module']) -> None:

    ModuleAttributeError: 'BatchNorm2d' object has no attribute '_non_persistent_buffers_set'

    opened by dara1400 8
  • Same Output for each image

    Same Output for each image

    I've tried to use the pertained models on Images from MIMIC-CXR. For each model I get the same probabilities for each image, even if they are very different from each other.

    For example: image image

    Both images have been center cropped and resized to 224x224 resolution. I used the following code to get outputs from the model:

    model = xrv.models.DenseNet(weights="densenet121-res224-all")
    
    with torch.no_grad(): 
        out0 = model(inputs['image'][0].unsqueeze(0))
        out1 = model(inputs['image'][1].unsqueeze(0))
    

    Both out0 and out1 equal tensor([[0.5995, 0.5762, 0.5281, 0.5486, 0.5477, 0.5251, 0.5390, 0.6766, 0.5525, 0.5918, 0.6122, 0.5254, 0.5949, 0.3159, 0.5500, 0.5202, 0.6688, 0.6592]])

    The same problem occurs with other pertained models like the one for MIMIC-CXR as well, only with different probabilities, but still the same ones for each respective image.

    opened by mohkoh19 6
  • Console always prints dataset statistics

    Console always prints dataset statistics

    Hi everyone,

    After having load the PadChest dataset my console prints its summary statistics for all executed commands

    Looks like this:

    {'Air Trapping': {0.0: 59407, 1.0: 2285}, 'Aortic Atheromatosis': {0.0: 60419, 1.0: 1273}, 'Aortic Elongation': {0.0: 56611, 1.0: 5081}, 'Atelectasis': {0.0: 59273, 1.0: 2419}, 'Bronchiectasis': {0.0: 60821, 1.0: 871}, 'Cardiomegaly': {0.0: 56305, 1.0: 5387}, 'Consolidation': {0.0: 61217, 1.0: 475}, 'Costophrenic Angle Blunting': {0.0: 59587, 1.0: 2105}, 'Edema': {0.0: 61584, 1.0: 108}, 'Effusion': {0.0: 60067, 1.0: 1625}, 'Emphysema': {0.0: 61146, 1.0: 546}, 'Fibrosis': {0.0: 61351, 1.0: 341}, 'Flattened Diaphragm': {0.0: 61379, 1.0: 313}, 'Fracture': {0.0: 60030, 1.0: 1662}, 'Granuloma': {0.0: 60135, 1.0: 1557}, 'Hemidiaphragm Elevation': {0.0: 60806, 1.0: 886}, 'Hernia': {0.0: 60704, 1.0: 988}, 'Hilar Enlargement': {0.0: 58875, 1.0: 2817}, 'Infiltration': {0.0: 57383, 1.0: 4309}, 'Mass': {0.0: 61186, 1.0: 506}, 'Nodule': {0.0: 59502, 1.0: 2190}, 'Pleural_Thickening': {0.0: 59617, 1.0: 2075}, 'Pneumonia': {0.0: 59782, 1.0: 1910}, 'Pneumothorax': {0.0: 61595, 1.0: 97}, 'Scoliosis': {0.0: 57761, 1.0: 3931}, 'Support Devices': {0.0: 60575, 1.0: 1117}, 'Tube': {0.0: 61467, 1.0: 225}, 'Tuberculosis': {0.0: 61290, 1.0: 402}}

    How can I deactivate this?

    Thanks a lot in advance!

    opened by pat-rig 5
  • num_classes no longer changing the classifier

    num_classes no longer changing the classifier

    Today I noticed that all predictions by the "All" model were "16" despite the dataset only giving labels between 0 and 3. First I thought it was a mistake on my end but I knew that I didn't change anything today. I checked the code anyways and found out that setting num_classes to 4 still gives a model.classifier of Linear(in_features=1024, out_features=18, bias=True).

    Using normal Densenet121 from torchvision models works fine so it is not an issue with my datamodule or data. The very strange part is that this changed all of a sudden while it was searching through hyperparameters with optuna. First 3 or 4 trials were fine and then all of a sudden I see label "4" and even "5" on the subsequent runs.

    opened by ihamdi 5
  • Finetune pretrained models on different dataset

    Finetune pretrained models on different dataset

    Hi all and thank you for developing this library. In the readme it's said that the pretrained models can be used for feature reuse for few-shot learning. Does that mean that it's possible to take a pretrained model and finetune it for a couple of epochs on a different dataset? I spent some time to explore the repo, but I couldn't find anything related to that. I would truly grateful if you could help me on that. Thanks

    opened by matteopilotto 5
  • Example Results with Pretrained Autoencoder

    Example Results with Pretrained Autoencoder

    Hi,

    Are there any example results with your pretrained autoencoder? I tried it with CheXpert but its decoded images were mostly gray. Wondering if there is an example and I might be missing some preprocessing? I am using the normalize function provided in the XRV repo to rescale my images.

    Example on CheXpert:

    image

    Thanks!

    opened by Htermotto 4
  • Any dataset tool to transform original big .jpg into small one

    Any dataset tool to transform original big .jpg into small one

    I have download MIMIC-CXR dataset and I want to train a model by myself . But the original images are too big,the total volume is 500GB. Disk IO will be a bottleneck. So is there any script to transform the images into small ones?

    opened by catfish132 1
  • Example notebook doesn't work and has poor results when fixed

    Example notebook doesn't work and has poor results when fixed

    Hi,

    In using Torch XRV we started with the example notebook. However, it has multiple issues such that it does not run to begin with. We were able to fix it but the results of the pretrained weights seem poor on the NIH dataset. Additionally we think there is a bug in the code that will erroneously apply sigmoid twice if apply_sigmoid=True link.

    I've opened a PR with our changes that fix the notebook here but we would appreciate input on the model performance.

    EDIT: I cleared the notebook in the PR so there wouldn't be a lot of output, but essentially what we are seeing is very low precision on NIH res224. Here are the metrics we get generated from running the above notebook:

    image

    Thanks!

    opened by Htermotto 4
  • Sharing models through Hugging Face Hub

    Sharing models through Hugging Face Hub

    Hi TorchXRayVision team!

    This project is amazing! Several Hugging Face followers and members of the "ML for healthcare" community recommended that we contacted you 🤗. I see you host and share models/datasets with your own server. Would you be interested in sharing your models in the Hugging Face Hub?

    This integration would allow you to freely download/upload models, and make your work more accessible and visible to the rest of the ML community. We can help you set up a TorchXRayVision organization (examples, Facebook AI y Stanford NLP).

    Creating the repos and adding new models should be a relatively straightforward process. This is a step-by-step guide explaining the process in case you're interested. Please let us know if you would be interested and if you have any questions.

    Some of the benefits of sharing your models through the Hub would be:

    • Presence in the HF Hub might lower the entry of barrier to TorchXRayVision as well as increase its visibility.
      • Repos provide useful metadata about their tasks, languages, metrics, etc that make them discoverable
    • versioning, commit history, and diffs.
    • multiple features from TensorBoard visualizations, PapersWithCode integration, and more.

    Additionally, we have a library to programmatically access repositories (both downloading pretrained models and pushing, with a lot of nice things such as filtering, caching, etc). If we want to try out this integration, I would suggest you add one or two models manually and then use the huggingface_hub library to implement downloading those models programmatically from torchxrayvision. You might want to check our documentation to read more about it.

    Relevant references:

    Happy to hear your thoughts,

    Omar and the Hugging Face team (cc @osanseviero @abidlabs )

    opened by omarespejel 0
Owner
Machine Learning and Medicine Lab
Machine Learning and Medicine Lab
Cosine Annealing With Warmup

CosineAnnealingWithWarmup Formulation The learning rate is annealed using a cosine schedule over the course of learning of n_total total steps with an

zhuyun 4 Apr 18, 2022
Official implementation of the NRNS paper: No RL, No Simulation: Learning to Navigate without Navigating

No RL No Simulation (NRNS) Official implementation of the NRNS paper: No RL, No Simulation: Learning to Navigate without Navigating NRNS is a heriarch

Meera Hahn 20 Nov 29, 2022
Moer Grounded Image Captioning by Distilling Image-Text Matching Model

Moer Grounded Image Captioning by Distilling Image-Text Matching Model Requirements Python 3.7 Pytorch 1.2 Prepare data Please use git clone --recurse

YE Zhou 60 Dec 16, 2022
An Active Automata Learning Library Written in Python

AALpy An Active Automata Learning Library AALpy is a light-weight active automata learning library written in pure Python. You can start learning auto

TU Graz - SAL Dependable Embedded Systems Lab (DES Lab) 78 Dec 30, 2022
A curated list of awesome resources related to Semantic Search🔎 and Semantic Similarity tasks.

A curated list of awesome resources related to Semantic Search🔎 and Semantic Similarity tasks.

224 Jan 04, 2023
Heart Arrhythmia Classification

This program takes and input of an ECG in European Data Format (EDF) and outputs the classification for heartbeats into normal vs different types of arrhythmia . It uses a deep learning model for cla

4 Nov 02, 2022
List of papers, code and experiments using deep learning for time series forecasting

Deep Learning Time Series Forecasting List of state of the art papers focus on deep learning and resources, code and experiments using deep learning f

Alexander Robles 2k Jan 06, 2023
RipsNet: a general architecture for fast and robust estimation of the persistent homology of point clouds

RipsNet: a general architecture for fast and robust estimation of the persistent homology of point clouds This repository contains the code asscoiated

Felix Hensel 14 Dec 12, 2022
DrNAS: Dirichlet Neural Architecture Search

This paper proposes a novel differentiable architecture search method by formulating it into a distribution learning problem. We treat the continuously relaxed architecture mixing weight as random va

Xiangning Chen 37 Jan 03, 2023
Learned model to estimate number of distinct values (NDV) of a population using a small sample.

Learned NDV estimator Learned model to estimate number of distinct values (NDV) of a population using a small sample. The model approximates the maxim

2 Nov 21, 2022
PyElastica is the Python implementation of Elastica, an open-source software for the simulation of assemblies of slender, one-dimensional structures using Cosserat Rod theory.

PyElastica PyElastica is the python implementation of Elastica: an open-source project for simulating assemblies of slender, one-dimensional structure

Gazzola Lab 105 Jan 09, 2023
PyTorch implementation of image classification models for CIFAR-10/CIFAR-100/MNIST/FashionMNIST/Kuzushiji-MNIST/ImageNet

PyTorch Image Classification Following papers are implemented using PyTorch. ResNet (1512.03385) ResNet-preact (1603.05027) WRN (1605.07146) DenseNet

1.2k Jan 04, 2023
Spectral Temporal Graph Neural Network (StemGNN in short) for Multivariate Time-series Forecasting

Spectral Temporal Graph Neural Network for Multivariate Time-series Forecasting This repository is the official implementation of Spectral Temporal Gr

Microsoft 306 Dec 29, 2022
Apply Graph Self-Supervised Learning methods to graph-level task(TUDataset, MolculeNet Datset)

Graphlevel-SSL Overview Apply Graph Self-Supervised Learning methods to graph-level task(TUDataset, MolculeNet Dataset). It is unified framework to co

JunSeok 8 Oct 15, 2021
A mini-course offered to Undergrad chemistry students

The best way to use this material is by forking it by click the Fork button at the top, right corner. Then you will get your own copy to play with! Th

Raghu 19 Dec 19, 2022
Emotional conditioned music generation using transformer-based model.

This is the official repository of EMOPIA: A Multi-Modal Pop Piano Dataset For Emotion Recognition and Emotion-based Music Generation. The paper has b

hung anna 96 Nov 09, 2022
Gradient Step Denoiser for convergent Plug-and-Play

Source code for the paper "Gradient Step Denoiser for convergent Plug-and-Play"

Samuel Hurault 11 Sep 17, 2022
City-Scale Multi-Camera Vehicle Tracking Guided by Crossroad Zones Code

City-Scale Multi-Camera Vehicle Tracking Guided by Crossroad Zones Requirements Python 3.8 or later with all requirements.txt dependencies installed,

88 Dec 12, 2022
Numbering permanent and deciduous teeth via deep instance segmentation in panoramic X-rays

Numbering permanent and deciduous teeth via deep instance segmentation in panoramic X-rays In this repo, you will find the instructions on how to requ

Intelligent Vision Research Lab 4 Jul 21, 2022
NP DRAW paper released code

NP-DRAW: A Non-Parametric Structured Latent Variable Model for Image Generation This repo contains the official implementation for the NP-DRAW paper.

ZENG Xiaohui 22 Mar 13, 2022