All Projects → wilhelmberghammer → pneumonia_detection

wilhelmberghammer / pneumonia_detection

Licence: MIT license
Pneumonia Detection using machine learning - with PyTorch

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pneumonia detection

app
Aplicación web para ANDES
Stars: ✭ 12 (+0%)
Mutual labels:  healthcare
chr247.com
An open source multi tenant cloud platform for small scale clinics
Stars: ✭ 56 (+366.67%)
Mutual labels:  healthcare
nurse-scheduling
A demo of a nurse scheduling model
Stars: ✭ 24 (+100%)
Mutual labels:  healthcare
openhospital-gui
Open Hospital GUI (Java Swing) component
Stars: ✭ 27 (+125%)
Mutual labels:  healthcare
HealthDeterminants
Social Determinants of Health Visualization
Stars: ✭ 58 (+383.33%)
Mutual labels:  healthcare
heltin
Robust client registry for individuals receiving mental healthcare services.
Stars: ✭ 18 (+50%)
Mutual labels:  healthcare
blockchain-hackathon
An electronic health record (EHR) system built on Hyperledger Composer blockchain
Stars: ✭ 67 (+458.33%)
Mutual labels:  healthcare
1 011 a infektionsfall uebermittellung
This repository is deprecated and has not been maintained for months!
Stars: ✭ 23 (+91.67%)
Mutual labels:  healthcare
icd10-cm
ICD-10 CM medical classification list by the World Health Organization
Stars: ✭ 55 (+358.33%)
Mutual labels:  healthcare
loinc2hpo
Java library to map LOINC-encoded test results to Human Phenotype Ontology
Stars: ✭ 19 (+58.33%)
Mutual labels:  healthcare
Udacity
This repo includes all the projects I have finished in the Udacity Nanodegree programs
Stars: ✭ 57 (+375%)
Mutual labels:  healthcare
HAR
Code for WWW2019 paper "A Hierarchical Attention Retrieval Model for Healthcare Question Answering"
Stars: ✭ 22 (+83.33%)
Mutual labels:  healthcare
rHealthDataGov
R interface to the HealthData.gov Data API
Stars: ✭ 38 (+216.67%)
Mutual labels:  healthcare
healthcare-server
A rubyOnRails based web application with a small concept behind healthcare
Stars: ✭ 16 (+33.33%)
Mutual labels:  healthcare
nativescript-healthcare-app
Healthcare example application built with NativeScript Angular. NativeScript template to quickly prototype your own business idea.
Stars: ✭ 24 (+100%)
Mutual labels:  healthcare
HealthLedger
Application for tracking Organs donations in hospitals and minimizing the scope of Organ trafficking using Blockchain (Hyperledger) technology.
Stars: ✭ 29 (+141.67%)
Mutual labels:  healthcare
openmrs-module-radiology
🏥 OpenMRS Radiology Module
Stars: ✭ 37 (+208.33%)
Mutual labels:  healthcare
fuse-med-ml
A python framework accelerating ML based discovery in the medical field by encouraging code reuse. Batteries included :)
Stars: ✭ 66 (+450%)
Mutual labels:  healthcare
ParseCareKit
Securely synchronize any CareKit 2.1+ based app to a Parse Server Cloud. Compatible with parse-hipaa.
Stars: ✭ 28 (+133.33%)
Mutual labels:  healthcare
fhir-works-on-aws-persistence-ddb
A DynamoDB implementation of the FHIR Works on AWS framework, enabling users to complete CRUD operations on FHIR resources
Stars: ✭ 24 (+100%)
Mutual labels:  healthcare

Pneumonia Detection

Pneumonia Detection using machine learning.

Training was done in colab:

Training In Colab


DEMO:

gif

Result (Confusion Matrix):

confusion matrix

Data

I uploaded my dataset to kaggle I used a modified version of this dataset from kaggle. Instead of NORMAL and PNEUMONIA I split the PNEUMONIA dataset to BACTERIAL PNUEMONIA and VIRAL PNEUMONIA. This way the data is more evenly distributed and I can distinguish between viral and bacterial pneumonia. I also combined the validation dataset with the test dataset because the validation dataset only had 8 images per class.

This is the resulting distribution:

data distribution

Processing and Augmentation

I resized the images to 150x150 and because some images already were grayscale I also transformed all the images to grayscale.

Additionaly I applied the following transformations/augmentations on the training data:

transforms.Resize((150, 150)),
transforms.Grayscale(),
transforms.ToTensor(),
transforms.RandomHorizontalFlip(),
transforms.RandomVerticalFlip(),
transforms.RandomRotation(45)

and those transformations on the test data:

transforms.Resize((150, 150)),
transforms.Grayscale(),
transforms.ToTensor(),

This is the resulting data:

sample images

I also used one-hot encoding for the labels!



Model

----------------------------------------------------------------
        Layer (type)               Output Shape         Param #
================================================================
            Conv2d-1         [-1, 16, 148, 148]             160
              ReLU-2         [-1, 16, 148, 148]               0
       BatchNorm2d-3         [-1, 16, 148, 148]              32
            Conv2d-4         [-1, 16, 146, 146]           2,320
              ReLU-5         [-1, 16, 146, 146]               0
       BatchNorm2d-6         [-1, 16, 146, 146]              32
         MaxPool2d-7           [-1, 16, 73, 73]               0
            Conv2d-8           [-1, 32, 71, 71]           4,640
              ReLU-9           [-1, 32, 71, 71]               0
      BatchNorm2d-10           [-1, 32, 71, 71]              64
           Conv2d-11           [-1, 32, 69, 69]           9,248
             ReLU-12           [-1, 32, 69, 69]               0
      BatchNorm2d-13           [-1, 32, 69, 69]              64
        MaxPool2d-14           [-1, 32, 34, 34]               0
           Conv2d-15           [-1, 64, 32, 32]          18,496
             ReLU-16           [-1, 64, 32, 32]               0
      BatchNorm2d-17           [-1, 64, 32, 32]             128
           Conv2d-18           [-1, 64, 30, 30]          36,928
             ReLU-19           [-1, 64, 30, 30]               0
      BatchNorm2d-20           [-1, 64, 30, 30]             128
        MaxPool2d-21           [-1, 64, 15, 15]               0
           Conv2d-22          [-1, 128, 13, 13]          73,856
             ReLU-23          [-1, 128, 13, 13]               0
      BatchNorm2d-24          [-1, 128, 13, 13]             256
           Conv2d-25          [-1, 128, 11, 11]         147,584
             ReLU-26          [-1, 128, 11, 11]               0
      BatchNorm2d-27          [-1, 128, 11, 11]             256
        MaxPool2d-28            [-1, 128, 5, 5]               0
          Flatten-29                 [-1, 3200]               0
           Linear-30                 [-1, 4096]      13,111,296
             ReLU-31                 [-1, 4096]               0
          Dropout-32                 [-1, 4096]               0
           Linear-33                 [-1, 4096]      16,781,312
             ReLU-34                 [-1, 4096]               0
          Dropout-35                 [-1, 4096]               0
           Linear-36                    [-1, 3]          12,291
          Softmax-37                    [-1, 3]               0
================================================================
Total params: 30,199,091
Trainable params: 30,199,091
Non-trainable params: 0
----------------------------------------------------------------
Input size (MB): 0.09
Forward/backward pass size (MB): 27.95
Params size (MB): 115.20
Estimated Total Size (MB): 143.24
----------------------------------------------------------------

Visualization using Streamlit

The webapp is not hosted because the model is too large. This is just to visualize.

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