cominder commited on
Commit
034cfe9
·
1 Parent(s): 0393b72

Add Iwin model config, weights (pth + safetensors), and README

Browse files
.gitattributes CHANGED
@@ -27,8 +27,9 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
  *.tar.* filter=lfs diff=lfs merge=lfs -text
28
  *.tar filter=lfs diff=lfs merge=lfs -text
29
  *.tflite filter=lfs diff=lfs merge=lfs -text
30
- *.tgz filter=lfs diff=lfs merge=lfs -text
31
- *.wasm filter=lfs diff=lfs merge=lfs -text
 
32
  *.xz filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
 
27
  *.tar.* filter=lfs diff=lfs merge=lfs -text
28
  *.tar filter=lfs diff=lfs merge=lfs -text
29
  *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tif filter=lfs diff=lfs merge=lfs -text
31
+ *.tiff filter=lfs diff=lfs merge=lfs -text
32
+ *.txt filter=lfs diff=lfs merge=lfs -text
33
  *.xz filter=lfs diff=lfs merge=lfs -text
34
  *.zip filter=lfs diff=lfs merge=lfs -text
35
  *.zst filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ tags:
4
+ - vision
5
+ - image-classification
6
+ - arxiv:2507.18405
7
+ datasets:
8
+ - imagenet-22k
9
+ ---
10
+
11
+
12
+ # Iwin Transformer (large-sized model, imagenet-22k, 224x224)
13
+
14
+ <div style="display:flex;justify-content: left">
15
+ <a href="https://arxiv.org/abs/2507.18405"><img src="https://img.shields.io/static/v1?label=Paper&message=Arxiv:Iwin&color=red&logo=arxiv"></a> &ensp;
16
+ <a href="https://github.com/Cominder/Iwin-Transformer/"><img src="https://img.shields.io/static/v1?label=Repository&message=Github&color=blue&logo=github-pages"></a> &ensp;
17
+ </div>
18
+
19
+ ## Model Source
20
+ Pre-trained Iwin Transformer models on ImageNet-1k and ImageNet-22k. For research purposes, we recommend our Github repository (https://github.com/Cominder/Iwin-Transformer), which is more suitable for both training and inference.
21
+
22
+ ## Model Descprition
23
+ We introduce Iwin Transformer, a novel positionembedding-free hierarchical vision transformer, which can be fine-tuned directly from low to high resolution, through the
24
+ collaboration of innovative interleaved window attention and depthwise separable convolution. This approach uses attention to connect distant tokens and applies convolution to link neighboring tokens, enabling global information exchange within a
25
+ single module, overcoming Swin Transformer's limitation of requiring two consecutive blocks to approximate global attention. Extensive experiments on visual benchmarks demonstrate that Iwin Transformer exhibits strong competitiveness in tasks such as image classification (87.4 top-1 accuracy on ImageNet-1K),
26
+ semantic segmentation, and video action recognition. We also validate the effectiveness of the core component in Iwin as a standalone module that can seamlessly replace the self-attention module in class-conditional image generation. The concepts
27
+ and methods introduced by the Iwin Transformer have the potential to inspire future research, like Iwin 3D Attention in video generation. The code and models are available at
28
+ https://github.com/cominder/Iwin-Transformer.
29
+
30
+ ## Citation
31
+ ```
32
+ @misc{huo2025iwin,
33
+ title={Iwin Transformer: Hierarchical Vision Transformer using Interleaved Windows},
34
+ author={Simin Huo and Ning Li},
35
+ year={2025},
36
+ eprint={2507.18405},
37
+ archivePrefix={arXiv},
38
+ primaryClass={cs.CV},
39
+ url={https://arxiv.org/abs/2507.18405},
40
+ }
41
+ ```
config.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "IwinForImageClassification"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.0,
6
+ "depths": [
7
+ 2,
8
+ 2,
9
+ 18,
10
+ 2
11
+ ],
12
+ "drop_path_rate": 0.2,
13
+ "embed_dim": 192,
14
+ "hidden_act": "gelu",
15
+ "hidden_dropout_prob": 0.0,
16
+ "image_size": 224,
17
+ "initializer_range": 0.02,
18
+ "layer_norm_eps": 1e-05,
19
+ "mlp_ratio": 4.0,
20
+ "model_type": "iwin",
21
+ "num_channels": 3,
22
+ "num_heads": [
23
+ 6,
24
+ 12,
25
+ 24,
26
+ 48
27
+ ],
28
+ "num_labels": 21841,
29
+ "patch_size": 4,
30
+ "path_norm": true,
31
+ "qkv_bias": true,
32
+ "torch_dtype": "float32",
33
+ "use_absolute_embeddings": false,
34
+ "window_size": 7
35
+ }
iwin_large_patch4_window7_224_22k.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ef6de2839858159f8b5227fd069ad38bf5b40dfa6781ae5f8af9e768195f5054
3
+ size 945561150
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dad7b16ff1bc59e96336cf3be476720dd22bb64594994e6ab487fba9eae066b6
3
+ size 945458972
preprocessor_config.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_normalize": true,
3
+ "do_resize": true,
4
+ "feature_extractor_type": "ViTFeatureExtractor",
5
+ "image_mean": [
6
+ 0.485,
7
+ 0.456,
8
+ 0.406
9
+ ],
10
+ "image_std": [
11
+ 0.229,
12
+ 0.224,
13
+ 0.225
14
+ ],
15
+ "resample": 3,
16
+ "size": 224
17
+ }