|
|
--- |
|
|
license: mit |
|
|
datasets: AllenTAN/image_sentiment |
|
|
base_model: google/efficientnet-b2 |
|
|
--- |
|
|
|
|
|
# EfficientNet B2 Image Classification |
|
|
|
|
|
This project implements an image classification model using the EfficientNet B2 architecture, fine-tuned on a custom dataset. It provides a modular and easy-to-use structure for training and evaluating the model. |
|
|
Dataset used: AllenTAN/image_sentiment |
|
|
|
|
|
## Project Structure |
|
|
|
|
|
``` |
|
|
project_root/ |
|
|
β |
|
|
βββ data/ |
|
|
β βββ train/ |
|
|
β βββ test/ |
|
|
β |
|
|
βββ src/ |
|
|
β βββ __init__.py |
|
|
β βββ data_setup.py |
|
|
β βββ train_and_test.py |
|
|
β βββ model.py |
|
|
β |
|
|
βββ main.py |
|
|
βββ requirements.txt |
|
|
βββ README.md |
|
|
``` |
|
|
|
|
|
- `data/`: Contains the training and testing datasets. |
|
|
- `src/`: Source code for the project. |
|
|
- `main.py`: The entry point of the project. |
|
|
|
|
|
## Setup |
|
|
|
|
|
1. Clone the repository: |
|
|
|
|
|
``` |
|
|
git clone https://github.com/brepositorium/effnetb2-sentiment-analysis.git |
|
|
cd effnetb2-sentiment-analysis |
|
|
``` |
|
|
|
|
|
2. Create a virtual environment and activate it: |
|
|
|
|
|
``` |
|
|
python -m venv venv |
|
|
source venv/bin/activate # On Windows, use `venv\Scripts\activate` |
|
|
``` |
|
|
|
|
|
3. Install the required packages: |
|
|
``` |
|
|
pip install -r requirements.txt |
|
|
``` |
|
|
|
|
|
## Usage |
|
|
|
|
|
To train the model, run: |
|
|
|
|
|
``` |
|
|
python main.py |
|
|
``` |
|
|
|
|
|
This will start the training process using the EfficientNet B2 model on your dataset. The script will output training progress and final results. |
|
|
|
|
|
## Customization |
|
|
|
|
|
- Edit `src/model.py` to experiment with different model architectures or layer configurations. |
|
|
- Adjust data augmentation in `src/data_setup.py` if needed. |
|
|
|
|
|
## Results |
|
|
|
|
|
After training, the model will output training and validation accuracy and loss. You can find these results printed in the console output. |
|
|
|
|
|
## Contributing |
|
|
|
|
|
Feel free to open issues or submit pull requests if you have suggestions for improvements or encounter any problems. |
|
|
|
|
|
## License |
|
|
|
|
|
MIT License |