{"notes":[{"id":"face-antispoofing/s-adapter","category":"face-antispoofing","legacyPath":"face-antispoofing/2309-s-adapter","legacySlug":"2309-s-adapter","legacyPaths":[],"title":"S-Adapter","subtitle":"Real Notebook","author":"Z. Yuan","paperDate":"2023-09-07","publishedOn":"2025-04-27","paperTitle":"S-Adapter: Generalizing Vision Transformer for Face Anti-Spoofing with Statistical Tokens","paperUrl":"https://arxiv.org/abs/2309.04038","bibliography":{"title":"S-Adapter: Generalizing Vision Transformer for Face Anti-Spoofing with Statistical Tokens","authors":["Rizhao Cai","Zitong Yu","Chenqi Kong","Haoliang Li","Changsheng Chen","Yongjian Hu","Alex Kot"],"url":"https://arxiv.org/abs/2309.04038","pdfUrl":"https://arxiv.org/pdf/2309.04038","codeUrl":null,"preprint":{"id":"2309.04038","submittedOn":"2023-09-07","url":"https://arxiv.org/abs/2309.04038"},"publication":{"venue":"IEEE Transactions on Information Forensics and Security","shortVenue":"IEEE TIFS","year":2024,"kind":"journal","url":"https://doi.org/10.1109/tifs.2024.3420699"},"citation":"@misc{faceantispoofingsadapter2023,\n  title = {{S-Adapter: Generalizing Vision Transformer for Face Anti-Spoofing with Statistical Tokens}},\n  author = {Rizhao Cai and Zitong Yu and Chenqi Kong and Haoliang Li and Changsheng Chen and Yongjian Hu and Alex Kot},\n  year = {2023},\n  eprint = {2309.04038},\n  archivePrefix = {arXiv},\n  url = {https://arxiv.org/abs/2309.04038}\n}\n","citationPath":"/content/papers/citations/face-antispoofing/s-adapter.1450240a15ac.bib"},"thumbnail":{"src":"/content/papers/assets/3fbf7b73957abdd3112f50967323d350ba6ca1ca4293bdb643a76aa525348539.jpg","width":1224,"height":644},"locale":"en","path":"/content/papers/en/face-antispoofing/s-adapter.70fc083bf5d0.md","headings":[{"id":"defining-the-problem","text":"Defining the Problem","depth":2},{"id":"solving-the-problem","text":"Solving the Problem","depth":2},{"id":"model-architecture","text":"Model Architecture","depth":2},{"id":"token-map-extraction","text":"Token Map Extraction","depth":3},{"id":"token-histogram-extraction","text":"Token Histogram Extraction","depth":3},{"id":"gram-matrix","text":"Gram Matrix","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"intra-domain-testing","text":"Intra-Domain Testing","depth":3},{"id":"cross-domain-testing","text":"Cross-Domain Testing","depth":3},{"id":"limited-source-domains-testing","text":"Limited Source Domains Testing","depth":3},{"id":"ablation-experiments","text":"Ablation Experiments","depth":2},{"id":"effectiveness-of-s-adapter-components","text":"Effectiveness of S-Adapter Components","depth":3},{"id":"histograms-enhancement-effect-on-vanilla-adapter","text":"Histogram's Enhancement Effect on Vanilla Adapter","depth":3},{"id":"tsr-module-and-λ-hyperparameter","text":"TSR Module and λ Hyperparameter","depth":3},{"id":"conclusion","text":"Conclusion","depth":2}],"anchorAliases":{},"guide":null,"relatedReading":[{"id":"face-antispoofing/divt","relation":"comparison","topic":"Domain-invariant visual Transformers"}]},{"id":"face-antispoofing/divt","category":"face-antispoofing","legacyPath":"face-antispoofing/2301-divt","legacySlug":"2301-divt","legacyPaths":[],"title":"DiVT","subtitle":"All-Star Championship","author":"Z. Yuan","paperDate":"2023","publishedOn":"2025-04-23","paperTitle":"Domain Invariant Vision Transformer Learning for Face Anti-Spoofing","paperUrl":"https://openaccess.thecvf.com/content/WACV2023/html/Liao_Domain_Invariant_Vision_Transformer_Learning_for_Face_Anti-Spoofing_WACV_2023_paper.html","bibliography":{"title":"Domain Invariant Vision Transformer Learning for Face Anti-Spoofing","authors":["Chen-Hao Liao","Wen-Cheng Chen","Hsuan-Tung Liu","Yi-Ren Yeh","Min-Chun Hu","Chu-Song Chen"],"url":"https://openaccess.thecvf.com/content/WACV2023/html/Liao_Domain_Invariant_Vision_Transformer_Learning_for_Face_Anti-Spoofing_WACV_2023_paper.html","pdfUrl":"https://openaccess.thecvf.com/content/WACV2023/papers/Liao_Domain_Invariant_Vision_Transformer_Learning_for_Face_Anti-Spoofing_WACV_2023_paper.pdf","codeUrl":null,"preprint":null,"publication":{"venue":"WACV","year":2023,"kind":"conference","url":"https://openaccess.thecvf.com/content/WACV2023/html/Liao_Domain_Invariant_Vision_Transformer_Learning_for_Face_Anti-Spoofing_WACV_2023_paper.html"},"citation":"@inproceedings{faceantispoofingdivt2023,\n  title = {{Domain Invariant Vision Transformer Learning for Face Anti-Spoofing}},\n  author = {Chen-Hao Liao and Wen-Cheng Chen and Hsuan-Tung Liu and Yi-Ren Yeh and Min-Chun Hu and Chu-Song Chen},\n  year = {2023},\n  booktitle = {WACV},\n  url = {https://openaccess.thecvf.com/content/WACV2023/html/Liao_Domain_Invariant_Vision_Transformer_Learning_for_Face_Anti-Spoofing_WACV_2023_paper.html}\n}\n","citationPath":"/content/papers/citations/face-antispoofing/divt.115ac8503061.bib"},"thumbnail":{"src":"/content/papers/assets/e9a1d49d2cdac39c893a66f00d487c033c228d8ac58af169238db7f9770269af.jpg","width":1224,"height":624},"locale":"en","path":"/content/papers/en/face-antispoofing/divt.6250594a3bc4.md","headings":[{"id":"problem-definition","text":"Problem Definition","depth":2},{"id":"solution","text":"Solution","depth":2},{"id":"model-architecture","text":"Model Architecture","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"implementation-details","text":"Implementation Details","depth":3},{"id":"leave-one-out-test-results","text":"Leave-One-Out Test Results","depth":3},{"id":"small-sample-setting","text":"Small Sample Setting","depth":3},{"id":"ablation-study","text":"Ablation Study","depth":2},{"id":"comparison-of-different-architectures","text":"Comparison of Different Architectures","depth":3},{"id":"effect-of-loss-function-combinations","text":"Effect of Loss Function Combinations","depth":3},{"id":"would-changing-the-classification-logic-be-better","text":"Would Changing the Classification Logic Be Better?","depth":3},{"id":"what-if-we-added-adversarial-loss","text":"What If We Added Adversarial Loss?","depth":3},{"id":"comparison-of-computational-resources","text":"Comparison of Computational Resources","depth":3},{"id":"conclusion","text":"Conclusion","depth":2}],"anchorAliases":{},"guide":null,"relatedReading":[{"id":"face-antispoofing/s-adapter","relation":"comparison","topic":"Domain-invariant visual Transformers"}]}],"text":"Adapter is a lightweight model adjustment technique that typically adds additional parameters to a pre-trained Transformer model. These parameters can be fine-tuned for specific tasks without needing to retrain the entire model.\n\nIf Transformers are the main protagonists in recent computer vision research, then adapters are the role adjusters that bridge tasks.\n\n\n> [!TIP]\n> \n> If you're unfamiliar with this concept, you can refer to our previous paper notes:\n> \n> - [**[19.02] Adapter: Saving 96% of Parameters**](/blog/papers/model-tuning/adapter)\n\n\n## Defining the Problem\n\nLooking at the face anti-spoofing (FAS) models so far, it’s clear how difficult they are.\n\nNot only do you need to determine \"is this face real or fake,\" but it must be stable enough. At the very least, it shouldn't fail simply because the lighting changed, the camera switched, or a new type of attack is used.\n\nThe model does not usually fail because it is too weak, but because the “world” it grows used to during training is too small. Imagine taking thousands of photos of real faces indoors, then deploying the model where someone scans their face with a phone under the blazing sun: it falls apart. No matter how much we fine-tune or stack models, **domain shift** can still undo generalization.\n\nThus, various solutions have emerged: Some use adversarial learning for style transfer, some use meta-learning to simulate unseen scenarios, while others try to compress real faces closer and spread fake faces further apart. But these methods still fall short when it comes to generalization, particularly in **zero-shot** testing.\n\nThen came ViT (Vision Transformer), and people were excited.\n\nAfter all, the attention mechanism in Transformers handles long-range information well, and the architecture is flexible, seemingly perfect for tasks that involve strong environmental variations.\n\nBut then another issue arises.\n\nWhile we can fine-tune a pre-trained ViT model on ImageNet, it indeed performs slightly better than CNN-based models, but just \"slightly.\" Sometimes, in few-shot or even zero-shot conditions, the ViT performs worse than CNN-based baselines.\n\nThere might be a more fundamental problem here:\n\n- **Transformers can see far, but can they see fine details?**\n- **Can they recognize subtle textures, local defects, and weaknesses left by attack mediums?**\n\nOr perhaps, we’ve assumed too quickly that Transformers can understand these \"things beyond style\"?\n\n## Solving the Problem\n\nThe first step in applying ViT to FAS is usually: fine-tuning a pre-trained ImageNet model.\n\nTo update fewer pretrained parameters during FAS fine-tuning, we can insert small Adapter modules, freeze the original ViT weights, and train the newly added task-specific parameters.\n\nThis approach is called Efficient Parameter Transfer Learning (EPTL), and methods like Adapter, LoRA, and Prompt-tuning all fall into this category.\n\nIn ViT, we can simplify the process of each block as the following inference process (ignoring LayerNorm and skip connections):\n\n$$\nY = W_i^{\\text{MLP}}(W_i^{\\text{MSA}}(X))\n$$\n\nHere, $X$ and $Y$ are the input and output tokens of a transformer block, MSA represents multi-head self-attention, and MLP is the multi-layer perceptron. If we use an Adapter, the structure becomes:\n\n$$\nY = A_i^{\\text{MLP}}(W_i^{\\text{MLP}}(A_i^{\\text{MSA}}(W_i^{\\text{MSA}}(X))))\n$$\n\nHere $A_i^{\\text{MSA}}$ and $A_i^{\\text{MLP}}$ are the inserted Adapters. The original ViT weights $W$ are frozen while the Adapters and other newly added parameters are updated, reducing the number of parameters to fine-tune.\n\nHowever, this Adapter structure works well in natural language tasks but struggles in FAS.\n\nThe reason is not hard to understand: General Adapters use linear layers, **which lack the inductive bias of spatial structure**.\n\nBut FAS depends heavily on **local details**—image artifacts, blurred edges, and reconstruction noise. Global attention can learn local cues, yet a standard linear Adapter does not explicitly model neighboring patches. That is the bias the authors want to add.\n\n## Model Architecture\n\n\n\n![model_arch](/content/papers/assets/3fbf7b73957abdd3112f50967323d350ba6ca1ca4293bdb643a76aa525348539.jpg)\n\n\n\nTo help the Transformer capture local texture features, the authors propose **S-Adapter**.\n\nThe inspiration comes from traditional texture analysis methods like Local Binary Pattern (LBP), as shown in the figure (a) above.\n\nLBP does not classify raw pixel values directly. It extracts local texture patterns and then counts them in histograms. Such statistics can be more robust to changes in lighting and materials, which is why they were used in earlier face analysis and anti-spoofing work.\n\nThe design of S-Adapter is to translate this logic into the Transformer world:\n\n> **Enable ViT tokens to learn statistics and extract spatial distribution features from local textures.**\n\nThe overall structure is as follows:\n\n\n\n![model_arch](/content/papers/assets/6e38ec11a0b892155afabd58280413cbdd9c2cb6b7e0240ee1b75e19c5198033.jpg)\n\n\n\nThe entire module is divided into two stages: **Token Map Extraction** and **Token Histogram Extraction**.\n\n### Token Map Extraction\n\nIn the FAS (Face Anti-Spoofing) scenario, the key to detecting attacks often lies in local details.\n\nThese details could be blur, edge artifacts, small texture anomalies caused by re-capturing, and such features are difficult for the global attention mechanism of Transformers to capture.\n\nViT represents patch tokens as a one-dimensional sequence; a general linear Adapter does not directly receive their original two-dimensional neighborhood. Reshaping makes that neighborhood explicit for convolution, while retaining token order and position.\n\nTherefore, **the first step** is to design a process that restores the spatial properties of tokens:\n\n- Given the input tokens $X \\in \\mathbb{R}^{N_P \\times C}$, where $N_P$ is the number of patch tokens (class token is ignored) and $C$ is the embedding dimension; the illustrated configuration first reduces the channels from 768 to 8;\n- Reshape it to $X_R \\in \\mathbb{R}^{H \\times W \\times C}$, where $H \\times W = N_P$;\n- Then permute the dimensions to $X_M \\in \\mathbb{R}^{C \\times H \\times W}$, similar to a $C$-channel image.\n\nNext, use a 2D convolution layer $W_\\text{Conv}$ to extract local features:\n\n$$\nZ = W_{\\text{Conv}}(X_M)\n$$\n\nThis introduces an explicit spatial inductive bias, helping the Adapter attend to local information.\n\nTo make the model more sensitive to local changes, the authors introduce a Center Difference (CD) operation:\n\n- For each token $Z_n$, compute the difference with its surrounding neighbors $P_n$;\n- Weighted sum using the convolution kernel weights $\\omega(p)$:\n\n$$\nZ^g_n = \\sum_{p \\in P_n} \\omega(p) \\cdot (Z_p - Z_n)\n$$\n\nThis results in $Z^g$, which captures fine-grained local gradient features, especially for subtle texture changes.\n\nFinally, the original feature $Z$ is fused with the gradient feature $Z^g$ to form a new token map:\n\n$$\nZ^* = (1 - \\theta) Z + \\theta Z^g\n$$\n\nwhere $\\theta$ controls the fusion ratio. This allows even ViT to incorporate local feature sensitivity similar to CNN.\n\n### Token Histogram Extraction\n\nEven with added local features, domain shift (cross-device, cross-lighting) still leads to instability in model performance.\n\nThe reason is that local pixel values are still easily affected by environmental factors.\n\nThus, the second step is to further statistically analyze these local features by computing a differentiable histogram for each small region.\n\nIntuitively, this means:\n\n- Soft binning a local window around each patch token;\n- Obtaining a statistical vector instead of a single pixel value;\n- Allowing the model to learn the overall structural distribution of local regions, rather than individual point values, enhancing domain stability.\n\nThe computation process is as follows:\n\nLet $\\mu_c$ be the center and $\\gamma_c$ control response width. Larger $|\\gamma_c|$ produces a narrower response, so it acts as an inverse scale rather than the width itself. Using a centered $3\\times3$ neighborhood $\\mathcal{N}=\\{-1,0,1\\}^2$:\n\n$$\nZ_{\\text{Hist}}^{c,h,w}\n= \\frac{1}{9} \\sum_{(j,k)\\in\\mathcal{N}} \\exp \\Bigl( -\\gamma_c^2 (Z^*_{c,h+j,w+k} - \\mu_c)^2 \\Bigr)\n$$\n\nwhere:\n\n- $J = K = 3$, i.e., a 3x3 convolution window;\n- stride = 1, padding = 1, ensuring the size remains unchanged.\n\nThe soft binning ensures that values closer to the bin center contribute more, and values farther away contribute less, making it differentiable.\n\nBreaking it down further:\n\n$$\nZ_{\\text{Hist}}^{c,h,w}\n= \\frac{1}{9} \\sum_{(j,k)\\in\\mathcal{N}} \\exp (-U_{c,j,k}^2)\n$$\n\n$$\nU_{c,j,k} = \\gamma_c (Z^*_{c,h+j,w+k} - \\mu_c)\n$$\n\n$U_{c,j,k}$ can be implemented with two channel-wise $1\\times1$ affine transforms. A dense convolution with every weight set to one would mix channels and would not implement this expression:\n\n- First layer $W_{\\text{Conv1}}$: the weights are fixed to 1, the bias is learnable (corresponding to $-\\mu$);\n- Second layer $W_{\\text{Conv2}}$: the bias is fixed to 0, and the weights are learnable (corresponding to $\\gamma$).\n\nThis design allows both the bin center and bin width to be automatically adjusted through training.\n\nFinally, in the illustrated ViT-Base configuration, $Z_{\\mathrm{Hist}}$ is reshaped into $N_P\\times8$ tokens, projected back to $N_P\\times768$, and fused with the original tokens. These are dimensions of the learned features of neighboring patch tokens, rather than a histogram of raw pixels within each patch.\n\n### Gram Matrix\n\nIn the context of deep learning, we can roughly classify image features into two categories:\n\n- **Content**: Essential information related to the task, such as texture flaws, blurred edges, and reorganization traces.\n- **Style**: Environmental style features related to the image capture, such as lighting, saturation, color shifts, and noise distribution.\n\nMany previous methods have attempted to use adversarial learning for feature disentanglement to separate these two types of information. However, these methods often struggle with instability and convergence, particularly in cross-domain tasks where convergence speed and stability are major challenges.\n\nThis paper adopts a more intuitive approach: **Since we know style can be represented using a Gram matrix, let's directly regularize the Gram matrix.**\n\nFirst, the authors define the Gram matrix for the token map $Z \\in \\mathbb{R}^{C \\times H \\times W}$ as follows:\n\n$$\nG(Z)_{k,k'} = \\frac{1}{CHW} \\sum_{h=1}^H \\sum_{w=1}^W Z_{k,h,w} \\cdot Z_{k',h,w}\n$$\n\nHere $Z_{k,h,w}$ is the value of channel $k$ at spatial position $(h,w)$. The Gram matrix measures uncentered inner products between channels as a proxy for this image's “style”; it is not a covariance matrix.\n\nIn the authors' design, the goal is not to enforce uniformity across all image styles but to regularize the **style consistency between bonafide (genuine) samples**.\n\nThis design has two advantages:\n\n1. It places no direct Gram-alignment constraint on attack samples, preserving differences useful for separating real from spoofed faces.\n2. It follows the authors' modeling assumption: styles of bonafide samples from different sources should be brought closer, while attack appearances may differ.\n\nGiven bonafide token maps from two domains, $Z_{D1}$ and $Z_{D2}$, the style regularization loss is defined as:\n\n$$\n\\mathcal{L}_{\\text{TSR}} = \\left\\| G(Z_{D1}) - G(Z_{D2}) \\right\\|_F^2\n$$\n\nThe loss encourages bonafide samples from two source domains to have closer Gram matrices. Whether that makes the model focus more on content cues still has to be tested.\n\nThe following diagram illustrates this design logic:\n\n\n\n![gram_matrix](/content/papers/assets/26b64ea0d5f4bf7e6f27bb805dc5f6c7f8e4844b428772ad637f1571977669eb.jpg)\n\n\n\nThe style of bonafide samples from different domains is aligned, but no additional constraints are applied to spoof attack samples, preserving their distinguishability.\n\nIn addition to TSR, the model still needs to distinguish between real and fake. Therefore, the authors use the common Binary Cross-Entropy (BCE) loss:\n\n$$\n\\mathcal{L}_{\\text{BCE}} = - \\left[ y \\cdot \\log(\\hat{y}) + (1 - y) \\cdot \\log(1 - \\hat{y}) \\right]\n$$\n\nFor multiple source domains, the authors average over every pair of bonafide domains, using token maps from the last Transformer block. If $\\mathcal{P}=\\{(i,j):i<j\\}$ is the set of pairs, its size $|\\mathcal{P}|$ is the averaging denominator:\n\n$$\n\\mathcal{L}_{\\text{TSR}}^{\\text{avg}} = \\frac{1}{|\\mathcal{P}|} \\sum_{(i,j)\\in\\mathcal{P}} \\left\\| G(Z_{D_i}) - G(Z_{D_j}) \\right\\|_F^2\n$$\n\nFinally, the total loss is:\n\n$$\n\\mathcal{L}_{\\text{total}} = \\mathcal{L}_{\\text{BCE}} + \\lambda \\cdot \\mathcal{L}_{\\text{TSR}}^{\\text{avg}}\n$$\n\n$\\lambda$ controls how strongly style regularization influences training. In the BCE expression, $y=0$ denotes bonafide and $y=1$ denotes spoof, and $\\hat y$ is the predicted spoof probability.\n\n## Discussion\n\nIn this section, let's take a look at how S-Adapter performs under various experimental settings.\n\nThe authors conducted four different types of evaluations:\n\n- Intra-Domain Testing (Training and testing within the same dataset)\n- Cross-Domain Testing (Testing across datasets)\n- Few-Shot Cross-Domain Testing (Testing with a small amount of target data)\n- Unseen Attack Testing (Testing with attack types that the model has not seen before)\n\nThe datasets used for evaluation include CASIA-FASD, Replay Attack, MSU MFSD, OULU-NPU, and SiW-M. The evaluation metrics include HTER, ACER, EER, AUC, and TPR at FPR = 1%.\n\n### Intra-Domain Testing\n\nThe authors compare the performance of existing methods on the four standard protocols of the OULU-NPU dataset, as shown in the table below:\n\n\n\n![intra-domain](/content/papers/assets/708410934ebedeb89ad41d84bc4e63e870cb16168e449e9875004f857bbf7015.jpg)\n\n\n\nIn ACER, S-Adapter-TSR has the lowest listed result on P1, P3, and P4. Its P2 result is 0.8%, above EPCR's 0.6%. It performs well under most of these within-dataset protocols, though this table does not separate the effects of local features from those of the histogram.\n\nHowever, looking at Intra-Domain alone is not enough to prove generalization capability.\n\n### Cross-Domain Testing\n\nThe Cross-Domain testing uses the classic MICO protocol (leave-one-out testing between the four datasets: CASIA-FASD, Replay-Attack, MSU-MFSD, OULU-NPU).\n\nThe results are shown in the table below:\n\n\n\n![cross-domain](/content/papers/assets/9e957509e9569cc6f366aa2b05a528605c993921345dce6de95c2865cf8ad1e1.jpg)\n\n\n\nFor both HTER and AUC, **S-Adapter-TSR outperforms the table's ViT† baseline in all four leave-one-out directions**, as well as the listed SSAN-R and MetaPattern results. ViT† excludes supplementary CelebA-Spoof data in this comparison, so it should be read under this table's training setup.\n\nThis echoes the design's central idea: **fine-tuning ViT for FAS also calls for better local recognition and resistance to changes in style.**\n\n### Limited Source Domains Testing\n\nIn practice, collecting cross-domain datasets is not an easy task.\n\nTherefore, the authors further test whether the model can maintain cross-domain performance when only two source datasets are used for training (e.g., MSU + Replay).\n\nThe results are shown in the table below:\n\n\n\n![limited-source](/content/papers/assets/9d1b8716dbd320a4bd97b424c2803106374fafb9dc64ae45f9c27def6005003a.jpg)\n\n\n\nEven with two sources, S-Adapter-TSR has the lowest HTER (17.93%) and highest AUC (89.56%) on M&I → C. On M&I → O, its 19.76% HTER and 86.87% AUC are slightly behind AMEL's 19.68% and 87.01%. The advantage in the first limited-source setting should therefore not be generalized to both.\n\n## Ablation Experiments\n\nFinally, the authors conduct ablation experiments to specifically examine the contributions of S-Adapter and TSR.\n\n### Effectiveness of S-Adapter Components\n\nFirst, the authors tested different versions of S-Adapter:\n\n- **S-Adapter** (Full version)\n- **S-Adapter w/o hist** (Removed histogram layer)\n- **S-Adapter w/o hist(θ=0)** (Removed both histogram and gradient extraction)\n\nThe experimental results are shown in the figure below:\n\n\n\n![ablation-sadapter](/content/papers/assets/5e6e9d8d84c78e825b33b02c9a1ab851dab92f28e7b609e83db989b3cd95873c.jpg)\n\n\n\nFrom the results, we can see that:\n\n- The full version of S-Adapter performs best in HTER across the four cross-domain scenarios.\n- Removing the histogram (w/o hist) causes a significant performance drop.\n- Removing gradients as well (θ=0) is usually worse, though the O-domain exception below matters.\n\nThis confirms that **statistical features (histogram) and local gradients make substantial contributions to cross-domain recognition.**\n\nHowever, in the special case of `C&I&M to O`, adding gradients to the version without a histogram actually increases HTER slightly.\n\nThe authors speculate that this is due to the higher resolution of the OULU-NPU dataset, while I, C, and M sources have lower resolutions, causing inconsistent gradient features across resolutions. The histogram statistical layer helps smooth this discrepancy, thus maintaining stable performance.\n\n### Histogram's Enhancement Effect on Vanilla Adapter\n\nTo verify the universality of histograms, the authors also added CDC layers and Histogram layers to the standard vanilla adapter.\n\nThe results are shown below:\n\n\n\n![ablation-cdc](/content/papers/assets/2c0d44fee3307e97f9f814566135288ce15624f25253d24df2797e6e74786aa4.jpg)\n\n\n\nIt can be seen that:\n\n- After adding CDC, HTER decreased (HTER lower is better).\n- Adding Histogram further improved the performance.\n\nAcross these four cross-domain tests, the histogram layer further reduces HTER even when added to a standard Adapter, so its benefit is not confined to the complete S-Adapter tested here.\n\n### TSR Module and λ Hyperparameter\n\nNext, let's look at the ablation of Token Style Regularization (TSR).\n\nThe authors set different values of λ, from 0 to 1, and observed the impact on HTER, as shown in the figure below:\n\n\n\n![ablation-tsr](/content/papers/assets/124266dfe14e95dc7c431482432c919fef2e0103014e4c2827148c5b574dbb6f.jpg)\n\n\n\nIt can be observed that:\n\n- The best $\\lambda$ differs across the four curves. For C&I&O → M, HTER at $\\lambda=0.05$ is actually higher than at $\\lambda=0$.\n- A large $\\lambda$ can also raise HTER; for example, C&M&I → O is clearly worse at $\\lambda=1.0$ than at intermediate values.\n- The authors suggest starting with a small value such as 0.1, but each source-domain combination still needs its own evaluation.\n\n## Conclusion\n\nThis paper did not follow the trend of pushing for a deeper ViT backbone nor did it attempt to reverse domain shift with complex adversarial learning techniques. Instead, it chose a relatively simple yet effective approach:\n\n> **Re-understanding local textures and statistical features, allowing Vision Transformers to learn to perceive differences.**\n\nEach design in S-Adapter directly addresses two fundamental problems in FAS tasks:\n\n- Recognizing local details\n- Resilience to style differences across environments\n\nStable generalization is not simply a matter of stacking a more complex network. It comes from understanding and refining what the task needs. Across the tested cross-domain settings, the authors show that this choice is more than a lucky result and may prove useful beyond a single dataset.\n","imageSizes":{"/content/papers/assets/3fbf7b73957abdd3112f50967323d350ba6ca1ca4293bdb643a76aa525348539.jpg":{"width":1224,"height":644},"/content/papers/assets/6e38ec11a0b892155afabd58280413cbdd9c2cb6b7e0240ee1b75e19c5198033.jpg":{"width":1080,"height":920},"/content/papers/assets/26b64ea0d5f4bf7e6f27bb805dc5f6c7f8e4844b428772ad637f1571977669eb.jpg":{"width":1152,"height":688},"/content/papers/assets/708410934ebedeb89ad41d84bc4e63e870cb16168e449e9875004f857bbf7015.jpg":{"width":752,"height":1080},"/content/papers/assets/9e957509e9569cc6f366aa2b05a528605c993921345dce6de95c2865cf8ad1e1.jpg":{"width":1226,"height":434},"/content/papers/assets/9d1b8716dbd320a4bd97b424c2803106374fafb9dc64ae45f9c27def6005003a.jpg":{"width":826,"height":328},"/content/papers/assets/5e6e9d8d84c78e825b33b02c9a1ab851dab92f28e7b609e83db989b3cd95873c.jpg":{"width":816,"height":592},"/content/papers/assets/2c0d44fee3307e97f9f814566135288ce15624f25253d24df2797e6e74786aa4.jpg":{"width":1072,"height":648},"/content/papers/assets/124266dfe14e95dc7c431482432c919fef2e0103014e4c2827148c5b574dbb6f.jpg":{"width":960,"height":728}}}
