Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

Commit 2d29a8d

Browse files
author
Tomer Gafner
committed
v.0.0.1
1 parent 95772b4 commit 2d29a8d

13 files changed

+704
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
butterfly_mini_dataset/
2+
butterfly_mini_dataset*
3+
14
# Byte-compiled / optimized / DLL files
25
__pycache__/
36
*.py[cod]

README.md

Lines changed: 128 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,128 @@
1-
# MITGrandHack2018
1+
# Welcome to the MIT GrandHack 2018
2+
3+
### About Butterfly Network
4+
5+
Butterfly Network has developed an innovative ultrasound platform that is affordable and accessible to everyone. By replacing the piezoelectric crystals traditionally used to generate ultrasound with semiconductor technology, Butterfly has exponentially lowered the the cost of life-saving technology. Our unique hardware platform has the additional advantage of being the first and only ultrasound transducer that can image the entire body, making exams faster and more efficient.
6+
7+
To continue developing this vision, we're seeking exceptional talent that is passionate about medical, making an impact and driving innovation. Thank you for being a part of this event!
8+
9+
### The Butterfly Network ultrasound dataset
10+
11+
The ultrasound dataset can be download directly using the following links:
12+
[Set 1](https://github.com/ButterflyNetwork/MITGrandHack2018/releases/download/v.0.0.1/butterfly_dataset_test.tar.gz)
13+
[Set 1](https://github.com/ButterflyNetwork/MITGrandHack2018/releases/download/v.0.0.1/butterfly_dataset_training1.tar.gz)
14+
[Set 3](https://github.com/ButterflyNetwork/MITGrandHack2018/releases/download/v.0.0.1/butterfly_dataset_training2.tar.gz)
15+
16+
A mini-version (a small subset) of the dataset is available [here](https://github.com/ButterflyNetwork/MITGrandHack2018/releases/download/v.0.0.1/butterfly_mini_dataset.tar.gz).
17+
18+
These images have been published by Butterfly Network Inc., and may be used solely for the Yale Hackathon 2018. The images may not be used for any other purpose, and may not be re-published without the express written permission of Butterfly Network Inc.
19+
20+
You will be provided with 2 ultrasound datasets.
21+
The large dataset (butterfly_dataset) contains 9 different classes of ultrasound images acquired with the Butterfly IQ on 31 individuals.
22+
The smaller subset of this dataset is called butterfly_mini_dataset. Each of the classes is acquired on a different part of the body.
23+
24+
The 9 types of ultrasound images are:
25+
- Morison's pouch
26+
- Bladder
27+
- PLAX view of the heart
28+
- 4 chambers of the heart
29+
- 2 chambers of the heart
30+
- IVC
31+
- Carotid artery
32+
- Lungs
33+
- Thyroid
34+
35+
The folder containing the data has already split the data into a training and test set.
36+
Each set contains enumerated folders representing different patients.
37+
Each patient contains at most 9 folders corresponding to the class/type of ultrasound images.
38+
The following is a diagram representing the folder structure containing the dataset.
39+
40+
```
41+
butterfly_dataset
42+
├── training
43+
│ ├── 1
44+
│ │ └── morisons_pouch
45+
│ │ │ └── img001.png
46+
│ │ │ └── img002.png
47+
│ │ │ └── img003.png
48+
│ │ │ └── ....
49+
│ │ └── bladder
50+
│ │ └── plax
51+
│ │ └── 4ch
52+
│ │ └── 2ch
53+
│ │ └── ...
54+
│ ├── 2
55+
│ └── ...
56+
├── test
57+
│ ├── 26
58+
│ ├── 27
59+
│ └── ...
60+
```
61+
62+
### Reference and starting point
63+
64+
We provide a code that can be used as a reference, or as a starting point for the challenges.
65+
You are not obligated to use the code or the approach taken there.
66+
This starting point example shows how to train the well-known InceptionV1 model and how then use it to classify ultrasound images.
67+
A utility function to download the datasets is also provided.
68+
69+
#### Installing and running the example
70+
71+
We assume you have git installed on your machine and python 3.5. If you don't, hack your way through the installation of these two popular tools.
72+
73+
The first thing you want to do is to clone this repository. In order to do this, invoke the following commands:
74+
75+
```
76+
git clone https://github.com/ButterflyNetwork/MITGrandHack2018.git
77+
cd MITGrandHack2018
78+
```
79+
80+
To verify that you actually have python 3 available from within MITGrandHack2018 folder, simply invoke the command:
81+
82+
```
83+
python --version
84+
```
85+
You should expect to see a version 3.x.x. We recommend you use 3.5, but the code probably will work with any version of python 3.
86+
87+
To install the libraries used in the example, simply invoke the following command from within the `MITGrandHack2018` folder.
88+
89+
```
90+
pip install -r requirements.txt
91+
```
92+
93+
Now you are ready to run the example.
94+
The example exposes 3 main methods:
95+
1. download_dataset
96+
2. train
97+
3. evaluate
98+
99+
To download the mini dataset you can invoke the command:
100+
101+
```
102+
python hackathon_example.py download_dataset
103+
```
104+
105+
To download the full dataset you can invoke the command:
106+
107+
```
108+
python hackathon_example.py download_dataset --large
109+
```
110+
111+
To train the model you can invoke the following command for example:
112+
113+
```
114+
python hackathon_example.py train --input_file=butterfly_mini_dataset/training/training.csv --export_dir=my_trained_model --number_of_epochs=4
115+
```
116+
117+
After training you can evaluate the saved model on the test set by invoking the following command for example:
118+
```
119+
python hackathon_example.py evaluate --input_file=butterfly_mini_dataset/test/test.csv --export_dir=my_trained_model
120+
```
121+
122+
#### Using our pre-trained model:
123+
124+
If you are just looking to use an already trained model you can invoke the following command
125+
```
126+
python hackathon_example.py evaluate --input_file=butterfly_mini_dataset/test/test.csv --export_dir=trained_model
127+
```
128+
This will load a model we have already trained so you can focus instead on using the output of the model for another task.

0 commit comments

Comments
 (0)