This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
pipeline:window:cryolo [2019/09/17 13:37] twagner [Configuration] |
pipeline:window:cryolo [2020/06/05 09:03] twagner [Overview] |
||
---|---|---|---|
Line 2: | Line 2: | ||
===== Overview ===== | ===== Overview ===== | ||
+ | |||
+ | <note important> | ||
+ | |||
+ | **NEW DOCUMENTATION** | ||
+ | |||
+ | 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 is a fast and accurate particle picking procedure. It's based on convolutional neural networks and utilizes the popular [[https:// | ||
Line 29: | Line 37: | ||
< | < | ||
< | < | ||
- | <a href=" | + | <a href=" |
</ | </ | ||
</ | </ | ||
Line 37: | Line 45: | ||
You can find the download and installation instructions here: [[howto: | You can find the download and installation instructions here: [[howto: | ||
+ | {{page> | ||
+ | ===== Release notes ===== | ||
+ | {{page> | ||
===== Tutorials ===== | ===== Tutorials ===== | ||
Depending what you want to do, you can follow one of these self-contained Tutorials: | Depending what you want to do, you can follow one of these self-contained Tutorials: | ||
- | - I would like to train a model from scratch for picking my particles | + | - [[pipeline: |
- | - I would like to train a model from scratch for picking filaments. | + | |
- | - I would like to refine a general model for my particles. | + | - [[pipeline: |
- | + | - [[pipeline: | |
- | 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. | + | |
- | + | ||
- | + | ||
- | + | ||
- | ===== Picking particles - Using a model trained for your data ===== | + | |
- | 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>pipeline: | + | |
- | + | ||
- | ==== Start crYOLO ==== | + | |
- | {{page> | + | |
- | + | ||
- | ==== Configuration ==== | + | |
- | {{page> | + | |
- | + | ||
- | < | + | |
- | <div style=" | + | |
- | < | + | |
- | </ | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | {{page> | + | |
- | + | ||
- | ==== Training ==== | + | |
- | + | ||
- | {{page> | + | |
- | ==== Picking ==== | + | |
- | {{page> | + | |
- | + | ||
- | + | ||
- | ==== Visualize the results ==== | + | |
- | {{page> | + | |
- | + | ||
- | ==== Evaluate your results ==== | + | |
- | {{page> | + | |
- | ===== Picking | + | |
- | 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>pipeline: | + | |
- | + | ||
- | ==== Configuration==== | + | |
- | In the GUI choose the //config// action. Fill in your target box size and leave the // | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | [[: | + | |
- | + | ||
- | * General model trained for low-pass filtered images : Select //filter// " | + | |
- | * General model trained for JANNI-denoised images: Select //filter// " | + | |
- | * General model for negative stain images: Select filter " | + | |
- | + | ||
- | < | + | |
- | <div style=" | + | |
- | < | + | |
- | </ | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | <hidden **Create the configuration file using the command line**> | + | |
- | In the following | + | |
- | + | ||
- | 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 /path/to/ | + | |
- | </ | + | |
- | + | ||
- | 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 | + | |
- | + | ||
- | Why should I // | + | |
- | - From theory, using fine-tuning should reduce the risk of overfitting ((Overfitting means, that the model works good on the training micrographs, | + | |
- | - 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>pipeline: | + | |
- | + | ||
- | ==== Start crYOLO ==== | + | |
- | + | ||
- | {{page> | + | |
- | ==== Configuration ==== | + | |
- | {{page> | + | |
- | + | ||
- | {{ : | + | |
- | Furthermore, | + | |
- | + | ||
- | You can now press the Start button to create configuration file. | + | |
- | + | ||
- | <hidden **Create the configuration file using the command line: | + | |
- | + | ||
- | 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 | + | |
- | + | ||
- | < | + | |
- | 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 | + | |
- | Since version 1.1.0 crYOLO supports | + | |
- | + | ||
- | Filament mode on Actin: | + | |
- | + | ||
- | {{: | + | |
- | + | ||
- | Filament mode on MAVS (EMPIAR-10031) : | + | |
- | + | ||
- | {{:pipeline: | + | |
- | + | ||
- | 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 | + | |
- | < | + | |
- | 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 and fill all arguments in the “Required arguments” tab: | + | |
- | {{ : | + | |
- | + | ||
- | 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 | + | |
- | </ | + | |
- | </ | + | |
+ | The **first, second and third tutorial** are the most common use cases and well tested. The **fourth tutorial** is still experimental but might give you better results in less time and less training data. | ||
- | ==== 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 ===== |