---
title: 'WAFL-ViT: Federated & Wavelet Vision Transformer'
url: https://www.emergentmind.com/topics/wafl-with-vision-transformer-wafl-vit
type: topic
---

# WAFL-ViT: Federated & Wavelet Vision Transformer

Searching arXiv for the papers and terminology to ground the article in current records.
WAFL with Vision Transformer (WAFL-ViT) appears in the provided literature in three distinct contexts rather than as a single uniformly defined model. In one usage, it denotes **Wireless Ad Hoc Federated Learning (WAFL)** with a **Vision Transformer (ViT)** backbone for mission-oriented image recognition on decentralized edge devices [2512.05468]. In a second usage, the label is treated as a naming variant or misnomer for **Wavelet Vision Transformer (Wave-ViT)**, which replaces non-invertible pooling-based key/value down-sampling in multi-scale ViTs with an invertible discrete wavelet transform and uses inverse DWT to enrich attention outputs [2207.04978]. In a third usage, the term is mapped to a ViT in which self-attention is replaced by **Multiscale Wavelet Attention (MWA)** derived from wavelet neural operators [2303.12398]. The shared theme across these usages is the combination of transformer-based visual representations with either decentralized collaborative learning or wavelet-domain multiscale processing.

## 1. Terminological scope and disambiguation

The expression “WAFL-ViT” is not a single canonical designation in the cited material. The following usages are explicitly present.

| Usage | Core meaning | Primary source |
|---|---|---|
| WAFL-ViT | Wireless Ad Hoc Federated Learning with a ViT backbone; only the classifier MLP head is fine-tuned and exchanged among neighbors | [2512.05468] |
| “WAFL-ViT” as a naming variant or misnomer | Wavelet Vision Transformer (Wave-ViT), which formulates invertible down-sampling with wavelet transforms and self-attention learning in a unified way | [2207.04978] |
| WAFL mapped to MWA-ViT | Multiscale Wavelet Attention replaces self-attention in ViT blocks through wavelet-domain filtering and IDWT reconstruction | [2303.12398] |

For the wavelet-based interpretation associated with Wave-ViT, the source explicitly states that there is **no separate prior called “WAFL”** in that context, and that “WAFL with Vision Transformer (WAFL-ViT)” appears to be a naming variant or misnomer for **Wavelet Vision Transformer (Wave-ViT)** [2207.04978]. For the wavelet-neural-operator interpretation, the source explicitly maps “WAFL” to the proposed **Multiscale Wavelet Attention (MWA)** module that replaces self-attention [2303.12398]. By contrast, in the mission-oriented IoT paper, WAFL unambiguously means **Wireless Ad Hoc Federated Learning**, a fully decentralized, device-to-device collaborative training framework for edge devices in an ad hoc wireless network [2512.05468].

This terminological overlap is a recurring source of confusion. A careful reading therefore requires distinguishing between **WAFL as a decentralized learning protocol** and **WAFL as a wavelet-based token-mixing or attention replacement shorthand**.

## 2. WAFL-ViT as Wireless Ad Hoc Federated Learning with a Vision Transformer

In the mission-oriented IoT setting, WAFL is defined as a **fully decentralized, device-to-device collaborative training framework for edge devices in an ad hoc wireless network** [2512.05468]. It was proposed to address **privacy and single-point-of-failure concerns inherent to centralized federated learning**. Edge devices train locally on their own data and exchange model information only with their wireless neighbors, thereby forming a **mission-oriented sensor system**. The deployment emphasized in the source is **smart-campus building image recognition**, in which sensors distributed across a campus collaboratively learn a joint classifier without relying on a central server.

WAFL-ViT integrates a **Vision Transformer (ViT)** into that paradigm. The key design choice is explicit: **freeze the ViT backbone on each device and only fine-tune and exchange the parameters of the classifier MLP head among neighbors** [2512.05468]. The source states that this design **limits overfitting to the local (often limited) data on each device and reduces communication overhead, because only the small head is shared, not the entire ViT**. It also states, verbatim, that **“To avoid overfitting to the local images, all parameters of each ViT in each device are not fine-tuned”**.

The local supervised objective is standard multi-class cross-entropy. For device \(n\) with local dataset \(D_n=\{(x_i,y_i)\}\), the loss is given as

$$
\ell_{\mathrm{CE}}(y,p)=-\sum_{c=1}^{C}\mathbf{1}[y=c]\log p_c,
$$

