Inspiration

I was inspired by a few things that all lined up at once. On campus, everyone knows about AI text tools and detectors like GPTZero, Turnitin, and QuillBot, but I rarely hear about video detectors. Also, my mom often sends me Instagram Reels that turn out to be AI. It’s not always obvious at the first glance but she has trouble noticing the differences between real and generated videos. With Sora 2 raising the quality of generated video, it is getting much harder to see the differences. For these reasons I wanted to create a tool that helps people check a clip, see why it looks suspicious, and learn the cues that separate real footage from AI-generated video.

What it does

TrueSight uses OpenCV to help detect if a video was generated by Artificial Intelligence or if it was naturally created. This program takes frames of the uploaded video, runs various tests on it, and helps the user make an informed decision on whether it was real or generated. We make sure to feature the top three most suspicious frames for the user to see, a chart showing the Error Level Analysis and Fast Fourier Transform frequency Analysis, and additional pages in the program which contain sample videos and educational information. The goal is that this program serves as a tool which helps you decide whether the video is likely made by AI or real.

How I built it

I built TrueSight using Python with Streamlit. The program prompts you to upload a video and it starts by sampling frames of the video at a user-selected FPS and returns RGB frames, thumbnails, and metadata. Then the program begins to compute per-frame forensics: ela_score (quantifies JPEG recompress differences), fft_highfreq_ratio (energy outside a low-frequency band), and laplacian_variance (sharpness of video; too low and too high are suspicious). Next the programs adds temporal signals between consecutive frames and calculates the flow_instability (track how tiny patches of the image move across frames) and edge_mad (traces outlines of objects in frames, and measures how much they jump around). Finally the program normalizes and weighs those signals to produce a 0–1 authenticity score and designate it as: Likely Real / Inconclusive / Likely AI-Generated. Since this program runs on the CPU only with OpenCV/NumPy/Pillow/Matplotlib, the processing is transient so nothing is stored and it cannot be "manipulated" by bad training.

Challenges I ran into

One of the biggest challenges I ran into was that Hyper-real generative clips were very good at passing our frame-by-frame checks. Originally I only had the frame-by-frame checks but the ELA, FFT, and Laplacian often looked clean when viewed as single images. I did research and found learned that they started to fail when we compared frames over time. For example textures would “swim” and outlines would flicker even though they weren't supposed to. That is why I added motion-aware signals (flow_instability for motion wobble and edge_mad for edge flicker) and made them a part of the score to catch cases that single-frame tests missed.

I also had some trouble dealings with the UI stability because I am new to Streamlit. In particular the sidebar had me stuck for a while. Figuring out where the uploads and status messages should be places took a few tries and the layout would keep shifting randomly. I settled it by simplifying the UX and rendering sections upon clicking a button instead of trying to jump around the page. This way new content appears in place and the layout stays steady.

Accomplishments that I'm proud of

I'm proud that despite having no experience with Streamlit and limited experience with OpenCV, I was capable of creating a functional and working checker that’s fast, explainable, and visual(it isnt just a score). It displays clear labels, sketchy frames, and has zero storage. I was able to accomplish this all on my own..

What I learned

I have learned a lot about OpenCV and that single-frame checks like ELA, FFT high-frequency ratio, and Laplacian variance are fast and easy to explain, but hyper-real videos often pass them when viewed frame by frame. I have gained a much better insight not only into these various tests but also on the generation of videos and how I can spot the differences(or help my mother spot them) compared to real videos. This is an issue that affects everyone to a certain degree and I want to do my part to help.

What's next for TrueSight

Something that I have been exploring to improve TrueSight would be to take advantage of the sound in these videos and try to sync them to the actual actions. Real videos are either synced or off by a few frames (but consistent). AI generated videos tend to be off but inconsistently(some sounds rush the video and other sounds drag behind). I also believe it would be more useful if this was deployed and accessible as a website. This way people can actually use it without having to download the program onto their computers.

Built With

Share this project:

Updates