Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Anomaly docs #3151

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion docs/source/guide/explanation/algorithms/anomaly/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ To predict the anomaly score, Mahalanobis distance is calculated to score each p

Since the PADIM model uses a pre-trained backbone to extract features, the training does not involve fine-tuning of neural network weights. This means that PADIM does not make use of an optimizer and a loss function.

Parameters
~~~~~~~~~~~~~~~~~~~~

Since the Padim model extracts features and uses clustering algorithms to learn normality, we use the following parameters for its training:

- ``Backbone``: The default backbone is ``ResNet18``. You can also use ``Wide ResNet50``.
- ``Layers``: The layers used for feature extraction. The default layers are ``layer1, layer2, layer3``.
- ``Pre-Trained``: Whether or not to use a pre-trained backbone. The default value is ``True``.
- ``N-Features``: The number of features to be retained for the dimensionality reduction step. Default values from the paper are available for: ``ResNet18 (100)`` and ``Wide ResNet50 (550)``.

Knowledge Distillation-based Models
-----------------------------------
Knowledge distillation is a deep learning technique in which a smaller model (student) is trained to imitate the behavior of a larger and more complex model (teacher). This technique is predicated on the notion that the knowledge contained in a large and complex model can be transferred to a smaller and simpler model, resulting in a model with comparable performance that is both more efficient and faster. OpenVINO Training Extensions currently supports `STFPM: Student-Teacher Feature Pyramid Matching for Unsupervised Anomaly Detection <https://arxiv.org/pdf/2103.04257.pdf>`_.
Expand All @@ -132,6 +142,7 @@ Training Parameters
Since STFPM trains the student network, we use the following parameters for its training:

- ``Backbone``: The default backbone is ``ResNet18``. You can also use ``Wide ResNet50``.
- ``Layers``: The layers used for feature extraction. The default layers are ``layer1, layer2, layer3``.
- ``Loss``: Loss is computed as the mean squared error between the student and teacher feature pyramids. The default loss is ``MSE`` and cannot be changed.
- ``Optimizer``: The default optimizer is ``SGD`` and cannot be changed. It uses the following parameters that can be changed:
- ``Learning Rate``: The default learning rate is ``0.4``.
Expand All @@ -141,7 +152,7 @@ Since STFPM trains the student network, we use the following parameters for its
- ``Aditional Techniques``:
- ``Early Stopping``: Early stopping is used to stop the training process when the validation loss stops improving. The default value of the early stopping patience is ``10``.

For more information on STFPM's training. We invite you to read Anomalib's `STFPM documentation <https://anomalib.readthedocs.io/en/latest/reference_guide/algorithms/stfpm.htm>`_.
For more information on STFPM's training. We invite you to read Anomalib's `STFPM documentation <https://anomalib.readthedocs.io/en/v1.0.0/markdown/guides/reference/models/image/stfpm.html>`_.

Reconstruction-based Models
---------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ anomaly detection tasks
['stfpm', 'padim']
'''

You can see two anomaly detection models, STFPM and PADIM. For more detail on each model, refer to Anomalib's `STFPM <https://openvinotoolkit.github.io/anomalib/reference_guide/algorithms/stfpm.html>`_ and `PADIM <https://openvinotoolkit.github.io/anomalib/reference_guide/algorithms/padim.html>`_ documentation.
You can see two anomaly detection models, STFPM and PADIM. For more detail on each model, refer to Anomalib's `STFPM <https://anomalib.readthedocs.io/en/v1.0.0/markdown/guides/reference/models/image/stfpm.html>`_ and `PADIM <https://anomalib.readthedocs.io/en/v1.0.0/markdown/guides/reference/models/image/padim.html>`_ documentation.

2. Let's proceed with PADIM for
this example.
Expand Down
Loading