--- license: unknown metrics: - accuracy tags: - art datasets: - DataScienceProject/Art_Images_Ai_And_Real_ library_name: keras language: - en pipeline_tag: image-classification --- # Model Card for Model ID This model is designed for classifying images as either 'real' or 'fake-AI generated' using a Convolutional Neural Network (CNN) combined with Error Level Analysis (ELA). Our goal is to accurately classify the source of the image with at least 85% accuracy and achieve at least 80% in the recall test. ### Model Description CNN is a type of deep learning model specifically designed to process and analyze visual data by applying convolutional layers that automatically detect patterns and features in images. Error Level Analysis (ELA) detects changes in digital images by comparing the differences between the original and a compressed version of the image. It highlights areas where alterations may have occurred, making it useful for identifying image tampering. After running ELA we feed the CNN with the result of comparing original and a compressed version of the same image and then we get the output. ### Direct Use This model can be used to classify images as 'real' or 'fake- Ai generated' based on the presence of anomalies and features characteristic of each category. ### Out-of-Scope Use The model may not perform well on images outside the scope of art or where the visual characteristics are drastically different from those in the training dataset. may not detect ai-images from newer diffusion models that has another method of creating ai images. ## Bias, Risks, and Limitations ELA can be very good in detecting tamparing such as photoshop, there is many diffusion engines that not tamper the image making the ELA weak against those ai-images. ### Recommendations Test this model with different hyperparameters / more CNN layers ## How to Get Started with the Model Prepare Data: Organize your images into appropriate folders and run the code ## Training Details -Dataset: DataScienceProject/Art_Images_Ai_And_Real_ -Preprocessing: Images are resized, image quallity changed , ELA version of this image created. ### Training Procedure Train the CNN with the Preprocessed images , use valitadion set. #### Training Hyperparameters -optimizer = RMSprop(lr=0.0005, rho=0.9, epsilon=1e-08, decay=0.0) -epochs = 22 -batch_size = 100 -loss = "categorical_crossentropy" -metrics=["accuracy"] -early_stopping = EarlyStopping(monitor='val_acc',min_delta=0,patience=2,verbose=0, mode='auto') ## CNN architecture ![image/png](https://cdn-uploads.huggingface.co/production/uploads/66d6f1b3b50e35e1709bfdf7/kMzJsIObIv2BJQeXlN8RI.png) ## Evaluation The model takes 7-10 minutes to run , based on our dataset , equipped with the following pc hardware: cpu :i9 13900 ,ram: 32gb , gpu: rtx 3080 your mileage may vary. ### Testing Data, Factors & Metrics -precision -recall -f1 -confusion_matrix -accuracy ### Results -test accuracy = 0.853 -precision = 0.866 -recall = 0.8357 -f1 = 0.8509 ![image/png](https://cdn-uploads.huggingface.co/production/uploads/66d6f1b3b50e35e1709bfdf7/fbB7aEJgS94WrIB8L3-_9.png) #### Summary The model preforms well and meet our initial goal ,thus this model can handle the task of image classification real image vs Ai generated image.