with \(p=\mathrm{softmax}(\mathrm{logits})\), and the local objective is

$$
L_n(W^n)=\frac{1}{|D_n|}\sum_{(x,y)\in D_n}\ell_{\mathrm{CE}}\!\left(y,f_{\text{head}}\!\left(f_{\text{ViT}}(x;\theta_{\text{ViT}});W^n\right)\right),
$$

where \(\theta_{\text{ViT}}\) are frozen ViT backbone parameters and \(W^n\) are the MLP head parameters on device \(n\) [2512.05468].

The ViT backbone described in the same source is **ViT-B/16**. Patch embedding is defined in the standard form by splitting an input image \(X\in\mathbb{R}^{H\times W\times 3}\) into non-overlapping \(p\times p\) patches, with \(p=16\), and projecting them linearly:

$$
Z_0=[x_1E;x_2E;\dots;x_NE]+E_{\text{pos}},
$$

where \(E\in\mathbb{R}^{(p^2\cdot 3)\times d}\) is the learned patch projection and \(E_{\text{pos}}\) are learned positional encodings. A class token \([\mathrm{CLS}]\) may be prepended, as in standard ViT. Self-attention and the transformer encoder block are written in standard form:

$$
\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\left(\frac{QK^\top}{\sqrt{d_k}}\right)V,
$$

