Kaspersky Machine Learning for Anomaly Detection

Training a neural network element of an ML model

December 6, 2023

ID 261883

With Kaspersky MLAD, you can train a neural network element for an ML model that was created manually, imported into Kaspersky MLAD, created from a template, or copied.

System administrators and users who have the Train models permission from the Manage ML models group of rights can train elements of ML models.

To train an ML model element:

  1. In the main menu, select the Models section.
  2. In the asset tree, select the neural network element that you want to train.

    A list of options appears on the right.

  3. Open the Training tab and click the Edit button in the upper-right corner of the window.
  4. In the Data selection interval field, specify the data time interval on which you want to train the ML model.
  5. To apply markups when selecting data for training the ML model within a selected interval, select one or several markups in the Markups field.

    The selected markups will form a learning indicator.

  6. To view the data that will be selected by the markups, click On graph.

    Markups are displayed in the colors that were specified when they were created.

  7. If necessary, enable Advanced training settings and do the following:
    1. In the Maximum training duration (sec) field, specify a maximum time in seconds that the Kaspersky MLAD server can spend for training an ML model.
    2. In the Validation split field, use a decimal value to specify the share of the validation sample as a percentage of the entire dataset used to train the ML model.

      You can specify a value in the range of 0 to 1.

      The default value of this parameter is 0.2.

    3. In the Maximum epoch count field, specify the maximum number of epochs for training the ML model.

      The default value of this parameter is 500.

    4. In the Patience field, specify the number of epochs with no improvement in training quality to wait before stopping the ML model training process early.

      Stopping the ML model training early avoids overfitting of the model. Training in this case is considered to be completed successfully.

      The default value of this parameter is 15.

    5. In the Resolution of training results graphs field, use a decimal value to specify the graph resolution for displaying training results on the Training results tab.

      You can specify a value in the range of 0 to 1.

    6. In the Batch size field, specify the number of selection items that must be sent for training within the iteration.

      The default value of this parameter is 16.

    7. In the Block count field, specify the number of blocks into which you want to split the dataset for training the ML model.

      The default value of this parameter is 4.

    8. In the Inference mode drop-down list, select one of the following values:
      • If you want to load all batches into RAM, select Fast inference.

        This inference mode allows you to perform inference faster.

      • If you want to load data batches into RAM one at a time, select Memory saving mode.

        This inference mode allows inference to be performed with minimal expenditure of RAM, but it will take place slower than in Fast inference mode.

      The selected inference mode is applied only while training a neural network element of an ML model.

    9. In the Training mode drop-down list, select one of the following values:
      • If you want to load the entire dataset for training the model into RAM, select Load whole dataset to RAM.
      • If you want to load one data block at a time into RAM and generate validation blocks from the end of the dataset, select Validate at the end of the dataset.
      • If you want to load one data block at a time into RAM without generating validation blocks, select Run validation in each training data block.

        Validation data is generated from each training data block.

    10. In the Memory allocation mode drop-down list, select one of the following settings:
      • Reserve minimum amount of free RAM. If this setting is selected, the Trainer service will make sure that the minimum amount of memory specified in the Amount of RAM, MB field remains free when training the ML model.
      • Reserve maximum available amount of RAM for model training. If this setting is selected, the Trainer service will use the maximum amount of RAM specified in the Amount of RAM, MB field when training the ML model.
    11. To consider previous training results while training an ML model on new data, enable the option to Initialize model weights with values from previous training results.
    12. If you want to shuffle the data to improve the quality of ML model training, enable the Shuffle data option.
  8. In the upper-right corner of the window, click the Save button.
  9. In the information block located above the training settings, click the Train element button.

The information block will show the number of the current training epoch of the ML model element. After the training is complete, you can view the training results of an ML model element in the Training results tab.

After training all the neural network elements within an ML model, the model is assigned the Trained status. If required, you can retrain the ML model element by clicking Restart training.

Did you find this article helpful?
What can we do better?
Thank you for your feedback! You're helping us improve.
Thank you for your feedback! You're helping us improve.