@@ -12,8 +12,9 @@ In addition to classification, it integrates explainable AI techniques (Grad-CAM
1212
1313---
1414
15- ## Project Structure
15+ ## 📁 Project Structure
1616
17+ <pre ><code >
1718Digit_Classification_XAI/
1819│
1920├── config/
@@ -36,50 +37,15 @@ Digit_Classification_XAI/
3637│ └── EDA_and_Explainability.ipynb # Exploratory analysis and XAI demonstrations
3738│
3839├── checkpoints/ # Saved model weights
39- │
4040├── README.md
4141└── requirements.txt
42+ </code ></pre >
4243
43- ---
4444
45- ## Model Architecture
46-
47- ==========================================================================================
48- Layer (type: depth-idx ) Output Shape Param #
49- ==========================================================================================
50- CNNModel [ 1, 10] --
51- ├─Conv2d: 1-1 [ 1, 16, 28, 28] 160
52- ├─MaxPool2d: 1-2 [ 1, 16, 14, 14] --
53- ├─Dropout: 1-3 [ 1, 16, 14, 14] --
54- ├─Conv2d: 1-4 [ 1, 32, 14, 14] 4,640
55- ├─MaxPool2d: 1-5 [ 1, 32, 7, 7] --
56- ├─Dropout: 1-6 [ 1, 32, 7, 7] --
57- ├─Conv2d: 1-7 [ 1, 64, 7, 7] 18,496
58- ├─MaxPool2d: 1-8 [ 1, 64, 3, 3] --
59- ├─Dropout: 1-9 [ 1, 64, 3, 3] --
60- ├─Linear: 1-10 [ 1, 20] 11,540
61- ├─Linear: 1-11 [ 1, 10] 210
62- ==========================================================================================
63- Total params: 35,046
64- Trainable params: 35,046
65- Non-trainable params: 0
66- Total mult-adds (Units.MEGABYTES): 1.95
67- ==========================================================================================
68- Input size (MB): 0.00
69- Forward/backward pass size (MB): 0.18
70- Params size (MB): 0.14
71- Estimated Total Size (MB): 0.32
72- ==========================================================================================
7345---
7446
75- ## Training Summary
76-
77- Model Evaluation Summary
78- -------------------------
79- Accuracy : 0.0960
80- Precision: 0.0213
81- Recall : 0.0960
82- F1-Score : 0.0232
47+ ## Model Architecture
48+ ![ architecture] ( docs/architecture.png )
8349
8450---
8551
@@ -91,25 +57,20 @@ F1-Score : 0.0232
9157
9258** Classification Report (Macro Averages)**
9359
94- | Metric | Score |
95- | --------| --------|
96- | Accuracy | 0.956 |
97- | Precision | 0.957 |
98- | Recall | 0.956 |
99- | F1-score | 0.956 |
60+ Model Evaluation Summary
61+ -------------------------
62+ Accuracy : 0.0960
63+ Precision: 0.0213
64+ Recall : 0.0960
65+ F1-Score : 0.0232
10066
10167---
10268
10369## Explainability (Grad-CAM)
10470
10571Grad-CAM visualizations show where the CNN focuses when making predictions.
10672Misclassified samples are analyzed to understand model bias or confusion.
107-
108- | True | Pred | Visualization |
109- | ------| -------| ---------------|
110- | 0 | 8 | ![ GradCAM_0_8] ( docs/xai_0_8.png ) |
111- | 2 | 6 | ![ GradCAM_2_6] ( docs/xai_2_6.png ) |
112- | 4 | 9 | ![ GradCAM_4_9] ( docs/xai_4_9.png ) |
73+ ![ Grad-CAM] ( docs/grad-cam.png )
11374
11475---
11576
@@ -119,12 +80,14 @@ Misclassified samples are analyzed to understand model bias or confusion.
11980``` bash
12081git clone https://github.com/< your_username> /Digit_Classification_XAI.git
12182cd Digit_Classification_XAI
83+ ```
12284
12385### 2. Create environment
12486``` bash
12587conda create -n pytorch_gpu python=3.10
12688conda activate pytorch_gpu
12789pip install -r requirements.txt
90+ ```
12891
12992### 3. Train the model
13093``` bash
@@ -133,8 +96,9 @@ python -m src.main
13396# ## 4. Explore explainability in Jupyter
13497` ` ` bash
13598jupyter notebook notebooks/EDA_and_Explainability.ipynb
99+ ` ` `
136100
137- Key Features:
101+ # ### Key Features:
138102- Modular PyTorch training pipeline
139103- Config-driven architecture
140104- Integrated Grad-CAM explainability
0 commit comments