Find answers to common issues you may encounter when working with Dragonfly's Deep Learning Tool…
No. You can only create or use a model within the limitations listed below:
This is the first version of our Deep Learning tool, and most model limitations will be addressed in future versions of the tool. We are currently working on supporting 3D models, multiple inputs and outputs, and other great features that will be included in the next Dragonfly release.
Absolutely. Keras models, saved as HDF5 files (with extension .h5 or .hdf5), can be imported into the Deep Trainer tool as long as they obey the constraints listed previously in these FAQs. Once imported into the tool, the model will have the same behaviour as the models created within the tool — you can apply, edit, and/or retrain them, if needed.
The classes number defines the output of the model and is dependent on the model type. Three model types are supported in Dragonfly:
No. The classes number is derived from the model and cannot be changed directly.
No. You can still use a model with a different number of classes, but you would need to edit it to reflect the new data or problem. We recommend that you preserve the original model by duplicating it.
Most commonly, the number of classes is derived from the "filters" attribute at the last convolutional layer, and you would need to edit its value. You might also need to edit the last activation function (could be defined as separate Activation layer, or as "activation" attribute, at one of the last layers, usually convolutional layer, - whatever comes last). It is recommended to use "sigmoid" activation for 1 class models, and "softmax for 2 or more classes.
Refer to https://keras.io/activations/ for more information about activation functions in Keras.
For easier visualization of the data flow through the model, you can use one of the two arrangement types:
For convenience, both arrangement types can be used with either Horizontal or Vertical layouts, as shown below.
There might be a number of reasons for this.
Training process is a heuristic search for an optimal solution. Unfortunately, sometimes it can get stuck in locally optimal solutions, whereas better globally optimal solutions exist. Changing training parameters (such as optimization algorithm) can be helpful sometimes. But oftentimes, such situations are caused by a bad starting point (for example when you start from a model pre-trained on a very different data and/or problem), and the only way to escape from such a local solution, is to start the training process over from a different start point. In Dragonfly, you can use Reset option, which randomizes learned weights. Depending on a complexity of your model, you might wish to Reset it a few times before starting a training process over (Tip: use Preview to evaluate your model).
Only valid Keras models can be saved. So If there is a problem with a model, save operation will fail. If the problem is obvious, for example when there are disconnected layers, Dragonfly will display a clear error message, which would explain the problem. However, in other cases, for example if there is a problem with layer attributes, Dragonfly will display an error message coming from Keras, which might or might not be clear to the user. Undoing recent changes and trying to save a model without those changes first might be a good strategy. You can also use Reload option to go back to the last saved model version.
To learn more about various layer attributes and how to properly use them, you can visit the Keras website and look for a particular layer type. In Arguments section for each layer type you will find a list of layer attributes, their meaning, and usage details.
There might be various reasons for this, such as wrong data type or wrong dimensions. If you point your mouse to the "+" button, you will see a tooltip that will help you to determine the problem.
Using more data to learn from is always beneficial, assuming the data is relevant to the problem. However, sometimes dataset include many irrelevant information which, if used for training, may cause optimization algorithm slow down or even go in a wrong direction. Reducing irrelevant information from the training data will generally lead to improvement in both training time and achieved results. An example of a dataset where using a mask could be highly beneficial, if not crucial, is shown at the image below.
Training is a heuristic process, and choosing a good set of training parameters can be quite challenging. Sometimes you have hardware limitations too. We try to help users by providing an initial set of training parameters, which would work well in most cases. Training parameters are saved with the model, and can be reused for future training.
Some models define an input size as part of the model. These are called fixed-size models. Trying to use these models with different sizes of input data will cause an error. Other models do not specify input size, but rather define a placeholder for the input. These variable-size models can be used with various input sizes, provided that a valid output can be computed for each model layer.
Callbacks are functions called at the particular time points during the training process, usually at the end of a training epoch or at the end of batch processing. In the current version, three callbacks are supported:
For more information about callbacks, refer to: https://keras.io/callbacks/.
Although callbacks are great when you know how to use them, they might cause undesired consequences when used improperly. For example, "Early Stopping" might stop a training process too early, while a better solution could be found if the training process would continue. This is why callbacks appear in "Advanced Settings" section of training parameters and are turned off by default.
Training a good deep model with a small amount of data is quite challenging. One way to overcome this, is to use pre-trained model and fine tune it to your data. If your data and/or problem is very different, and none of the pre-trained models work well for you, you might wish to build and train your own model. In this case, we recommend to use more shallow architectures, as adding more layers to the model would increase a risk of overfitting.
Every machine learning algorithm, whether deep or not, is prone to overfitting. Overfitting is a situation in which an algorithm just memorizes the data from training and fails to provide good results on new, previously unseen data. In order to avoid this situation, a separate data should be used for algorithm validation. This data has to be different from the data used in training.
In Dragonfly, you can either randomly split the available data into training and validation, specifying a percentage of the data to be preserved for validation, or to provide separate validation data explicitly. If you have only one dataset, you can reuse it for both training and validation by defining non-intersecting masks.
Although we don't force using validation, we strongly recommend it, even if the amount of data is limited. The reason is that the training error will always decrease during the training, and monitoring its value is useless. However, if we have validation data and monitor validation error, we can detect a point when the validation error starts increasing. This means that the algorithm starts overfitting, and training process should be stopped.https://visualstudiomagazine.com/articles/2015/05/01/train-validate-test-stopping.aspx