https://github.com/hendhamdi/deep_learning-cnn-master.github.io
Image Classification with a Convolutional Neural Network (CNN)
https://github.com/hendhamdi/deep_learning-cnn-master.github.io
classification-algorithm cnn deep-learning python testing training
Last synced: 9 months ago
JSON representation
Image Classification with a Convolutional Neural Network (CNN)
- Host: GitHub
- URL: https://github.com/hendhamdi/deep_learning-cnn-master.github.io
- Owner: hendhamdi
- Created: 2023-12-19T13:33:39.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-14T13:12:14.000Z (over 1 year ago)
- Last Synced: 2025-01-09T11:20:01.478Z (over 1 year ago)
- Topics: classification-algorithm, cnn, deep-learning, python, testing, training
- Language: Python
- Homepage:
- Size: 83.8 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Image Classification with a Convolutional Neural Network (CNN)
## Description
This project uses PyTorch to create, train, and evaluate a convolutional neural network (CNN) for image classification. The dataset is split into training (80%) and testing (20%) sets, and metrics such as loss and accuracy are tracked to analyze the model's performance.
## Features
**Data Splitting** : Splitting the dataset into training (80%) and testing (20%) sets using `split.py` script.
- **CNN Model** : Construction of a network with convolutional layers, normalization, activation (ReLU), pooling, and a fully connected layer for classification.
- **Advanced Optimization** : Implementation of the SGD (Stochastic Gradient Descent) algorithm with hyperparameter tuning such as learning rate and momentum.
- **Performance Analysis** : Tracking metrics across epochs, including loss and accuracy.
- **Visualization** : Generation of a graph illustrating loss and accuracy over epochs, saved as a PDF.
## Dataset
The dataset contains the following classes:
- Annual Crop
- Forest
- River
- Sea Lake
- Highway
- Industrial
- Pasture
- Permanent Crop
- Residential
- Herbaceous Vegetation
## Dependencies
Ensure the following libraries are installed:
- Python 3.x
- PyTorch
- Matplotlib
- Scikit-learn
- MySQL (if additional storage is needed)
## Usage
### Data Splitting
The `split.py` script in the `other` directory splits the dataset into training and testing sets:
```python
from sklearn.model_selection import train_test_split
An example of usage is included in the script.
### Model Training
. Training Phase : Adjusting weights through backpropagation.
.Testing Phase : Evaluating the model's ability to generalize.
## Results
.Final Accuracy : 85% (training), 81% (testing).
.Observed Trends : Progressive decrease in loss, consistent increase in accuracy.
## Visualization
A graph illustrating loss and accuracy across epochs is generated and saved as a PDF.

