├── Graphs.png
├── Instructions_Task1.txt
├── OpenCodeData.zip
├── README.md
├── Task1.ipynb
├── Task1_solutions
├── 22135033.ipynb
├── Add your task 1 notebook in this folder.txt
├── CEG2020103026.ipynb
├── CS22BTECH11017.ipynb
├── CS22BTECH11045.ipynb
├── IEC2022060.ipynb
├── IIT2022005 (1).ipynb
├── IIT2022020.ipynb
├── IIT2022123.ipynb
├── IIT2022161.ipynb
├── IIT2022232.ipynb
├── Ife2022018.ipynb
├── JIIT_23103331.ipynb
├── arya230.ipynb
├── atharva0192.ipynb
├── iec2022027.ipynb
└── iitbhu_23114024.ipynb
├── Task2.ipynb
├── Task2_Resources.txt
├── Task2_solutions
├── 22155031.txt
├── CEG2020103026.txt
├── Example.txt
├── IIT2022020.txt
├── IIT2022161.txt
├── IIT2022232.txt
├── atharva0192.txt
├── iec2022027.txt
└── sarthakvermaa.txt
├── Task3.ipynb
├── Task3_solutions
├── Piyush
│ ├── PiyushTiwari.txt
│ ├── ROC_graph.jpg
│ ├── graph1and2.jpg
│ └── model.h5
├── Tej-as1
│ ├── Confusion Matrix.png
│ ├── Graphs.png
│ └── Tej-as1.txt
├── example_submit
│ └── example_submit.txt
├── rnavaneeth992
│ ├── Binary-Classification.pth
│ ├── Graph 1.png
│ ├── Graph 2.png
│ ├── Graph 3.png
│ ├── Graph 4.png
│ └── colab.txt
├── sarthakvermaa
│ ├── h5model.txt
│ ├── result.jpg
│ └── sarthakvermaa.txt
├── temp
├── tonyStark-Jr
│ └── iec2022027.txt
└── trial.txt
├── Task4.ipynb
├── Task4_solutions
├── IIT2022232
├── Piyush
│ ├── IIT2022020.txt
│ ├── resnet_model_graph.jpg
│ └── resnet_model_graph_2.jpg
├── Tej-as1
│ └── Tej-as1.txt
├── atharva0192
│ ├── ConfusionMatrix.png
│ ├── Graphs.png
│ ├── ROC-AUC_score.png
│ ├── atharva0192.txt
│ └── model.txt
├── sarthakvermaa
│ ├── 1.png
│ ├── 2.png
│ ├── 3.png
│ └── sarthakvermaa.txt
├── tonyStark-Jr.txt
└── trial.txt.txt
└── atharva0192
├── ConfusionMatrix.png
├── Graphs.png
├── Link.txt
├── app.py
└── requirements.txt
/Graphs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/Graphs.png
--------------------------------------------------------------------------------
/Instructions_Task1.txt:
--------------------------------------------------------------------------------
1 | This task is all about loading and understanding the data.
2 |
3 | 1. Don't change any prewritten comments and code. And follow instructions given.
4 | 2. There is excess time given in this task to study given images and revise your DL skills.
5 | 3. Save your final .ipynb file in Task1_solutions folder.
6 |
7 | Resources:
8 | 1. https://www.geeksforgeeks.org/opencv-overview/
--------------------------------------------------------------------------------
/OpenCodeData.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/OpenCodeData.zip
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Medical-Image-Classification
2 |
3 | In recent years, the intersection of medical imaging and deep learning has witnessed unprecedented advancements, revolutionizing the landscape of healthcare. One notable application that has gained substantial attention is medical image classification using Convolutional Neural Networks (CNNs). As we embark on this project, we delve into the realm of leveraging cutting-edge deep learning techniques to augment traditional medical image analysis.
4 |
5 | **Probelm statement: You are give data which contain 100's of x-rays. Your task is to build a effective and efficient CNN model to classify them into Normal and Infected category. Show you amazing DL skills to bulid best model :)**
6 |
7 |
8 | ## Instructions
9 | * For any concept/technique refer articles available on internet rather than using ChatGPT, as it may be misleading and many times provide only half information.
10 | * Do not alter any pre-written code/comments.
11 | * Write code in provided space only.
12 | * Write commnets for what you did so that mentors can easy understand your work.
13 | * Only use Google colab for running code.
14 |
15 | ## Procedure
16 |
17 | 1. Fork and cloning this repository on your local device.
18 | 2. Open each task on Google colab.
19 | 3. Once task is completed download .ipynb file and store it in respective folder.
20 | 4. Name your file as Enrollment no.
21 | * For task1 store final file in Task1_solution with file name IIT2022119.
22 | 5. Push this file to forked repo and then send PR.
23 | 6. Your PR will be reviwed by the mentors. Once your PR is accepted, file will be merged and points will be granted.
24 |
25 | ## Help
26 | For any query feel free to contact iit2022119@iiita.ac.in. You can also interact with mentors and community on [Discord](https://discord.gg/D9999YTkS8)
27 |
--------------------------------------------------------------------------------
/Task1.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "code",
5 | "execution_count": null,
6 | "metadata": {
7 | "id": "ugafaNqf08Au"
8 | },
9 | "outputs": [],
10 | "source": [
11 | "''' Do not change this cell '''\n",
12 | "#Functions\n",
13 | "\n",
14 | "def check_gpu():\n",
15 | " if tf.test.gpu_device_name() != '':\n",
16 | " print(\"GPU sucessfully connected\")\n",
17 | " else: print(\"PLease connect GPU\")\n",
18 | "\n",
19 | "def check_data():\n",
20 | " a = set()\n",
21 | " for image in Images:\n",
22 | " a.add(Image.shape[2])\n",
23 | " if len(a)==1 and len(Images)==624:\n",
24 | " print(\"PASS\")\n",
25 | " else: print(\"FAIL\")"
26 | ]
27 | },
28 | {
29 | "cell_type": "code",
30 | "execution_count": null,
31 | "metadata": {
32 | "id": "4-Y7qb0iYVbt"
33 | },
34 | "outputs": [],
35 | "source": [
36 | "#Import any library here only."
37 | ]
38 | },
39 | {
40 | "cell_type": "markdown",
41 | "metadata": {
42 | "id": "cJLJww-DCmOK"
43 | },
44 | "source": [
45 | "## Task #1\n",
46 | "\n",
47 | "Data loading and understanding data"
48 | ]
49 | },
50 | {
51 | "cell_type": "code",
52 | "execution_count": null,
53 | "metadata": {
54 | "id": "WJbEpu20Wmgr"
55 | },
56 | "outputs": [],
57 | "source": [
58 | "#Setup and check a gpu connection."
59 | ]
60 | },
61 | {
62 | "cell_type": "code",
63 | "execution_count": null,
64 | "metadata": {
65 | "id": "xh7FVYEB1i4g"
66 | },
67 | "outputs": [],
68 | "source": [
69 | "''' Do not change this cell '''\n",
70 | "check_gpu()"
71 | ]
72 | },
73 | {
74 | "cell_type": "code",
75 | "execution_count": null,
76 | "metadata": {
77 | "id": "bXslEZLxW4yx"
78 | },
79 | "outputs": [],
80 | "source": [
81 | "#Create two lists, images and labels. Store Input images in 'Images' list and its labels in 'Labels' list.\n",
82 | "#Infected Images have two categories viral and bacterial. Find Number of images in each class. (Hint: See image name)\n",
83 | "#Note that images are of different sizes."
84 | ]
85 | },
86 | {
87 | "cell_type": "code",
88 | "execution_count": null,
89 | "metadata": {
90 | "id": "MYMO3xFo28TP"
91 | },
92 | "outputs": [],
93 | "source": [
94 | "''' Do not change this cell '''\n",
95 | "check_data()"
96 | ]
97 | },
98 | {
99 | "cell_type": "code",
100 | "execution_count": null,
101 | "metadata": {
102 | "id": "2uJ1Q2WoYkMW"
103 | },
104 | "outputs": [],
105 | "source": [
106 | "#Plot 5 images each of normal and infected category.\n",
107 | "#Also do neccessary labelings. Make sure your plots have all necessary details and looks good :)\n",
108 | "#You can customise your plots as per your wish."
109 | ]
110 | }
111 | ],
112 | "metadata": {
113 | "colab": {
114 | "provenance": []
115 | },
116 | "kernelspec": {
117 | "display_name": "Python 3",
118 | "name": "python3"
119 | },
120 | "language_info": {
121 | "name": "python"
122 | }
123 | },
124 | "nbformat": 4,
125 | "nbformat_minor": 0
126 | }
127 |
--------------------------------------------------------------------------------
/Task1_solutions/Add your task 1 notebook in this folder.txt:
--------------------------------------------------------------------------------
1 | https://colab.research.google.com/drive/1zULx_XyW1leUEzVDzz_Mb5uh2Iotj8uu?usp=sharing
--------------------------------------------------------------------------------
/Task2.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "metadata": {},
6 | "source": [
7 | "**Copy this task at end of task #1 notebook**"
8 | ]
9 | },
10 | {
11 | "cell_type": "code",
12 | "execution_count": null,
13 | "metadata": {},
14 | "outputs": [],
15 | "source": [
16 | "# Copy and run the code you wrote in task 1 notebook here\n"
17 | ]
18 | },
19 | {
20 | "cell_type": "markdown",
21 | "metadata": {
22 | "id": "28W1Ymzzpznu"
23 | },
24 | "source": [
25 | "## Task #2\n",
26 | "\n",
27 | "Data Augmentation\n",
28 | "\n",
29 | "Here I have attached an resource if you find difficuties in dealing with imbalanced data: [Click here](https://www.geeksforgeeks.org/imbalanced-learn-module-in-python/)\n",
30 | "\n",
31 | "Image augmentation and Pre-Processing:\n",
32 | "* [Resource 1](https://www.analyticsvidhya.com/blog/2020/08/image-augmentation-on-the-fly-using-keras-imagedatagenerator/)\n",
33 | "* [Resource 2](https://www.analyticsvidhya.com/blog/2023/03/getting-started-with-image-processing-using-opencv/)\n",
34 | "\n",
35 | "**Ofcourse you may use other techniques of your choice :)**\n",
36 | "\n",
37 | "** Keep note that pre-proceesing and augmentation play crucial role in building good models"
38 | ]
39 | },
40 | {
41 | "cell_type": "code",
42 | "execution_count": null,
43 | "metadata": {
44 | "id": "9pNp2TSHm3Qk"
45 | },
46 | "outputs": [],
47 | "source": [
48 | "#Deal with unbalanced data\n",
49 | "\n",
50 | "'''\n",
51 | " Now condider only two categories \"Normal\" and \"Infected\".\n",
52 | "'''\n"
53 | ]
54 | },
55 | {
56 | "cell_type": "code",
57 | "execution_count": null,
58 | "metadata": {},
59 | "outputs": [],
60 | "source": [
61 | "# Pre-process images here.\n"
62 | ]
63 | },
64 | {
65 | "cell_type": "code",
66 | "execution_count": null,
67 | "metadata": {},
68 | "outputs": [],
69 | "source": [
70 | "# Plot 5 pre-processed image\n"
71 | ]
72 | },
73 | {
74 | "cell_type": "code",
75 | "execution_count": null,
76 | "metadata": {},
77 | "outputs": [],
78 | "source": [
79 | "# Split images into train, validation and test.\n"
80 | ]
81 | },
82 | {
83 | "cell_type": "code",
84 | "execution_count": null,
85 | "metadata": {
86 | "id": "cSw5cxX6fh7i"
87 | },
88 | "outputs": [],
89 | "source": [
90 | "# Do required image augmentation on train data here.\n"
91 | ]
92 | },
93 | {
94 | "cell_type": "code",
95 | "execution_count": null,
96 | "metadata": {},
97 | "outputs": [],
98 | "source": [
99 | "# Plot 5 augmented train images\n"
100 | ]
101 | }
102 | ],
103 | "metadata": {
104 | "colab": {
105 | "provenance": []
106 | },
107 | "kernelspec": {
108 | "display_name": "Python 3",
109 | "name": "python3"
110 | },
111 | "language_info": {
112 | "codemirror_mode": {
113 | "name": "ipython",
114 | "version": 3
115 | },
116 | "file_extension": ".py",
117 | "mimetype": "text/x-python",
118 | "name": "python",
119 | "nbconvert_exporter": "python",
120 | "pygments_lexer": "ipython3",
121 | "version": "3.11.1"
122 | }
123 | },
124 | "nbformat": 4,
125 | "nbformat_minor": 0
126 | }
127 |
--------------------------------------------------------------------------------
/Task2_Resources.txt:
--------------------------------------------------------------------------------
1 | 1. For Imbalanced dataset: https://www.geeksforgeeks.org/imbalanced-learn-module-in-python/
2 |
3 | 2. For Pre-processing and Augmentation:
4 | : https://www.analyticsvidhya.com/blog/2020/08/image-augmentation-on-the-fly-using-keras-imagedatagenerator/
5 | : https://www.analyticsvidhya.com/blog/2023/03/getting-started-with-image-processing-using-opencv/
--------------------------------------------------------------------------------
/Task2_solutions/22155031.txt:
--------------------------------------------------------------------------------
1 | Colab file after pre-processing:
2 |
3 | '''
4 | https://colab.research.google.com/drive/1AvmGpmsY7kBk7YmpHlctZvb9ULWDSS53?usp=sharing
5 | '''
6 |
7 | Colab file after augmenting train images:
8 |
9 | '''
10 | https://colab.research.google.com/drive/1AvmGpmsY7kBk7YmpHlctZvb9ULWDSS53?usp=sharing
11 | '''
12 |
--------------------------------------------------------------------------------
/Task2_solutions/CEG2020103026.txt:
--------------------------------------------------------------------------------
1 | Colab file after pre-processing:
2 |
3 | '''
4 | https://drive.google.com/file/d/16QMqRkC2BOnTeWSOaBA-0_FAtRDwPsG1/view?usp=sharing
5 | '''
6 |
7 | Colab file after augmenting train images:
8 |
9 | '''
10 | https://drive.google.com/file/d/16QMqRkC2BOnTeWSOaBA-0_FAtRDwPsG1/view?usp=sharing
11 | '''
--------------------------------------------------------------------------------
/Task2_solutions/Example.txt:
--------------------------------------------------------------------------------
1 | Colab file after pre-processing:
2 |
3 | '''
4 | link to colab file with permission in **read mode** to "iit2022119@iiita.ac.in"
5 | '''
6 |
7 | Colab file after augmenting train images:
8 |
9 | '''
10 | link to colab file with permission in **read mode** to "iit2022119@iiita.ac.in"
11 | '''
--------------------------------------------------------------------------------
/Task2_solutions/IIT2022020.txt:
--------------------------------------------------------------------------------
1 | Colab file after pre-processing:
2 |
3 | '''
4 | https://drive.google.com/file/d/1VrFbwIkiqfCKxcfCwrcvfhrtNA-1-hcw/view?usp=sharing
5 | '''
6 |
7 | Colab file after augmenting train images:
8 |
9 | '''
10 | https://drive.google.com/file/d/1VrFbwIkiqfCKxcfCwrcvfhrtNA-1-hcw/view?usp=sharing
11 | '''
--------------------------------------------------------------------------------
/Task2_solutions/IIT2022161.txt:
--------------------------------------------------------------------------------
1 | Colab File After Pre-Processing:
2 | https://colab.research.google.com/drive/1GnuT5aKkUjqoZQx8Y7ydLsxGQ5ESa5ge?usp=sharing
3 |
4 | Colab file after Augmentation and Balancing:
5 | https://colab.research.google.com/drive/1GnuT5aKkUjqoZQx8Y7ydLsxGQ5ESa5ge?usp=sharing
--------------------------------------------------------------------------------
/Task2_solutions/IIT2022232.txt:
--------------------------------------------------------------------------------
1 | collab link: https://colab.research.google.com/drive/1sy1af0sZHs-2xhYgK7dS-66sa1uPvp7X?usp=sharing
2 | callab link: https://colab.research.google.com/drive/1MEi2vbUkYA9fc1-zBjz4Djc7agfu1vlB?usp=sharing
3 |
--------------------------------------------------------------------------------
/Task2_solutions/atharva0192.txt:
--------------------------------------------------------------------------------
1 | ImageAugmentation Done
2 | https://colab.research.google.com/drive/1ZlEpP2qBLIKua0i6nurfHU72Ll2E__U2?usp=sharing
3 |
--------------------------------------------------------------------------------
/Task2_solutions/iec2022027.txt:
--------------------------------------------------------------------------------
1 | Colab file after pre-processing:
2 |
3 | '''
4 | https://colab.research.google.com/drive/1HS0AUNtTZhwkrs4SXYMQsxYmoIY-VgUZ?usp=sharing
5 | '''
6 |
7 | Colab file after augmenting train images:
8 |
9 | '''
10 | https://colab.research.google.com/drive/1LM-CiFZ0QN_Bc5wHmRUmahRBXN6Ea73n?usp=sharing
11 | '''
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Task2_solutions/sarthakvermaa.txt:
--------------------------------------------------------------------------------
1 | Colab file after pre-processing:
2 |
3 | '''
4 | https://colab.research.google.com/drive/1_OmQODk9gOBD4QnhTgZjopMwgyPGTWJg?usp=sharing
5 | '''
6 |
7 | Colab file after augmenting train images:
8 |
9 | '''
10 | https://colab.research.google.com/drive/1_OmQODk9gOBD4QnhTgZjopMwgyPGTWJg?usp=sharing
11 | '''
12 |
--------------------------------------------------------------------------------
/Task3.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "metadata": {
6 | "id": "F2pdoYFFNleu"
7 | },
8 | "source": [
9 | "**Copy this task at end of task #2 notebook**"
10 | ]
11 | },
12 | {
13 | "cell_type": "code",
14 | "execution_count": null,
15 | "metadata": {
16 | "id": "4-Y7qb0iYVbt"
17 | },
18 | "outputs": [],
19 | "source": [
20 | "# Do the tasks mentioned below at the end of task2 notebook."
21 | ]
22 | },
23 | {
24 | "cell_type": "markdown",
25 | "metadata": {
26 | "id": "28W1Ymzzpznu"
27 | },
28 | "source": [
29 | "## Task #3\n",
30 | "\n",
31 | "Build and Training model\n",
32 | "\n",
33 | "Aim to increase accuracy and AUC score\n",
34 | "\n",
35 | "Note: Accuracy of your model also depend on how you have pre-processed your data along with model architecture. Hence results of your CNN is highly dependent on Task #2"
36 | ]
37 | },
38 | {
39 | "cell_type": "markdown",
40 | "metadata": {},
41 | "source": [
42 | "This is binary classification task. Classifying images into normal and infected "
43 | ]
44 | },
45 | {
46 | "cell_type": "code",
47 | "execution_count": null,
48 | "metadata": {
49 | "id": "HU19U1O8hKn4"
50 | },
51 | "outputs": [],
52 | "source": [
53 | "#Create a CNN.\n",
54 | "#Use accuracy and ROC-AUC matices.\n"
55 | ]
56 | },
57 | {
58 | "cell_type": "code",
59 | "execution_count": null,
60 | "metadata": {
61 | "id": "eU5z_CuHkhKG"
62 | },
63 | "outputs": [],
64 | "source": [
65 | "#Run model here.\n"
66 | ]
67 | },
68 | {
69 | "cell_type": "code",
70 | "execution_count": null,
71 | "metadata": {
72 | "id": "UuC-x6B4lQBS"
73 | },
74 | "outputs": [],
75 | "source": [
76 | "'''Plot 3 graphs showing progress over each epoch - \n",
77 | "\n",
78 | " loss vs validation loss\n",
79 | " accurracy vs validation accuracy\n",
80 | " AUC score vs Validation AUC score.\n",
81 | "'''\n",
82 | "\n",
83 | "#There should be proper labelling of graphs, show legends.\n"
84 | ]
85 | },
86 | {
87 | "cell_type": "markdown",
88 | "metadata": {},
89 | "source": [
90 | "Take care of underfitting and overfitting. Even if your model has better matrices score, but under or overfitting may lead to rejection of PR"
91 | ]
92 | },
93 | {
94 | "cell_type": "code",
95 | "execution_count": null,
96 | "metadata": {
97 | "id": "PG5WqZswk7aR"
98 | },
99 | "outputs": [],
100 | "source": [
101 | "#Test model here.\n"
102 | ]
103 | },
104 | {
105 | "cell_type": "markdown",
106 | "metadata": {},
107 | "source": [
108 | "Make sure to save your best model (.h5 format)"
109 | ]
110 | },
111 | {
112 | "cell_type": "code",
113 | "execution_count": null,
114 | "metadata": {
115 | "id": "OvkZvXX_lAWm"
116 | },
117 | "outputs": [],
118 | "source": [
119 | "#Plot confusion matrix\n"
120 | ]
121 | }
122 | ],
123 | "metadata": {
124 | "colab": {
125 | "provenance": []
126 | },
127 | "kernelspec": {
128 | "display_name": "Python 3",
129 | "name": "python3"
130 | },
131 | "language_info": {
132 | "name": "python"
133 | }
134 | },
135 | "nbformat": 4,
136 | "nbformat_minor": 0
137 | }
138 |
--------------------------------------------------------------------------------
/Task3_solutions/Piyush/PiyushTiwari.txt:
--------------------------------------------------------------------------------
1 | https://colab.research.google.com/drive/1VrFbwIkiqfCKxcfCwrcvfhrtNA-1-hcw#scrollTo=lBq-rgPGiIHd
2 |
3 | auc test score = 0.9524555903866249
--------------------------------------------------------------------------------
/Task3_solutions/Piyush/ROC_graph.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/Task3_solutions/Piyush/ROC_graph.jpg
--------------------------------------------------------------------------------
/Task3_solutions/Piyush/graph1and2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/Task3_solutions/Piyush/graph1and2.jpg
--------------------------------------------------------------------------------
/Task3_solutions/Piyush/model.h5:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/Task3_solutions/Piyush/model.h5
--------------------------------------------------------------------------------
/Task3_solutions/Tej-as1/Confusion Matrix.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/Task3_solutions/Tej-as1/Confusion Matrix.png
--------------------------------------------------------------------------------
/Task3_solutions/Tej-as1/Graphs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/Task3_solutions/Tej-as1/Graphs.png
--------------------------------------------------------------------------------
/Task3_solutions/Tej-as1/Tej-as1.txt:
--------------------------------------------------------------------------------
1 | MODEL - https://drive.google.com/file/d/10vodnVOmVwsn1YeZpry_bXqS6cyi51wu/view?usp=sharing
2 |
3 | COLAB - https://colab.research.google.com/drive/1GnuT5aKkUjqoZQx8Y7ydLsxGQ5ESa5ge?usp=sharing
--------------------------------------------------------------------------------
/Task3_solutions/example_submit/example_submit.txt:
--------------------------------------------------------------------------------
1 | '''
2 | link to colab file with access to 'iit2022119@iiita.ac.in' and '22f3002029@ds.study.iitm.ac.in'
3 | '''
--------------------------------------------------------------------------------
/Task3_solutions/rnavaneeth992/Binary-Classification.pth:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/Task3_solutions/rnavaneeth992/Binary-Classification.pth
--------------------------------------------------------------------------------
/Task3_solutions/rnavaneeth992/Graph 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/Task3_solutions/rnavaneeth992/Graph 1.png
--------------------------------------------------------------------------------
/Task3_solutions/rnavaneeth992/Graph 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/Task3_solutions/rnavaneeth992/Graph 2.png
--------------------------------------------------------------------------------
/Task3_solutions/rnavaneeth992/Graph 3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/Task3_solutions/rnavaneeth992/Graph 3.png
--------------------------------------------------------------------------------
/Task3_solutions/rnavaneeth992/Graph 4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/Task3_solutions/rnavaneeth992/Graph 4.png
--------------------------------------------------------------------------------
/Task3_solutions/rnavaneeth992/colab.txt:
--------------------------------------------------------------------------------
1 | https://colab.research.google.com/drive/16QMqRkC2BOnTeWSOaBA-0_FAtRDwPsG1
--------------------------------------------------------------------------------
/Task3_solutions/sarthakvermaa/h5model.txt:
--------------------------------------------------------------------------------
1 | Github was not allowing to upload file of size over 25 MB.
2 | So, I am uploading a drive link.
3 | https://drive.google.com/file/d/1EcP4uEfYn74PPHgHQ3AMlCsRKeyTNlgu/view?usp=sharing
4 |
--------------------------------------------------------------------------------
/Task3_solutions/sarthakvermaa/result.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/Task3_solutions/sarthakvermaa/result.jpg
--------------------------------------------------------------------------------
/Task3_solutions/sarthakvermaa/sarthakvermaa.txt:
--------------------------------------------------------------------------------
1 | https://colab.research.google.com/drive/1upYgaizTUkyiDO4Hl4Yrb5MSi2ahx6m_?usp=sharing
2 |
3 | Test ROC-AUC Score: 0.9837767683322518
4 |
--------------------------------------------------------------------------------
/Task3_solutions/temp:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Task3_solutions/tonyStark-Jr/iec2022027.txt:
--------------------------------------------------------------------------------
1 | https://colab.research.google.com/drive/1xWaBezMzn7o7ConbH9St-V2TS6h5_x3W?usp=sharing
2 |
--------------------------------------------------------------------------------
/Task3_solutions/trial.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/Task3_solutions/trial.txt
--------------------------------------------------------------------------------
/Task4.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "metadata": {
6 | "id": "F2pdoYFFNleu"
7 | },
8 | "source": [
9 | "**Copy this task at end of task #3 notebook**"
10 | ]
11 | },
12 | {
13 | "cell_type": "code",
14 | "execution_count": null,
15 | "metadata": {
16 | "id": "4-Y7qb0iYVbt"
17 | },
18 | "outputs": [],
19 | "source": [
20 | "#Import any library here only.\n"
21 | ]
22 | },
23 | {
24 | "cell_type": "markdown",
25 | "metadata": {
26 | "id": "28W1Ymzzpznu"
27 | },
28 | "source": [
29 | "## Task #4\n",
30 | "\n",
31 | "Finetuning a pre-trained model and then train it\n",
32 | "\n",
33 | "Aim to increase accuracy and AUC score"
34 | ]
35 | },
36 | {
37 | "cell_type": "code",
38 | "execution_count": null,
39 | "metadata": {
40 | "id": "5cCG3oyz-rfE"
41 | },
42 | "outputs": [],
43 | "source": [
44 | "# Use any pretrained model resnet/EfficientNet/VGG etc. and finetune them.\n",
45 | "#Perform all task in task3.\n"
46 | ]
47 | }
48 | ],
49 | "metadata": {
50 | "colab": {
51 | "provenance": []
52 | },
53 | "kernelspec": {
54 | "display_name": "Python 3",
55 | "name": "python3"
56 | },
57 | "language_info": {
58 | "name": "python"
59 | }
60 | },
61 | "nbformat": 4,
62 | "nbformat_minor": 0
63 | }
64 |
--------------------------------------------------------------------------------
/Task4_solutions/IIT2022232:
--------------------------------------------------------------------------------
1 | collab link : https://colab.research.google.com/drive/1XoxP7sAPL-oRHYgdGq7I-pMW2iUVioNY?usp=sharing
2 |
3 | vgg16
4 | outputs loss,acc,auc : https://drive.google.com/file/d/1RbAmjEfxRby_3KnXCFvfICJl2WtLLXmQ/view?usp=sharing
5 | val_accuracy = 91
6 | test_accuracy = 95.73
7 | saved_model = https://drive.google.com/file/d/1-4j6KVdvrAUkHOXL7JZYO2ESwTetf5Yc/view?usp=sharing
8 |
9 | Resnet50
10 | output loss,acc,auc = https://drive.google.com/file/d/1cEcf5LoiN_lAX-C0g6HHncfRIdGAHEzm/view?usp=sharing
11 | val_accuracy = 98.72
12 | test_accuracy = 95.73
13 | auc-roc score = 0.9576648841354723
14 | saved model: https://drive.google.com/file/d/11Z52Hn2pwiXj4vPft6hpV6737ZK2U16p/view?usp=drive_link
15 | confusion_matrix : https://drive.google.com/file/d/1ExV8fwnp0upCLOFYTp5gKbwIEx5tVSB5/view?usp=sharing
16 |
--------------------------------------------------------------------------------
/Task4_solutions/Piyush/IIT2022020.txt:
--------------------------------------------------------------------------------
1 | colab file link = https://colab.research.google.com/drive/1VrFbwIkiqfCKxcfCwrcvfhrtNA-1-hcw#scrollTo=4aajVokQsBec
2 |
3 | 0.99141526222229
4 |
5 | model drive link = https://drive.google.com/file/d/1cxnRnH0AtcQzoNIDhn0dJ2ZxE2XtWAgc/view?usp=drive_link
--------------------------------------------------------------------------------
/Task4_solutions/Piyush/resnet_model_graph.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/Task4_solutions/Piyush/resnet_model_graph.jpg
--------------------------------------------------------------------------------
/Task4_solutions/Piyush/resnet_model_graph_2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/Task4_solutions/Piyush/resnet_model_graph_2.jpg
--------------------------------------------------------------------------------
/Task4_solutions/Tej-as1/Tej-as1.txt:
--------------------------------------------------------------------------------
1 | https://colab.research.google.com/drive/1GnuT5aKkUjqoZQx8Y7ydLsxGQ5ESa5ge?usp=sharing
--------------------------------------------------------------------------------
/Task4_solutions/atharva0192/ConfusionMatrix.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/Task4_solutions/atharva0192/ConfusionMatrix.png
--------------------------------------------------------------------------------
/Task4_solutions/atharva0192/Graphs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/Task4_solutions/atharva0192/Graphs.png
--------------------------------------------------------------------------------
/Task4_solutions/atharva0192/ROC-AUC_score.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/Task4_solutions/atharva0192/ROC-AUC_score.png
--------------------------------------------------------------------------------
/Task4_solutions/atharva0192/atharva0192.txt:
--------------------------------------------------------------------------------
1 | ROC-AUC score -- 1.0
2 | https://colab.research.google.com/drive/1uq8ypUXrsiD1yvLCON_1Wp2dfsQJ07JP?usp=sharing
--------------------------------------------------------------------------------
/Task4_solutions/atharva0192/model.txt:
--------------------------------------------------------------------------------
1 | https://drive.google.com/file/d/1jgM0k6THvCw5e-lI4b7vn0A28xu5A9Cr/view?usp=drive_link
--------------------------------------------------------------------------------
/Task4_solutions/sarthakvermaa/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/Task4_solutions/sarthakvermaa/1.png
--------------------------------------------------------------------------------
/Task4_solutions/sarthakvermaa/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/Task4_solutions/sarthakvermaa/2.png
--------------------------------------------------------------------------------
/Task4_solutions/sarthakvermaa/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/Task4_solutions/sarthakvermaa/3.png
--------------------------------------------------------------------------------
/Task4_solutions/sarthakvermaa/sarthakvermaa.txt:
--------------------------------------------------------------------------------
1 | https://colab.research.google.com/drive/16jzSGHbqtDtLLsVT5-FsCS2twwFeOcG8?usp=sharing
2 | ROC AUC for test data: 0.9831
3 | model:
4 | https://drive.google.com/file/d/1Ik1TGAl-0ZVZwY_cAW12ESiG4pOeDBhu/view?usp=sharing
5 |
--------------------------------------------------------------------------------
/Task4_solutions/tonyStark-Jr.txt:
--------------------------------------------------------------------------------
1 | File link: https://colab.research.google.com/drive/1YVqfboLjMG_95hyDwgftmGZqgobMPMg6?usp=sharing
2 |
--------------------------------------------------------------------------------
/Task4_solutions/trial.txt.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/Task4_solutions/trial.txt.txt
--------------------------------------------------------------------------------
/atharva0192/ConfusionMatrix.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/atharva0192/ConfusionMatrix.png
--------------------------------------------------------------------------------
/atharva0192/Graphs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opencodeiiita/Medical-Image-Classification/e37ed1f7e43449754dbb28e3e5b695a65e9b8353/atharva0192/Graphs.png
--------------------------------------------------------------------------------
/atharva0192/Link.txt:
--------------------------------------------------------------------------------
1 | https://medicalimageclassification.streamlit.app
2 |
3 |
4 | repo link -- https://github.com/atharva0192/MedicalImageClassification
5 |
--------------------------------------------------------------------------------
/atharva0192/app.py:
--------------------------------------------------------------------------------
1 | import streamlit as st
2 | import tensorflow as tf
3 | import base64
4 | import time
5 | from PIL import Image
6 | import numpy as np
7 | import json
8 | import requests
9 | from streamlit_lottie import st_lottie
10 |
11 | url = requests.get(
12 | "https://lottie.host/0ea6f299-fe52-414e-8063-f54283c7c577/YTa5T7FZRz.json")
13 | # Creating a blank dictionary to store JSON file,
14 | # as their structure is similar to Python Dictionary
15 | url_json = dict()
16 |
17 | back = requests.get(
18 | "https://lottie.host/dc8eb2d2-dc26-4bff-a908-20668f49437a/7rui3mxxXI.json")
19 | # Creating a blank dictionary to store JSON file,
20 | # as their structure is similar to Python Dictionary
21 | back_json = dict()
22 |
23 | if url.status_code == 200:
24 | url_json = url.json()
25 | else:
26 | print("Error in the URL")
27 |
28 | if back.status_code == 200:
29 | back_json = back.json()
30 | else:
31 | print("Error in the URL")
32 | # Load the saved model
33 | model = tf.keras.models.load_model('MyCNN.h5')
34 |
35 | # Define a function for model inference
36 | def predict(image):
37 | # Open and preprocess the image
38 | img = Image.open(image).convert('RGB') # Ensure the image is in RGB format
39 | img = img.resize((256, 256)) # Resize the image to match the model input size
40 | img_array = np.array(img) # Convert the image to a NumPy array
41 | img_array = img_array / 255.0 # Normalize pixel values to the range [0, 1]
42 | img_array = np.expand_dims(img_array, axis=0) # Add a batch dimension
43 |
44 | # Make predictions using the loaded model
45 | predictions = model.predict(img_array)
46 |
47 | return predictions
48 |
49 | # Streamlit app code
50 | st.set_page_config(
51 | page_title="Classification of Medical X-Rays",
52 | layout="centered",
53 | initial_sidebar_state="expanded",
54 | )
55 |
56 | # Sidebar
57 | with st.sidebar:
58 | st_lottie(back_json ,
59 | height=350,
60 | width=350)
61 | st.sidebar.title("Classification of Medical X-Rays")
62 | st.sidebar.write(
63 | "In recent years, the intersection of medical imaging and deep learning has witnessed unprecedented advancements, revolutionizing the landscape of healthcare. One notable application that has gained substantial attention is medical image classification using Convolutional Neural Networks (CNNs). As we embark on this project, we delve into the realm of leveraging cutting-edge deep learning techniques to augment traditional medical image analysis"
64 | )
65 | st.markdown(
66 | f'''
67 |
72 | ''',
73 | unsafe_allow_html=True
74 | )
75 |
76 | # Main content
77 |
78 | st.title("Classification of Medical X-Rays")
79 |
80 | uploaded_file = st.file_uploader("Choose an image...", type="jpg")
81 |
82 | if uploaded_file is not None:
83 | # Display the uploaded image with border
84 | st.image(uploaded_file, caption="Uploaded Image", use_column_width=True, output_format="JPEG")
85 |
86 | # Perform prediction
87 | if st.button("Predict"):
88 | result = predict(uploaded_file)
89 | progress_bar = st.progress(0)
90 | status_text = st.empty()
91 |
92 |
93 | for i in range(100):
94 | progress_bar.progress(i + 1)
95 | status_text.text(f'Progress: {i}%')
96 | time.sleep(0.00)
97 |
98 | status_text.text('Done!')
99 |
100 | # Display the prediction results
101 | st.write("Prediction Results:")
102 | prediction_label = "Normal" if result >= 0.5 else "Infected"
103 | if prediction_label == "Normal":
104 | st.balloons()
105 | st.success(f"The image is predicted as {prediction_label}")
106 | else :
107 | st.snow()
108 | st.warning(f'Warning : The image is predicted as {prediction_label}', icon="⚠️")
109 |
110 | expander = st.expander("View Training , Validation and Testing Results")
111 | expander.write("Following are the results : ")
112 | expander.write("Confusion Matrix: ")
113 | expander.image("./ConfusionMatrix.png", use_column_width=True)
114 | expander.write("Graphs: ")
115 | expander.image("./Graphs.png", use_column_width=True)
116 |
117 | # Footer
118 | st.markdown("---")
119 | st.write("Developed by Atharva Chavan")
120 | st.write("Copyright © 2023. All rights reserved.")
--------------------------------------------------------------------------------
/atharva0192/requirements.txt:
--------------------------------------------------------------------------------
1 | streamlit
2 | tensorflow
3 | Pillow
4 | numpy
5 |
--------------------------------------------------------------------------------