Inspiration
We find that there are increasing numbers of images online that are AI generated; Many of these images look highly realistic and cannot be differentiated from the human eye. These result in many societal effects such as scams and lower trust in technology.
What it does
Our code runs a website that takes in a folder of images, runs through our model and outputs whether the image is real or AI, along with a .json file to be downloaded
How we built it
We first explored with ResNet18 as the base backbone. With the SID_Set and CIFAKE dataset, we trained ResNet18 with default ImageNet weights on different epochs and images per class size.
We concluded that ResNet18 works best with 12 epochs and 1000 images per class; These variables were then tested on ResNet50 and EfficientNet_B0. While experimenting, it was discovered that ResNet18 on 12 epochs and EfficientNet_B0 on 20 epochs had equally good accuracy rates
We then did further training with images that undergone the transformations:
- JPEG Compression
- Gaussian Blur
- Resize
- Gaussian Noise
- Colour Jitter
- Center Crop
Due to time limit, we only trained ResNet18 on these images. We wrote a script that transforms a portion of our images during training. We further trained our model with 50% transformed and 100% transformed images. The results showed that that the model trained on 50% transformed images had a higher accuracy. As such, this was the model used in our product
Challenges we ran into
Our images are trained on a small variety of images only as we only used the two datasets. As such, there might be certain patterns of images generated by other AI models that our model is unable to detect.
Improvements that we could adopt include training out model on a larger dataset with greater variety of photos. Moreover, with more time, we can also train our model to be more robust and experiment with different variables
Accomplishments that we're proud of
Starting with little to no experience in developing ML models, we are proud that we managed to learn more and successfully develop our own model and prototype
What we learned
We the basics of developing machine learning models, developing websites and how different layers connect to form a working product
What's next for Robust AI Image Detector
We hope to be able to continue improving the accuracy of our model, making it more robust and able to detect images that are generated by different models
Built With
- fetch
- flask
- huggingface
- numpy
- pillow
- python
- pytorch
- scikit-learn
- torchvision
Log in or sign up for Devpost to join the conversation.