Inspiration
Artificial intelligence is becoming a part of more and more people's lives. From DALLE-2 to ChatGPT, AI technology is undeniably as big as it's ever been, with no signs of slowing down. However, this technology comes with a downfall: deepfakes, cheats, and passing AI artwork off as your own? While the latter of the three seems trivial, social media is buzzing with trivial misinformation. We wanted to build a tool to help people separate truth and fiction when it comes to AI artwork.
What it does
Our application functions on a fairly simple premise: Data was used to train 3 separate models, each with their own strengths and weaknesses. Users can pass images into these models and they will collectively decide upon one answer: AI or not. We intensively studied the behaviors these models during training and testing and decided on decision weights that would most accurately represent the actual state of the test image.
How we built it
We started by gathering a dataset. We scraped various Reddit subs to build a collection of AI and non-AI art images to be used for training. Once we had a reasonably sized dataset, we wrote a data cleaner and used cleaned data to feed into the training of a random forest classifier. We were able to get reasonable accuracy out of the forest classifier, so we began work on the second node: the convolution neural net. We ran into difficulties using pretrained models and eventually had to write one from scratch. We had issues with accuracy after that, but after more architecture redesign we were able to get acceptable accuracy out of the model. Finally, we trained a k-neighbors classifier. Accuracy was acceptable, and we decided to use this model as a tertiary decider. While the models were being worked on, we also designed a sleek interface for easy access to the ML models. All of this comes together into one standalone executable.
Challenges we ran into
We ran into several challenges along the way. First, we had teammates with registration issues and as a result had to work as a pair instead of a team of four. That raised another problem, since one of our proposed teammates had the responsibility of procuring the dataset. We were eventually able to build one, after issues with scrapers and file types. Another issue was with model accuracy. We had severe problems with the convolution neural network at the beginning (training on an uneven dataset, using incorrect weights and layers, etc), but we overcame that by consulting documentation and crunching some numbers. Another issue we ran into was TKinter syntax. There is little documentation for the type of project we wanted, so we largely had to rely on forums or even trial & error.
Accomplishments that we're proud of
We are extremely proud of the level of polish and quality of our product at the end of the 36 hour period. We worked extremely hard on getting high model accuracy and a sleek UI, as well as simply finishing our project.
What we learned
We learned several do's and don'ts: DO plan ahead. While you can't start coding until the hackathon starts, you can plan out your tasks and timeframes. DO find a good place to work. Environment is key in these types of events. We used a deserted engineering building that we practically had to ourselves. DO write modular code. If you write a 600 line code loop, it is going to break and you will be unhappy. Write small 30 line functions and plug them into your main loop.
DON'T bite off more than you can chew. We knew this going into the weekend and specifically decided on a project that could cater to our abilities. DON'T rely on maybes. Our dataset was a maybe and we suffered time loss because of it. Have a contingency plan in place and execute it if you need to. DON'T give up! No matter how small it is, get some sort of product out the door. We decided well ahead of time what our Minimum Viable Product would be if we couldn't implement all the features we wanted to.
What's next for TNAP - Tri-Node Art Predictor
TNAP is a great beginning in what will (hopefully) be a really cool ecosystem of AI tools. We plan on not only improving the quality of this application post-hackathon, but also developing other sister apps for more general detection, as well as generation. The hackathon might be over, but TNAP is just starting!
Log in or sign up for Devpost to join the conversation.