$$
X'=X+\mathrm{MHA}(\mathrm{LN}(X)), \qquad X''=X'+\mathrm{MLP}(\mathrm{LN}(X')).
$$

The exchanged classifier head consumes either the \([\mathrm{CLS}]\) token representation or pooled patch features to produce logits over \(C\) classes [2512.05468].

## 3. Decentralized optimization, communication, and mission-oriented data

WAFL-ViT performs **decentralized neighbor averaging of the MLP head parameters** [2512.05468]. Let \(n\) index devices, \(\mathrm{adj}(n)\) be the set of wireless neighbors of device \(n\), \(W^n\) the MLP head parameters at device \(n\), and \(\lambda\in[0,1]\) a mixing hyperparameter. The parameter-exchange update is

$$
W^{n} \leftarrow W^{n} + \lambda \, \frac{\sum_{k \in \mathrm{adj}(n)} (W^{k} - W^{n})}{|\mathrm{adj}(n)| + 1}.
$$

The round structure is also explicit. In each round, a device \(n\) first **fine-tunes its local MLP head \(W^n\) on local images** while the ViT backbone remains frozen, and then **exchanges \(W^n\) with neighbors and updates \(W^n\) via the above rule**. The paper further states that there is **no global server and no FedAvg**; instead, the algorithm is a **decentralized neighbor averaging (gossip-like) rule specialized to the MLP head** [2512.05468].

Connectivity is dynamic because devices follow **random waypoint mobility (RWP)**, so \(\mathrm{adj}(n)\) changes over time. The simulation assumes **10 distributed devices across the campus**. Images are **uniformly distributed across devices (IID)**, and the source explicitly notes that **non-IID heterogeneity is not considered in this study**. Device hardware, bandwidth, latency, payload sizes per round, compression or quantization, and energy consumption are **not specified** [2512.05468].

The mission-oriented data regime is central to this formulation. The paper cites the **UTokyo Building Recognition Dataset (UTBR)** as the original mission-oriented dataset used to validate WAFL-ViT; UTBR comprises **10 labeled buildings for smart-campus image recognition at the University of Tokyo**, although the source does not provide per-class counts, splits, or resolutions there [2512.05468]. The new dataset introduced in the paper is the **Chulalongkorn University Building Recognition Dataset (CUBR)**, tailored to smart-campus vision recognition in a WAFL setting. CUBR contains **32 distinct buildings (labels 0–31)** and **4005 images across 32 classes**, with totals of **3194 training images** and **811 validation images**. Images were **captured over a month using 4 different devices** and include **diverse distances, viewing angles, illumination conditions, partial occlusions, and cluttered backgrounds** [2512.05468].

This mission-oriented framing is presented as the rationale for dataset specialization. The source states that WAFL is built for **targeted missions** where devices collect local data tied to the deployment environment, and that CUBR extends this paradigm to Chulalongkorn University so that the training data reflect the actual buildings and conditions encountered by an IoT sensor network on that campus [2512.05468].

## 4. Empirical behavior of decentralized WAFL-ViT

The reported evaluation protocol computes accuracy at **10 nodes** using test data, with **mean and standard deviation calculated over 32 labels × 10 nodes = 320 accuracies** [2512.05468]. Under the IID case on CUBR, the quantitative results are as follows.

| Model | Accuracy | Standard deviation |
|---|---:|---:|
| WAFL-ViT | 0.861 | 0.007 |
| WAFL-ResNet | 0.833 | 0.022 |
| WAFL-VGG | 0.732 | 0.008 |
| WAFL-MobileNet | 0.791 | 0.015 |
| SELF-ViT | 0.619 | 0.017 |
| SELF-ResNet | 0.596 | 0.025 |
| SELF-VGG | 0.498 | 0.023 |
| SELF-MobileNet | 0.561 | 0.018 |

The source states that **WAFL-ViT achieves the best accuracy and consistency (lowest std) among all configurations**, and that **all WAFL models outperform their corresponding self-training baselines** [2512.05468]. A confusion matrix is shown for **device 6 at epoch 2000**, and the accompanying analysis indicates difficulty distinguishing between **label 10 and label 11**.

The training budgets are asymmetric across scenarios. The paper reports **“up to 500 epochs for self-training and up to 1500 epochs for collaborative training”** for WAFL models, and **“up to 2000 epochs for self-training”** for SELF models. It does **not specify per-round local steps or the mapping from epochs to communication rounds**. It also does **not include training curves, convergence statistics, or ablations** such as the number of devices, communication rounds, ViT size, patch size, or learning rate [2512.05468].

A plausible implication is that the numerical superiority of WAFL-ViT over self-training on CUBR is well supported within the reported IID simulation, whereas its behavior under non-IID partitions, heterogeneous devices, or explicit wireless constraints remains outside the scope of the reported experiments.

## 5. Wave-ViT: wavelet-based invertible down-sampling in multi-scale vision transformers

In the wavelet-transformer literature, the closely related model is **Wave-ViT**, introduced as **Wavelet Vision Transformer** [2207.04978]. Its motivation is the quadratic cost of self-attention with respect to the input patch number. Multi-scale ViTs often reduce attention cost by **down-sampling operations (e.g., average pooling) over keys/values**, but the source argues that such over-aggressive down-sampling design is **not invertible and inevitably causes information dropping especially for high-frequency components in objects (e.g., texture details)**.

Wave-ViT addresses that issue by replacing pooling-based \(K/V\) down-sampling with an **invertible discrete wavelet transform (DWT)** and using **inverse DWT (IDWT)** to strengthen attention outputs by aggregating local contexts with enlarged receptive field [2207.04978]. Standard scaled dot-product attention is written as

$$
Q=XW_Q,\qquad K=XW_K,\qquad V=XW_V,
$$

$$
\mathrm{Att}(Q,K,V)=\mathrm{softmax}\!\left(\frac{QK^\top}{\sqrt{d}}\right)V,
$$

with complexity \(O(N^2d)\). If \(K\) and \(V\) are computed on a reduced set of tokens \(N_s<N\), the complexity becomes \(O(NN_sd)\). With **DWT-based down-sampling at factor 2 per spatial dimension, \(N_s=N/4\)** [2207.04978].

The transform uses the **Haar wavelet** with filters

$$
f_L=\left(\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}}\right),\qquad
f_H=\left(\frac{1}{\sqrt{2}},-\frac{1}{\sqrt{2}}\right).
$$

A single-level 2D DWT yields four sub-bands at half resolution in each spatial dimension:

$$
LL=(X*h_x*h_y)\downarrow 2,\qquad
LH=(X*h_x*g_y)\downarrow 2,
$$

$$
HL=(X*g_x*h_y)\downarrow 2,\qquad
HH=(X*g_x*g_y)\downarrow 2.
$$

These correspond to **LL (coarse structure)** and **LH/HL/HH (horizontal, vertical, diagonal high-frequency textures)**. For orthonormal Haar, **perfect reconstruction holds if filters form a quadrature mirror pair (QMF)**, and **boundary handling uses symmetric padding in practice to avoid artifacts** [2207.04978].

