The generalization performance of AI-generated image detection remains a critical challenge. Although most existing methods perform well in detecting images from generative models included in the training set, their accuracy drops significantly when faced with images from unseen generators. To address this limitation, we propose a novel detection method based on the fractal self-similarity of the spectrum, a common feature among images generated by different models. Specifically, we demonstrate that AI-generated images exhibit fractal-like spectral growth through periodic extension and low-pass filtering. This observation motivates us to exploit the similarity among different fractal branches of the spectrum. Instead of directly analyzing the spectrum, our method mitigates the impact of varying spectral characteristics across different generators, improving detection performance for images from unseen models. Experiments on a public benchmark demonstrated the generalized detection performance across both GANs and diffusion models.
As AI-driven educational systems increasingly rely on deep neural networks, their vulnerability to adversarial perturbations raises concerns about assessment integrity, fairness, and reliability. Adversarial example purification is attractive for such deployments because it removes input perturbations without modifying the already deployed models. However, most existing purification methods are inherently goal-free: denoising-based approaches apply blind heuristic operators, while reconstruction-based methods rely on stochastic sampling guided by natural image priors. These methods typically suppress perturbations at the cost of weakening semantic details or inducing structural distortions. To address this limitation, we propose a novel goal-directed purification framework, termed adversarial energy field optimization for adversarial example purification (AEFOP). AEFOP formulates purification as a constrained optimization problem by defining a learnable adversarial energy which quantifies how far an input deviates from the benign region. This allows adversarial examples to be explicitly pushed from high-energy regions toward low-energy benign regions along an interpretable descent trajectory. Specifically, we build an adversarial energy network and optimize the energy field via a two-stage strategy: adversarial energy field shaping, which enforces distance-like energy behavior and correct gradient directions, and task-driven energy field calibration, which unrolls the descent process to calibrate the field with classification-consistency and semantic-preservation objectives. Extensive experiments across multiple attack scenarios demonstrate that AEFOP achieves superior purification accuracy and high visual quality while requiring only a few gradient steps during inference, offering a practical and efficient robustness layer for vision-based AI services in education.