--- title: Fresh vs Rotten Fruit Classifier emoji: 🍎 colorFrom: green colorTo: red sdk: streamlit sdk_version: "1.48.1" app_file: app_ui.py pinned: false --- # 🍎 Fresh vs Rotten Fruit Classifier An AI-powered web application that classifies fruit types and determines their freshness using a pre-trained ResNet152 model. ## 🎯 Features - **Fruit Classification**: Identifies fruit types (apple, banana, orange, etc.) - **Freshness Detection**: Determines if fruit is fresh or rotten - **Real-time Processing**: Upload images for instant AI predictions - **User-friendly Interface**: Clean Streamlit UI for easy interaction ## 🚀 How to Use 1. **Upload Image**: Click "Choose an image..." and select a fruit photo 2. **Classify**: Click the "Classify" button to analyze your image 3. **View Results**: See the predicted fruit type and freshness status ## 🤖 Model Details - **Architecture**: Multi-task ResNet152 - **Input**: 224x224 RGB images - **Outputs**: - Fruit classification (apple, banana, orange, mixed) - Freshness probability (fresh vs rotten) - **Training**: Trained on diverse fruit dataset with fresh/rotten labels ## 📊 Supported Fruits - 🍎 Apple - 🍌 Banana - 🍊 Orange - 🍇 Mixed fruits ## 💡 Use Cases - **Food Quality Control**: Assess fruit freshness in retail/storage - **Smart Agriculture**: Monitor crop quality and harvest timing - **Food Safety**: Identify potentially spoiled produce - **Educational**: Learn about AI in food technology ## 🔧 Technical Stack - **Framework**: Streamlit - **AI Model**: TensorFlow/Keras ResNet152 - **Image Processing**: PIL, NumPy - **Deployment**: Hugging Face Spaces ## 📝 Example Results Upload a fruit image and get: - **Fruit Type**: "Apple" (95.2% confidence) - **Freshness**: "Fresh" (12.3% rotten probability) Try it now with your own fruit photos! 🍓🥝🍑