ff98 commited on
Commit
f1623ef
·
1 Parent(s): 8018e91

readme updated

Browse files
Files changed (1) hide show
  1. README.md +152 -1
README.md CHANGED
@@ -9,5 +9,156 @@ app_file: app.py
9
  pinned: false
10
  license: apache-2.0
11
  ---
12
-
13
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  pinned: false
10
  license: apache-2.0
11
  ---
 
12
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
13
+
14
+ # <p align="center"> AI and REAL Image Classification </p>
15
+ ## Introduction
16
+ An image classification model that takes an image as an input, and predicts whether the image is real or created by A.I. based on the results from two models.
17
+
18
+ ## Models Developed/Implemented
19
+ 1. A Convolutional Neural Network (CNN) architecture was developed by our team
20
+ 2. An EfficientNet-based model architecture implemented by our team.
21
+
22
+ ## Team
23
+ |Names |Primary Roles | Secondary Roles |
24
+ | --------------------- | ------------------------------------------- | ------------------------------------------------- |
25
+ | Farhikhta Farzan | Data collector and cleaner | Model Interpreation/ Visualization and deployment |
26
+ | Keira James | Feature Engineer | Model Developer |
27
+ | Tesneem Essa | Feature Engineer | Model Developer |
28
+
29
+ ## Deployed Version
30
+ Try the project here 🎨 !
31
+
32
+ https://huggingface.co/spaces/Digital-Detectives/AI-vs-Real-Image-Detection
33
+
34
+ ## UI
35
+
36
+ https://github.com/user-attachments/assets/7d6a3c38-f7dc-4e74-8f0d-6d31653e7670
37
+
38
+ ## Project Outline
39
+ The goal of this project is to develop a deep learning model that can accurately distinguish between real images and AI-generated images. We will collect datasets of real images and fake images. The data will be preprocessed, normalized, and augmented to enhance training. Using TensorFlow and Keras, we will design a Convolutional Neural Network (CNN) for classification, and validating performance through a confusion matrix. Finally, the project will include documentation of the process, findings, and suggestions for future improvements.
40
+
41
+ ## Datasets Used
42
+ [CIFAKE: Real and AI-Generated Synthetic Images]([/guides/content/editing-an-existing-page](https://www.kaggle.com/datasets/birdy654/cifake-real-and-ai-generated-synthetic-images)) <br>
43
+ CIFAKE is a dataset that contains 60,000 synthetically-generated images and 60,000 real images (collected from CIFAR-10). The dataset contains two classes - REAL and FAKE.
44
+ For REAL, images are collected from Krizhevsky & Hinton's CIFAR-10 dataset. For the FAKE images, the equivalent of CIFAR-10 with Stable Diffusion version 1.4 was generated.
45
+ There are 100,000 images for training (50k per class) and 20,000 for testing (10k per class)
46
+
47
+ [Paintings from 10 different popular artists]([/guides/content/editing-an-existing-page](https://www.kaggle.com/datasets/binukandagedon/paintings-from-10-different-popular-artists)) <br>
48
+ This data set is about paintings from 10 different artists. The artists are davinci, frida kahlo, henri matisse, jackson pollock, johannes vermeer, picasso, piere auguste, raphael, rembrandt, and van gough
49
+
50
+ [ArtStyles-Dataset]([/guides/content/editing-an-existing-page](https://www.kaggle.com/datasets/norasami/artstylesdataset/data)) <br>
51
+ ArtStyles dataset contains 360 images containing 3 different digital art styles. The art style includes Anime, Comic and Semi Realism
52
+
53
+ [DALLE Art March, 2023]([/guides/content/editing-an-existing-page](https://www.kaggle.com/datasets/nikbearbrown/dalle-art-march-2023))<br>
54
+ These are AI-generated art images using Midjourney for the month of March 2023. It contains around 660 files
55
+
56
+ [Detecting AI-generated Artwork]([/guides/content/editing-an-existing-page](https://www.kaggle.com/datasets/birdy654/detecting-ai-generated-artwork))<br>
57
+ This dataset was produced as part of the study "AI Generated Art: Latent Diffusion-Based Style and Detection". It contains 1705 fake images and 1705 real images.
58
+
59
+ [Midjourney Images & Prompt]([/guides/content/editing-an-existing-page](https://www.kaggle.com/datasets/cyanex1702/midjourney-imagesprompt))<br>
60
+ This dataset is an extensive collection of pictures produced by using the mid-journey idea. It provides a wide range of varied photos with corresponding prompts that are created automatically by means of an advanced captioning system.This dataset, designed primarily for diffusion model training, is a valuable resource for improving machine learning capabilities in image generation. Using the picture and accompanying cues, researchers can delve into the complexities of training stable diffusion models capable of producing visuals resembling mid-journey scenarios.
61
+
62
+ [BEAR x DALLE - Robot Illustrations]([/guides/content/editing-an-existing-page](https://www.kaggle.com/datasets/nikbearbrown/bear-x-dalle-robot-illustrations))<br>
63
+ This is a dataset for illustrations of robots in the styles of well-known artists, art genre styles, perspectives, formats, and lighting.
64
+ This is a dataset of illustrations of robots in the styles of well-known artists, art genre styles, perspective, formats, and lighting, as part of the BEAR x DALLE project, which focuses on computational art.
65
+
66
+ [Generated Abstract Art Gallery]([/guides/content/editing-an-existing-page](https://www.kaggle.com/datasets/bryanb/generated-abstract-dataset-diffusion))<br>
67
+ This dataset used Generative x Diffusion models to generate 512x512 AI images with abtract style art.
68
+
69
+ [Anime Chibi Datasets]([/guides/content/editing-an-existing-page](https://www.kaggle.com/datasets/hirunkulphimsiri/anime-chibi-datasets))<br>
70
+ Anime Chibi Characters Datasets : Scraped From safebooru.org/Scraped with tags "chibi standing white_background solo -translation_request -text"
71
+ Aims to be used in gans to generate Chibi characters
72
+
73
+ [Cats and Dogs Cartoons]([/guides/content/editing-an-existing-page](https://www.kaggle.com/datasets/maroquio/cats-and-dogs-cartoons))<br>
74
+ This is a great dataset for learning image classification. The dataset has 400 images (200 cats and 200 dogs) in hand drawn cartoon style. Each image is 1024x1024 pixels. The data was generated in MidJourney and was proved to be very useful in my Machine Learning classes.
75
+
76
+ [Indian Paintings Dataset]([/guides/content/editing-an-existing-page](https://www.kaggle.com/datasets/ajg117/indian-paintings-dataset?select=gond+painting))<br>
77
+ Dive into the vibrant kaleidoscope of Indian art with our meticulously curated Indian Painting Styles Dataset! Number of classes - 8 (gond, kalighat, kangra, kerala mural, madhubani, mandana, pichwai, warli paintings) Total Images - 2249 images. File Formats - .jpg, .jpeg, .png, .webp
78
+
79
+ ## Technologies Used
80
+ 1. Kaggle
81
+ 2. Numpy
82
+ 3. Panda
83
+ 4. cv2
84
+ 5. Pillow
85
+ 6. Seaborn
86
+ 7. Tensorflow/Keras
87
+ 8. Scikit-Learn
88
+ 9. Streamlit
89
+
90
+ ## Model Performance
91
+ CNN Model:
92
+
93
+ Accuracy: 97.62%
94
+ Precision: 97.6%
95
+ Recall : 97.6%
96
+ F1 score : 97.6%
97
+
98
+
99
+ Efficientnet Model:
100
+
101
+ Accuracy: 97.72%
102
+ Precision: 97.4%
103
+ Recall : 98.05%
104
+ F1 score: 97.72%
105
+
106
+ Efficientnet Art Model:
107
+
108
+ Accuracy: 98%
109
+ Precision: 97%
110
+ Recall: 98%
111
+ F1 score: 98%
112
+
113
+ ## Model Evaluation
114
+ ### <ins>CNN Model</ins> 📸
115
+ The model demonstrates strong performance in classifying real images, particularly those depicting nature, animals, and humans. However, it faces challenges in accurately identifying fake images and high-quality digital art. The model struggles with discerning AI-generated human headshots, occasionally misclassifying them as real. It also misclassifies certain art images, including fantasy-style art and specific scenic art, as real. Despite these limitations, the model excels in detecting fake images overall, making it a reliable tool for identifying real versus fake content in various domains.
116
+
117
+ ### <ins>Efficientnet Model</ins> 🎨
118
+ The model exhibits exceptional performance in identifying real images, including high-quality real art images. It also demonstrates strong capabilities in detecting fake images, particularly AI-generated headshots, art portraits, and nature landscapes. However, it encounters difficulties with certain AI-generated digital art styles, such as 3D animated art, neon art, cyberpunk art etc.. Despite these challenges, the model remains highly effective in accurately classifying real images and provides reliable results in detecting fake ones overall.
119
+
120
+ &nbsp;&nbsp;&nbsp;&nbsp;** <ins>Note</ins> **
121
+ The EfficientNet model performs better than the CNN model in areas where CNN struggles.
122
+ Conversely, the CNN model shows better performance in areas where EfficientNet has limitations.
123
+
124
+ ### <ins>Efficientnet art Model</ins> 🥸
125
+ This model demonstrates exceptional performance in identifying fake images, particularly in categories such as animals, nature, and art. However, it faces challenges in accurately identifying real images.
126
+
127
+ ## Practical Application
128
+ Our project is crucial in today’s world, where AI-generated content is increasingly prevalent. This model can be used by social media platforms, news organizations, and even everyday people to verify the authenticity of images, helping to fight against misinformation and ensure the integrity of visual media.
129
+
130
+ ## Set up
131
+ 1. Navigate to desired library
132
+ ```
133
+ cd your_directory
134
+ ```
135
+ 2. Clone repository
136
+ ```
137
+ git clone https://github.com/KeiraJames/CTP-Project-2024.git
138
+ ```
139
+ 3. Navigate to repo
140
+ ```
141
+ cd CTP-Project-2024
142
+ ```
143
+ 4. Create virtual environment
144
+ ```
145
+ python -m venv .aivsreal-venv
146
+ ```
147
+ 5. Activate virtual environment (MAC)
148
+ ```
149
+ source .aivsreal/bin/activate
150
+ ```
151
+ 6. Install the requirements
152
+ ```
153
+ pip install -r requirements.txt
154
+ ```
155
+ 7. Run streamlit
156
+ ```
157
+ streamlit run app.py
158
+ ```
159
+
160
+
161
+
162
+
163
+
164
+