Skip to content

li-liwen/Nucleus-Segmentation-with-U-net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nucleus Segmentation with U net

Based on U-net architecture, trained on Pannuke dataset.

Input image & predicted mask resolution: 256x256

Results

Dice Score: 85.1%

Accuracy: >95%

show

U-Net Architecture

U-Net U-Net: Convolutional Networks for Biomedical Image Segmentation

Loss Function and Metric

Loss Function:

def Dice_Loss(y_true, y_pred):
    y_true = tf.cast(y_true, tf.float32)
    y_pred = tf.cast(y_pred, tf.float32)
    inter = tf.math.multiply(y_true, y_pred)
    union = tf.math.divide(tf.math.add(
        tf.reduce_sum(y_true), tf.reduce_sum(y_pred)), 2)
    score = tf.math.divide(tf.reduce_sum(inter), tf.reduce_sum(union))
    loss = tf.math.subtract(tf.constant(1.0), score)
    return loss

Loss function inspired from: Using Intersection over Union loss to improve Binary Image Segmentation

Metric:

def Dice_Score(y_true, y_pred):
    y_true = tf.cast(y_true, tf.float32)
    y_pred = tf.math.greater(y_pred, 0.5)
    y_pred = tf.cast(y_pred, tf.float32)
    inter = tf.math.multiply(y_true, y_pred)
    union = tf.math.divide(tf.math.add(
        tf.reduce_sum(y_true), tf.reduce_sum(y_pred)), 2)
    score = tf.math.divide(tf.reduce_sum(inter), tf.reduce_sum(union))
    return score

DataSets

Original Dataset (Numpy format)

Exported Dataset (PNG format) and Pretrained Model (TensorFlow)

About

Based on U-net architecture, trained on Pannuke dataset.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published