CNNimgClassification | R Documentation |
Classification using convolutionnal network on image profile.
CNNimgClassification( object, scores = c("prediction", "all", "none"), fcol = "markers", resample_data = TRUE, model_type = "CNN", keep_img = FALSE, epochs = 40, batch_size = 32, lr = 0.001, show_plot = FALSE )
object |
An instance of class |
scores |
One of |
fcol |
The feature meta-data containing marker definitions.
Default is |
resample_data |
Logical to tell if you want to rebalance the data (remove proteins with bad profiles and add artificial ones to get a more uniform distribution of the number of profiles per class) |
model_type |
The type of neural network you want (either 'CNN' or 'SpatialTransformer'). |
keep_img |
Logical to tell if you want to keep the images profiles created. |
epochs |
The number of epochs for training; default is 40. |
batch_size |
The size of the batch for training; default is 16. |
lr |
The learning rate of the neural network; default is 0.001. |
show_plot |
Logical to tell if you want to print the loss and accuracy plots. |
This algorithm will not apply clustering on raw data but on the image of the profiles from each protein. Then by using a convolutional network, it will learn to classify those images and then make predictions. Also, since the output is a log softmax, we can interpret these scores as probabilities. So we can handle proteins with composite profiles.
The first model available is a classical CNN containg two conv2d layers with dropout, Tanh activation and maxpool. The second one is a spatial transformers using convolutional layers and affine transformation.
This function calls python scripts in order to use torch python library, so it totally depends on reticulate
r package.
An instance of class "MSnSet"
with
CNNimg
and CNNimg.scores
feature variables storing the
classification results and scores respectively.
library(pRolocExtra) data(tan2009r1) res <- CNNimgClassification(tan2009r1) getPredictions(res, fcol = "CNNimg") getPredictions(res, fcol = "CNNimg", t = 0.75) plot2D(res, fcol = "CNNimg")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.