{"id":31642258,"url":"https://github.com/gaiarighetti00/deep-learning-pasta-classification","last_synced_at":"2026-04-15T22:36:28.974Z","repository":{"id":316236674,"uuid":"1062488442","full_name":"GaiaRighetti00/deep-learning-pasta-classification","owner":"GaiaRighetti00","description":"Deep learning project for pasta image classification using CNNs, data augmentation, and regularization.","archived":false,"fork":false,"pushed_at":"2025-09-23T12:02:03.000Z","size":7887,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-23T13:35:58.969Z","etag":null,"topics":["cnn","computer-vision","deep-learning","food-ai","image-classification","keras","tensorflow"],"latest_commit_sha":null,"homepage":"","language":null,"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/GaiaRighetti00.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-23T10:19:21.000Z","updated_at":"2025-09-23T12:02:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"a9b63062-048f-476a-aef0-4252fd0d45ec","html_url":"https://github.com/GaiaRighetti00/deep-learning-pasta-classification","commit_stats":null,"previous_names":["gaiarighetti00/deep-learning-pasta-classification"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/GaiaRighetti00/deep-learning-pasta-classification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GaiaRighetti00%2Fdeep-learning-pasta-classification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GaiaRighetti00%2Fdeep-learning-pasta-classification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GaiaRighetti00%2Fdeep-learning-pasta-classification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GaiaRighetti00%2Fdeep-learning-pasta-classification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GaiaRighetti00","download_url":"https://codeload.github.com/GaiaRighetti00/deep-learning-pasta-classification/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GaiaRighetti00%2Fdeep-learning-pasta-classification/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278717449,"owners_count":26033542,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cnn","computer-vision","deep-learning","food-ai","image-classification","keras","tensorflow"],"created_at":"2025-10-07T03:57:44.622Z","updated_at":"2025-10-07T03:57:52.085Z","avatar_url":"https://github.com/GaiaRighetti00.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🍝 Guess the Pasta — Deep Learning with CNNs\n\n![Python](https://img.shields.io/badge/Python-3.10+-blue?logo=python)\n![TensorFlow](https://img.shields.io/badge/TensorFlow-2.x-orange?logo=tensorflow)\n![Keras](https://img.shields.io/badge/Keras-DeepLearning-red?logo=keras)\n![Jupyter](https://img.shields.io/badge/Notebook-Jupyter-orange?logo=jupyter)\n![License: MIT](https://img.shields.io/badge/License-MIT-green)\n\n\u003e **Classifying pasta types with Convolutional Neural Networks (CNNs)**  \n\u003e Master’s Degree in Data Science — University of Milano-Bicocca (A.Y. 2023/2024)  \n\n---\n\n## 📖 Overview\nThis project applies **deep learning** to the (delicious) challenge of recognizing pasta varieties from images.  \nWe start from a small, noisy dataset and iteratively improve the model with **data augmentation**, **regularization**, and **optimizer tuning** to boost generalization and stability.\n\n---\n\n## 🎯 Goals\n- Build and train CNNs to classify pasta images.  \n- Group images into **short**, **long**, **filled**, **layered** pasta.  \n- Mitigate small-dataset issues using augmentation \u0026 L2 regularization.  \n- Compare optimizers (**RMSprop** vs **Adam**) and report findings.\n\n---\n\n## 📂 Repository Structure\n- data/ # (see Data \u0026 Model section for download)\n- models/pasta_model_M4.4.keras\n- notebooks/pasta_classification_notebook.ipynb\n- slides_pasta_classification.pdf\n- README.md\n\n\n---\n\n## 🧭 Method \u0026 Models\n1. **Dataset evolution**\n   - Start: 12 classes (~30 img/class) → cleaned duplicates/errors.  \n   - Reduced to 10 classes due to look-alike pairs (e.g., tagliatelle vs fettuccine).  \n   - Final consolidation into **4 macro-classes**: short, long, filled, layered.\n\n2. **Model iterations**\n   - **M1**: Baseline CNN + BatchNorm + Dropout, **RMSprop**.  \n   - **M2**: + **Data Augmentation**.  \n   - **M3**: + **L2 Regularization**.  \n   - **M4**: Switch to **Adam** → *final model saved as* `pasta_model_M4.4.keras`.\n\n3. **Key observations**\n   - Validation accuracy rises with augmentation \u0026 regularization.  \n   - **Long pasta** is hardest (shape changes; sauces/packaging can occlude pasta).  \n   - Data quality \u0026 size are the main bottlenecks.\n\n---\n\n## Environment\npython -m venv .venv\nsource .venv/bin/activate      # Windows: .venv\\Scripts\\activate\npip install -r requirements.txt\n\nIf requirements.txt is missing, install minimally:\npip install tensorflow keras numpy pandas matplotlib scikit-learn pillow jupyter\n\n---\n\n## Run\nOpen the notebook and follow the cells:\njupyter notebook notebooks/pasta_classification_notebook.ipynb\n\nTo load the pretrained model:\nfrom tensorflow import keras\nmodel = keras.models.load_model(\"models/pasta_model_M4.4.keras\")\n\n---\n\n## 📦 Data \u0026 Model (large files)\nGitHub’s web upload blocks files \u003e100 MB. We provide large assets as Release attachments.\nDownload model: models/pasta_model_M4.4.keras\nDownload datasets (archives): data/raw/pasta_4.zip, pasta_10.zip, pasta_12.zip\nHow to set up:\nGo to Releases → Latest → Assets and download the files.\nPlace them under the paths shown above (create folders if needed).\n\n---\n\n## 📊 Results (high level)\nInitial small dataset → ~0.20 validation accuracy.\nAugmentation + L2 reduced overfitting and improved stability.\nMisclassifications often occurred on long pasta and occluded images (sauces, packaging).\n\n\n---\n\n## 🚀 Future Work\nAdd more high-quality, standardized images per class.\nDistinguish raw vs cooked pasta explicitly.\nTry transfer learning (ResNet, EfficientNet, MobileNetV3).\nAdd Grad-CAM visualizations for interpretability.\n\n\n---\n\n## 📑 Documentation\nSlides: docs/slides_pasta_classification.pdf\n\n---\n\n## ⚖️ License\nThis repository is released under the MIT License.\nData are used for educational purposes; check original sources’ terms before redistribution\n\n\n✨ From spaghetti to lasagne, let deep learning guess your pasta!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaiarighetti00%2Fdeep-learning-pasta-classification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaiarighetti00%2Fdeep-learning-pasta-classification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaiarighetti00%2Fdeep-learning-pasta-classification/lists"}