Add Swin-Transformer to keras.applications
See original GitHub issueIf you open a GitHub issue, here is our policy:
It must be a bug, a feature request, or a significant problem with the documentation (for small docs fixes please send a PR instead). The form below must be filled out.
Here’s why we have that policy:.
Keras developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow.
System information.
TensorFlow version (you are using): 2.6 Are you willing to contribute it (Yes/No): Yes
Describe the feature and the current behavior/state.
Describe the feature clearly here. Be sure to convey here why the requested feature is needed. Any brief description of the use-case would help.
Paper: Swin Transformer: Hierarchical Vision Transformer using Shifted Windows Original Code: https://github.com/microsoft/Swin-Transformer?utm_source=catalyzex.com
It’s a variant of the transformer model and achieves state-of-the-art performance or comparable performance with the best CNN-based models. It also contains enough citations (~250 at this moment) for addition to the package.
On ImageNet-1K and 22K, below is the comparable results with EfficientNet (CNN) models.
- | Img Size | Top 1K acc | - | Img Size | Top 1K acc | Top 22K acc |
---|---|---|---|---|---|---|
E3 | 300 | 81.6 | EfficientNetV2-S | - | 83.9 | 84.9 |
E5 | 456 | 83.6 | EfficientNetV2-M | - | 85.1 | 86.2 |
E7 | 600 | 84.3 | EfficientNetV2-L | - | 85.7 | 86.8 |
- | - | - | EfficientNetV2-XL | - | - | 87.3 |
Swin-T | 224 | 81.3 | Swin-B | 224 | - | 85.2 |
Swin-S | 224 | 83.0 | Swin-B | 384 | - | 86.4 |
Swin-B | 224 | 83.5 | Swin-L | 384 | - | 87.3 |
Swin-B | 384 | 84.5 | - | - | - | - |
Will this change the current api? How? Yes. It will change as follows
tensorflow.keras.applications.SwinT
tensorflow.keras.applications.SwinS
tensorflow.keras.applications.SwinB
tensorflow.keras.applications.SwinL
Who will benefit from this feature? Keras users.
- Do you want to contribute a PR? (yes/no): yes.
- If yes, please read this page for instructions
- Briefly describe your candidate solution(if contributing):
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (13 by maintainers)
Top GitHub Comments
Can we close this for https://github.com/keras-team/keras-cv/issues/671?
Sorry for the late reply. We probably have to host this in the keras/application for now. Eventually we will move this to keras-cv, but we are not ready yet. Feel free to send PR if you have any.