Wave-ViT uses a **four-stage hierarchical ViT backbone (input 224×224)** with outputs \(H/4\times W/4\), \(H/8\times W/8\), \(H/16\times W/16\), and \(H/32\times W/32\). Within each **Wavelets block**, the incoming feature \(X\in\mathbb{R}^{H\times W\times D}\) is first projected to \(\tilde{X}=XW_d\in\mathbb{R}^{H\times W\times (D/4)}\), then passed through a single-level 2D DWT to produce \(X_{LL},X_{LH},X_{HL},X_{HH}\), concatenated along channels into \(\hat{X}\in\mathbb{R}^{H/2\times W/2\times D}\), and processed by a **\(3\times 3\) convolution** to impose locality. Queries are obtained from the original-resolution \(X\), while down-sampled keys and values are obtained from the wavelet-domain representation. The final block output concatenates the multi-head attention outputs with the IDWT reconstruction \(X^r\) and projects them back, thereby combining **global attention** with **enhanced local context** [2207.04978].

The source reports the following ImageNet-1K results: **Wave-ViT-S: 82.7% top-1, 96.2% top-5, 19.8M params, 4.3 GFLOPs**; **Wave-ViT-S⋆: 83.9% top-1, 96.6% top-5, 22.7M params, 4.7 GFLOPs**; **Wave-ViT-B⋆: 84.8% top-1, 97.1% top-5, 33.5M params, 7.2 GFLOPs**; **Wave-ViT-L⋆: 85.5% top-1, 97.3% top-5, 57.5M params, 14.8 GFLOPs** [2207.04978]. On COCO with RetinaNet \(1\times\), **Wave-ViT-S AP=45.8** and **Wave-ViT-B AP=47.2**; on Mask R-CNN \(1\times\), **Wave-ViT-S \(AP^{box}=46.6\), \(AP^{mask}=42.4\)** and **Wave-ViT-B \(AP^{box}=47.6\), \(AP^{mask}=43.0\)**. On ADE20K with UPerNet, **Wave-ViT-S \(mIoU=49.6\)** and **Wave-ViT-B \(mIoU=51.5\)** [2207.04978].

The ablation on down-sampling choices is particularly central to the Wave-ViT interpretation. For the small model, the source reports **average pooling K/V: 3.9 GFLOPs, 82.0% top-1**; **pooling kernels (conv): 4.0 GFLOPs, 82.0% top-1**; **DWT only (invertible K/V down-sampling): 4.3 GFLOPs, 82.5% top-1**; and **DWT + Conv + IDWT (full Wavelets block): 4.3 GFLOPs, 82.7% top-1** [2207.04978]. The source further states that preserving **LH/HL/HH** sub-bands maintains edges and fine textures crucial for detection and segmentation.

## 6. MWA-ViT: multiscale wavelet attention as a replacement for self-attention

A second wavelet-based interpretation maps WAFL-ViT to the architecture described in **“Multiscale Attention via Wavelet Neural Operators for Vision Transformers”** [2303.12398]. In that usage, WAFL corresponds to the proposed **Multiscale Wavelet Attention (MWA)** module, which replaces self-attention in ViT blocks.

The motivation is that standard self-attention has quadratic complexity in sequence length, while **AFNO** and **GFN** provide efficient global filtering but are less effective for **small and moderate scale structures that commonly appear in natural images** [2303.12398]. MWA instead uses wavelet-domain multiscale filtering. For a 2D token-grid \(X\), forward DWT produces approximation and detail coefficients, and the learned operator is written as

$$
\mathrm{MWA}(X)=\mathrm{IDWT}\!\left(\Phi^{(a)}_J(a_J),\{\Phi^{(d)}_j(d_j)\}_{j=1}^{J}\right).
$$

The default configuration uses **Haar wavelet** and **\(m=1\)** decomposition level. In practical block form, the input token sequence is reshaped to a grid, decomposed into **LL, LH, HL, HH**, each sub-band is filtered by **grouped 2D/3D convolutions with kernel sizes \(1\times 1\) and \(3\times 3\) followed by GeLU**, and IDWT reconstructs the spatial feature map. The module also uses **weighted skip connections (\(1\times 1\) and \(3\times 3\) conv + GeLU)** to facilitate identity mapping and high-frequency preservation [2303.12398].

The resulting transformer block is **LayerNorm → MWA → Residual Add → MLP (FFN) → Residual Add**, with positional encodings unchanged. The source gives the complexity comparison in asymptotic form: **SA: \(O(N^2 d)+O(N d^2)\)**, **AFNO: \(O(N d \log N)\)**, and **MWA: \(O(N d)\)** in sequence length, with memory **\(O(N d)\)** and no \(N\times N\) attention matrix [2303.12398].

