rg314 / pytraction

Bayesian Traction Force Microscopy
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

automatic segmentation of cell #2

Open rg314 opened 3 years ago

rg314 commented 3 years ago

Use segmentation models to automatically segment cells. This should be done using an EfficentNet-B0 backbone so it is lightweight and can be easily run on CPU.

Please see quick and simple version in autoballs

rg314 commented 3 years ago

B0 too simple

DATA_DIR = 'data/..'
PATH = '/home/ryan/Documents/GitHub/pytraction/data'

DATASETS = ['BF-C2DL-HSC', 'BF-C2DL-MuSC', 'DIC-C2DH-HeLa', 'Fluo-C2DL-Huh7', 'Fluo-C2DL-MSC', 'Fluo-N2DH-GOWT1', 'Fluo-N2DL-HeLa', 'PhC-C2DH-U373', 'PhC-C2DL-PSC', 'Fluo-N2DH-SIM']
ENCODER = 'efficientnet-b0'
ENCODER_WEIGHTS = 'imagenet'
CLASSES = ['cell']
ACTIVATION = 'sigmoid' # could be None for logits or 'softmax2d' for multicalss segmentation
DEVICE = 'cuda'
SIZE=512
IN_CHANNELS = 1
VIS = False
TRAIN = True
BATCH_SIZE = 1

image

rg314 commented 3 years ago

B1 too simple

DATA_DIR = 'data/..'
PATH = '/home/ryan/Documents/GitHub/pytraction/data'

DATASETS = ['BF-C2DL-HSC', 'BF-C2DL-MuSC', 'DIC-C2DH-HeLa', 'Fluo-C2DL-Huh7', 'Fluo-C2DL-MSC', 'Fluo-N2DH-GOWT1', 'Fluo-N2DL-HeLa', 'PhC-C2DH-U373', 'PhC-C2DL-PSC', 'Fluo-N2DH-SIM']
ENCODER = 'efficientnet-b1'
ENCODER_WEIGHTS = 'imagenet'
CLASSES = ['cell']
ACTIVATION = 'sigmoid' # could be None for logits or 'softmax2d' for multicalss segmentation
DEVICE = 'cuda'
SIZE=512
IN_CHANNELS = 1
VIS = False
TRAIN = True
BATCH_SIZE = 1

image

rg314 commented 3 years ago

First guess is that I'm trying to generalize too much

# need to update path
DATA_DIR = 'data/..'
PATH = '/home/ryan/Documents/GitHub/pytraction/data'

DATASETS = ['BF-C2DL-HSC', 'BF-C2DL-MuSC', 'DIC-C2DH-HeLa', 'Fluo-C2DL-Huh7', 'Fluo-C2DL-MSC', 'Fluo-N2DH-GOWT1', 'Fluo-N2DL-HeLa', 'PhC-C2DH-U373', 'PhC-C2DL-PSC', 'Fluo-N2DH-SIM']
ENCODER = 'efficientnet-b7'
ENCODER_WEIGHTS = 'imagenet'
CLASSES = ['cell']
ACTIVATION = 'sigmoid' # could be None for logits or 'softmax2d' for multicalss segmentation
DEVICE = 'cuda'
SIZE=256
IN_CHANNELS = 1
VIS = False
TRAIN = True
BATCH_SIZE = 4

image

rg314 commented 3 years ago

As expected I was trying to generalize too much with the data. Managed to get pretty good results with simple encoder

# need to update path
DATA_DIR = 'data/..'
PATH = '/home/ryan/Documents/GitHub/pytraction/data'

DATASETS = ['DIC-C2DH-HeLa','Fluo-C2DL-Huh7', 'Fluo-C2DL-MSC', 'Fluo-N2DH-GOWT1','PhC-C2DH-U373',]
ENCODER = 'efficientnet-b1'
ENCODER_WEIGHTS = 'imagenet'
CLASSES = ['cell']
ACTIVATION = 'sigmoid' # could be None for logits or 'softmax2d' for multicalss segmentation
DEVICE = 'cuda'
SIZE=512
IN_CHANNELS = 1
VIS = False
TRAIN = True
BATCH_SIZE = 4

Uploaded to cloud with name 20210316

image