This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
pipeline:window:cryolo [2019/09/17 13:38] twagner [Configuration] |
pipeline:window:cryolo [2021/02/19 10:00] (current) twagner |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{ : | + | {{ : |
===== Overview ===== | ===== Overview ===== | ||
- | CrYOLO is a fast and accurate particle picking procedure. It's based on convolutional neural networks and utilizes the popular [[https:// | + | <note warning> |
- | * crYOLO makes picking **fast** | + | |
- | * crYOLO makes picking **smart** | + | **NEW DOCUMENTATION** |
- | * crYOLO makes training **easy** | + | |
- | * crYOLO makes training **tolerant** | + | The documentation has moved to [[https:// |
+ | |||
+ | </ | ||
+ | |||
+ | CrYOLO is a fast and accurate particle picking procedure. It's based on convolutional neural networks and utilizes the popular [[https:// | ||
+ | |||
+ | * crYOLO makes picking **fast** | ||
+ | * crYOLO makes picking **smart** | ||
+ | * crYOLO makes training **easy** | ||
+ | * crYOLO makes training **tolerant** | ||
In this tutorial we explain our recommended configurations for single particle and filament projects. You can find more information how to use crYOLO, about supported networks and about the config file in the following articles: | In this tutorial we explain our recommended configurations for single particle and filament projects. You can find more information how to use crYOLO, about supported networks and about the config file in the following articles: | ||
+ | |||
* [[https:// | * [[https:// | ||
* [[: | * [[: | ||
* [[: | * [[: | ||
- | |||
- | |||
< | < | ||
Line 26: | Line 34: | ||
We are also proud that crYOLO was recommended by F1000: | We are also proud that crYOLO was recommended by F1000: | ||
- | //" | + | //" |
- | < | + | |
- | < | + | |
- | <a href=" | + | |
- | </ | + | |
- | </ | + | |
===== Installation ===== | ===== Installation ===== | ||
- | You can find the download and installation instructions here: [[howto: | + | You can find the download and installation instructions here: [[:howto: |
- | ===== Tutorials ===== | + | {{page> |
- | Depending what you want to do, you can follow one of these self-contained Tutorials: | + | ===== Release notes ===== |
- | - I would like to train a model from scratch for picking my particles | + | {{page> |
- | - I would like to train a model from scratch for picking filaments. | + | |
- | - I would like to refine a general model for my particles. | + | |
- | The **first and the second tutorial** are the most common use cases and well tested. The **third tutorial** is still experimental but might give you better results in less time and less training data. | + | ===== Tutorials ===== |
+ | Depending what you want to do, you can follow one of these self-contained Tutorials: | ||
+ | - [[: | ||
+ | - [[: | ||
+ | - [[: | ||
+ | - [[: | ||
- | ===== Picking particles - Using a model trained for your data ===== | + | The **first, second |
- | This tutorial explains you how to train a model specific for you dataset. | + | |
- | + | ||
- | If you followed the installation instructions, | + | |
- | + | ||
- | < | + | |
- | source activate cryolo | + | |
- | </ | + | |
- | ==== Data preparation ==== | + | |
- | {{page> | + | |
- | + | ||
- | ==== Start crYOLO ==== | + | |
- | {{page> | + | |
- | + | ||
- | ==== Configuration ==== | + | |
- | {{page> | + | |
- | + | ||
- | < | + | |
- | <div style=" | + | |
- | < | + | |
- | </ | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | {{page> | + | |
- | + | ||
- | ==== Training ==== | + | |
- | + | ||
- | {{page> | + | |
- | ==== Picking ==== | + | |
- | {{page> | + | |
- | + | ||
- | + | ||
- | ==== Visualize the results ==== | + | |
- | {{page> | + | |
- | + | ||
- | ==== Evaluate your results ==== | + | |
- | {{page> | + | |
- | ===== Picking particles - Without training using a general model ===== | + | |
- | Here you can find how to apply the general models we trained for you. If you would like to train your own general model, please see our extra wiki page: [[: | + | |
- | + | ||
- | Our general models can be found and downloaded here: [[howto: | + | |
- | + | ||
- | If you followed the installation instructions, | + | |
- | + | ||
- | < | + | |
- | source activate cryolo | + | |
- | </ | + | |
- | ==== Start crYOLO ==== | + | |
- | {{page> | + | |
- | + | ||
- | ==== Configuration==== | + | |
- | In the GUI choose the //config// action. Fill in your target box size and leave the // | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | [[: | + | |
- | + | ||
- | | + | |
- | | + | |
- | | + | |
- | + | ||
- | < | + | |
- | <div style=" | + | |
- | < | + | |
- | </ | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | < | + | |
- | In the following I assume that you target box size is 220. Please adapt if necessary. | + | |
- | + | ||
- | For the general **[[: | + | |
- | < | + | |
- | cryoloo.py config config_cryolo_.json 220 --filter LOWPASS --low_pass_cutoff 0.1 | + | |
- | </ | + | |
- | + | ||
- | For the general model trained with **neural-network denoised cryo images** (with [[: | + | |
- | < | + | |
- | cryoloo.py config config_cryolo_.json 220 --filter JANNI --janni_model / | + | |
- | </ | + | |
- | + | ||
- | For the general model for **negative stain data** please run: | + | |
- | < | + | |
- | cryoloo.py config config_cryolo_.json 220 --filter NONE | + | |
- | </ | + | |
- | </ | + | |
- | + | ||
- | ==== Picking ==== | + | |
- | {{page> | + | |
- | + | ||
- | ==== Visualize the results ==== | + | |
- | {{page> | + | |
- | ===== Picking particles - Using the general model refined for your data ===== | + | |
- | + | ||
- | + | ||
- | Since crYOLO 1.3 you can train a model for your data by // | + | |
- | + | ||
- | What does // | + | |
- | + | ||
- | The general model was trained on a lot of particles with a variety of shapes and therefore learned a very good set of generic features. The last layers, however, learn a pretty abstract representation of the particles and it might be that they do not perfectly fit for your particle at hand. Fine-tuning only traines the last two convolutional layers, but keep the others fixed. This adjusts the more abstract representation for your specific problem. | + | |
- | + | ||
- | Why should I // | + | |
- | - From theory, using fine-tuning should reduce | + | |
- | - The training is much faster, as not all layers have to be trained. | + | |
- | - The training will need less GPU memory ((We are testing crYOLO with its default configuration on graphic cards with >= 8 GB memory. Using the fine tune mode, it should also work with GPUs with 4 GB memory)) and therefore is usable with NVIDIA cards with less memory. | + | |
- | + | ||
- | However, the fine tune mode is still somewhat experimental and we will update this section if see more advantages or disadvantages. | + | |
- | + | ||
- | If you followed the installation instructions, | + | |
- | + | ||
- | < | + | |
- | source activate cryolo | + | |
- | </ | + | |
- | + | ||
- | ==== Data preparation ==== | + | |
- | {{page> | + | |
- | + | ||
- | ==== Start crYOLO ==== | + | |
- | + | ||
- | {{page> | + | |
- | ==== Configuration ==== | + | |
- | {{page> | + | |
- | + | ||
- | {{ : | + | |
- | Furthermore, | + | |
- | + | ||
- | < | + | |
- | <div style=" | + | |
- | < | + | |
- | </ | + | |
- | </ | + | |
- | + | ||
- | < | + | |
- | + | ||
- | I assume your box files for training are in the folder '' | + | |
- | + | ||
- | < | + | |
- | cryoloo.py config config_cryolo.json 160 --train_image_folder train_image --train_annot_folder train_annot --pretrained_weights gmodel_phosnet_20190516.h5 | + | |
- | </ | + | |
- | + | ||
- | To get a full description of all available options type: | + | |
- | < | + | |
- | cryoloo.py config -h | + | |
- | </ | + | |
- | + | ||
- | If you want to specify seperate validation folders you can use the %%--%%valid_image_folder and %%--%%valid_annot_folder options: | + | |
- | + | ||
- | < | + | |
- | cryoloo.py config config_cryolo.json 160 --train_image_folder train_image --train_annot_folder train_annot --pretrained_weights gmodel_phosnet_20190516.h5 --valid_image_folder valid_img --valid_annot_folder valid_annot | + | |
- | </ | + | |
- | + | ||
- | </ | + | |
- | + | ||
- | ==== Training ==== | + | |
- | + | ||
- | Now you are ready to train the model. In case you have multiple GPUs, you should first select a free GPU. The following command will show the status of all GPUs: | + | |
- | + | ||
- | < | + | |
- | nvidia-smi | + | |
- | </ | + | |
- | + | ||
- | For this tutorial, we assume that you have either a single GPU or want to use GPU 0. | + | |
- | + | ||
- | In the GUI choose the action //train//. In the //" | + | |
- | {{ : | + | |
- | + | ||
- | In the //" | + | |
- | {{ : | + | |
- | <note important> | + | |
- | The number of layers to fine tune (specified by layers_fine_tune in the //" | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | <note tip> | + | |
- | + | ||
- | **Training on CPU** | + | |
- | + | ||
- | The fine tune mode is especially useful if you want to [[downloads: | + | |
- | </ | + | |
- | + | ||
- | <hidden **Run training with the command line**> | + | |
- | In comparison to the training from scratch, you can skip the warm up training ( -w 0 ). Moreover you have to add the // | + | |
- | + | ||
- | < | + | |
- | cryolo_train.py -c config.json -w 0 -g 0 --fine_tune -lft 2 | + | |
- | </ | + | |
- | </ | + | |
- | + | ||
- | ==== Picking ==== | + | |
- | {{page> | + | |
- | + | ||
- | ==== Visualize the results | + | |
- | {{page> | + | |
- | + | ||
- | ==== Evaluate your results ==== | + | |
- | {{page> | + | |
- | ===== Picking filaments - Using a model trained for your data ===== | + | |
- | Since version 1.1.0 crYOLO supports picking filaments. | + | |
- | + | ||
- | Filament mode on Actin: | + | |
- | + | ||
- | {{: | + | |
- | + | ||
- | Filament mode on MAVS (EMPIAR-10031) : | + | |
- | + | ||
- | {{: | + | |
- | + | ||
- | If you followed the installation instructions, | + | |
- | + | ||
- | < | + | |
- | source activate cryolo | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | ==== Data preparation ==== | + | |
- | {{ : | + | |
- | + | ||
- | The first step is to create the training data for your model. Right now, you have to use the e2helixboxer.py for this: | + | |
- | < | + | |
- | e2helixboxer.py --gui my_images/ | + | |
- | </ | + | |
- | + | ||
- | After tracing your training data in e2helixboxer, | + | |
- | + | ||
- | For projects with roughly 20 filaments per image we successfully trained on 40 images (=> 800 filaments). | + | |
- | + | ||
- | ==== Start crYOLO ==== | + | |
- | {{page> | + | |
- | + | ||
- | + | ||
- | ==== Configuration ==== | + | |
- | {{page> | + | |
- | + | ||
- | You can now press the Start button to create you configuration file. | + | |
- | + | ||
- | {{page> | + | |
- | ==== Training ==== | + | |
- | + | ||
- | {{page> | + | |
- | ==== Picking ==== | + | |
- | Select the action prediction | + | |
- | {{ : | + | |
- | + | ||
- | Now select the " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | Press the start button to start the picking. The directory '' | + | |
- | + | ||
- | You can find a detailed description [[: | + | |
- | + | ||
- | <hidden **Run prediction in commmand line**> | + | |
- | Let's assume you want to pick a filament with a width of 100 pixels (-fw 100). The box size is 200x200 and you want a 90% overlap (-bd 20). Moreover, you wish that each filament has at least 6 boxes (-mn 6). The micrographs are in the '' | + | |
- | < | + | |
- | cryolo_predict.py -c cryolo_config.json -w cryolo_model.h5 -i full_data --filament -fw 100 -bd 20 -o boxes/ -g 0 -mn 6 | + | |
- | </ | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | ==== Visualize the results ==== | + | |
- | {{page> | + | |
- | + | ||
- | ===== Evaluate your results ===== | + | |
- | {{page> | + | |
- | + | ||
- | + | ||
- | ===== Advanced parameters ===== | + | |
- | During **training** (// | + | |
- | * // | + | |
- | * // | + | |
- | * // | + | |
- | * // | + | |
- | * // | + | |
- | * //%%-%%lft NUM_LAYER_FINETUNE//: | + | |
- | + | ||
- | During **picking** (// | + | |
- | * //-t CONFIDENCE_THRESHOLD//: | + | |
- | * //-d DISTANCE_IN_PIXEL//: | + | |
- | * //-pbs PREDICTION_BATCH_SIZE//: | + | |
- | * // | + | |
- | * // | + | |
- | * // | + | |
- | * // | + | |
- | * //-sr SEARCH_RANGE_FACTOR//: | + | |
- | + | ||
===== Help ===== | ===== Help ===== | ||
Line 343: | Line 62: | ||
Find help at our [[https:// | Find help at our [[https:// | ||
+ | |||
+ |