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

Add Semi-SL for Multi-class Classification (EfficientNet-B0) #3566

Merged
merged 21 commits into from
Jun 7, 2024
Merged

Add Semi-SL for Multi-class Classification (EfficientNet-B0) #3566

merged 21 commits into from
Jun 7, 2024

Conversation

harimkang
Copy link
Contributor

@harimkang harimkang commented May 31, 2024

Summary

CVS-141546

  • OTX 2.1 imports the Semi-SL algorithm from OTX 1.6.
  • Add Unlabeled data pipeline
--data_root: Target the supervised folder.
--data.config.unlabeled_subset.data_root: Targets the unlabeled folder.

image
For the example above,
--data_root is supervised/
and --data.config.unlabeled_subset.data_root must be specified as unlabeled/.

  • Add Multi-Transforms logic into unlabeled dataset
    image
  • Add Semi-SL classifier & Head in OTX 1.6
FMNIST 25@1_0 Accuracy E2E time Epochs
Baseline (SL) 79.01 0:03:37 90
Semi-SL 83.03 (+4.02) 0:06:19 (1.75x) 75

How to test

otx train --config src/otx/recipe/classification/multi_class_cls/efficientnet_b0_semisl.yaml --data_root fmnist@25_0/supervised --data.config.unlabeled_subset.data_root fmnist@25_0/unlabeled

Checklist

  • I have added unit tests to cover my changes.​
  • I have added integration tests to cover my changes.​
  • I have ran e2e tests and there is no issues.
  • I have added the description of my changes into CHANGELOG in my target branch (e.g., CHANGELOG in develop).​
  • I have updated the documentation in my target branch accordingly (e.g., documentation in develop).
  • I have linked related issues.

License

  • I submit my code changes under the same Apache License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below).
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

@github-actions github-actions bot added TEST Any changes in tests OTX 2.0 labels May 31, 2024
Copy link

codecov bot commented Jun 3, 2024

Codecov Report

Attention: Patch coverage is 30.23256% with 150 lines in your changes missing coverage. Please review.

Project coverage is 82.51%. Comparing base (81c2d9e) to head (42f5404).

Current head 42f5404 differs from pull request most recent head fd5c7ca

Please upload reports for the commit fd5c7ca to get more accurate results.

Files Patch % Lines
src/otx/algo/classification/heads/semi_sl_head.py 20.23% 67 Missing ⚠️
src/otx/core/data/module.py 31.81% 30 Missing ⚠️
src/otx/algo/callbacks/unlabeled_loss_warmup.py 0.00% 19 Missing ⚠️
src/otx/algo/classification/efficientnet.py 27.27% 16 Missing ⚠️
...go/classification/classifier/semi_sl_classifier.py 31.25% 11 Missing ⚠️
src/otx/algo/callbacks/iteration_timer.py 40.00% 6 Missing ⚠️
src/otx/core/data/dataset/base.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3566      +/-   ##
===========================================
- Coverage    82.86%   82.51%   -0.35%     
===========================================
  Files          256      258       +2     
  Lines        25305    25394      +89     
===========================================
- Hits         20968    20954      -14     
- Misses        4337     4440     +103     
Flag Coverage Δ
py310 ?
py311 82.51% <30.23%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@harimkang harimkang added this to the 2.1.0 milestone Jun 4, 2024
@harimkang harimkang marked this pull request as ready for review June 4, 2024 02:13
eunwoosh
eunwoosh previously approved these changes Jun 4, 2024
eunwoosh
eunwoosh previously approved these changes Jun 5, 2024
Copy link
Collaborator

@kprokofi kprokofi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work! Overall design looks good.

@kprokofi
Copy link
Collaborator

kprokofi commented Jun 5, 2024

Can we simplify --data.config.unlabeled_subset.data_root CLI command? I prefer shorter, maybe we can create a link to this param and call it as "--unlabeled_data_root"

@harimkang
Copy link
Contributor Author

Can we simplify --data.config.unlabeled_subset.data_root CLI command? I prefer shorter, maybe we can create a link to this param and call it as "--unlabeled_data_root"

Looking at it, the current data-related configs are gathered in data.config. For now, I think we need to think a little more about how to make this a little shorter. Personally, I think it would be better if it goes along with the refactoring of OTXDatamodule.

@harimkang harimkang requested a review from kprokofi June 7, 2024 00:21
Copy link
Contributor

@sungchul2 sungchul2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Co-authored-by: Kim, Sungchul <sungchul.kim@intel.com>
sungchul2
sungchul2 previously approved these changes Jun 7, 2024
eunwoosh
eunwoosh previously approved these changes Jun 7, 2024
@harimkang harimkang dismissed stale reviews from eunwoosh and sungchul2 via fd5c7ca June 7, 2024 08:32
@harimkang harimkang requested review from eunwoosh and sungchul2 June 7, 2024 08:32
@harimkang harimkang merged commit 1343203 into openvinotoolkit:develop Jun 7, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TEST Any changes in tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants