Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,70 @@
|
|
1 |
-
---
|
2 |
-
license: unknown
|
3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: unknown
|
3 |
+
---
|
4 |
+
|
5 |
+
Real Art vs AI-Generated Art Image Classification with CNN + ELA
|
6 |
+
Project Overview
|
7 |
+
This project combines a Convolutional Neural Network (CNN) with Error Level Analysis (ELA) for classifying images as 'real art' or 'fake art'. The CNN model extracts features from images, while ELA enhances artifacts that help in distinguishing real art from AI-generated art.
|
8 |
+
|
9 |
+
Objective: Achieve at least 85% accuracy and 80% recall in classifying 'real art' versus 'fake art'.
|
10 |
+
|
11 |
+
Installation
|
12 |
+
Required Libraries:
|
13 |
+
|
14 |
+
numpy
|
15 |
+
pandas
|
16 |
+
tensorflow
|
17 |
+
keras
|
18 |
+
matplotlib
|
19 |
+
sklearn
|
20 |
+
cv2
|
21 |
+
pillow (for ELA)
|
22 |
+
Data Preparation
|
23 |
+
Data:
|
24 |
+
|
25 |
+
2,800 images (PNG, JPG)
|
26 |
+
Labeled as 'real art' (0) and 'fake art' (1)
|
27 |
+
Split: 90% for training and 10% for testing
|
28 |
+
Preprocessing:
|
29 |
+
|
30 |
+
Resize and normalize images.
|
31 |
+
Apply Error Level Analysis (ELA) to highlight discrepancies in image quality.
|
32 |
+
Model Architecture
|
33 |
+
CNN Architecture:
|
34 |
+
|
35 |
+
Convolutional Layers: Use 32 or 64 filters with a size of 3x3, activation function ReLU.
|
36 |
+
MaxPooling Layers: Reduce spatial dimensions to 2x2.
|
37 |
+
Flatten Layer: Convert multi-dimensional output to a 1D vector.
|
38 |
+
Dropout Layer: Apply dropout with a rate of 0.5 after the first Dense layer.
|
39 |
+
Dense Layer: Final classification layer with a sigmoid activation function.
|
40 |
+
ELA Integration:
|
41 |
+
|
42 |
+
Preprocessing: Apply ELA to images to emphasize differences between real and fake art.
|
43 |
+
Feature Extraction: Combine ELA-enhanced images with CNN features for improved classification.
|
44 |
+
Training
|
45 |
+
Parameters:
|
46 |
+
|
47 |
+
Epochs: [To be filled]
|
48 |
+
Optimizer: [To be filled]
|
49 |
+
Loss Function: Binary cross-entropy
|
50 |
+
Validation: 20% of the training data reserved for validation
|
51 |
+
Cross-Validation: 4-fold cross-validation
|
52 |
+
Callbacks:
|
53 |
+
|
54 |
+
EarlyStopping: Stops training if validation accuracy doesn't improve for a set patience period.
|
55 |
+
ModelCheckpoint: Saves the best model weights based on validation accuracy.
|
56 |
+
Performance Evaluation
|
57 |
+
Metrics:
|
58 |
+
|
59 |
+
Accuracy: Percentage of correct classifications
|
60 |
+
Precision, Recall, F1-Score: Evaluate classification ability on both real and AI-generated images
|
61 |
+
Confusion Matrix: Displays true positives, false positives, true negatives, and false negatives
|
62 |
+
Instructions
|
63 |
+
Organize Data: Place images into respective training and testing folders.
|
64 |
+
Preprocess Images: Resize, normalize, and apply ELA.
|
65 |
+
Train the Model: Use the provided code and specified parameters.
|
66 |
+
Evaluate Performance: Assess the model on the test set.
|
67 |
+
Visualization
|
68 |
+
Confusion Matrix: To visualize classification performance.
|
69 |
+
Training and Validation Metrics: Plots for accuracy and loss over epochs.
|
70 |
+
|