{"id":30354504,"url":"https://github.com/theveryhim/unet-segmentation","last_synced_at":"2025-10-10T13:04:28.204Z","repository":{"id":307162427,"uuid":"1027909800","full_name":"theveryhim/UNet-Segmentation","owner":"theveryhim","description":"A practice on using UNets as segmentors.","archived":false,"fork":false,"pushed_at":"2025-08-01T13:23:20.000Z","size":40054,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-19T03:10:42.416Z","etag":null,"topics":["attention","deep-learning","image-processing","image-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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theveryhim.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}},"created_at":"2025-07-28T18:06:21.000Z","updated_at":"2025-08-01T13:23:24.000Z","dependencies_parsed_at":"2025-07-29T21:01:57.229Z","dependency_job_id":"a7464d4d-231e-4082-955e-bf2e835b7bf7","html_url":"https://github.com/theveryhim/UNet-Segmentation","commit_stats":null,"previous_names":["theveryhim/unet-segmentation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/theveryhim/UNet-Segmentation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theveryhim%2FUNet-Segmentation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theveryhim%2FUNet-Segmentation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theveryhim%2FUNet-Segmentation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theveryhim%2FUNet-Segmentation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theveryhim","download_url":"https://codeload.github.com/theveryhim/UNet-Segmentation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theveryhim%2FUNet-Segmentation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004005,"owners_count":26083661,"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-10T02:00:06.843Z","response_time":62,"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":["attention","deep-learning","image-processing","image-segmentation"],"created_at":"2025-08-19T03:03:22.470Z","updated_at":"2025-10-10T13:04:28.155Z","avatar_url":"https://github.com/theveryhim.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UNet-Segmentation\n\n## Data\n\nAll BraTS multimodal scans are available as NIfTI files (.nii.gz) and describe a) native (T1) and b) post-contrast T1-weighted (T1Gd), c) T2-weighted (T2), and d) T2 Fluid Attenuated Inversion Recovery (T2-FLAIR) volumes, and were acquired with different clinical protocols and various scanners from multiple (n=19) institutions, mentioned as data contributors here.\n\nAll the imaging datasets have been segmented manually, by one to four raters, following the same annotation protocol, and their annotations were approved by experienced neuro-radiologists. Annotations comprise the GD-enhancing tumor (ET — label 4), the peritumoral edema (ED — label 2), and the necrotic and non-enhancing tumor core (NCR/NET — label 1), as described both in the BraTS 2012-2013 TMI paper and in the latest BraTS summarizing paper. The provided data are distributed after their pre-processing, i.e., co-registered to the same anatomical template, interpolated to the same resolution (1 mm^3) and skull-stripped.\n\u003ccenter\u003e\u003cimg width=\"70%\" src=\"figures\\1.png\"\u003e\u003c/center\u003e\n\n## \u003ca id='toc1_3_3_'\u003e\u003c/a\u003e[U-Net Model](#toc0_)\n| **Stage**           | **Operation**                 | **Purpose**                              |\n|---------------------|-------------------------------|------------------------------------------|\n| Input               | Image tile                    | Input for segmentation                   |\n| Contracting Path    | Conv 3×3, ReLU + MaxPool      | Feature extraction and downsampling      |\n| Bottleneck          | Deepest layer                 | Global context representation            |\n| Expanding Path      | Up-conv + Skip connections    | Resolution recovery and spatial merging  |\n| Output Layer        | 1×1 convolution               | Pixel-wise classification                |\n\u003ccenter\u003e\n\u003cimg width=\"70%\" src=\"figures\\2.png\"\u003e\n\u003cimg width=\"70%\" src=\"figures\\3.png\"\u003e\n\u003cimg width=\"70%\" src=\"figures\\4.png\"\u003e\n\u003cimg width=\"70%\" src=\"figures\\5.png\"\u003e\n\u003c/center\u003e\n\n## UNet with attention\n\nNow we augment the regular UNet with several sub-modules and techniques such as ResNets, Attention modules, etc. We describe the expected architecture for this notebook:\n\n+ *ResNet:* As a base sub-module, we define each ResNet block as two consecutive convolutional layers with a GELU activation in between and Group Normalization after each convolutional layer. We can use this module in Down/Up blocks. Also, by removing the residual connection, you can use this block as a convolutional network throughout the network.\n+ *Attention:* This is also a sub-module consisting of a Layer Normalization, Multi-head Attention (use from `torch.nn`), a residual connection, a feed-forward network, and another residual connection.\n\n\u003ccenter\u003e\n\u003cimg width=\"70%\" src=\"figures\\6.png\"\u003e\n\u003cimg width=\"70%\" src=\"figures\\7.png\"\u003e\n\u003c/center\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheveryhim%2Funet-segmentation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheveryhim%2Funet-segmentation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheveryhim%2Funet-segmentation/lists"}