Inspiration
The world cup motivated some of us to watch a lot of football related content before the big games. Especially documentary type videos or explainer videos of players relating their backstories and quirks. What surprised us was how many of the search results that come back on Youtube contain unbearably slopped out videos. That made us think that there must be a way to solve this problem using ChatGPT. That's how we came up with our idea for SlopShield.
What it does
SlopShield is a Chrome (and Firefox) extension that analyses the transcripts and sound of the Youtube videos that are displayed in your viewport while browsing. It passes the ids down to the backend for analysis, through our engine, that then reports how confident it is that the video has been AI generated. The videos that are flagged are then removed from the Youtube viewport by the browser plugin. Nice and simple.
How we built it
At first we wanted to train a model to do this but soon we realized that this can be solved for the most part by using very simple heuristics. For one, the transcripts already signal very heavily when a video has been generated by a botfarm. That's because the text will have been generated by, usually, a very old model that by now is easy for AI text detectors to flag.
Beyond that, SlopShield also checks the sound characteristics of the video by running it through a synthetic voice detector and uses that information to influence the confidence score as well.
These two methods combined resulted in a surprisingly effective filter that gets rid of most of the garbage that you would see in your feed.
Challenges we ran into
The Youtube api is a little restrictive about just fetching an infinite amount of transcripts and eventually just flagged our backend's IP which made our system run into a slew of 429s.
To get around that, we use the session of the user, because they are already logged in, to generate a OTP that the plugin passes to Youtube's backend as if the user click on the transcript button on the bottom of the video. Like this, the IP that is used to fetch the transcript is the same IP as the user watching and searching Youtube, which makes the network traffic behave the way Youtube intends it to.
Another complication was dealing with our compute limitations. We have one 3090 that we use for the engine, so we set up a few queues to make the load of multiple users best distributed over that one GPU. In addition we set up a database to cache results so no video has to be processed more than once, which would be wasteful.
Lastly, and probably the trickiest problem we ran into, is that the passing of the transcript to the backend via the plugin meant that there was a cache poisoning attack vector. To get around that, we corroborate the transcript that is sent against a transcript that we generate ourselves using whisper for a segment of that video.
Accomplishments that we're proud of
That we overcame the technical hurdles listed above is a large source of pride for sure.
That we came managed to cook something of this complexity up within a week is also definitely a source of pride. Even if it was all ChatGPT's merit anyway.
What we are also proud of is that this product has the potential to increase the viewing experience of other people. As well as combating botfarms that just manipulate people for views.
What we learned
We learned a lot about how youtube's API and backend works. We learned a lot about how effective ChatGPT/Codex is at researching, testing and calibrating local models for our use-case. We also learned that an insane amount of videos are AI generated.
What's next for SlopShield
There is a lot to expand on here. Many user interface improvements can be made. The engine can be made much faster. Which is something that would a very interesting technical challenge for us. We did not implement analysis on Youtube shorts yet, so that would be something that we would love to tackle given more time. Honestly this is a project with a really high polish ceiling that we could definitely make so good that you wouldn't want to use Youtube without it.
Built With
- bert
- bun
- chatgpt
- codex
- generateit
- python
- typscript
- xlsr
- yt-mlp
Log in or sign up for Devpost to join the conversation.