{"id":15157769,"url":"https://github.com/manuelz/dlpt-semantic-segmentation","last_synced_at":"2026-02-07T11:03:19.829Z","repository":{"id":253864374,"uuid":"843587248","full_name":"ManuelZ/DLPT-semantic-segmentation","owner":"ManuelZ","description":"Project #4 for the OpenCV University course \"Deep Learning with PyTorch\". ","archived":false,"fork":false,"pushed_at":"2025-02-05T05:00:29.000Z","size":212027,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-22T05:49:01.884Z","etag":null,"topics":["deep-learning","python","pytorch","semantic-segmentation"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/ManuelZ.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-08-16T21:11:44.000Z","updated_at":"2025-02-05T05:00:32.000Z","dependencies_parsed_at":"2024-09-22T06:01:48.659Z","dependency_job_id":"fdee8c44-5273-4aca-afae-765c6b965072","html_url":"https://github.com/ManuelZ/DLPT-semantic-segmentation","commit_stats":{"total_commits":89,"total_committers":1,"mean_commits":89.0,"dds":0.0,"last_synced_commit":"82f2ee80bdb0aed3bfe31126045f5570ad694885"},"previous_names":["manuelz/dlpt-semantic-segmentation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ManuelZ/DLPT-semantic-segmentation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManuelZ%2FDLPT-semantic-segmentation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManuelZ%2FDLPT-semantic-segmentation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManuelZ%2FDLPT-semantic-segmentation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManuelZ%2FDLPT-semantic-segmentation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ManuelZ","download_url":"https://codeload.github.com/ManuelZ/DLPT-semantic-segmentation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManuelZ%2FDLPT-semantic-segmentation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29193089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T07:37:03.739Z","status":"ssl_error","status_checked_at":"2026-02-07T07:37:03.029Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["deep-learning","python","pytorch","semantic-segmentation"],"created_at":"2024-09-26T20:02:59.982Z","updated_at":"2026-02-07T11:03:19.817Z","avatar_url":"https://github.com/ManuelZ.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multi-Class Semantic Segmentation of Drone Imagery\n\nThis is the fourth project of the Opencv University course [\"Deep Learning with PyTorch\"](https://opencv.org/university/deep-learning-with-pytorch/).\nIt focuses on applying semantic segmentation on images taken from drones to differentiate between 12 classes.\n\n\n## Introduction\n\nSemantic segmentation is a foundational computer vision task that assigns a class label to every pixel in an image. This project applies segmentation to drone imagery, addressing challenges such as diverse classes and imbalanced data to classify pixels into 12 categories. Potential applications include autonomous navigation and environmental monitoring.\n\n\n## Data\n\nThe project uses a dataset of 3269 images of size 1280(W) x 720(H), taken by drones, and annotated image masks for \nthe following 12 classes: \n\n    background, person, bike, car, drone, boat, animal, obstacle, construction, vegetation, road, sky\n\nExamples:\n![img.png](media/img.png)\n\nOne of the challenges of this dataset is the class imbalance. The following image shows the number of pixels per class across the whole dataset:\n![Number of pixels per class](media/pixel_count.png)\n\n## The methods used\n\nFine-tuning a pre-trained DeepLabV3 ResNet-101 model using a custom training loop in PyTorch. The primary objective was to gain hands-on experience with implementing all the steps of the training process in PyTorch.\n\n- The dataset was split using a stratified shuffle split scheme into train and validation subsets with 80% and 20% of the \navailable data, respectively. The stratification was done based on the presence or not of a class in each image. \n\n- Various loss functions were tested, including:\n  - The Focal Loss: is a modification of the Cross-Entropy loss focused on learning from hard negative examples.\n  - The Soft Dice Loss: is effective in addressing the challenge of imbalanced foreground and background regions.\n  - An equally weighted combination of the Focal Loss and the Soft Dice Loss.\n  - The Tversky Loss: An improvement over the Dice loss\n\n- A learning rate scheduler that implements the 1-cycle policy. It adjusts the learning rate from an initial rate to a \nmaximum, then decreases it to a much lower minimum.\n\n- Custom training loop features:\n    - Gradient accumulation\n    - Automatic Mixed Precision \n    - Tracking of training/validation losses and scores\n    - Tracking of per-class scores\n\n\n## Discussion\n\nThe model used is DeeplabV3, trained for 60 epochs with unscaled images (H720 x W1280), which resulted in a Dice Score of `0.79776` on the Kaggle competition Private Set.\n\nSee the [notebook](project-4-deep-learning-with-pytorch-2024.ipynb).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanuelz%2Fdlpt-semantic-segmentation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanuelz%2Fdlpt-semantic-segmentation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanuelz%2Fdlpt-semantic-segmentation/lists"}