Download README.md from EnYa32/Date-Fruit-Classification-ResNet50: direct link, hf CLI and curl.
- Browser
- Download file 2.93 kB
-
https://huggingface.co/spaces/EnYa32/Date-Fruit-Classification-ResNet50/resolve/main/README.md
- Command line
-
hf download hf://spaces/EnYa32/Date-Fruit-Classification-ResNet50/README.md
-
curl -L -o README.md https://huggingface.co/spaces/EnYa32/Date-Fruit-Classification-ResNet50/resolve/main/README.md
A newer version of the Streamlit SDK is available: 1.67.0
title: DateFruitClassifierResNet50
emoji: π΄
colorFrom: gray
colorTo: green
sdk: streamlit
app_file: src/streamlit_app.py
pinned: false
short_description: Date fruit image classifier app using ResNet50.
license: mit
π¦ Date Fruit Classification using ResNet50 (Transfer Learning)
π Project Summary
This project classifies different types of date fruits using deep learning.
Because the dataset is small and the fruits look very similar, I used Transfer Learning with ResNet50, a model pre-trained on ImageNet. This helped improve accuracy and reduce training time.
π― Goals
- Classify multiple date fruit types using images
- Use ResNet50 with transfer learning
- Compare model results with a CNN trained from scratch
- Evaluate with accuracy/loss curves and classification report
- Write a technical report (included as PDF)
π Results
| Model | Validation Accuracy | Validation Loss | Macro F1-score |
|---|---|---|---|
| Custom CNN (no TL) | ~90% | ~0.30 | ~0.88 |
| ResNet50 (with TL) | 94.22% | 0.1842 | 0.94 |
β Transfer Learning improved accuracy
β Model did not overfit
β Works well at classifying most types
π§ Model Used
ResNet50 (ImageNet weights, frozen) β GlobalAveragePooling2D β Dense(256, relu) β Dropout(0.5) β Dense(num_classes, softmax)
yaml Code kopieren
π§ Training Settings
| Option | Value |
|---|---|
| Optimizer | Adam (lr = 0.001) |
| Loss | sparse_categorical_crossentropy |
| Batch Size | 16 |
| Epochs | 40 |
| Validation Split | 20% |
| Callbacks | ReduceLROnPlateau, ModelCheckpoint, EarlyStopping |
π Files
π project_folder β βββ app.py # Optional Streamlit app βββ model_resnet50.keras # Trained model βββ notebook.ipynb # Training notebook βββ history_resnet50.pkl # Training history βββ resnet50_transfer_learning_report.pdf # Full report (EN + DE) βββ README.md # This file
yaml Code kopieren
π How to Use the Model
from tensorflow.keras.models import load_model
import numpy as np
from tensorflow.keras.preprocessing import image
model = load_model('model_resnet50.keras')
img = image.load_img('test_image.jpg', target_size=(224, 224))
img_array = image.img_to_array(img)
img_array = np.expand_dims(img_array, axis=0)
prediction = model.predict(img_array)
print(prediction)
π Next Steps (Optional)
Fine-tune ResNet50 (unfreeze some layers, lower learning rate)
Add more images to improve weak classes
Try class weighting
π **Download Technical Report (PDF)**
[CNN_Date_Report.pdf](./resnet50_report.pdf)
π§βπ» Author
Enes Yamac
Deep Learning Project β Transfer Learning with ResNet50
π
November 2025
π Final Note
Transfer Learning helped achieve high accuracy and reliable classification performance.