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

[FEATURE] Add Semi-SL multilabel classification algorithm #1805

Merged
merged 22 commits into from
Mar 16, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add semi sl mlc
  • Loading branch information
sovrasov committed Mar 15, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit db8adf27a40c16ea8d0edac8b11d371325c670d3
Original file line number Diff line number Diff line change
@@ -52,11 +52,47 @@ In the table below the `mAP <https://en.wikipedia.org/w/index.php?title=Informat
| EfficientNet-V2-S | 91.91 | 77.28 | 71.52 | 80.24 |
+-----------------------+-----------------+-----------+------------------+-----------+

.. ************************
.. Semi-supervised Learning
.. ************************
************************
Semi-supervised Learning
************************

.. To be added soon
Semi-SL (Semi-supervised Learning) is a type of machine learning algorithm that uses both labeled and unlabeled data to improve the performance of the model. This is particularly useful when labeled data is limited, expensive or time-consuming to obtain.

To utilize unlabeled data during training, we use `BarlowTwins loss <https://arxiv.org/abs/2103.03230>`_ as an auxiliary loss for Semi-SL task solving. BarlowTwins enforces consistency across augmented versions of the same data (both labeled and unlabeled). Additionally, our algorithm uses a combination of strong data augmentations and a specific optimizer called Sharpness-Aware Minimization (SAM) to further improve the accuracy of the model.
sovrasov marked this conversation as resolved.
Show resolved Hide resolved

Overall, OpenVINO™ Training Extensions utilizes powerful techniques for improving the performance of Semi-SL algorithm with limited labeled data. They can be particularly useful in domains where labeled data is expensive or difficult to obtain, and can help to reduce the time and cost associated with collecting labeled data.
sovrasov marked this conversation as resolved.
Show resolved Hide resolved

.. _mlc_cls_semi_supervised_pipeline:

- ``BarlowTwins loss``: A specific implementation of Semi-SL that combines the use of a consistency loss with strong data augmentations, and a specific optimizer called Sharpness-Aware Minimization (SAM) to improve the performance of the model.

- ``Adaptive loss auxiliary loss weighting``: A technique for assigning such a weight for an auxiliary loss that the resulting value is a predefined fraction of the EMA-smoothed main loss value. This method allows aligning contribution of the losses during different training phases.

- ``Exponential Moving Average (EMA)``: A technique for maintaining a moving average of the model's parameters, which can improve the generalization performance of the model.

- ``Additional techniques``: Other than that, we use several solutions that apply to supervised learning (No bias Decay, Augmentations, Early-Stopping, etc.)
sovrasov marked this conversation as resolved.
Show resolved Hide resolved

Please, refer to the :doc:`tutorial <../../../tutorials/advanced/semi_sl>` on how to train semi-supervised learning.
Training time depends on the number of images and can be up to several times longer than conventional supervised learning.

In the table below the mAP on some academic datasets using our pipeline is presented.
sovrasov marked this conversation as resolved.
Show resolved Hide resolved

+-----------------------+---------+----------------------+----------------+---------+----------------+---------+
| Dataset | AerialMaritime 3 cls | | VOC 2007 3 cls | | COCO 14 3 cls | |
+=======================+======================+=========+================+=========+================+=========+
| | SL | Semi-SL | SL | Semi-SL | SL | Semi-SL |
+-----------------------+----------------------+---------+----------------+---------+----------------+---------+
| MobileNet-V3-large-1x | 74.28 | 74.41 | 96.34 | 97.29 | 82.39 | 83.77 |
+-----------------------+----------------------+---------+----------------+---------+----------------+---------+
| EfficientNet-B0 | 79.59 | 80.91 | 97.75 | 98.59 | 83.24 | 84.19 |
+-----------------------+----------------------+---------+----------------+---------+----------------+---------+
| EfficientNet-V2-S | 75.91 | 81.91 | 95.65 | 96.43 | 85.19 | 84.24 |
+-----------------------+----------------------+---------+----------------+---------+----------------+---------+

AerialMaritime was sampled with 5 images per label. VOC and COCO were sampled with 50 images per label.

.. note::
This result can vary greatly depending on the image selected for each class. Also, since there are few labeled settings for the Semi-SL algorithm. Some models may require larger datasets for better results.
sovrasov marked this conversation as resolved.
Show resolved Hide resolved

.. ************************
.. Self-supervised Learning