{"id":22158054,"url":"https://github.com/sahal-mulki/spottingdiffusion","last_synced_at":"2026-02-16T23:40:16.948Z","repository":{"id":174021639,"uuid":"586345966","full_name":"sahal-mulki/SpottingDiffusion","owner":"sahal-mulki","description":"Official implementation of SpottingDiffusion : A CNN-based method of detecting AI generated images.","archived":false,"fork":false,"pushed_at":"2025-03-23T13:03:40.000Z","size":89350,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-02T14:40:09.528Z","etag":null,"topics":["ai","ai-generated-images","cnn","cnn-classification","code","laion","midjourney","pretrained-model","research-paper","stable-diffusion","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sahal-mulki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-01-07T20:02:05.000Z","updated_at":"2025-03-23T13:03:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"375f68a0-7c4d-42c0-92ad-e25b2c65723c","html_url":"https://github.com/sahal-mulki/SpottingDiffusion","commit_stats":null,"previous_names":["sahal-mulki/spottingdiffusion"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sahal-mulki/SpottingDiffusion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahal-mulki%2FSpottingDiffusion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahal-mulki%2FSpottingDiffusion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahal-mulki%2FSpottingDiffusion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahal-mulki%2FSpottingDiffusion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sahal-mulki","download_url":"https://codeload.github.com/sahal-mulki/SpottingDiffusion/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahal-mulki%2FSpottingDiffusion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29524393,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T21:45:09.491Z","status":"ssl_error","status_checked_at":"2026-02-16T21:44:58.452Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ai-generated-images","cnn","cnn-classification","code","laion","midjourney","pretrained-model","research-paper","stable-diffusion","tensorflow"],"created_at":"2024-12-02T03:17:13.722Z","updated_at":"2026-02-16T23:40:16.911Z","avatar_url":"https://github.com/sahal-mulki.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SpottingDiffusion \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/sahal-mulki/SpottingDiffusion/blob/main/SpottingDiffusion.ipynb\"\u003e \u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/\u003e\u003c/a\u003e\n\nThis repository is the official implementation of [SpottingDiffusion: Using transfer learning to detect Latent Diffusion Model-synthesized images](https://doi.org/10.59720/23-256)\n\n![SpottingDiffusion tried on 3 random images from the dataset.](https://i.imgur.com/aSPB4nS.png)\n\n# Table of Contents.\n- [Table of Contents](#table-of-contents)\n- [Abstract](#abstract)\n- [Requirements](#requirements)\n- [Training](#training)\n- [Pretrained](#pretrained)\n# Abstract\n\nThis study aims to present a novel method of detecting images made by “Latent Diffusion Models” as described by \u003ca href=\"https://arxiv.org/abs/2112.10752\"\u003e Rombach et al.\u003c/a\u003e \nThe issue of differentiating AI generated images from real ones has recently become one of great importance and debate; as extremely realistic AI generated images are rapidly becoming easier to make and disseminate. \n\nThe need of detecting these images arises when these technologies will inevitably be used to make misleading material with the intent of deceiving the human viewer. The authors of this study present a solution, an algorithmic way of differentiating images made by “Latent Diffusion Models” from real ones. In specific, we detail our research on detecting images produced by the “Stable Diffusion Latent Diffusion Model”. \n\n# Requirements\n\nYou may also easily use the Google Colab version of the trainer, which has training and downloading automatically built in.  \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/sahal-mulki/SpottingDiffusion/blob/main/SpottingDiffusion.ipynb\"\u003e \u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/\u003e\u003c/a\u003e\n\n### To install dependencies:\n\n`pip install -r requirements.txt`\n\n### To download datasets for training and evaluation:\n\nLogin with kaggle API, and then,\n\n```\nkaggle datasets download sahalmulki/stable-diffusion-generated-images\nkaggle datasets download sahalmulki/spottingdiffusion-testing-dataset\n\nmkdir testing\nunzip /content/spottingdiffusion-testing-dataset.zip -d /testing/\n```\n\n# Training\n\n### Run this command after downloading the dataset for training the model as specified in the paper:\n`python train.py 12 0.3 0.00001`\n\n### Evaluate the model on the testing dataset using this command:\n`python evaluate.py /full-path-to-dir/testing pretrained/pretrained-spotting-diffusion` \nGoogle Colab Notebook for Evaluation: \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/sahal-mulki/SpottingDiffusion/blob/main/SpottingDiffusion_Testing.ipynb\"\u003e \u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/\u003e\u003c/a\u003e\n\n# Pretrained\n\n### A pretrained model for SpottingDiffusion is available in the SavedModel format in the `pretrained` directory.\n\n# Cite this:\n\n```\n@article{spottingdiffusionmulki2024,\ntitle={Spottingdiffusion: Using transfer learning to detect latent diffusion model-synthesized images},\nDOI={10.59720/23-256},\njournal={Journal of Emerging Investigators},\nauthor={Sahal Mulki, Muhammad and Adil Mulki, Sadaf},\nyear={2024},\nmonth={Nov}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsahal-mulki%2Fspottingdiffusion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsahal-mulki%2Fspottingdiffusion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsahal-mulki%2Fspottingdiffusion/lists"}