• Stars
    star
    183
  • Rank 210,154 (Top 5 %)
  • Language
    Python
  • License
    BSD 2-Clause "Sim...
  • Created over 8 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

LUNA16 Lung Nodule Analysis - NWI-IMC037 Final Project

luna16

LUNA16 Lung Nodule Analysis - NWI-IMC037 Final Project

Respository containing code for our final project of the computer aided medical diagnosis course, which yielded an entry in the LUNA16 competition. Unfortunately this project is ill documented, as it was created very quickly and pragmatically as we hurried to meet deadlines for the university course this was the main project of. Running it will likely require minor edits left and right (mostly to do with filepaths), unless you place the data in the same folder as we did.

A rough list of requirements:

Python 2.7 with theano, lasagne (with CUDNN configured), tqdm, pandas, numpy, scipy, scikit-image, scikit-learn, opencv2.

UNET for dense prediction

Preprocessing

Convert data to 1x1x1mm_512x512 slices. A requirement is also a set of segmentations of the lungs (can be found on the LUNA16 website). Place your data in folder data/original_lungs:

Use script src/data_processing/create_same_spacing_data_NODULE.py, this may take a long time (up to 24 hours) depending on your machine.

Then, download imagename_zspacing.csv from here and put it in the data folder.

Unet training

src/deep/unet/unet_trainer.py <config>

Example conifg config/unet_splits/split01.ini. Repeat this for each of the splits.

Unet held out set dense predictions

src/deep/predict <model_name> <epoch>

When training a model a folder is created in /models. The folder name is the model name here. Manually look up which epoch had the lowest validation set loss and was a checkpoint.

Unet dense predictions -> candidates:

This part is likely hard to redo using our code, as it was done by manually editing the scripts. This part is however the easiest conceptually and clearly described in our method description on the Luna competition page. To go from dense prediction to the initial set without postprocessing you can look at src/candidates.py. You will have to edit line 30.

False positive reduction (Wide ResNet)

Preprocessing:

We performed this on a large cluster (using up to 20 nodes simoultaneously, this may take very long on a single machine). First we equalize the spacings tp 0.5mm0.5mm0.5mm using src/data_processing/equalize_spacings.py. Then we create the 96x96 patches in all three orientations using src/data_processing/create_xy_xz_yz_CARTESIUS.py. Scripts to perform this using SLURM for job management (will require some editing of paths) can be found in /scripts/create_patches/ and /scripts/rescale.

Training

python train.py <config> in /src/deep
Configurations: https://github.com/gzuidhof/luna16/blob/master/config/resnet56_X_diag.ini with X 0 through 9.

Predict

src/deep/predict_resnet <model_name> <epoch> <which subsets to predict>

The prediction CSV can then be found in the model folder. All you have to do now is combine these. You could use src/ensembleSubmissions.py for this, which also features some equalization of predictions of the different models.

More Repositories

1

starboard-notebook

In-browser literate notebooks
TypeScript
1,217
star
2

tygo

Generate Typescript types from Golang source code
Go
592
star
3

coi-serviceworker

Cross-origin isolation (COOP and COEP) through a service worker for situations in which you can't control the headers (e.g. GH pages)
JavaScript
369
star
4

nn-transfer

Convert trained PyTorch models to Keras, and the other way around
Python
226
star
5

zarr.js

Javascript implementation of Zarr
TypeScript
132
star
6

GConsole

Developer Console for Unity3D
C#
101
star
7

starboard-cli

Starboard CLI for local (offline) editing of notebooks
CSS
20
star
8

LD49

TypeScript
20
star
9

starboard-observable

Observable cells in Starboard Notebook. Why not?
TypeScript
20
star
10

jpeg-artifact-reduction

Jupyter Notebook
16
star
11

starboard-jupyter

Plugin to run Starboard cells in an external Jupyter kernel
TypeScript
15
star
12

starboard-wrap

🌯A small library that wraps a Starboard Notebook iframe in the parent webpage
TypeScript
14
star
13

wasmwrap

Wrap WASM into JS files as base64
TypeScript
13
star
14

hx-ash

Entity Component Framework
Haxe
12
star
15

jupystar

Convert Jupyter notebooks (ipynb) to Starboard notebooks
Jupyter Notebook
8
star
16

starboard-python

Plugin that adds Python cells to Starboard
8
star
17

no-free-plan

HTML
8
star
18

rollup-plugin-base64

A rollup plugin that allows you to import files as a base64 string
JavaScript
7
star
19

flipper

🐬 Flipper is a monitoring service that automatically re-points floating IPs at healhy targets.
Go
7
star
20

li-hackathon

48 hour hackathon project: From RU with Love
Vue
6
star
21

nasync-js

What if JS didn't have await and async, because everything is async and awaited?
TypeScript
5
star
22

starlit

Go
4
star
23

WebMetaverse

Supposedly the 3D world wide web.
JavaScript
3
star
24

whole-slide-breast-cancer-classification

Resulting publication http://spie.org/Publications/Journal/10.1117/1.JMI.4.4.044504
Jupyter Notebook
3
star
25

HRI

Human Robot Interaction course project (robot cooking assistant with NLP)
Python
3
star
26

starcloud

CDN origin for Starboard assets with the correct headers set
Go
2
star
27

advent-of-code-2020

Advent of Code 2020 Solutions
2
star
28

LD30

"Connected Worlds"
C#
2
star
29

GConsoleNGUI

NGUI Frontend for GConsole
C#
2
star
30

ai-at-the-web-scale

Final project for "AI at the web scale" course (profit optimization for webshop -> contextual bandit problem)
Python
1
star
31

magiclogin-docs

Docs for https://magiclogin.net
1
star
32

excess

Performant WebRTC signalling server (written in Elixir)
Elixir
1
star
33

gamejam

GAMEJAM games
ASP
1
star
34

Mash

Mash, 2D Game Engine with Ash Entity System Framework
Haxe
1
star