Abstract
The prevalence of AI-generated imagery has raised concerns about the authenticity of astronomical images, especially with advanced text-to-image models like Stable Diffusion producing highly realistic synthetic samples. Existing detection methods, primarily based on convolutional neural networks (CNNs) or spectral analysis, have limitations when used independently. We present AstroSpy, a hybrid model that integrates both spectral and image features to distinguish real from synthetic astronomical images. Trained on a unique dataset of real NASA images and AI-generated fakes (approximately 18k samples), AstroSpy utilizes a dual-pathway architecture to fuse spatial and spectral information. This approach enables AstroSpy to achieve superior performance in identifying authentic astronomical images. Extensive evaluations demonstrate AstroSpy's effectiveness and robustness, significantly outperforming baseline models in both in-domain and cross-domain tasks, highlighting its potential to combat misinformation in astronomy.
The Challenge of Synthetic Space Imagery
As text-to-image models like Stable Diffusion become more sophisticated, the line between a genuine Hubble deep-field capture and a synthetic "hallucination" is blurring. In the field of astronomy, this isn't just a matter of aesthetics—it is a matter of scientific integrity. A critical risk exists where AI-generated celestial phenomena might capture the public's imagination more effectively than real data, potentially diverting funding and resources toward fictitious targets.
Current detection methods usually fall into two camps: Convolutional Neural Networks (CNNs) that analyze spatial patterns (pixels), or spectral analysis that examines frequency distributions. However, used in isolation, these methods often struggle with high-quality forgeries. AstroSpy bridges this gap by analyzing both the visual content and the underlying mathematical structure of the image.
The AstroSpy Architecture
The core of AstroSpy is its dual-pathway architecture. Instead of feeding an image into a single classifier, the model processes the input in two parallel streams to capture a more holistic digital fingerprint.
- Spatial Pathway: A ResNet50 (RN50) encoder extracts visual patterns and textures directly from the raw image.
- Spectral Pathway: The image is converted to the frequency domain via a Fourier Transform. A second RN50 analyzes the magnitude spectrum.
While AI generators are excellent at mimicking visual textures, they often fail to reproduce the natural spectral distribution of real light captured by telescopes. These "spectral artifacts" are often invisible to the human eye but serve as a reliable indicator for the model. The features from both pathways are fused into a joint embedding before passing through a final binary classifier.
Data and Methodology
The researchers curated a unique dataset of approximately 18,000 samples:
- Real Data: ~9,000 images sourced from NASA archives using keywords like "nebula," "black hole," and "galaxy."
- Synthetic Data: ~9,000 images generated via Stable Diffusion, specifically prompted to mimic the visual context of the NASA samples.
- Out-of-Domain (OOD) Benchmarks: To test generalization, the model was evaluated on ImageNet (natural images), MIMIC-CXR (medical X-rays), and FairFace (human faces), with corresponding fakes generated by models like UniDiffuser and StyleGAN2.
Key Results and Feature Separation
AstroSpy achieved a remarkable 98.5% accuracy on the NASA/Stable Diffusion test set. A significant finding was the synergy between the two pathways: a spectral-only baseline achieved only 69% accuracy, while the joint model's performance jumped to nearly 99%.
As shown in the t-SNE visualizations above, the joint representation in AstroSpy (b) creates much clearer clusters for real and fake images compared to the baseline (a). This separation is the key to its high detection rate. Furthermore, AstroSpy demonstrated surprising robustness; when trained on astronomical data, it still maintained 93% accuracy on human faces, suggesting that AI generation leaves universal signatures across different content types.
Conclusion and Future Directions
While AstroSpy is highly effective against current diffusion models, the "arms race" between generation and detection continues. Future research will focus on testing the model against proprietary "black-box" generators like Midjourney or DALL-E 3 and investigating adversarial fakes designed specifically to bypass spectral detectors. By combining spatial and spectral intelligence, AstroSpy provides a robust framework for maintaining the authenticity of the visual record in the age of AI.
Summary updated