This intelligent Date Classification System leverages state-of-the-art deep learning techniques to accurately distinguish between two premium date varieties: Ajwa and Medjool. The project combines machine learning with an intuitive web interface, making date identification accessible to consumers, retailers, and agricultural professionals.
- Consumer Education: Help consumers identify authentic date varieties when shopping
- Quality Control: Assist retailers and distributors in verifying date authenticity
- Agricultural Research: Support researchers studying date fruit characteristics
- Educational Tool: Demonstrate practical applications of computer vision in agriculture
- Food Industry: Aid in automated sorting and quality assessment processes
- High-Accuracy Classification: AI-powered image recognition with trained CNN model
- User-Friendly Web Interface: Interactive Streamlit application for easy image upload
- Real-Time Predictions: Instant classification results with confidence scores
- Educational Content: Detailed information about both date varieties
- Mobile-Friendly: Responsive design works on desktop and mobile devices
- Sample Images: Pre-loaded test images for trying the system immediately
- Python 3.x: Primary programming language
- TensorFlow: Deep learning framework for CNN model
- Streamlit: Web application framework for the interactive interface
- NumPy: Numerical computing library
- PIL (Pillow): Python Imaging Library for image processing
- Jupyter Notebook: Development environment for model training
- Architecture: Convolutional Neural Network (CNN)
- Framework: TensorFlow/Keras
- Input Size: 256x256x3 (RGB images)
- Model File:
Date_Mode.h5(pre-trained model) - Classes: Binary classification (Ajwa vs Medjool)
streamlit
tensorflow
numpy
pillow
The model is trained on the UCI Machine Learning Repository dataset:
- Dataset Name: Ajwa or Medjool Date Classification
- Source: UCI ML Repository
- Classes: 2 (Ajwa and Medjool dates)
- Format: High-resolution JPG images
- Split: 80% training, 20% validation
The classification model is a Convolutional Neural Network (CNN) optimized for date fruit recognition:
Input Layer (256x256x3)
β
Conv2D (32 filters, 3x3) + ReLU + MaxPooling2D
β
Conv2D (64 filters, 3x3) + ReLU + MaxPooling2D
β
Conv2D (128 filters, 3x3) + ReLU + MaxPooling2D
β
Flatten Layer
β
Dense Layer (128 neurons, ReLU)
β
Output Layer (2 neurons, Softmax)
- Epochs: 10
- Optimizer: Adam
- Loss Function: Sparse Categorical Crossentropy
- Metrics: Accuracy
- Batch Size: 32
- Python 3.7 or higher
- pip package manager
-
Clone the repository
git clone https://github.com/0M3REXE/Date-Classification.git cd Date-Classification -
Install dependencies
pip install -r requirements.txt
-
Run the application
streamlit run streamlit_app.py
-
Open your browser and navigate to
http://localhost:8501
- Upload a clear JPG image of a date fruit
- Wait for the AI analysis to complete
- View the classification result with confidence score
- Learn more about the identified date variety
Try the live application: https://date-classification.streamlit.app/
Use the provided sample images or upload your own date pictures to test the classifier!
- Model Accuracy: Trained for optimal performance on date classification
- Real-time Processing: Fast inference suitable for web applications
- Confidence Scoring: Provides prediction confidence for reliability assessment
Date-Classification/
βββ streamlit_app.py # Main web application
βββ Date_Mode.h5 # Pre-trained CNN model
βββ Dates.ipynb # Model training notebook
βββ requirements.txt # Python dependencies
βββ sample Images/ # Test images
β βββ AJWA/ # Ajwa date samples
β βββ Medjool/ # Medjool date samples
βββ README.md # Project documentation
βββ LICENSE # Apache License 2.0
Origin: Medina, Saudi Arabia
- Soft, dark brown appearance with a distinctive wrinkled texture
- Rich, complex flavor with hints of honey and caramel
- Highly valued for their religious and cultural significance
- Premium quality dates often consumed during Ramadan
- Known for their nutritional benefits and antioxidant properties
Origin: Morocco (now cultivated worldwide)
- Large, plump dates often called the "King of Dates"
- Golden-brown color with a glossy, smooth skin
- Sweet, caramel-like flavor with chewy texture
- Popular in Western markets and gourmet applications
- Excellent source of fiber, potassium, and natural sugars
Contributions are welcome! Please feel free to submit issues, fork the repository, and create pull requests for any improvements.
- Model accuracy improvements
- Additional date varieties
- UI/UX enhancements
- Performance optimizations
- Documentation improvements
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- UCI Machine Learning Repository for providing the dataset
- TensorFlow and Streamlit communities for their excellent frameworks
- Contributors and users who help improve this project
β If you find this project helpful, please give it a star on GitHub!