This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
cinderella_micrographs [2019/12/10 08:51] twagner [How to use SPHIRE's Cinderella for micrograph selection] |
cinderella_micrographs [2020/08/28 07:35] (current) twagner [Training] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== How to use SPHIRE' | ====== How to use SPHIRE' | ||
- | This tutorial describes how to use Cinderella to sort micrographs. Unfortunately, | + | This tutorial describes how to use Cinderella to sort micrographs. Unfortunately, |
Line 8: | Line 8: | ||
You can find the download and installation instructions here: [[auto_2d_class_selection|Download and Installation]] | You can find the download and installation instructions here: [[auto_2d_class_selection|Download and Installation]] | ||
+ | |||
+ | ==== Training ==== | ||
+ | |||
+ | The first step is to train Cinderella with manually selected good and bad micrographs. Create two folders, one containing manually selected good micrographs (e.g '' | ||
+ | <note question> | ||
+ | **How many micrographs do I need?** | ||
+ | |||
+ | We typically start with 30 good and 30 bad micrographs. | ||
+ | </ | ||
+ | |||
+ | Then specify the paths into a config file like this: | ||
+ | |||
+ | <code json config.json> | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | |||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | The fields in the section **model** have the following meaning: | ||
+ | * **input_size**: | ||
+ | * **mask_radius**: | ||
+ | |||
+ | The fields in the section **train** have the following meaning: | ||
+ | * **batch_size**: | ||
+ | * **good_path**: | ||
+ | * **bad_path**: | ||
+ | * **pretrained_weights**: | ||
+ | * **saved_weights_name**: | ||
+ | * **learning_rate**: | ||
+ | * **nb_epoch**: | ||
+ | * **nb_early_stop**: | ||
+ | |||
+ | The next step is to run the training: | ||
+ | |||
+ | < | ||
+ | sp_cinderella_train.py -c example_config.json --gpu 1 | ||
+ | </ | ||
+ | |||
+ | This will train a classification network on the GPU with ID=1. After the training finishes, you get a '' | ||
+ | |||
+ | |||
+ | ==== Classify ==== | ||
+ | Suppose you want to separate good and bad micrographs in the folder '' | ||
+ | |||
+ | This is the command to run: | ||
+ | |||
+ | < | ||
+ | sp_cinderella_predict.py -i micrographs/ | ||
+ | </ | ||
+ | |||
+ | You will find the files '' |