---
title: 'NeuralNetwork Settings'
url: 'https://docs.danami.com/warden/settings/antispam/plugin-settings/neuralnetwork'
markdown: 'https://docs.danami.com/warden/settings/antispam/plugin-settings/neuralnetwork.md'
date: '2026-10-09'
description: 'Check emails using a neural network algorithm for better spam detection using a trained AI model. Use neural network - use_neuralnetwork Whether to use Neural Network, if it is available. Default: 1 Neural network data directory - neuralnetwork_data_dir Where the NeuralNetwork plugin will store i…'
taxonomy:
  category:
    - docs
  tag:
    - neuralnetwork
---

[](#)  [ Basics ](https://docs.danami.com/warden/)     [ Settings ](https://docs.danami.com/warden/settings)     [ Antispam ](https://docs.danami.com/warden/settings/antispam)     [ Plugin Settings ](https://docs.danami.com/warden/settings/antispam/plugin-settings)      NeuralNetwork Settings    

# NeuralNetwork Settings

Check emails using a neural network algorithm for better spam detection using a trained AI model.

**Use neural network** - `use_neuralnetwork`
Whether to use Neural Network, if it is available.
Default: 1

**Neural network data directory** - `neuralnetwork_data_dir`
Where the NeuralNetwork plugin will store its data.
Default: /etc/mail/spamassassin/.neuralnetwork

**Neural network min text length** - `neuralnetwork_min_text_len`
The minimum number of characters of visible text required to run prediction or learning on a message.
Default: 256

**Neural network min word length** - `neuralnetwork_min_word_len`
The minimum token length considered when building the vocabulary and feature vectors.
Default: 4

**Neural network max word length** - `neuralnetwork_max_word_len`
The maximum token length considered when building the vocabulary and feature vectors.
Default: 24

**Neural network vocab cap** - `neuralnetwork_vocab_cap`
The maximum number of vocabulary terms to retain; least-frequent terms are pruned when exceeded.
Default: 10000

**Neural network min vocab hits** - `neuralnetwork_min_vocab_hits`
The minimum number of tokens in the email that must exist in the vocabulary for prediction to run.
Default: 10

**Neural network cache TTL** - `neuralnetwork_cache_ttl`
The time-to-live in seconds for the in-memory vocabulary and model caches Set to 0 to disable caching.
Default: 300

**Neural network min spam count** - `neuralnetwork_min_spam_count`
The minimum number of spam messages in the vocabulary required to enable prediction.
Default: 100

**Neural network min ham count** - `neuralnetwork_min_ham_count`
The minimum number of ham messages in the vocabulary required to enable prediction.
Default: 100

**neuralnetwork\_spam\_threshold** - `neuralnetwork_spam_threshold`
Prediction values above this threshold are considered spam.
Default: 0.8

**Neural network ham threshold** - `neuralnetwork_ham_threshold`
Prediction values below this threshold are considered ham.
Default: 0.2

**Neural network learning rate** - `neuralnetwork_learning_rate`
The learning rate used by the underlying FANN network during incremental training.
Default: 0.1

**Neural network momentum** - `neuralnetwork_momentum`
The momentum used for training updates.
Default: 0.1

**Neural network train epochs** - `neuralnetwork_train_epochs`
The number of training epochs to perform when learning a single message.
Default: 50

**Neural network train algorithm** - `neuralnetwork_train_algorithm`
The algorithm used by Fann neural network used when training, might increase speed depending on the data volume.
Default: FANN\_TRAIN\_RPROP

**Neural network lock timeout** - `neuralnetwork_lock_timeout`
The maximum number of seconds to wait for the exclusive training lock before giving up and skipping the learn operation. Set to 0 to wait indefinitely.
Default: 10

**Neural network RPROP delta max** - `neuralnetwork_rprop_delta_max`
The delta value to apply to RPROP training replay loop.
Default: 0.5

**Neural network retrain interval** - `neuralnetwork_retrain_interval`
The number of successful learn\_message calls between forced full retrains of the neural network from the persisted vocabulary. After each retrain the incrementally-trained network is replaced with the freshly rebuilt one. Set to 0 to disable periodic retraining and keep online learning only.
Default: 100

**neuralnetwork\_stopwords** - `neuralnetwork_stopwords`
A space-separated list of stopwords to ignore when tokenizing text.
Default: the and for with that this from there their have be not but you your

**Neural network autolearn** - `neuralnetwork_autolearn`
When SpamAssassin declares a message spam or ham during the message scan, and launches the auto-learn process, the message is autolearned as spam/ham in the same way as during the manual learning.
Default: 0

**Neural network autolearn vocab only** - `neuralnetwork_autolearn_vocab_only`
When enabled and auto-learn is enabled, autolearned messages update the vocabulary and training buffer but skip FANN model training and saving. This avoids slow I/O operations and temporary files during daemon processing. The model is rebuilt from the accumulated vocabulary on the next manual sa-learn run.
Default: 0

## Related Pages

- [NeuralNetwork](https://docs.danami.com/warden/user-guide/antispam-plugins/neuralnetwork "NeuralNetwork")

 [ ](https://docs.danami.com/warden/command-line-interface/antispam/antispam-plugin-neuralnetwork)

---

## Navigation

- Parent: [Plugin Settings](https://docs.danami.com/warden/settings/antispam/plugin-settings.md)
- Previous: [FromNameSpoof Settings](https://docs.danami.com/warden/settings/antispam/plugin-settings/fromnamespoof.md)
- Next: [OLEVBMacro Settings](https://docs.danami.com/warden/settings/antispam/plugin-settings/olevbmacro.md)
