Rahuletto commited on
Commit
0075336
·
1 Parent(s): 6fdc829

chore: README contents

Browse files
README.md ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CNN with CIFAR-10
2
+
3
+ A PyTorch implementation of a Convolutional Neural Network (CNN) for image classification on the CIFAR-10 dataset, achieving **81.45% test accuracy**.
4
+
5
+ ## Architecture
6
+
7
+ ![CNN Architecture](benchmarks/architecture.png)
8
+
9
+ The CNN model consists of
10
+ ### Convolutional Layers:
11
+ - **Conv1**: 3 → 32 channels, 3x3 kernel, padding=1
12
+ - **Conv2**: 32 → 64 channels, 3x3 kernel, padding=1
13
+ - **Conv3**: 64 → 128 channels, 3x3 kernel, padding=1
14
+
15
+ ### Others
16
+ - **Batch Normalization** after each convolutional layer
17
+ - **MaxPooling2D** (2x2) for downsampling
18
+ - **ReLU** activation functions
19
+ - **Fully Connected Layers**: 2048 → 512 → 10
20
+ - **Dropout** (50%) for regularization
21
+
22
+
23
+ ## Getting Started
24
+
25
+ ### Prerequisites
26
+ - Python 3.12+
27
+ - PyTorch 2.7.1+
28
+ - torchvision 0.22.1+
29
+
30
+ > [!TIP]
31
+ > This project was developed with `uv`, so it is best to use `uv` for project management.
32
+
33
+ ### Installation
34
+
35
+ 1. **Clone the repository:**
36
+ ```bash
37
+ git clone https://github.com/rahuletto/cnn
38
+ cd CNN
39
+ ```
40
+
41
+ 2. **Create virtual environment:**
42
+ ```bash
43
+ python -m venv .venv
44
+ source .venv/bin/activate # On Windows: .venv\Scripts\activate
45
+ ```
46
+
47
+ 3. **Install dependencies:**
48
+ ```bash
49
+ pip install -r requirements.txt
50
+ ```
51
+
52
+
53
+ ## Training Configuration
54
+
55
+ - **Optimizer**: Adam (lr=0.001)
56
+ - **Batch Size**: 64
57
+ - **Epochs**: 50
58
+
59
+ > Best model checkpoint was saved at epoch 49 with validation loss of 0.6553.
60
+
61
+
62
+ ## Performance
63
+
64
+ ![Training Loss](benchmarks/loss.png)
65
+ Reaching 0.7227 in Train loss and 0.6557 in Validation loss at epoch 50
66
+
67
+
68
+ ### Accuracy:
69
+
70
+ Total Accuracy: `81.45%`
71
+ - **Airplane**: `84.60%`
72
+ - **Automobile**: `93.20%`
73
+ - **Bird**: `76.90%`
74
+ - **Cat**: `69.70%`
75
+ - **Deer**: `77.20%`
76
+ - **Dog**: `64.00%`
77
+ - **Frog**: `89.30%`
78
+ - **Horse**: `82.10%`
79
+ - **Ship**: `89.60%`
80
+ - **Truck**: `87.90%`
81
+
82
+ ![Accuracy Benchmark](benchmarks/accuracy.png)
83
+
84
+ ---
85
+
86
+ ## References
87
+
88
+ - [CIFAR-10 Dataset](https://www.cs.toronto.edu/~kriz/cifar.html)
89
+ - [PyTorch Documentation](https://pytorch.org/docs/)
90
+ - [Convolutional Neural Networks for Visual Recognition (CS231n)](http://cs231n.stanford.edu/)
91
+ - [Deep Learning Book - Ian Goodfellow](https://www.deeplearningbook.org/)
92
+
93
+ ## License
94
+
95
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
benchmarks/accuracy.png ADDED

Git LFS Details

  • SHA256: 5c9901490f0a421f25f1b29b04ed6ef681ba2dfed532d48ab42017796ab694a2
  • Pointer size: 130 Bytes
  • Size of remote file: 35.4 kB
benchmarks/architecture.png ADDED

Git LFS Details

  • SHA256: a9c676a7529a19f4be79783379050c409aff94307f8279e21af03e7cebea17e5
  • Pointer size: 130 Bytes
  • Size of remote file: 51.8 kB
benchmarks/classes.png ADDED

Git LFS Details

  • SHA256: 6f49909a0de09f1b957cc168565f81d25348c60c58982baed47713067d6eddf1
  • Pointer size: 130 Bytes
  • Size of remote file: 96.7 kB
benchmarks/loss.png ADDED

Git LFS Details

  • SHA256: b89afe7f818fbdbf80a1000f89ca4ceb0d445fd6da5652de61f6198e1fd95912
  • Pointer size: 130 Bytes
  • Size of remote file: 50.4 kB