Add artwork feature extractor and fix spectral centroid bug#51
Merged
exdysa merged 3 commits intodarkshapes:mainfrom Mar 22, 2026
Merged
Add artwork feature extractor and fix spectral centroid bug#51exdysa merged 3 commits intodarkshapes:mainfrom
exdysa merged 3 commits intodarkshapes:mainfrom
Conversation
The fourier_discrepancy method used log_mag.T which creates a (w,h) matrix that can't be added to the (h,w) log_mag matrix when h != w. Split into separate row/col contributions to avoid the broadcast.
Implements the 39-feature extraction pipeline from Li & Stamp (2025) "Detecting AI-generated Artwork" (arXiv:2504.07078), extended with 10 FFT/DCT spectral analysis features for frequency-domain artifact detection. Features: brightness (2), color (23), texture (6), shape (6), noise (2), frequency (10). All CPU-only, no pretrained models required. Includes benchmark tests with SVM/MLP/XGBoost ensemble achieving 95%+ accuracy with calibrated thresholds and abstention for uncertain images.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fourier_discrepancythat crashed on non-square images (affected all inference on real-world images)Features added
49 image features extracted without GPU or pretrained models:
Benchmark results
5-fold cross-validation on WikiArt (human) vs AI-generated images:
Test plan
pytest tests/test_chip.py tests/test_dataset.py tests/test_load_spec.py)pytest tests/test_artwork_accuracy.py -v -s)python tests/generate_results_pdf.py)