mipbkhn commited on
Commit
3369a1a
1 Parent(s): 8bcef38
.devcontainer/Devcontainer.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "Python 3",
3
+ "build": {
4
+ "dockerfile": "Dockerfile",
5
+ "context": "..",
6
+ },
7
+
8
+ // Configure tool-specific properties.
9
+ "customizations": {
10
+ // Configure properties specific to VS Code.
11
+ "vscode": {
12
+ // Set *default* container specific settings.json values on container create.
13
+ "settings": {
14
+ "python.defaultInterpreterPath": "/usr/local/bin/python",
15
+ "python.linting.enabled": true,
16
+ "python.linting.pylintEnabled": true,
17
+ "python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
18
+ "python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
19
+ "python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
20
+ "python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
21
+ "python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
22
+ },
23
+ // Add the IDs of extensions you want installed when the container is created.
24
+ "extensions": [
25
+ "ms-python.python",
26
+ "ms-python.vscode-pylance",
27
+ "ms-toolsai.jupyter"
28
+ ]
29
+ }
30
+ },
31
+ "runArgs": ["--gpus" ,"all", "--ulimit", "memlock=-1", "--ulimit", "stack=67108864", "--shm-size=12g"],
32
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
33
+ "forwardPorts": [8888]
34
+ }
.devcontainer/Dockerfile ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ ARG FROM_IMAGE_NAME=nvcr.io/nvidia/pytorch:22.05-py3
2
+
3
+ FROM ${FROM_IMAGE_NAME}
4
+
5
+ RUN pip install fastai nbdev fastbook ipywidgets timm
.gitignore ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ rsna-breast-cancer-detection/
2
+ rsna-breast-cancer-detection.zip
3
+ vindr-mammo-a-large-scale-benchmark-dataset-for-computer-aided-detection-and-diagnosis-in-full-field-digital-mammography-1.0.0.zip
4
+ physionet.org/
5
+ data/
.gradioignore ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ rsna-breast-cancer-detection/
2
+ rsna-breast-cancer-detection.zip
3
+ vindr-mammo-a-large-scale-benchmark-dataset-for-computer-aided-detection-and-diagnosis-in-full-field-digital-mammography-1.0.0.zip
4
+ physionet.org/
5
+ data/
README.md CHANGED
@@ -1,12 +1,12 @@
1
- ---
2
- title: BreastCancer
3
- emoji: 😻
4
- colorFrom: red
5
- colorTo: red
6
- sdk: gradio
7
- sdk_version: 3.39.0
8
- app_file: app.py
9
- pinned: false
10
- ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
+ ---
2
+ title: Breast Cancer Detection
3
+ emoji: 😻
4
+ colorFrom: red
5
+ colorTo: red
6
+ sdk: gradio
7
+ sdk_version: 3.39.0
8
+ app_file: app.py
9
+ pinned: false
10
+ ---
11
+
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio
2
+ from fastai.vision.all import *
3
+
4
+ MODELS_PATH = Path('./models')
5
+ EXAMPLES_PATH = Path('./examples')
6
+
7
+ learn = load_learner(MODELS_PATH/'model.pkl')
8
+ labels = learn.dls.vocab
9
+
10
+ def gradio_predict(img):
11
+ img = PILImage.create(img)
12
+ _pred, _pred_idx, probs = learn.predict(img)
13
+ labels_probs = {labels[i]: float(probs[i]) for i, _ in enumerate(labels)}
14
+ return labels_probs
15
+
16
+ with open('gradio_article.md') as f:
17
+ article = f.read()
18
+
19
+ interface_options = {
20
+ "title": "Breast Cancer Detection",
21
+ "description": "Find breast cancers in screening mammograms",
22
+ "article": article,
23
+ "examples" : [f'{EXAMPLES_PATH}/{f.name}' for f in EXAMPLES_PATH.iterdir()],
24
+ "layout": "horizontal",
25
+ "theme": "default",
26
+ }
27
+
28
+ demo = gradio.Interface(fn=gradio_predict,
29
+ inputs=gradio.inputs.Image(shape=(512, 512)),
30
+ outputs=gradio.outputs.Label(num_top_classes=5),
31
+ **interface_options)
32
+
33
+ launch_options = {
34
+ "enable_queue": True,
35
+ "share": False,
36
+ }
37
+
38
+ demo.launch(**launch_options)
examples/00a369b4ec1e5e0ff34e6bd838e5f2d6_2feab51140b38f9ec90e17b7006501b2.jpg ADDED
examples/00a369b4ec1e5e0ff34e6bd838e5f2d6_b70e49d5e28ad1ac33920a9b641c7b8f.jpg ADDED
examples/00a7a306c763ab5f0cb6a846825b7d04_274942d5c9036c89aca0b16a36d2b076.jpg ADDED
examples/00a7a306c763ab5f0cb6a846825b7d04_2ce50597d3a7711d30b9ec3a0aa25623.jpg ADDED
examples/00a7a306c763ab5f0cb6a846825b7d04_c7ae763953bfd86e922d9259e2c7afc7.jpg ADDED
examples/0a3018e7ad1d1d7d2e142c2ca7c518fa_a321db55863a3c192f1b6ba790e62c07.jpg ADDED
examples/0baef459a10e51c65302ddb63012c147_7eb213019e972514b4ce6ccb53df509a.jpg ADDED
examples/0d8fc33c55f2f6af87ee3bd16614e208_dd0b143a10f7dd0cedb9de5f146005aa.jpg ADDED
examples/30c3a965cd79168a8b85899be4d0bdab_e788be650ac8e1f81beda55451f217e3.jpg ADDED
examples/3b9d3e9aa2fcdefd74d4cbfb496694b4_6c571a3fb5a3abe21141333f65b5bf09.jpg ADDED
gradio_article.md ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ## Description
3
+ In this application, I delved into the realm of medical imaging to combat one of the most prevalent and devastating diseases worldwide – breast cancer. Inspired by the imperative need for early detection and the potential to revolutionize patient care, I participated in the prestigious Kaggle competition, set forth by the Radiological Society of North America (RSNA), with the audacious goal of improving the identification of breast cancer through automated screening mammography.
4
+
5
+ Breast cancer remains a formidable global health challenge, with staggering statistics revealing its widespread impact. To address this pressing issue, I harnessed the power of advanced machine learning techniques to revolutionize the process of breast cancer detection. By leveraging a diverse dataset of screening mammograms, acquired from regular screenings, this project aimed to develop a robust and accurate AI model capable of identifying potential malignancies with a level of precision that could rival experienced radiologists.
6
+
7
+ The significance of this endeavor extends beyond statistical improvement; it holds the potential to transform the landscape of breast cancer diagnosis. Through this project, I sought to empower healthcare professionals with a tool that not only enhances their diagnostic accuracy but also optimizes their workflow, thereby amplifying the quality and safety of patient care. The ripple effects of this advancement are far-reaching – from reducing the burden of unnecessary medical procedures and mitigating costs, to extending the benefits of early detection to underserved populations around the world.
8
+
9
+ The challenges inherent in the early detection of breast cancer, ranging from the scarcity of trained radiologists to the prevalence of false positive results, underscored the urgency of my pursuit. Through rigorous experimentation, iterative model refinement, and insightful feature engineering, I endeavored to create an AI solution that holds the potential to reshape the future of breast cancer screening.
10
+
11
+ As breast cancer continues to impact countless lives globally, the significance of such AI application cannot be overstated. It represents a profound step forward in merging cutting-edge technology with medical expertise, with the shared goal of reducing breast cancer mortality rates. With this project, I aspire to leave an indelible mark on the field of medical AI, contributing to a brighter future where early detection becomes not only a possibility but a reality for all, regardless of geographic or socioeconomic constraints.
models/model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8b6ae81c7a538e8f927b8a39b21b77122fc72f6418d8706a61e7e48f588c73ee
3
+ size 114726377
train.ipynb ADDED
The diff for this file is too large to render. See raw diff