Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ThirteenYue/2MSPK-Net
https://github.com/ThirteenYue/2MSPK-Net
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/ThirteenYue/2MSPK-Net
- Owner: ThirteenYue
- Created: 2024-03-19T09:12:36.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-05-23T09:03:49.000Z (8 months ago)
- Last Synced: 2024-05-23T10:25:33.615Z (8 months ago)
- Language: Python
- Size: 1.97 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- Awesome-Segment-Anything - [code
README
# 2MSPK-Net
This repo is the official implementation of
['2MSPK-Net: A Nuclei Segmentation Network Based on Multi-Scale, Multi-Dimensional Attention, and SAM Prior Knowledge']
We proposed a segmentation method based on SAM prior knowledge guidance strategy, and the above is a schematic diagram of integrating SAM prior knowledge.For detailed method introduction, please read the original article## Requirements
Install from the ```requirements.txt``` using:
```angular2html
pip install -r requirements.txt
```## Usage
*Note: If you have some problems with the code, the [issues](https://github.com/ThirteenYue/2MSPK-Net/issues) may help.*
### 1. Data Preparation
#### 1.1. GlaS and MoNuSeg Datasets
π₯ The original data can be downloaded in following links:
* MoNuSeg Dataset - [Link (Original)](https://monuseg.grand-challenge.org/Data/)
* TNBC Dataset - [Link (Original)](https://paperswithcode.com/dataset/tnbc)Then prepare the datasets in the following format for easy use of the code:
```angular2html
βββ Dataset
Β Β βββ MoNusg
Β Β βΒ Β βββ test
Β Β βΒ Β βΒ Β βββ boundary_priors
βΒ Β βΒ Β βββ images
βΒ Β βΒ Β βββ masks
Β Β βΒ Β βΒ Β βββ seg_priors
βΒ Β βββ train
Β Β βΒ Β βΒ Β βββ boundary_priors
βΒ Β βΒ Β βββ images
βΒ Β βΒ Β βββ masks
Β Β βΒ Β βΒ Β βββ seg_priors
Β Β βΒ Β βββ val
Β Β βΒ Β βΒ Β βββ boundary_priors
βΒ Β βΒ Β βββ images
βΒ Β βΒ Β βββ masks
Β Β Β Β Β Β βββ seg_priors
```### 2. Training
During the training process, the data were uniformly resized to $256\times256$ pixels and data augmentation was applied, including affine transformation, random flipping, and random rotation. Gradient descent was performed using the Adam optimizer with $\beta_1$ set to 0.9 and $\beta_2$ set to 0.999. The initial learning rate was set to $1\times{10}^{-4}$, and an adaptive learning rate decay strategy was employed. If the loss on the validation set did not decrease after every 20 epochs, the learning rate was reduced by a factor of 0.5. The batch size was set to 4, and the training was completed after 600 epochs.#### 2.2 Pre-training
We didn't use any pre-trained weights### 3. Testing
We also added SAM prior area maps and contour maps to the test data set
* You can generate area maps and contour mapsarea and contour plots using [SAM_prior](https://github.com/ThirteenYue/2MSPK-Net/blob/master/src/SAM_prior.py)
We will announce other test and visualization codes later## Reference
* UNet:https://github.com/LeeJunHyun/Image_Segmentation#u-net
* UNet++: https://github.com/qubvel/segmentation_models.pytorch
* U2Net:https://github.com/huangmozhilv/u2net_torch
* Attention U-Net: https://github.com/bigmb/Unet-Segmentation-Pytorch-Nest-of-Unets
* TransUNet: https://github.com/Beckschen/TransUNet
* Swin-Unet: https://github.com/HuCaoFighting/Swin-Unet## Contact
Weight files and evaluation codes can be obtained by contacting the author
ββGongtao Yue([[email protected]]([email protected]))