Skip to content

Commit 633a3c4

Browse files
committed
Removed ReadMe.md and Added Explanation inside all Notebooks
1 parent 21e0788 commit 633a3c4

File tree

5 files changed

+95
-60
lines changed

5 files changed

+95
-60
lines changed

notebooks/deep_learning/CNNImageClassification/1. PreProcessing.ipynb

+48-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,45 @@
55
"id": "6a9fb5f2",
66
"metadata": {},
77
"source": [
8-
"More At : https://github.com/iSiddharth20/DeepLearning-ImageClassification-Toolkit"
8+
"## Welcome to the AI-ML-Jupyter-Notebooks repository! \n",
9+
"### This guide will help you navigate and learn CNN Image Classification using TensorFlow and OpenCV.\n",
10+
"\n",
11+
"----\n",
12+
"\n",
13+
"#### Make sure to install necessary dependencies by running this command :\n",
14+
"pip install -r requirements.txt\n",
15+
"\n",
16+
"---\n",
17+
"\n",
18+
"#### TensorFlow is Required to run this codebase.\n",
19+
"Install using the Official Guige [HERE](https://www.tensorflow.org/install/pip).\n",
20+
"\n",
21+
"---"
22+
]
23+
},
24+
{
25+
"cell_type": "markdown",
26+
"id": "e9736387-67a9-454a-8a07-402e0f20b9ac",
27+
"metadata": {},
28+
"source": [
29+
"### Understanding PreProcessing\n",
30+
"- Load Dataset from 'DATA_DIR' Directory\n",
31+
"- Creates DataFrame containing Full Paths of Images and their Class Labels\n",
32+
"- (Change as per Requirement) Rescale Images to Computationally Efficient Resolution\n",
33+
"- (Optional but Recommended) Extracts Largest Object from Image using 'image_processing' Function\n",
34+
" - Leverages Parallel Processing for Faster Results\n",
35+
"- Compares Original and Rescaled+Processed Image SIde-By-Side to make necessary changes\n",
36+
"- Converts Processed Images to NumPy Array and Exports as Pickle File\n",
37+
" - Verifies If Exported Pickle File is Appropriate through 10 Random Samples\n",
38+
"- (Optional) Merge Certain Class Lables Together\n",
39+
"- Split Data for Training, Testing, Validation with Stratify to ensure data balancing\n",
40+
" - Verify if Split is Appropriate through 2 random samples\n",
41+
"- (Optional) Perform Random Oversampling on Data to reduce Biasness\n",
42+
" - Verify if Oversampling is Appropriate through 2 random samples\n",
43+
"- Perform One-Hot-Encoding of Class Labels\n",
44+
"- Training, Testing, Validation Data and One-Hot-Encoding is Exported as Pickle Files\n",
45+
"\n",
46+
"---"
947
]
1048
},
1149
{
@@ -569,10 +607,18 @@
569607
" print('Export Unsuccessful for : OHE.pkl ') "
570608
]
571609
},
610+
{
611+
"cell_type": "markdown",
612+
"id": "3fab41a4-8ee1-4d28-aa5e-55d6596c0c4a",
613+
"metadata": {},
614+
"source": [
615+
"More At : https://github.com/iSiddharth20/DeepLearning-ImageClassification-Toolkit"
616+
]
617+
},
572618
{
573619
"cell_type": "code",
574620
"execution_count": null,
575-
"id": "0e1e3bfb-f1f8-4db6-8943-da8fce55b769",
621+
"id": "27bc0e74-0129-4052-b8c1-5649b0b500bd",
576622
"metadata": {},
577623
"outputs": [],
578624
"source": []

notebooks/deep_learning/CNNImageClassification/2. Training_CNN_ResNet50.ipynb

+24-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,23 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "bf037fe5",
5+
"id": "dd400876-f589-4f9e-8a48-326b58f26389",
66
"metadata": {},
77
"source": [
8-
"More At : https://github.com/iSiddharth20/DeepLearning-ImageClassification-Toolkit"
8+
"### Understanding Model Creating and Training of CNN ResNet50\n",
9+
"- Training, Testing, Validation Data and One-Hot-Encoding are Imported\n",
10+
" - All Data is converted to TensorFlow Format\n",
11+
"- Learning Rate Scheduler is Defined (Change If Desired) \n",
12+
"- Stochastic Gradient Descent with Momentum is Used as Optimizer (Change If Desired) \n",
13+
"- Added Data Augmentation Techniques to improve Model Learning (Change If Desired) \n",
14+
"- Base Model (CNN ResNet50) is Loded from TensorFlow Library\n",
15+
" - Custom Optimal Changes have been made to the Structure\n",
16+
" - Final Model is Compiled\n",
17+
"- Final Model is Trained\n",
18+
" - Final Model with Lowest Validation Loss is Exported as a '.h5' file\n",
19+
"- Traning Time (In Seconds) is Displayed\n",
20+
"\n",
21+
"---"
922
]
1023
},
1124
{
@@ -298,10 +311,18 @@
298311
"print('Testing : ', model.evaluate(test_dataset))"
299312
]
300313
},
314+
{
315+
"cell_type": "markdown",
316+
"id": "f7082894-40c3-49a9-85df-fe6221c5079c",
317+
"metadata": {},
318+
"source": [
319+
"More At : https://github.com/iSiddharth20/DeepLearning-ImageClassification-Toolkit"
320+
]
321+
},
301322
{
302323
"cell_type": "code",
303324
"execution_count": null,
304-
"id": "abde9303-25fa-4ea5-84d7-c946da47a59d",
325+
"id": "86eef81e-0ff9-4b6d-b6c0-b955c49b9a15",
305326
"metadata": {},
306327
"outputs": [],
307328
"source": []

notebooks/deep_learning/CNNImageClassification/3. Verification and Confusion Matrix.ipynb

+18-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "9fc5ca60",
5+
"id": "1fb9033f-927a-4954-acc6-d38357bc3fd0",
66
"metadata": {},
77
"source": [
8-
"More At : https://github.com/iSiddharth20/DeepLearning-ImageClassification-Toolkit"
8+
"### Understanding Verification and Confusion Matrix\n",
9+
"- Trained Model and One-Hot-Encoding are Imported\n",
10+
"- Entire Dataset is Run through the Trained Model to get Ground Truth of Accuracy\n",
11+
"- (Optional) Incorrectly Classified Image Files will be copied to a seprate folder with detected class label\n",
12+
"- Ground Truth Classification Confusion Matrix is Created\n",
13+
" - (Optional) Confusion Matrix can be Exported as a '.png' file\n",
14+
"\n",
15+
"---"
916
]
1017
},
1118
{
@@ -216,10 +223,18 @@
216223
"plt.show()"
217224
]
218225
},
226+
{
227+
"cell_type": "markdown",
228+
"id": "98f5ddd2-ee51-4587-bdcc-8e1fba479f43",
229+
"metadata": {},
230+
"source": [
231+
"More At : https://github.com/iSiddharth20/DeepLearning-ImageClassification-Toolkit"
232+
]
233+
},
219234
{
220235
"cell_type": "code",
221236
"execution_count": null,
222-
"id": "50710aca-1c65-4477-8387-0815faf93959",
237+
"id": "0ddd3728-6672-4a7c-a3b0-e963ee8d119d",
223238
"metadata": {},
224239
"outputs": [],
225240
"source": []

notebooks/deep_learning/CNNImageClassification/HelperFunctions.py

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
'''
2+
3+
Understanding HelperFunctions
4+
- Function to display 2 images side-by-side on screen
5+
- Function to Extract largest object from souruce image
6+
27
Source : https://github.com/iSiddharth20/DeepLearning-ImageClassification-Toolkit
38
'''
49

notebooks/deep_learning/CNNImageClassification/README..md

-52
This file was deleted.

0 commit comments

Comments
 (0)