Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
756 changes: 0 additions & 756 deletions Getting Started.ipynb

This file was deleted.

77 changes: 77 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Image Classification Project

This project is a deep learning-based image classification system built with TensorFlow and Keras. It classifies images into two categories: "happy" and "sad". The workflow includes data preprocessing, model training, evaluation, and prediction.

## Project Structure

```
├── data/
│ ├── happy/
│ └── sad/
├── logs/
│ ├── train/
│ └── validation/
├── models/
│ └── imageclassifier.h5
├── notebook.ipynb
├── requirements.txt
└── venv311/
```

- **data/**: Contains subfolders for each class ("happy", "sad") with images for training and validation.
- **logs/**: Stores TensorBoard logs for training and validation.
- **models/**: Contains the saved Keras model.
- **notebook.ipynb**: Jupyter notebook with step-by-step code for data processing, model building, training, evaluation, and testing.
- **requirements.txt**: List of required Python packages.
- **venv311/**: Python virtual environment.

## Main Steps

1. **Install Dependencies**
- TensorFlow, OpenCV, Matplotlib, and other required packages.
2. **Data Cleaning**
- Remove corrupted or unsupported images.
3. **Data Loading & Preprocessing**
- Load images using `tf.keras.utils.image_dataset_from_directory`.
- Scale pixel values to [0, 1].
- Split data into training, validation, and test sets.
4. **Model Building**
- Build a CNN using Keras Sequential API.
5. **Training**
- Train the model with TensorBoard logging.
6. **Evaluation**
- Evaluate model performance using accuracy, precision, and recall.
7. **Testing**
- Test the model on new images.
8. **Saving & Loading Model**
- Save the trained model and demonstrate loading for inference.

## Usage

1. Clone the repository and navigate to the project directory.
2. (Optional) Create and activate a Python virtual environment.
3. Install dependencies:
```bash
pip install -r requirements.txt
```
4. Place your images in the `data/happy/` and `data/sad/` folders.
5. Open and run the `Getting Started.ipynb` notebook to train and test the model.

## Requirements
- Python 3.11+
- TensorFlow
- OpenCV
- Matplotlib
- NumPy

All dependencies are listed in `requirements.txt`.

## Model
- The model is a simple CNN with Conv2D, MaxPooling2D, Flatten, and Dense layers.
- Trained model is saved as `models/imageclassifier.h5`.

## Logs
- Training and validation logs are saved in the `logs/` directory for visualization with TensorBoard.

## License
This project is for educational purposes.
Binary file modified models/imageclassifier.h5
Binary file not shown.
Loading