The reported experiments use **CIFAR-10/100** and **Tiny-ImageNet**, with **ViT-XS/4**, **ViT-S/4**, and **ViT-B/4**, **patch size \(p=4\)**, **Adam**, **cross-entropy loss**, **300 epochs**, **LR \(5\times 10^{-4}\)**, **5-epoch linear warm-up**, **cosine decay to \(10^{-5}\)**, **gradient clipping \(\le 1\)**, and **weight decay 0.05** [2303.12398]. Representative results include:

- On **CIFAR-10**, **ViT-B/4** with **MWA** achieves **Top-1 96.1**, compared with **95.2** for **AFNO** and **95.3** for **GFN**.
- On **CIFAR-10**, **ViT-S/4** with **MWA** achieves **Top-1 95.3**, compared with **93.7** for **AFNO** and **94.4** for **GFN**.
- On **Tiny-ImageNet**, **ViT-S/4** with **MWA** achieves **Top-1 81.40**, compared with **79.98** for **AFNO** and **80.32** for **GFN** [2303.12398].

The ablations identify the practical defaults. For the number of decomposition levels, **\(m=1\)** is fastest and competitive, although higher \(m\) can modestly increase accuracy at significant training-time cost. For wavelet type on CIFAR-100 with ViT-XS/4, the source reports **Haar: Top-1 71.6%, Train \(\sim 4{:}36{:}12\)**, **db4: Top-1 71.3%, Train \(\sim 6{:}14{:}59\)**, and **db6: Top-1 71.6%, Train \(\sim 8{:}36{:}31\)**. For **DWT vs. DTCWT**, it reports **DWT: Top-1 71.6%, Train \(\sim 4{:}36{:}12\)** and **DTCWT: Top-1 72.2%, Train \(\sim 9{:}45{:}54\)**. For the skip branches, **\(3\times 3 + 1\times 1\)** gives the best shown CIFAR-100 result at **Top-1 71.6%** [2303.12398].

## 7. Limitations, misconceptions, and comparative interpretation

The most immediate misconception is terminological. In the cited material, **WAFL-ViT does not identify one unique architecture**. It may refer to a **decentralized federated ViT**, to **Wave-ViT**, or to **MWA-ViT**. Any technical discussion therefore requires the underlying paper or mechanism to be specified explicitly.

For **Wireless Ad Hoc Federated Learning with ViT**, the source lists several limitations: the data distribution is **IID across devices**; **non-IID heterogeneity is not assessed**; only the **MLP head is fine-tuned and exchanged**; and **real-world wireless parameters (bandwidth, latency, energy) and hardware characteristics are not provided**, with results obtained from **simulation with RWP mobility** [2512.05468]. The source also notes that optimizer, learning rates, batch sizes, augmentation, and the mixing parameter \(\lambda\) are **not specified by the authors**.

For **Wave-ViT**, the limitations stated in the source include **small compute and implementation complexity** from DWT/IDWT, the fact that the paper uses **Haar** and does **not report alternative wavelet families ablations**, and the need for correct **sub-band channel grouping and padding** because implementation errors **degrade reconstruction** [2207.04978]. The source further suggests that benefits are strongest on **texture-rich, dense prediction tasks**, while gains may be smaller on **extremely smooth or low-texture data**.

For **MWA-ViT**, the reported limitations are **sensitivity to wavelet choice**, possible **boundary effects and padding artifacts**, reduced benefit in **very low-resolution regimes**, and substantial training-time growth at **higher decomposition levels** [2303.12398]. Haar is repeatedly identified as the practical speed-oriented default, while richer wavelets or DTCWT can improve detail modeling at higher cost.

Taken together, the three lines of work indicate two different but technically related patterns. One pattern uses ViTs as the **backbone model class inside a decentralized learning protocol** [2512.05468]. The other uses wavelets to modify the **token-mixing mechanism or attention pathway inside the transformer itself** [2207.04978; 2303.12398]. A plausible implication is that the phrase “WAFL-ViT” should always be accompanied by an explicit expansion—**Wireless Ad Hoc Federated Learning**, **Wavelet Vision Transformer**, or **Multiscale Wavelet Attention**—to avoid conflating distributed optimization with wavelet-domain attention design.

Source: https://www.emergentmind.com/topics/wafl-with-vision-transformer-wafl-vit