NS-Net: Decoupling CLIP Semantic Information through NULL-Space for Generalizable AI-Generated Image Detection
Jiazhen Yan, Fan Wang, Weiwei Jiang, Ziqiang Li, Zhangjie Fu · 2025
Read NS-Net: Decoupling CLIP Semantic Information through NULL-Space for Generalizable AI-Generated Image Detection by Jiazhen Yan, Fan Wang, Weiwei Jiang, Ziqiang Li, Zhangjie Fu (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2508-01248.txt.
Introduction
Jiazhen Yan and co-authors improved in 2025 the detection of AI-generated pictures by stripping meaning out of the evidence. Detectors built on a famous vision model's features stumble when fake and real photos show the same content, because the features dwell on what a picture depicts. Their network projects those features onto a null space, discarding the semantic part.
What remains, sharpened by contrast training, is the statistical fingerprint of how the picture was made. The detector then travels better to generators it never saw. As image fakes improve, judging the making, not the scene, is the durable strategy.
Catalog record
| CREATOR | Jiazhen Yan, Fan Wang, Weiwei Jiang, Ziqiang Li, Zhangjie Fu |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 45 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2508-01248
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
NS-Net: Decoupling CLIP Semantic Information through NULL-Space for Generalizable AI-Generated Image Detection Jiazhen Yan, Fan Wang, Weiwei Jiang, Ziqiang Li, Zhangjie Fu Abstract The rapid progress of generative models, such as GANs and diffusion models, has facilitated the creation of highly realistic images, raising growing concerns over their misuse in security-sensitive domains. While existing detectors perform well under known generative settings, they often fail to generalize to unknown generative models, especially when semantic content between real and fake images is closely aligned. In this paper, we revisit the use of CLIP features for AI-generated image detection and uncover a critical limitation: the high-level semantic information embedded in CLIP’s visual features hinders effective discrimination. To address this, we propose NS-Net, a novel detection framework that leverages NULL-Space projection to decouple semantic information from CLIP’s visual features, followed by contrastive learning to capture intrinsic distributional differences between real and generated images. Furthermore, we design a Patch Selection strategy to preserve fine-grained artifacts by mitigating semantic bias caused by global image structures. Extensive experiments on an open-world benchmark comprising images generated by 40 diverse generative models show that NS-Net outperforms existing state-of-the-art methods, achieving a 7.4% improvement in detection accuracy, thereby demonstrating strong generalization across both GAN- and diffusion-based image generation techniques. Introduction The rapid advancement of artificial intelligence has significantly accelerated the development of generative models, such as GANs ( Karras et al. 2018 ; Park et al. 2019 ; Huang et al. 2024 ) and diffusion models ( Ho, Jain, and Abbeel 2020 ; Rombach et al. 2022 ; Wu et al. 2024b ) . While these models are widely employed to generate highly realistic images and have enabled numerous beneficial applications, their potential misuse ( Li et al. 2025c ) raises serious concerns related to economic stability, political manipulation, and social security. Consequently, the reliable detection of AI-generated images has emerged as a critical research focus. To date, several effective detection methods ( Zhao et al. 2021 ; Wu et al. 2024a ; Tan et al. 2024a ; Tao et al. 2025 ; Li et al. 2025a ) have been proposed, particularly in scenarios where the generative model is known. However, developing robust and generalizable detection techniques that can effectively identify images from unknown generative models remains a fundamental and unresolved challenge. Recently, a number of studies on AI-generated image detection ( Ojha, Li, and Lee 2023 ; Liu et al. 2024a ; Fu et al. 2025 ) have sought to enhance generalization by directly leveraging or fine-tuning CLIP ( Radford et al. 2021 ) —a multimodal model pre-trained on large-scale image-text datasets, known for its strong generalization capabilities across unseen visual and textual data. Although the effectiveness of CLIP in this context has been demonstrated through quantitative experiments, there remains a lack of in-depth investigation into the intrinsic properties of its extracted features and how these characteristics influence detection performance. Inspired by VIB-Net ( Zhang et al. 2025 ) , which aims to decouple category-related features, we revisit the distinctions between features with different intrinsic properties extracted by CLIP. Specifically, we construct two datasets, each containing 1,000 real images from LSUN and 1,000 images generated by SDXL. In the matched dataset , the generated images are conditioned on BLIP-derived textual descriptions of the corresponding real images. In contrast, the mismatched dataset consists of randomly selected real images and generated images conditioned on unrelated text prompts. We extract visual features using CLIP’s image encoder and visualize them using t-SNE, as shown in Figure 1 (a). The features from the mismatched dataset exhibit clear clustering, suggestive of a linearly separable binary classification problem. In contrast, features from the matched dataset are more entangled and less distinguishable. This suggests that CLIP effectively separates real and generated images when semantic alignment is weak but struggles when the semantic content of both is closely aligned. Figure 1 (b) presents the corresponding visualization of semantic features extracted by CLIP’s text encoder. Based on these observations, we propose the following hypothesis: The semantic information embedded in the visual features extracted by CLIP negatively impacts the performance of AI-generated image detection. Figure 1: T-SNE Visualization of Features Extracted from the Matched Dataset and the Mismatched Dataset . To decouple the semantic information embedded in visual features, we construct the NULL-Space ( Fang et al. 2024 ) corresponding to the semantic components in CLIP’s image features. The NULL-Space, formally defined as the set of vectors mapped to the zero vector under a given linear transformation, enables the removal of specific feature components. Given that CLIP is trained for text-image alignment, we leverage text features as a more tractable and semantically explicit representation, rather than attempting to disentangle the complex semantics directly from image features. Specifically, we extract features from the associated text prompts and compute their NULL-Space. Visual features extracted by CLIP’s image encoder are then projected onto this NULL-Space, thereby eliminating semantically aligned information and retaining components more relevant to forgery detection. As illustrated in Figure 1 (c), this projection—achieved without any additional training—results in a clear separation between real and generated images.hile reducing the influence of semantic content on forgery detection ( Zheng et al. 2024 ) . To this end, we propose an innovative method, termed NS-Net, designed to extract more generalizable artifact information. Specifically, we leverage NULL-Space projection to decouple high-level semantic information encoded in CLIP features, followed by contrastive learning to model the underlying distributional differences between real and generated images. This strategy improves generalization ability beyond simple classification accuracy. Moreover, traditional center-cropping operations ( Li et al. 2025b ) often discard critical forgery traces—especially when manipulations occur away from the image center. To mitigate this, we introduce a Patch Selection strategy. Each image is first divided into uniform patches, from which those with the highest and lowest texture richness (based on predefined metrics) are selected. These selected patches are then shuffled and rearranged to form a new input image of the desired size. This process reduces the dominance of semantic content and enhances the preservation of fine-grained forgery cues. As shown in Figure 1 (d), our method effectively removes task-irrelevant semantic features while retaining the generator-specific artifact patterns crucial for reliable detection. The main contributions of this work are summarized as follows: • We innovatively construct the NULL-Space of the semantic features of generated images, which simply and efficiently eliminates task-irrelevant semantic information embedded in visual features extracted by image encoders, thus improving the generalization detection ability of AI-generated images. • We design a data preprocessing strategy called Patch Selection, which not only reduces the loss of forged information caused by center cropping operation adopted in previous work, but also utilizes patch rearrangement to further weaken the interference of irrelevant semantic information on detection performance. • Comprehensive experimental results have verified that our method exhibits strong generalization ability across 40 different generative models. Compared with the state-of-the-art methods, the detection accuracy is improved by 7.4%, which further highlights its superiority and universality. Figure 2: Architecture of NS-Net for Generalizable AI-Generated Image Detection . Specifically, we first employ the Patch Selection strategy adjusted for CLIP’s input size to preserve potential forgery-related artifacts. Subsequently, the visual features extracted by the CLIP’s image encoder are