<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Oghosa Abu on Medium]]></title>
        <description><![CDATA[Stories by Oghosa Abu on Medium]]></description>
        <link>https://medium.com/@abuoghosa?source=rss-b5223bdf3e8c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YUn-rS1dew5T2gMUPGAKTg.jpeg</url>
            <title>Stories by Oghosa Abu on Medium</title>
            <link>https://medium.com/@abuoghosa?source=rss-b5223bdf3e8c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 17:47:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abuoghosa/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Hybrid Quantum-Classical Approach to Image Forgery Detection]]></title>
            <link>https://medium.com/@abuoghosa/a-hybrid-quantum-classical-approach-to-image-forgery-detection-70a699eb7294?source=rss-b5223bdf3e8c------2</link>
            <guid isPermaLink="false">https://medium.com/p/70a699eb7294</guid>
            <category><![CDATA[ai-generated-content]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[image-processing]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[cnn]]></category>
            <dc:creator><![CDATA[Oghosa Abu]]></dc:creator>
            <pubDate>Tue, 20 May 2025 19:42:01 GMT</pubDate>
            <atom:updated>2025-05-20T19:42:01.400Z</atom:updated>
            <content:encoded><![CDATA[<h3>Motivation</h3><p><strong>Is anything real anymore?<br></strong>Not long ago, seeing a photo meant witnessing a real moment frozen in time. But as computers advanced, so did our ability to manipulate reality. We began editing images, placing people into scenes they were never part of. At first, these edits were obvious. But we learned to blend edges and shadows seamlessly over time, making the fake look convincingly real.</p><p>In the age of Photoshop, a trained eye could still spot subtle alterations in an airbrushed celebrity photo, a digitally altered background. Then came artificial intelligence, revolutionizing photo editing and image generation. Initially, AI-generated images were easy to detect. Today, they’re nearly indistinguishable from real photos unless they’re blatantly absurd, like Donald Trump in a pope outfit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/0*Rk26pjkfta4oCWag" /></figure><p>But what if it’s a photo of me at the foot of the Eiffel Tower? It would look real enough, wouldn’t it? The truth is, I’ve never been there, at least not yet. So that image would be fake, or even a random picture of a beautiful lady.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/0*wqtBG8Nf_nnbu3bl" /></figure><p>And that’s the problem. We’re entering an age where visual evidence is no longer trustworthy. This unsettling shift in our perception of visual truth inspired this project.</p><h3>Method</h3><p>To address this challenge, we developed an image forgery detector, a hybrid AI model capable of binary classification, distinguishing between <strong>real</strong> and fake(<strong>AI-generated)</strong> images.</p><p>Our goals were clear:</p><ul><li>Accurately differentiate between real and fake images</li><li>Ensure fast and efficient classification using quantum computing algorithms.</li><li>Lay the groundwork for future AI-verification systems.</li><li>Design a deployable solution that works in real-world settings.</li></ul><p>We focused on building a system that balances performance, speed, and scalability to achieve this.</p><h3>Hybrid Quantum Classical Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZPamrL33MRCn3fy2" /></figure><p>We implemented a <strong>hybrid system</strong> integrating <strong>quantum computing</strong> with classical <strong>convolutional neural networks (CNNs)</strong>. The classical CNN component extracts spatial features from images, effectively capturing patterns such as edges, textures, and structures.</p><p>The <strong>quantum component</strong> introduces a powerful layer of representation using <strong>parameterized quantum circuits</strong>. By using quantum properties such as <strong>superposition</strong> and <strong>entanglement</strong>, this layer enhances the model’s ability to detect subtle and complex distinctions between authentic and AI-generated images, differences that classical models may struggle to identify.</p><p>We implemented a fidelity-based quantum kernel using amplitude embedding feature vectors from the CNN, which are normalized and encoded into quantum states. The kernel measures the quantum state similarity between image representations and feature separability in cases where classical boundaries are complex. We simulated our quantum components using PennyLane’s quantum simulator.</p><p>Our model was trained on a combined <strong>DeepFake</strong> and <strong>CASIA 2.0 dataset</strong>, totaling over <strong>18,000 images</strong>. To ensure efficient training, the data was loaded and processed in <strong>batches</strong>. We employed a quantum circuit with <strong>sixteen qubits</strong> (balancing expressivity with current simulator constraints), and a<strong> 4-layer variational quantum circuit</strong> was selected to balance expressive power with the computational constraints of current quantum simulators and hardware.</p><p>We also deployed it as a usable Huggingface space, which can be accessed as an API.</p><h3>Step-by-Step Solution</h3><h4>Step 1: Collect a Dataset of Real and Fake Images</h4><p>We used two publicly available datasets to ensure a balanced and comprehensive representation of both real and fake images:</p><ol><li><strong>DeepFake Detection Dataset: </strong>a dataset containing train, test, and validation folders, each with real and fake subfolders. Designed for detecting AI-generated facial photos. Dataset size: ~470 GB. Source:<a href="https://www.kaggle.com/datasets/manjilkarki/deepfake-and-real-images"> DeepFake and Real Images on Kaggle</a></li><li><strong>CASIA 2.0 Image Tampering Dataset: </strong>a dataset developed for detecting digitally altered (tampered) images. It includes: Tampered images (<strong>Tp</strong>), Authentic images (<strong>Au</strong>), and Reference annotations (<strong>CASIA2 Groundtruth</strong>). Source:<a href="https://www.kaggle.com/datasets/divg07/casia-20-image-tampering-detection-dataset"> CASIA 2.0 on Kaggle</a></li></ol><p>We merged these datasets and used them in one dataset in this project. This made our dataset robust and very good for this project, but it was too large.</p><h4>Step 2: Preprocessing Images for an AI Model</h4><p>We resized images to a standard size (<strong>128×128 pixels</strong>) and then kept RGB for feature extraction. We normalized pixel values (scale between 0 and 1). Again, we split our dataset into <strong>training, validation, and test sets</strong>.</p><h4>Step 3: Build a Hybrid Quantum-Classical AI Model</h4><p>Using Convolutional Neural Networks (CNNs) for image feature extraction, we integrated quantum-inspired enhancements to improve performance. Specifically, Quantum Kernels were employed to achieve better feature separation, while Variational Quantum Circuits (VQC) were incorporated to boost classification accuracy. Our implementation leveraged Python frameworks such as TensorFlow and PyTorch for classical deep learning, and PennyLane for quantum-enhanced components.</p><p>We adopted a modified ResNet-18 architecture with the following customizations:</p><ul><li>Reduced filter sizes (3×3) in the early convolutional layers to detect fine-grained manipulation artifacts</li><li>Squeeze-and-Excitation (SE) blocks to improve channel-wise feature attention</li><li>Spatial Pyramid Pooling (SPP) to capture multi-scale contextual information</li><li>Fully connected layers refined to: 512 → 256 → 128 units with ReLU activation functions</li></ul><h4>Step 4: Trained and Optimized the Model</h4><p>We trained the AI model on real vs. fake images, using a CNN model and then the hybrid quantum model, <strong>which improv</strong>ed the accuracy to 84.20% compared to a classical CNN. Fine-tuning hyperparameters using <strong>quantum-inspired optimizers</strong> made our model perform 40% better than the classical CNN model. While our method succeeded, the limitation we faced at this stage was the high computational power, which took too long to train.</p><h4>Step 5: Tested the Model</h4><p>We uploaded test images and checked if they were <strong>real or tampered with</strong>. This can be reached and tested: <a href="https://huggingface.co/spaces/Omotola12/image_forgery_detector_with_quantum_features">https://huggingface.co/spaces/Omotola12/image_forgery_detector_with_quantum_features</a></p><h4>Step 6: Deployed the Model as an API</h4><p>We deployed the model as an<strong> API</strong> using FastAPI for easy use. We also deployed a Gradio solution with an API and available documentation on how to use it. [ Check the link above]</p><h3>Why Quantum Made the Difference</h3><h4>Enhanced Feature Separability</h4><p>The quantum kernel approach fundamentally transformed the feature space. By mapping classical features into a higher-dimensional space, our model could identify linearly inseparable patterns in classical space. This was particularly valuable for detecting sophisticated AI-generated images with subtle artifacts.</p><h4>Improved Generalization on Limited Data</h4><p>While deep learning typically requires massive datasets, our quantum approach showed better generalization from fewer training examples. The quantum circuit’s ability to explore the feature space more efficiently meant we could achieve robust performance even with limited examples of certain forgery types.</p><h4>Resistance to Adversarial Examples</h4><p>An unexpected benefit was the model’s improved resistance to adversarial examples. The probabilistic nature of quantum measurements created a form of inherent regularization that made the model less susceptible to carefully crafted adversarial inputs designed to fool classifiers.</p><p>In conclusion, our work represents a small yet meaningful step toward combating the growing challenge of fake images and the spread of misinformation. We have developed a <strong>modular, easy-to-use solution</strong> that contributes to the broader effort of detecting AI-generated images. It lays a crucial groundwork for future innovations in visual media verification.</p><p>Useful Links:</p><p>Hugging face spaces: <a href="https://huggingface.co/spaces/Omotola12/image_forgery_detector_with_quantum_features/tree/main">https://huggingface.co/spaces/Omotola12/image_forgery_detector_with_quantum_features/tree/main</a></p><p>Github Repo: <a href="https://github.com/omotolani12/image-forgery-detector">https://github.com/omotolani12/image-forgery-detector</a></p><p>Thanks for reading.</p><p>This study was a collaborative effort by <a href="https://medium.com/@omotolaniosems">Omotolani Kehinde-Osems</a> and Oghosa Osazemen Abu.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70a699eb7294" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Fashion Stylist: Virtual Stylist Solution Using LLama and Gradio]]></title>
            <link>https://medium.com/@abuoghosa/ai-fashion-stylist-virtual-stylist-solution-using-llama-and-gradio-0ed3a2a571f7?source=rss-b5223bdf3e8c------2</link>
            <guid isPermaLink="false">https://medium.com/p/0ed3a2a571f7</guid>
            <category><![CDATA[fashion]]></category>
            <category><![CDATA[hugging-face]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[gradio]]></category>
            <category><![CDATA[llama-2]]></category>
            <dc:creator><![CDATA[Oghosa Abu]]></dc:creator>
            <pubDate>Tue, 09 Jul 2024 17:53:35 GMT</pubDate>
            <atom:updated>2024-07-09T17:53:35.894Z</atom:updated>
            <content:encoded><![CDATA[<p>Imagine maximizing your time and effort in getting ready for an event or everyday function without the risk of looking out of place — no more frequent returns of items that do not fit your body type or style. Now, envision a fashion retailer offering a virtual styling service where users chat with an AI assistant to receive personalized outfit recommendations based on their body shape and style preferences. This innovative service ensures that every outfit complements your body type and aligns with your unique fashion tastes, making dressing up effortless and enjoyable.</p><p>Exploring the use of AI tools in various fields is fascinating, so why not apply them to the world of fashion? A virtual fashion stylist (VFS) tailors users’ recommendations based on questions regarding body type, preference, and taste. In the course of this research, we surveyed prospective users to determine if there was a need for such a tool. We gauged this need using Google Forms to consider the number of friends and family who would use such a tool.</p><p>We hope more stores will implement this on their websites to provide personalized fashion recommendations to consumers. This approach employs AI assistants to provide suitable recommendations to their consumer base.</p><h3>What is a VFS?</h3><p>A Virtual Fashion Stylist (VFS) is an AI-driven tool that provides personalized fashion suggestions based on individual metrics and current trends. It functions like a personal stylist, understanding your unique style and making outfit suggestions that enhance your wardrobe choices. This innovative technology leverages advanced algorithms to offer tailored outfit ideas, trend insights, and wardrobe coordination. By integrating LLama, an AI transformer model, with Gradio, a user-friendly interface, we have developed a tool that delivers human-like fashion advice and offers a seamless application experience for users.</p><p><strong>Llama</strong></p><p>Llama, a product of Meta AI, has demonstrated strong performance in text generation and belongs to the family of autoregressive large language models.</p><p>Leveraging the capabilities of this model, we trained a virtual fashion stylist capable of generating human-like responses. Various versions of this open-source model are available, and we accessed it through Hugging Face.</p><p><strong>Gradio</strong></p><p>To create an interactive and user-friendly experience, we utilized Gradio, a Python library that automatically generates public links for creator websites. Gradio simplified the process of using the VFS solution, making it an enjoyable experience. Users can input their fashion preferences and receive outfit suggestions on this intuitive platform. Gradio bridges the gap between complex AI technology and everyday consumers, making smart fashion styling accessible to everyone.</p><h3>How does VFS work?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XRjnE3YbTcl9sUvA" /><figcaption>Process Flowchart</figcaption></figure><h3>Step 1: Setting Up the Environment</h3><p>Before we talk about the implementation, ensure you have the following installed:</p><ul><li>Python (&gt;= 3.6)</li><li>Transformers library</li><li>Gradio library</li></ul><p>These commands install the required libraries: transformers, torch, accelerate, and gradio.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JhP8VpiGHjiiv3_Y" /></figure><p>They also handle authentication with Hugging Face to access specific models.</p><h3>Step 2: Import libraries and load the tokenizer</h3><p>Next, we import the relevant libraries, define the model name, and load the tokenizer for the LLaMA model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WbTLTGY0p2tHe-3h" /></figure><p>With the tokenizer loaded, the next step is to create a text generation pipeline using this model. This pipeline will handle the input processing and text generation tasks.</p><h3><strong>Step 3: Create a text generation pipeline</strong></h3><p>We create a pipeline for text generation using the specified model. This setup uses torch.float16 for precision and automatically allocates computational resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rn8vr5-6AYfZb4XC" /></figure><h3><strong>Prompt Formatting and Response Generation</strong></h3><h3><strong>Step 4: Define a system prompt and format messages</strong></h3><p>We define a system prompt to set the tone for the chatbot’s responses. The `format_message` function formats the message and conversation history to be used as input for the model. Additionally, it ensures the model has the necessary context to generate appropriate responses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UzZaQ6ux-pMkXdmr" /></figure><h3><strong>Step 5: Generate responses</strong></h3><p>Now, we define a function get_llama_response that generates a response from the LLaMA language model pipeline given a message and conversation history.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pfUgkZf2c_3q8li3" /></figure><h3>Recommendation Generation</h3><h3><strong>Step 6: Generate fashion recommendations</strong></h3><p>Then we generate a detailed fashion recommendation based on user inputs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pR9V4vGRjiNs_VcA" /></figure><h3><strong>Gradio Interface</strong></h3><h3><strong>Step 7:Define Gradio interface</strong></h3><p>Finally, we created the Gradio interface that allows users to interact with the VFS and receive personalized fashion recommendations. First, we define the inputs and outputs for the Gradio interface. Then, we launch the Gradio interface, enabling users to interact with the VFS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LDJozABm7Iyb_fQC" /></figure><h3><strong>Understanding the Virtual Fashion Stylist (VFS) Output</strong></h3><p>The provided outputs demonstrate the capabilities of our LLM-powered Virtual Fashion Stylist (VFS).</p><p><strong>Output 1</strong></p><p>In this example, the VFS shows its ability to cater to individual style preferences. The user expressed a preference for simple, colorful, and modest clothing, and the VFS generated recommendations that align with these preferences, demonstrating its ability to understand and respond to diverse user needs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*V6RuqL1CVKZ6B9yN" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JE8aq8pd6iGAzDXk" /></figure><p><strong>Output 2</strong></p><p>This output highlights the VFS’s capacity to incorporate specific brand preferences into its recommendations. The user indicated a preference for darker, neutral colors and mentioned specific brands they enjoy shopping at. The VFS successfully tailored its suggestions to include outfits from these brands, demonstrating its ability to personalize recommendations based on individual tastes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NTykECNrBI6XMXuH" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vSLsPo4ixlvBQX-B" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TKvOAlogA4ZkP42p" /></figure><p>These outputs show the VFS’s potential to change the way people approach fashion. By providing personalized recommendations that consider both individual preferences and current trends, the VFS can help users make informed fashion choices that enhance their confidence and self-expression.</p><p>As a part of this study, we explored fashion data to identify similarities using cosine measures, uncovering hidden patterns in open-source fashion data. However, we found that more open-source data sources are needed to provide comprehensive insights. For further studies, training a knowledge-based LLama model using fashion data that describes products in terms of patterns, colours, and sizes across different categories would be interesting.</p><p>Thanks for reading. The code is available on <a href="https://github.com/omotolani12/Virtual-Fashion-Stylist-Project-using-Llama2">GitHub</a>.</p><p>This study was a collaborative effort by <a href="https://medium.com/@omotolaniosems">Omotolani Kehinde-Osems</a> and Oghosa Osazemen Abu.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0ed3a2a571f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>