{"id":26454494,"url":"https://github.com/techiesamosa/image_classification_deccanai","last_synced_at":"2026-04-13T05:39:05.501Z","repository":{"id":281354987,"uuid":"945018872","full_name":"TechieSamosa/Image_Classification_DeccanAI","owner":"TechieSamosa","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-08T14:19:43.000Z","size":118,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-08T14:28:23.843Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TechieSamosa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2025-03-08T13:21:38.000Z","updated_at":"2025-03-08T14:19:47.000Z","dependencies_parsed_at":"2025-03-08T14:39:30.052Z","dependency_job_id":null,"html_url":"https://github.com/TechieSamosa/Image_Classification_DeccanAI","commit_stats":null,"previous_names":["techiesamosa/image_classification_deccanai"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechieSamosa%2FImage_Classification_DeccanAI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechieSamosa%2FImage_Classification_DeccanAI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechieSamosa%2FImage_Classification_DeccanAI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechieSamosa%2FImage_Classification_DeccanAI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TechieSamosa","download_url":"https://codeload.github.com/TechieSamosa/Image_Classification_DeccanAI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244297889,"owners_count":20430347,"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":"2025-03-18T19:57:47.117Z","updated_at":"2025-12-31T00:14:01.838Z","avatar_url":"https://github.com/TechieSamosa.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Image Classification Project\n\n**Author**: Aditya Khamitkar  \n**Email**: [khamitkaraditya@gmail.com](mailto:khamitkaraditya@gmail.com)  \n**Assessment for**: Soul AI by Deccan AI  \n\n---\n\n## Overview\nThis project demonstrates an end-to-end image classification pipeline using **TensorFlow**, **FastAPI**, and **Streamlit** on the **Fashion MNIST** dataset. It includes:\n\n1. **Jupyter Notebook** (`Image_Classification.ipynb`) for model training and evaluation.\n2. **FastAPI backend** (`app.py`) serving a `/predict` endpoint.\n3. **Streamlit frontend** (`frontend.py`) for easy interaction.\n4. **Authentication module** (`auth.py`) for secure API access.\n5. **Docker support** for easy deployment.\n6. **Comprehensive documentation** (`report.md`).\n\nThis project is part of an assessment for **Soul AI** by **Deccan AI**.\n\n---\n\n## Project Structure\n\n```\n├── app\n│   ├── app.py          # FastAPI backend\n│   ├── auth.py         # Authentication module\n│   ├── frontend.py     # Streamlit frontend\n│   ├── requirements.txt # Dependencies\n├── Notebook\n│   └── Image_Classification.ipynb # Model training \u0026 evaluation\n├── model\n│   └── final_model.h5  # Trained model\n├── .gitignore\n├── Dockerfile\n├── LICENSE\n├── README.md\n└── report.md\n```\n\n### Key Components\n\n#### **1. `Image_Classification.ipynb`**\n- Loads **Fashion MNIST dataset**.\n- Preprocesses and augments images.\n- Builds and trains a **CNN model**.\n- Saves the trained model in `.h5` format.\n\n#### **2. `app.py` (FastAPI Backend)**\n- Loads the saved model.\n- Implements the `/predict` endpoint.\n- Accepts images via `POST` requests.\n- Returns prediction results (class + confidence score).\n\n#### **3. `auth.py` (Authentication Module)**\n- Implements **Bearer Token authentication**.\n- Restricts access to the API.\n\n#### **4. `frontend.py` (Streamlit UI)**\n- Provides a simple UI to upload images.\n- Calls the `/predict` API.\n- Displays the **predicted class \u0026 confidence score**.\n\n#### **5. `Dockerfile` (Containerization)**\n- Containerizes the FastAPI application.\n- Installs dependencies and exposes port `8000`.\n\n#### **6. `report.md` (Documentation)**\n- Summarizes **data preprocessing, model selection, training, and deployment**.\n- Discusses potential improvements (e.g., transfer learning, cloud deployment).\n\n---\n\n## Installation \u0026 Setup\n\n### **1️⃣ Clone the Repository**\n```bash\ngit clone https://github.com/TechieSamosa/Image_Classification_DeccanAI.git\ncd Image_Classification_DeccanAI\n```\n\n### **2️⃣ Install Dependencies**\n```bash\npip install -r requirements.txt\n```\n\n### **3️⃣ Run the Jupyter Notebook** *(Optional for retraining)*\n```bash\njupyter notebook Notebook/Image_Classification.ipynb\n```\n- This step is **only necessary** if you want to **retrain the model**.\n\n### **4️⃣ Start the FastAPI Server**\n```bash\nuvicorn app:app --reload\n```\n- The API will be available at `http://127.0.0.1:8000`.\n\n### **5️⃣ Run the Streamlit Frontend**\n```bash\nstreamlit run frontend.py\n```\n- Visit `http://localhost:8501` to upload images \u0026 get predictions.\n\n---\n\n## Authentication (Bearer Token)\n\nTo make API requests, you **must** provide a valid authentication token.\n\n#### **Example: cURL Request with Token**\n```bash\ncurl -X POST -H \"Authorization: Bearer mysecuretoken\" \\\n     -F \"file=@path_to_image.jpg\" \\\n     http://127.0.0.1:8000/predict\n```\n\n---\n\n## Running with Docker\n\n### **1️⃣ Build the Docker Image**\n```bash\ndocker build -t image-classification .\n```\n\n### **2️⃣ Run the Container**\n```bash\ndocker run -p 8000:8000 image-classification\n```\n\n- The **FastAPI app** will be available at `http://127.0.0.1:8000`.\n- To access the **frontend**, run Streamlit separately.\n\n---\n\n## Debugging \u0026 Troubleshooting\n\n| **Issue** | **Possible Cause \u0026 Fix** |\n|-----------|--------------------------|\n| **No response / app hangs** | The FastAPI backend (`uvicorn`) might not be running. Run: `uvicorn app:app --reload` |\n| **403: Forbidden** | Ensure `Authorization` header in `frontend.py` has `Bearer mysecuretoken`. |\n| **500: Internal Server Error** | Model input might not match. Try printing `processed_image.shape` before `model.predict()`. |\n| **404: Not Found** | Check if the API URL is correct in `frontend.py` (`http://127.0.0.1:8000/predict`). |\n\n---\n\n## Future Improvements\n- **Use Transfer Learning**: Models like MobileNetV2 or EfficientNet can improve accuracy.\n- **Grad-CAM Visualization**: Implement Grad-CAM to interpret model predictions.\n- **Deploy on Cloud**: AWS, GCP, or Azure for scalability.\n- **Improve Authentication**: Use OAuth2 or JWT instead of a static token.\n- **Enhance UI**: Add drag-and-drop, batch uploads, and result history.\n\n---\n\n## Contributing\nFeel free to open issues or submit pull requests. This is a demonstration project, so any improvements or new ideas are welcome.\n\n---\n\n## License\nThis project is licensed under the terms of the [MIT License](LICENSE).\n\n---\n\n### **Author**\n**Aditya Khamitkar**  \n[khamitkaraditya@gmail.com](mailto:khamitkaraditya@gmail.com)\n\n---\n\n## Special Notes\n- This project is part of an **Assessment for Soul AI by Deccan AI**.\n- For production use, **secure credentials properly** (avoid hardcoding).\n- Future enhancements may include **cloud deployment, improved UI, and deeper model analysis**.\n\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechiesamosa%2Fimage_classification_deccanai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechiesamosa%2Fimage_classification_deccanai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechiesamosa%2Fimage_classification_deccanai/lists"}