Comments (31)
Working on GRAD-CAM version 2. Merged: keras-team/keras-io#399
Need some initial motivation from here: https://github.com/YassineYousfi/comma10k-baseline
Also need to look how the robust model performs on these datasets:
- https://www.cityscapes-dataset.com/
- https://github.com/commaai/comma10k
- https://www.mapillary.com/dataset/vistas?pKey=8BV5FtKXHwgZBSFY9Bfc5g&lat=20&lng=0&z=1.5
- Stanford BG http://dags.stanford.edu/projects/scenedataset.html
- PASCAL VOC http://host.robots.ox.ac.uk/pascal/VOC/
from cellseg.
Hey @heraldofsolace I forgot about this task... is this done?
https://colab.research.google.com/drive/16LMsoN0y__pAEVcrqzIb9bJ8y2Fogv7_?usp=sharing
Problem: Classification Model with the following specifications
Task:
- Use data generator from Keras to do data augmentation with a batch size of 24, probably in Google Colab for now.
- Make sure to find/ check the data distribution (using histograms from matplotlib) first, and if there is any class imbalance and stuff, then we have to take necessary actions, and ask for help.
- Split the data to 80-10-10 (80% training, 10% validation and 10% test).
- Record Precision, Recall, Accuracy, Loss, F1 score on datasets, i.e., training, validation and test sets. This can be done using scikit learn.
- Plot all the graphs obtained and display the same.
- Make a confusion matrix plot it using Matplotlib
TODO
- K-Fold cross validation
from cellseg.
Working on it but I feel dumb lol
from cellseg.
from cellseg.
https://colab.research.google.com/drive/16LMsoN0y__pAEVcrqzIb9bJ8y2Fogv7_?usp=sharing
A very simple skeleton is here, but it needs to be modified a lot
from cellseg.
Why? LOL
Well, it's your model
from cellseg.
Oh, so it won't obey you 🌚
from cellseg.
🥺
from cellseg.
Yes
from cellseg.
Also need to build slides, deadline - 14 th March. Need to discuss about that soon...
from cellseg.
@heraldofsolace Probably suggest a good name for this repo xD
from cellseg.
Lol Tamal Mj's Laptop's CUDA just messed up for some reason, I need to fix that tomorrow... Let's see. Studying few papers today.
from cellseg.
from cellseg.
Lol
from cellseg.
In the set "ig" has 4 different types of things "IG", "MMY", "MY", "PMY" and Neutrphil has 3 different types "BNE", "SNE" and "Neutrophil"
from cellseg.
I have seen that before, thought that 8 classes will be good, but eventually we need them too. What would be better? Having a classifier to screen the first 8 classes first and then from that we will use different screening techniques? Or what do you suggest?
This is the cell glossary we will get from the slides
Blast (Bl)
Promyelocyte (PM)
Myelocyte (My)
Metamyelocyte (Me)
Band form (Band) (Not a cell)
Neutrophil (N)
Eosinophil (Eo)
Basophil (Ba)
Lymphocyte (L)
Monocyte (Mo)
Nucleated RBC (NRBC)
from cellseg.
from cellseg.
I was thinking, maybe take them all as separate classes and separately augment them until they reach 2000 samples or something and combine into one dataset.
from cellseg.
So let's do that then. What techniques will you use?
- color jittering
- flips
- zoom
- blurring(?)
- maybe noise (?)
- maybe (small) random crop of some image into a particular image
- rotation
- affine (?)
I was even thinking of doing an ensemble with polar transformation and FFT, but that will be too much for now
from cellseg.
Let's first write the baseline code and then we'll add more augmentation as needed.
from cellseg.
So, the generator doesn't actually balance the classes. Using the generator we can't control the number of samples in classes. So we have two options -
- Accept the imbalance and set the model weight accordingly instead with augmentation.
- Use a dummy training run with augmentation to generate augmented image and create a larger dataset.
I think the 2nd approach would not be good as there is huge imbalance and some of the classes would just be full of slightly different images.
from cellseg.
from cellseg.
Ok
from cellseg.
Aniket, If you have some scripts to run related to the project (say 100 epochs), you can give me.
from cellseg.
https://colab.research.google.com/drive/1s1WgkH0DG2BPHJnG11UTSBLRz0h1CGms?usp=sharing
It predicts everything as BNE lol
from cellseg.
Why? LOL
from cellseg.
def Model_V2_Gradcam(H,W,C):
input_layer = tf.keras.Input(shape=(H, W, C))
x_1 = tf.keras.layers.Conv2D(16, 3, activation='relu', strides=(1, 1), name="conv_16_1", padding='same', kernel_initializer = 'he_normal', kernel_regularizer=l2(1e-4))(input_layer)
x_2 = tf.keras.layers.Conv2D(16, 3, activation='relu', strides=(1, 1), name="conv_16_2", padding='same', kernel_initializer = 'he_normal', kernel_regularizer=l2(1e-4))(x_1)
# x_4 = tf.keras.layers.Conv2D(16, 3, activation='relu', strides=(1, 1), name="conv_64_21", padding='same')(add([x_3,x_1]))
x_3 = tf.keras.layers.MaxPooling2D((2, 2), name="max_pool3")(x_2)
x_4 = tf.keras.layers.Conv2D(32, 3, activation='relu', strides=(1, 1), name="conv_32_1", padding='same', kernel_initializer = 'he_normal', kernel_regularizer=l2(1e-4))(x_3)
x_5 = tf.keras.layers.Conv2D(32, 3, activation='relu', strides=(1, 1), name="conv_32_2", padding='same', kernel_initializer = 'he_normal', kernel_regularizer=l2(1e-4))(x_4)
x_6 = tf.keras.layers.MaxPooling2D((2, 2), name="max_pool4")(x_5)
x_7 = tf.keras.layers.Conv2D(64, 3, activation='relu', strides=(1, 1), name="conv_64_1", padding='same', kernel_initializer = 'he_normal', kernel_regularizer=l2(1e-4))(x_6)
x_8 = tf.keras.layers.Conv2D(64, 3, activation='relu', strides=(1, 1), name="conv_64_2", padding='same', kernel_initializer = 'he_normal', kernel_regularizer=l2(1e-4))(x_7)
x = tf.keras.layers.MaxPooling2D((2, 2), name="max_pool5")(x_8)
x = tf.keras.layers.Conv2D(64, 3, activation='relu', strides=(2, 2), name="conv_64_3", kernel_initializer = 'he_normal', kernel_regularizer=l2(1e-4))(x)
x = tf.keras.layers.MaxPooling2D((2, 2), name="max_pool6")(x)
x = tf.keras.layers.Flatten(name="flatten")(x)
x = tf.keras.layers.Dropout(0.15, name="dropout_3")(x)
x = tf.keras.layers.Dense(256, activation='relu', name="dense_64")(x)
x = tf.keras.layers.Dense(N_LABELS, activation='softmax', name="output_layer")(x)
model = tf.keras.models.Model(inputs=input_layer, outputs=x)
return model
model = Model_V2_Gradcam(H=360, W=360, C=3)
model.compile(optimizer='adam', loss='categorical_crossentropy',
metrics= ['accuracy'])
model.summary()
from cellseg.
I told you it needs multiple screening models, one model needs to be too deep to understand the minor variations between the classes, so ends up doing nothing
from cellseg.
https://www.kaggle.com/paultimothymooney/identify-blood-cell-subtypes-from-images
from cellseg.
Oof
from cellseg.
Why? LOL
Well, it's your model
Looks like the primitive one should work better. Not tested though.
def Model_V1_Gradcam(H,W,C):
input_layer = tf.keras.Input(shape=(H, W, C))
x = tf.keras.layers.Conv2D(32, 3, activation='relu', strides=(2, 2), name="conv_32")(input_layer)
x = tf.keras.layers.MaxPooling2D((2, 2), name="max_pool1")(x)
x = tf.keras.layers.Conv2D(64, 3, activation='relu', strides=(2, 2), name="conv_64")(x)
x = tf.keras.layers.MaxPooling2D((2, 2), name="max_pool2")(x)
x = tf.keras.layers.Conv2D(64, 3, activation='relu', strides=(2, 2), name="conv_64_2")(x)
x = tf.keras.layers.MaxPooling2D((2, 2), name="max_pool3")(x)
x = tf.keras.layers.Flatten(name="flatten")(x)
x = tf.keras.layers.Dense(512, activation='relu', name="dense_512")(x)
x = tf.keras.layers.Dropout(0.5, name="dropout_1")(x)
x = tf.keras.layers.Dense(512, activation='relu', name="dense_256")(x)
x = tf.keras.layers.Dropout(0.5, name="dropout_2")(x)
x = tf.keras.layers.Dense(128, activation='relu', name="dense_64")(x)
x = tf.keras.layers.Dropout(0.5, name="dropout_3")(x)
x = tf.keras.layers.Dense(N_LABELS, activation='softmax', name="output_layer")(x)
#x = tf.keras.layers.Reshape((1, N_LABELS))(x)
model = tf.keras.models.Model(inputs=input_layer, outputs=x)
return model
model = Model_V1_Gradcam(H=360, W=360, C=3)
model.compile(optimizer='adam', loss='categorical_crossentropy',
metrics= ['accuracy'])
model.summary()
from cellseg.
Related Issues (14)
- Data store link for reference HOT 5
- EOSINOPHILS started
- LYMPHOCYTES started
- METAMYELOCYTES started
- MONOCYTES started
- PROMYELOCYTES started
- Colors
- Slides to Mask using CVAT HOT 22
- MaskRCNN3 HOT 8
- New error while upgrading to tensorflow-gpu for faster eval HOT 1
- No history neither models or generated images saved, we need to save model, history and generated images HOT 7
- Annotation
- Proper data store HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cellseg.