Upload folder using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +1 -0
- README.md +84 -3
- best_model.pth +3 -0
- model.ipynb +0 -0
- requirements.txt +10 -0
- training_data/a.txt +0 -0
- training_data/clean_dataset.csv +32 -0
- training_data/dataset.csv +33 -0
- training_data/image/Untitled.jpeg +0 -0
- training_data/image/p1.jpg +0 -0
- training_data/image/p10.jpeg +0 -0
- training_data/image/p11.jpeg +0 -0
- training_data/image/p12.jpeg +0 -0
- training_data/image/p13.jpeg +0 -0
- training_data/image/p14.jpeg +0 -0
- training_data/image/p15.jpeg +0 -0
- training_data/image/p16.jpeg +0 -0
- training_data/image/p17.jpeg +0 -0
- training_data/image/p18.jpeg +0 -0
- training_data/image/p19.jpeg +0 -0
- training_data/image/p2.jpg +0 -0
- training_data/image/p20.jpeg +0 -0
- training_data/image/p21.jpeg +0 -0
- training_data/image/p22.jpeg +0 -0
- training_data/image/p23.jpeg +0 -0
- training_data/image/p24.jpeg +0 -0
- training_data/image/p25.jpeg +0 -0
- training_data/image/p26.jpeg +0 -0
- training_data/image/p27.jpeg +0 -0
- training_data/image/p28.jpeg +0 -0
- training_data/image/p29.jpeg +0 -0
- training_data/image/p3.jpeg +0 -0
- training_data/image/p3.jpg +0 -0
- training_data/image/p30.jpeg +0 -0
- training_data/image/p31.jpeg +0 -0
- training_data/image/p34.jpeg +0 -0
- training_data/image/p35.jpeg +0 -0
- training_data/image/p36.jpeg +0 -0
- training_data/image/p37.jpeg +0 -0
- training_data/image/p38.jpeg +0 -0
- training_data/image/p39.jpeg +0 -0
- training_data/image/p4.jpeg +0 -0
- training_data/image/p40.jpeg +0 -0
- training_data/image/p41.jpeg +0 -0
- training_data/image/p5.jpeg +0 -0
- training_data/image/p6.jpeg +0 -0
- training_data/image/p7.jpeg +0 -0
- training_data/image/p8.jpeg +0 -0
- training_data/image/p9.jpeg +0 -0
- webapp/__pycache__/app.cpython-313.pyc +0 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
webapp/static/source.gif filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -1,3 +1,84 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Pazham 🎯
|
| 2 |
+
A machine learning model that predicts multiple features of a banana based on its physical characteristics:
|
| 3 |
+
1. Number of seeds
|
| 4 |
+
2. Curvature (in degrees)
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
## Basic Details
|
| 8 |
+
### Team Name: (AB)²
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
### Team Members
|
| 12 |
+
- Team Lead: Atul Biju - Adi Shankara Institute of Engineering and Technology
|
| 13 |
+
- Member 2: Amal Babu - Adi Shankara Institute of Engineering and Technology
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
## Overview
|
| 17 |
+
|
| 18 |
+
This project uses a Random Forest Regressor to predict multiple banana characteristics based on various physical features. The model achieves good accuracy (R² scores > 0.80) on synthetic data and can be retrained with real-world data.
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
## Features
|
| 22 |
+
|
| 23 |
+
### Input Features
|
| 24 |
+
The model takes the following measurements as input:
|
| 25 |
+
- Length (centimeters)
|
| 26 |
+
- Width (centimeters)
|
| 27 |
+
- Weight (grams)
|
| 28 |
+
- Ripeness level (scale 1-5)
|
| 29 |
+
- Color (1=green, 2=yellow, 3=brown)
|
| 30 |
+
|
| 31 |
+
### Predictions
|
| 32 |
+
The model predicts:
|
| 33 |
+
1. Number of seeds
|
| 34 |
+
2. Curvature (degrees)
|
| 35 |
+
|
| 36 |
+
## Requirements
|
| 37 |
+
|
| 38 |
+
- Python 3.x
|
| 39 |
+
- Required packages:
|
| 40 |
+
- numpy
|
| 41 |
+
- pandas
|
| 42 |
+
- scikit-learn
|
| 43 |
+
|
| 44 |
+
## Usage
|
| 45 |
+
|
| 46 |
+
The model is implemented in a Jupyter notebook (`model.ipynb`). To use it:
|
| 47 |
+
|
| 48 |
+
1. Open `model.ipynb` in Jupyter or VS Code
|
| 49 |
+
2. Run all cells to train the model
|
| 50 |
+
3. Use the `predict_seeds()` function with your banana measurements
|
| 51 |
+
|
| 52 |
+
Example usage:
|
| 53 |
+
```python
|
| 54 |
+
predictions = predict_banana_features(
|
| 55 |
+
length=16, # cm
|
| 56 |
+
width=3.2, # cm
|
| 57 |
+
weight=130, # g
|
| 58 |
+
ripeness=4, # scale 1-5
|
| 59 |
+
color=2 # yellow
|
| 60 |
+
)
|
| 61 |
+
|
| 62 |
+
print(f"Predicted seeds: {predictions['seeds']}")
|
| 63 |
+
print(f"Predicted curvature: {predictions['curvature']}°")
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
## Model Performance
|
| 67 |
+
|
| 68 |
+
Current model metrics on synthetic data:
|
| 69 |
+
- Mean Squared Error: 0.20
|
| 70 |
+
- R² Score: 0.80
|
| 71 |
+
|
| 72 |
+
Note: These metrics are based on synthetic training data. Performance may vary with real-world data.
|
| 73 |
+
|
| 74 |
+
## Future Improvements
|
| 75 |
+
|
| 76 |
+
- Replace synthetic data with real banana measurements
|
| 77 |
+
- Add image processing to automatically extract features
|
| 78 |
+
- Implement cross-validation
|
| 79 |
+
- Add visualization of feature importance
|
| 80 |
+
- Create a simple web interface for predictions
|
| 81 |
+
|
| 82 |
+
## License
|
| 83 |
+
|
| 84 |
+
[MIT License](LICENSE)
|
best_model.pth
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a8ae069d5c491106c116b515a527e3918d3932e336a846b99cc5c78f86966472
|
| 3 |
+
size 46365583
|
model.ipynb
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
requirements.txt
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
torch>=2.7.1
|
| 2 |
+
torchvision>=0.22.1
|
| 3 |
+
Flask>=3.1.1
|
| 4 |
+
Pillow>=11.3.0
|
| 5 |
+
numpy>=2.2.6
|
| 6 |
+
pandas>=2.3.1
|
| 7 |
+
scikit-learn>=1.7.1
|
| 8 |
+
werkzeug>=3.1.3
|
| 9 |
+
opencv-python>=4.12.0
|
| 10 |
+
matplotlib>=3.10.3
|
training_data/a.txt
ADDED
|
File without changes
|
training_data/clean_dataset.csv
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
image_filename,length_cm,width_cm,weight_g,ripeness,color_code,seed_count,curvature_degrees
|
| 2 |
+
image/p4.jpeg,19.5,4.5,170.0,4,2,380,285.0
|
| 3 |
+
image/p5.jpeg,22.0,4.2,170.0,4,2,427,190.0
|
| 4 |
+
image/p6.jpeg,20.5,4.31,152.8,5,2,103,250.5
|
| 5 |
+
image/p7.jpeg,19.86,4.68,157.2,4,1,392,271.6
|
| 6 |
+
image/p8.jpeg,20.65,4.4,143.4,4,2,273,202.4
|
| 7 |
+
image/p9.jpeg,21.52,4.24,142.1,5,2,274,188.6
|
| 8 |
+
image/p11.jpeg,19.77,4.22,180.3,4,1,179,265.2
|
| 9 |
+
image/p14.jpeg,21.58,4.43,158.9,4,1,102,205.3
|
| 10 |
+
image/p15.jpeg,20.77,4.11,175.1,5,1,221,172.5
|
| 11 |
+
image/p16.jpeg,19.53,4.2,165.4,5,2,267,282.3
|
| 12 |
+
image/p17.jpeg,20.54,4.43,150.3,1,2,209,211.7
|
| 13 |
+
image/p18.jpeg,19.54,4.51,165.4,1,1,247,227.3
|
| 14 |
+
image/p19.jpeg,19.53,4.43,183.1,2,1,296,268.9
|
| 15 |
+
image/p20.jpeg,20.24,4.38,159.5,1,1,373,247.8
|
| 16 |
+
image/p21.jpeg,18.09,4.35,183.5,3,1,252,255.6
|
| 17 |
+
image/p24.jpeg,18.28,4.18,120.7,2,1,233,187.2
|
| 18 |
+
image/p25.jpeg,19.44,4.29,172.3,5,1,172,230.4
|
| 19 |
+
image/p26.jpeg,18.99,4.33,161.3,4,3,304,250.5
|
| 20 |
+
image/p27.jpeg,20.31,4.56,155.5,4,1,343,189.7
|
| 21 |
+
image/p28.jpeg,19.09,4.45,161.4,4,1,329,182.7
|
| 22 |
+
image/p29.jpeg,18.59,4.14,130.2,5,2,374,287.7
|
| 23 |
+
image/p30.jpeg,21.47,4.45,156.7,2,1,421,227.2
|
| 24 |
+
image/p31.jpeg,19.77,4.34,165.4,2,3,147,193.9
|
| 25 |
+
image/p34.jpeg,20.07,4.3,182.2,2,3,247,289.5
|
| 26 |
+
image/p35.jpeg,18.58,4.49,152.2,2,1,289,285.5
|
| 27 |
+
image/p36.jpeg,19.46,4.55,147.9,2,1,193,232.6
|
| 28 |
+
image/p37.jpeg,20.11,4.54,152.5,1,1,146,274.7
|
| 29 |
+
image/p38.jpeg,18.85,4.27,173.7,1,1,250,184.5
|
| 30 |
+
image/p39.jpeg,20.38,4.35,164.9,3,1,173,196.3
|
| 31 |
+
image/p40.jpeg,19.4,4.45,152.1,2,1,236,251.0
|
| 32 |
+
image/p41.jpeg,19.71,4.55,167.7,3,1,375,270.1
|
training_data/dataset.csv
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
image_filename,length_cm,width_cm,weight_g,ripeness,color_code,seed_count,curvature_degrees
|
| 2 |
+
image/p4.jpeg,19.5,4.5,170,4,2,380,285
|
| 3 |
+
image/p5.jpeg,22,4.2,170,4,2,427,190
|
| 4 |
+
image/p6.jpeg,20.5,4.31,152.8,5,2,103,250.5
|
| 5 |
+
image/p7.jpeg,19.86,4.68,157.2,4,1,392,271.6
|
| 6 |
+
image/p8.jpeg,20.65,4.4,143.4,4,2,273,202.4
|
| 7 |
+
image/p9.jpeg,21.52,4.24,142.1,5,2,274,188.6
|
| 8 |
+
image/p0.jpeg,19.77,4.52,172.2,5,1,175,252.4
|
| 9 |
+
image/p11.jpeg,19.77,4.22,180.3,4,1,179,265.2
|
| 10 |
+
image/p14.jpeg,21.58,4.43,158.9,4,1,102,205.3
|
| 11 |
+
image/p15.jpeg,20.77,4.11,175.1,5,1,221,172.5
|
| 12 |
+
image/p16.jpeg,19.53,4.2,165.4,5,2,267,282.3
|
| 13 |
+
image/p17.jpeg,20.54,4.43,150.3,1,2,209,211.7
|
| 14 |
+
image/p18.jpeg,19.54,4.51,165.4,1,1,247,227.3
|
| 15 |
+
image/p19.jpeg,19.53,4.43,183.1,2,1,296,268.9
|
| 16 |
+
image/p20.jpeg,20.24,4.38,159.5,1,1,373,247.8
|
| 17 |
+
image/p21.jpeg,18.09,4.35,183.5,3,1,252,255.6
|
| 18 |
+
image/p24.jpeg,18.28,4.18,120.7,2,1,233,187.2
|
| 19 |
+
image/p25.jpeg,19.44,4.29,172.3,5,1,172,230.4
|
| 20 |
+
image/p26.jpeg,18.99,4.33,161.3,4,3,304,250.5
|
| 21 |
+
image/p27.jpeg,20.31,4.56,155.5,4,1,343,189.7
|
| 22 |
+
image/p28.jpeg,19.09,4.45,161.4,4,1,329,182.7
|
| 23 |
+
image/p29.jpeg,18.59,4.14,130.2,5,2,374,287.7
|
| 24 |
+
image/p30.jpeg,21.47,4.45,156.7,2,1,421,227.2
|
| 25 |
+
image/p31.jpeg,19.77,4.34,165.4,2,3,147,193.9
|
| 26 |
+
image/p34.jpeg,20.07,4.3,182.2,2,3,247,289.5
|
| 27 |
+
image/p35.jpeg,18.58,4.49,152.2,2,1,289,285.5
|
| 28 |
+
image/p36.jpeg,19.46,4.55,147.9,2,1,193,232.6
|
| 29 |
+
image/p37.jpeg,20.11,4.54,152.5,1,1,146,274.7
|
| 30 |
+
image/p38.jpeg,18.85,4.27,173.7,1,1,250,184.5
|
| 31 |
+
image/p39.jpeg,20.38,4.35,164.9,3,1,173,196.3
|
| 32 |
+
image/p40.jpeg,19.4,4.45,152.1,2,1,236,251
|
| 33 |
+
image/p41.jpeg,19.71,4.55,167.7,3,1,375,270.1
|
training_data/image/Untitled.jpeg
ADDED
|
training_data/image/p1.jpg
ADDED
|
training_data/image/p10.jpeg
ADDED
|
training_data/image/p11.jpeg
ADDED
|
training_data/image/p12.jpeg
ADDED
|
training_data/image/p13.jpeg
ADDED
|
training_data/image/p14.jpeg
ADDED
|
training_data/image/p15.jpeg
ADDED
|
training_data/image/p16.jpeg
ADDED
|
training_data/image/p17.jpeg
ADDED
|
training_data/image/p18.jpeg
ADDED
|
training_data/image/p19.jpeg
ADDED
|
training_data/image/p2.jpg
ADDED
|
training_data/image/p20.jpeg
ADDED
|
training_data/image/p21.jpeg
ADDED
|
training_data/image/p22.jpeg
ADDED
|
training_data/image/p23.jpeg
ADDED
|
training_data/image/p24.jpeg
ADDED
|
training_data/image/p25.jpeg
ADDED
|
training_data/image/p26.jpeg
ADDED
|
training_data/image/p27.jpeg
ADDED
|
training_data/image/p28.jpeg
ADDED
|
training_data/image/p29.jpeg
ADDED
|
training_data/image/p3.jpeg
ADDED
|
training_data/image/p3.jpg
ADDED
|
training_data/image/p30.jpeg
ADDED
|
training_data/image/p31.jpeg
ADDED
|
training_data/image/p34.jpeg
ADDED
|
training_data/image/p35.jpeg
ADDED
|
training_data/image/p36.jpeg
ADDED
|
training_data/image/p37.jpeg
ADDED
|
training_data/image/p38.jpeg
ADDED
|
training_data/image/p39.jpeg
ADDED
|
training_data/image/p4.jpeg
ADDED
|
training_data/image/p40.jpeg
ADDED
|
training_data/image/p41.jpeg
ADDED
|
training_data/image/p5.jpeg
ADDED
|
training_data/image/p6.jpeg
ADDED
|
training_data/image/p7.jpeg
ADDED
|
training_data/image/p8.jpeg
ADDED
|
training_data/image/p9.jpeg
ADDED
|
webapp/__pycache__/app.cpython-313.pyc
ADDED
|
Binary file (2.38 kB). View file
|
|
|