{"id":23685037,"url":"https://github.com/simplecyber/fruit_classification-ieee","last_synced_at":"2026-04-28T01:33:24.327Z","repository":{"id":268217046,"uuid":"903672850","full_name":"SimpleCyber/Fruit_Classification-IEEE","owner":"SimpleCyber","description":"Image classification : Detecting the fresh and spoiled fruits for the IEEE event.","archived":false,"fork":false,"pushed_at":"2024-12-15T08:45:43.000Z","size":2191,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-29T20:51:48.226Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SimpleCyber.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-15T08:44:28.000Z","updated_at":"2024-12-21T01:53:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"abb91ebd-1ba5-4fa1-a9c2-0fa8b9efe3bb","html_url":"https://github.com/SimpleCyber/Fruit_Classification-IEEE","commit_stats":null,"previous_names":["simplecyber/ieeecgh","simplecyber/fruit_classification-ieee"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimpleCyber%2FFruit_Classification-IEEE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimpleCyber%2FFruit_Classification-IEEE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimpleCyber%2FFruit_Classification-IEEE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimpleCyber%2FFruit_Classification-IEEE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SimpleCyber","download_url":"https://codeload.github.com/SimpleCyber/Fruit_Classification-IEEE/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239742366,"owners_count":19689307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-29T20:51:32.113Z","updated_at":"2026-04-28T01:33:24.312Z","avatar_url":"https://github.com/SimpleCyber.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🍎 Fruit Quality Detector: Technical Architecture \u0026 Dual-Engine AI\n\n[![Python](https://img.shields.io/badge/Python-3.10-blue.svg)](https://www.python.org/)\n[![TensorFlow](https://img.shields.io/badge/TensorFlow-2.15.0-orange.svg)](https://tensorflow.org/)\n[![Streamlit](https://img.shields.io/badge/Streamlit-App-red.svg)](https://streamlit.io/)\n\n---\n\n## 📖 Introduction\nThe **Fruit Quality Detector** is a high-performance computer vision application. It solves the critical task of distinguishing between **Good** and **Spoiled** produce by analyzing visual features such as skin texture, color uniformity, and surface defects.\n\n---\n\n## 🧠 Core Concept: Convolutional Neural Networks (CNN)\n\n### **What is a CNN?**\nA **Convolutional Neural Network** is a deep learning architecture inspired by the human visual cortex. Unlike standard neural networks that see images as a flat list of pixels, a CNN understands **spatial hierarchies** (edges → shapes → objects).\n\n#### **The 4 Key Layers in our CNN:**\n1.  **Convolutional Layer**: Uses \"filters\" to scan the image. It acts like a magnifying glass looking for specific patterns (like a brown spot on an apple).\n2.  **Activation (ReLU)**: Adds non-linearity. It decides which features are \"important\" enough to pass to the next layer.\n3.  **Pooling (Max Pooling)**: Reduces the image size while keeping the most important information. This makes the model faster and more robust to image rotation.\n4.  **Dense (Fully Connected)**: The final \"brain\" that takes all the extracted features and makes the final decision: *Is this a good orange or a spoiled one?*\n\n---\n\n## 🏛️ Custom Model: MobileNetV2 Backbone\n\n### **What is a \"Backbone\"?**\nIn deep learning, a **Backbone** is a pre-trained model that acts as a \"Feature Extractor.\" We use **MobileNetV2** as our backbone. It has already \"seen\" millions of images (ImageNet) and knows how to recognize shapes, colors, and textures.\n\n*   **Why MobileNetV2?**: It is designed for speed. It uses *Depthwise Separable Convolutions* to provide high accuracy while using very little memory.\n*   **The Custom Head**: We removed the original classification layer of MobileNetV2 and added our own **Custom Layers** (Dense, Dropout, Softmax) to specifically detect fruit quality.\n\n---\n\n## 🧬 ResNet-50: Residual Architecture\n\n### **Advanced Architecture Breakdown**\nResNet (Residual Network) is famous for its **Skip Connections**. \n\nStandard networks try to learn the full mapping $H(x)$. ResNet instead learns the \"Residual\" $F(x) = H(x) - x$. This allows the network to effectively \"bypass\" layers if they aren't helping, which prevents the **Vanishing Gradient Problem** (where the model stops learning because it's too deep).\n\n#### **ResNet-50 Data Flow Diagram**\n```mermaid\ngraph TD\n    subgraph \"Phase 1: Stem\"\n    In[\"Input (224x224x3)\"] --\u003e C1[\"7x7 Conv (64 Filters)\"]\n    C1 --\u003e BN1[\"Batch Norm + ReLU\"]\n    BN1 --\u003e MP1[\"3x3 Max Pool\"]\n    end\n\n    subgraph \"Phase 2: Residual Stages\"\n    MP1 --\u003e S1[\"Stage 1: 3x Bottleneck Blocks\"]\n    S1 --\u003e S2[\"Stage 2: 4x Bottleneck Blocks\"]\n    S2 --\u003e S3[\"Stage 3: 6x Bottleneck Blocks\"]\n    S3 --\u003e S4[\"Stage 4: 3x Bottleneck Blocks\"]\n    end\n\n    subgraph \"Phase 3: Classification Head\"\n    S4 --\u003e GAP[\"Global Average Pooling\"]\n    GAP --\u003e FC[\"Fully Connected (1000 units)\"]\n    FC --\u003e SM[\"Softmax (Probabilities)\"]\n    end\n\n    style In fill:#f9f9f9,stroke:#333\n    style SM fill:#dcedc8,stroke:#33691e,stroke-width:2px\n```\n\n---\n\n## 📊 Models Table: Side-by-Side\n\n| Feature | Custom CNN (MobileNetV2) | ResNet-50 |\n| :--- | :--- | :--- |\n| **Logic** | Specialized Fine-Tuning | Pre-trained Generalist |\n| **Architecture** | Depthwise Separable Conv | Residual Skip Connections |\n| **Primary Goal** | **Fruit Freshness** | **General Object Identity** |\n| **Performance** | High Accuracy on this Dataset | Baseline Comparisons |\n\n---\n\n## 🚀 Setup \u0026 Execution\n\n\u003e [!NOTE]\n\u003e Ensure you have **TensorFlow 2.15.0** installed for maximum compatibility with the `.h5` model files.\n\n```bash\n# Install dependencies\npip install -r requirements.txt\n\n# Start the Streamlit server\nstreamlit run app.py\n```\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eDeveloped for professional fruit quality assessment using Deep Learning.\u003c/b\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplecyber%2Ffruit_classification-ieee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimplecyber%2Ffruit_classification-ieee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplecyber%2Ffruit_classification-ieee/lists"}