{"id":20526542,"url":"https://github.com/tugstugi/pytorch-saltnet","last_synced_at":"2025-04-03T03:11:08.382Z","repository":{"id":137627756,"uuid":"153854501","full_name":"tugstugi/pytorch-saltnet","owner":"tugstugi","description":"Kaggle | 9th place single model solution for TGS Salt Identification Challenge","archived":false,"fork":false,"pushed_at":"2018-10-29T12:36:02.000Z","size":750,"stargazers_count":279,"open_issues_count":2,"forks_count":52,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-24T08:37:41.918Z","etag":null,"topics":["cnn","convolutional-neural-networks","deep-learning","kaggle-competition","pytorch","segmentation","seismic-imaging","unet","unet-image-segmentation","unet-pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","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/tugstugi.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":"2018-10-20T00:13:24.000Z","updated_at":"2025-03-21T14:39:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"e08d008e-3868-4f0b-b0e2-f2cc68af307d","html_url":"https://github.com/tugstugi/pytorch-saltnet","commit_stats":{"total_commits":13,"total_committers":2,"mean_commits":6.5,"dds":0.07692307692307687,"last_synced_commit":"a3e63b357f975924e75b5db24ee528c5797f5efb"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tugstugi%2Fpytorch-saltnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tugstugi%2Fpytorch-saltnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tugstugi%2Fpytorch-saltnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tugstugi%2Fpytorch-saltnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tugstugi","download_url":"https://codeload.github.com/tugstugi/pytorch-saltnet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246927835,"owners_count":20856198,"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":["cnn","convolutional-neural-networks","deep-learning","kaggle-competition","pytorch","segmentation","seismic-imaging","unet","unet-image-segmentation","unet-pytorch"],"created_at":"2024-11-15T23:14:38.788Z","updated_at":"2025-04-03T03:11:08.360Z","avatar_url":"https://github.com/tugstugi.png","language":"Python","funding_links":[],"categories":["Pytorch elsewhere ｜ Pytorch相关","Pytorch elsewhere"],"sub_categories":["Other libraries｜其他库:","Other libraries:"],"readme":"UNet for segmenting salt deposits from seismic images with PyTorch.\n\n## General\n\nWe, [tugstugi](https://github.com/tugstugi) and [xuyuan](https://github.com/xuyuan), have participated\nin the Kaggle competition [TGS Salt Identification Challenge](https://www.kaggle.com/c/tgs-salt-identification-challenge)\nand reached the 9-th place. This repository contains a simplified and cleaned up version of our team's code partially based\non the ideas of [Heng Cherkeng's discussion](https://www.kaggle.com/c/tgs-salt-identification-challenge/discussion/65933)\non the Kaggle discussion board.\n\nWe have used a single UNet model with a SENet154 encoder which has a single fold score of 0.882.\nWith 10 folds using reflective padding and another 10 folds with resizing, we got 0.890.\nThe final private LB score 0.892 was achieved by post processing on the model's output.\n\n\n## Features\n\n* single [UNet](https://arxiv.org/abs/1505.04597) model with a [Squeeze-and-Excitation network](https://arxiv.org/abs/1709.01507) encoder\n* no ensembling, no pseudo labeling\n* [object context](https://arxiv.org/abs/1809.00916) in the decoders and in the base\n* symmetric extension of the [Lovasz hinge loss](https://arxiv.org/abs/1705.08790) function (+0.02 private LB improvement):\n```python\ndef symmetric_lovasz(outputs, targets):\n    return (lovasz_hinge(outputs, targets) + lovasz_hinge(-outputs, 1 - targets)) / 2\n```\n\n## Training\n1. Download and extract the [dataset](https://www.kaggle.com/c/tgs-salt-identification-challenge/data)\n    * copy `train.csv` into `datasets/`\n    * copy train images and masks into `datasets/train/`\n    * copy test images into `datasets/test/`\n2. Train SENet154-Unet for 250 epochs on 2x P100: `python train.py --vtf --pretrained imagenet --loss-on-center --batch-size 32 --optim adamw --learning-rate 5e-4 --lr-scheduler noam --basenet senet154 --max-epochs 250 --data-fold fold0 --log-dir runs/fold0 --resume runs/fold0/checkpoints/last-checkpoint-fold0.pth`\n    * tensorboard logs, checkpoints and models are saved under `runs/`\n    * start tensorboard with `tensorboard --logdir runs`\n    * training log of a LB0.883 model is provided under `runs/lb0.883_fold0/`\n3. Do [SWA](https://arxiv.org/abs/1803.05407) on the best loss, accuracy and kaggle metrics models: `python swa.py --input runs/fold0/models --output fold0_swa.pth`\n4. Create a Kaggle submission: `python test.py --tta fold0_swa.pth --output-prefix fold0`\n    * a submission file `fold0-submission.csv` should be created now\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftugstugi%2Fpytorch-saltnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftugstugi%2Fpytorch-saltnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftugstugi%2Fpytorch-saltnet/lists"}