{"id":31052802,"url":"https://github.com/shervinnd/pet_segmentation_unet","last_synced_at":"2025-09-18T04:03:51.011Z","repository":{"id":314248140,"uuid":"1054750471","full_name":"shervinnd/Pet_Segmentation_UNet","owner":"shervinnd","description":"A U-Net model for pet image segmentation using the Oxford-IIIT Pet dataset 🐾. Features preprocessing, training, and evaluation with IoU and ROC curves 📊. Perfect for computer vision enthusiasts! 🚀","archived":false,"fork":false,"pushed_at":"2025-09-11T10:08:34.000Z","size":3014,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-11T12:37:24.354Z","etag":null,"topics":["computer-vision","convolutional-neural-networks","deep-learning","image-segmentation","keras","machine-learning","oxford-iiit-pet-dataset","semantic-segmentation","tensorflow","unet"],"latest_commit_sha":null,"homepage":"","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/shervinnd.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-11T09:26:19.000Z","updated_at":"2025-09-11T10:12:32.000Z","dependencies_parsed_at":"2025-09-11T12:37:25.595Z","dependency_job_id":"00c35e48-5914-4b63-845e-569ca6da61d4","html_url":"https://github.com/shervinnd/Pet_Segmentation_UNet","commit_stats":null,"previous_names":["shervinnd/pet_segmentation_unet"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/shervinnd/Pet_Segmentation_UNet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shervinnd%2FPet_Segmentation_UNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shervinnd%2FPet_Segmentation_UNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shervinnd%2FPet_Segmentation_UNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shervinnd%2FPet_Segmentation_UNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shervinnd","download_url":"https://codeload.github.com/shervinnd/Pet_Segmentation_UNet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shervinnd%2FPet_Segmentation_UNet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275193550,"owners_count":25421408,"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-09-14T02:00:10.474Z","response_time":75,"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":["computer-vision","convolutional-neural-networks","deep-learning","image-segmentation","keras","machine-learning","oxford-iiit-pet-dataset","semantic-segmentation","tensorflow","unet"],"created_at":"2025-09-15T01:24:05.171Z","updated_at":"2025-09-16T02:02:47.615Z","avatar_url":"https://github.com/shervinnd.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PetSegmentationUNet 🐾\n\nWelcome to **PetSegmentationUNet**! This project implements a U-Net\nmodel for semantic segmentation of pet images using the Oxford-IIIT Pet\ndataset 📷. It segments images into three classes: pet, background, and\nborder, with robust preprocessing, training, and evaluation using IoU\nand ROC curves 📊. Perfect for computer vision enthusiasts! 🚀\n\n## 📋 Table of Contents\n\n-   Overview\n-   Features\n-   Installation\n-   Usage\n-   Results\n-   Contributing\n-   License\n\n## 🌟 Overview\n\nThis project leverages a U-Net architecture to perform pixel-wise\nsegmentation on the Oxford-IIIT Pet dataset, which contains images of\ncats and dogs with corresponding segmentation masks 🐶🐱. The pipeline\nincludes data preprocessing, model training, evaluation with IoU and ROC\ncurves, and visualization of results.\n\n## ✨ Features\n\n-   🖼️ **Data Preprocessing**: Resizes images and masks to 128x128,\n    normalizes images, and adjusts mask labels.\n-   🧠 **U-Net Model**: A deep U-Net with encoder-decoder architecture\n    for accurate segmentation.\n-   📊 **Evaluation**: Computes IoU scores and ROC curves for each class\n    (pet, background, border).\n-   🖌️ **Visualization**: Displays input images, ground truth masks, and\n    predicted masks.\n-   💾 **Model Saving**: Saves the trained model in HDF5 format.\n\n## 🛠️ Installation\n\n1.  **Clone the Repository**:\n\n    ``` bash\n    git clone https://github.com/shervinnd/PetSegmentationUNet.git\n    cd PetSegmentationUNet\n    ```\n\n2.  **Install Dependencies**: Ensure Python 3.8+ is installed, then run:\n\n    ``` bash\n    pip install tensorflow tensorflow-datasets numpy matplotlib scikit-learn\n    ```\n\n3.  **Verify TensorFlow**:\n\n    ``` python\n    import tensorflow as tf\n    print(tf.__version__)\n    ```\n\n## 🚀 Usage\n\n1.  **Run the Pipeline**: Execute the scripts in order (provided as\n    separate Python files):\n\n    -   `01_load_dataset.py`: Load the Oxford-IIIT Pet dataset 📂.\n    -   `02_preprocess_dataset.py`: Preprocess images and masks 🖼️.\n    -   `03_unet_model.py`: Define and compile the U-Net model 🧠.\n    -   `04_train_model.py`: Train the model for 10 epochs 🎓.\n    -   `05_evaluate_visualize.py`: Evaluate and visualize predictions\n        📊.\n    -   `06_calculate_iou_roc.py`: Compute IoU and ROC curves 📈.\n    -   `07_save_model.py`: Save the trained model 💾.\n\n    Run each script:\n\n    ``` bash\n    python 01_load_dataset.py\n    python 02_preprocess_dataset.py\n    # ... and so on\n    ```\n\n2.  **Expected Output**:\n\n    -   Model summary with \\~31M parameters.\n    -   Training logs with loss and accuracy.\n    -   Test accuracy and IoU scores per class (pet, background,\n        border).\n    -   ROC curves with AUC scores for each class.\n    -   Visualizations of images, masks, and predictions.\n\n## 📈 Results\n\n-   **Dataset**: Oxford-IIIT Pet with 3680 training and 3669 test\n    images.\n-   **Model**: U-Net with 3 output classes (pet, background, border).\n-   **Metrics**:\n    -   IoU scores (example): `[0.6, 0.8, 0.4]` for pet, background,\n        border.\n    -   ROC AUC scores (example): `[0.85, 0.90, 0.70]` for each class.\n-   **Visualizations**: Sample images, ground truth masks, and predicted\n    masks displayed in a 3x3 grid.\n\n## 🤝 Contributing\n\nContributions are welcome! 🌟 To contribute:\n\n1.  Fork the repository.\n2.  Create a feature branch (`git checkout -b feature`).\n3.  Commit changes (`git commit -m`).\n4.  Push to the branch (`git push origin feature`).\n5.  Open a Pull Request.\n\nSuggestions for improvement:\n\n-   Add data augmentation 📸.\n-   Implement weighted loss for class imbalance ⚖️.\n-   Experiment with deeper architectures or learning rate schedules ⏳.\n\n## 📜 License\n\nThis project is licensed under the MIT License. See the LICENSE file for\ndetails.\\\n\\\n***Powerd by Miracle⚡***\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshervinnd%2Fpet_segmentation_unet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshervinnd%2Fpet_segmentation_unet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshervinnd%2Fpet_segmentation_unet/lists"}