<?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 Domenico Lacavalla on Medium]]></title>
        <description><![CDATA[Stories by Domenico Lacavalla on Medium]]></description>
        <link>https://medium.com/@domenicolacavalla8?source=rss-9f77f7f7f008------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ZnRcpCuJHME18lwt6PrTqg.jpeg</url>
            <title>Stories by Domenico Lacavalla on Medium</title>
            <link>https://medium.com/@domenicolacavalla8?source=rss-9f77f7f7f008------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 09:53:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@domenicolacavalla8/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[Text2Motion: From Text to 3D Animation for Any Mesh]]></title>
            <link>https://medium.com/@domenicolacavalla8/text2motion-from-text-to-3d-animation-for-any-mesh-5f437165eb96?source=rss-9f77f7f7f008------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f437165eb96</guid>
            <category><![CDATA[diffusion-models]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[computer-graphics]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Domenico Lacavalla]]></dc:creator>
            <pubDate>Thu, 09 Oct 2025 19:20:16 GMT</pubDate>
            <atom:updated>2025-10-09T19:20:16.824Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Text2Motion is an end-to-end system that automatically rigs, skins, and animates any 3D mesh directly from natural language</em></p><p><em>A project by </em><a href="https://www.linkedin.com/in/matteo-balice-a4446818b/"><em>Matteo Balice</em></a><em>, </em><a href="https://www.linkedin.com/in/domenico-lacavalla/"><em>Domenico Lacavalla</em></a><em>, </em><a href="https://www.linkedin.com/in/antonio-giuseppe-doronzo/"><em>Antonio Giuseppe Doronzo</em></a><em> and </em><a href="https://www.linkedin.com/in/alessandro-masini/"><em>Alessandro Masini</em></a><em>.</em></p><p>The full project and implementation are available on <a href="https://github.com/bralani/text2motion"><strong>GitHub Repository</strong></a><strong>.</strong></p><h3>Introduction</h3><p>The creation of 3D animations has long been a complex and labor-intensive process, demanding specialized expertise in rigging, skinning, and keyframe animation. This high barrier to entry often limits creative expression to those with extensive technical training.</p><p>Our work aims to democratize this field by proposing a system that automates the entire pipeline, from a static 3D mesh to a complete animation, guided solely by natural language. This approach significantly accelerates prototyping for game development, VFX, and virtual reality, making dynamic content creation more accessible.</p><h4>Table of Contents:</h4><p>· <a href="#b1f0">1. Automating 3D Animation</a><br>· <a href="#4378">2. Stage 1: Automatic Rigging &amp; Skinning with PointNet++</a><br> ∘ <a href="#e2c7">Armature Classification and Joint Prediction (Rigging)</a><br> ∘ <a href="#728e">Weight Prediction (Skinning)</a><br>· <a href="#58d4">3. Stage 2: Motion Generation with a Diffusion Model</a><br> ∘ <a href="#6554">A Topology-Aware Transformer for Any Skeleton</a><br> ∘ <a href="#ba45">Text Conditioning and Coherence</a><br>· <a href="#c3ae">4. Results and Evaluation</a><br> ∘ <a href="#21f6">Rigging &amp; Skinning Performance (Stage 1)</a><br> ∘ <a href="#360f">Motion Generation Performance (Stage 2)</a><br> ∘ <a href="#63ee">Visual Results</a><br>· <a href="#cf6a">5. Conclusion and Future Work</a><br>· <a href="#f29f">Acknowledgments</a></p><h3>1. Automating 3D Animation</h3><p>The traditional animation workflow, illustrated below, involves a series of painstaking manual steps.</p><p>This classic pipeline includes:</p><ul><li><strong>Modeling:</strong> Creating the 3D mesh.</li><li><strong>Rigging:</strong> Manually building a virtual skeleton, or “armature,” and fitting it inside the mesh.</li><li><strong>Skinning:</strong> Manually painting influence weights to bind the mesh’s vertices to the armature’s joints.</li><li><strong>Armature Animation:</strong> Manually posing the armature frame by frame to create the motion sequence.</li><li><strong>Final Deformation:</strong> Applying the armature’s motion to the skinned mesh.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*LlQioDPlv2x9jOdThytkkg.png" /><figcaption>Full steps</figcaption></figure><p>Our <strong>Text2Motion</strong> pipeline is designed to automate this entire process. It automatically performs the Rigging and Skinning, and then our diffusion model generates the Armature Animation directly from a text prompt. This lets the user bypass the most labor-intensive parts of the workflow and focus purely on the creative description.</p><p>To achieve this, we designed a three-stage system that systematically handles each part of the process, as shown in the high-level architecture below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*yeKTPzXXzrKUXqoq52_RQg.png" /><figcaption>Text2Motion Pipeline</figcaption></figure><p>Our end-to-end process breaks down into three main stages:</p><ol><li><strong>Classification and Rigging:</strong> We analyze the input 3D mesh to determine the most suitable skeleton (“armature”), using a PointNet++-based model to classify the mesh and predict the joint positions.</li><li><strong>Skinning:</strong> We then automatically bind the mesh to the predicted skeleton, creating a “skinned” model that can be realistically deformed.</li><li><strong>Motion Generation:</strong> Finally, a powerful, text-conditioned diffusion model generates the animation, bringing the character to life from a text prompt.</li></ol><h3>2. Stage 1: Automatic Rigging &amp; Skinning with PointNet++</h3><p>Before a 3D model can be animated, it needs a skeleton (<strong>rigging</strong>) and a way for its skin to deform realistically with the skeleton’s movements (<strong>skinning</strong>). Our goal is to automate these traditionally manual and intricate tasks. For this crucial first step, we employ a single, powerful <a href="https://arxiv.org/abs/1706.02413"><strong>PointNet++</strong></a> architecture to handle everything.</p><p>Our network is built on a PointNet++ encoder-decoder that captures both global shape and local geometry from a point cloud sampled from the mesh’s surface. The features learned by this backbone are then fed into three distinct “heads,” each responsible for a specific task: classifying the armature, predicting joint positions, and calculating skinning weights.</p><h4>Armature Classification and Joint Prediction (Rigging)</h4><p>First, the network needs to understand <em>what</em> it is looking at.</p><ul><li><strong>Armature Classification</strong>: The encoder produces a single global feature vector that describes the entire mesh. This vector is fed into a classifier that assigns the mesh to a predefined category (e.g., “T-Rex,” “Chicken”), each tied to a specific skeleton topology. This tells us which bones our character should have.</li><li><strong>Joint Prediction</strong>: The decoder generates rich, per-point features. A prediction head uses these features to estimate the 3D location of every possible joint. By using the result from the classification head as a mask, we discard irrelevant joints and calculate the final position for each bone as a weighted average of the point cloud coordinates.</li></ul><p>This process transforms a static mesh into a rigged character, but the skin is not yet attached to the bones.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*1BS5WM5dFRf-Lx3bFvfdZg.png" /><figcaption>Pointnet++</figcaption></figure><h4>Weight Prediction (Skinning)</h4><p>The final head of our PointNet++ model predicts the <strong>skinning weights</strong>. It determines how much influence each joint has on every vertex of the mesh, which is key to achieving smooth and realistic deformations. This network is inspired by the <a href="https://zhan-xu.github.io/rig-net/"><strong>SkinNet</strong></a> architecture.</p><p>Here’s a breakdown of the process:</p><ol><li><strong>Input Features</strong>: For each point, we combine the features from the PointNet++ decoder with the point’s 3D coordinates and the coordinates of the <strong>5 nearest predicted joints</strong>.</li><li><strong>Graph Convolution Unit (GCU)</strong>: This is the core of the skinning head. The feature vectors are processed by a <strong>Graph Convolutional Unit (GCU)</strong> which operates on the skeleton’s hierarchy. This allows the network to pass information along the bones, helping it understand their relationships and ensuring that deformations are anatomically consistent.</li><li><strong>Weight Calculation</strong>: After the GCU and further processing through MLPs, a final classifier outputs the influence weights for each point with respect to every joint. A softmax function converts these into a probability distribution, which is optimized using a Cross-Entropy loss.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*pGlJzOSDJ5w6iRQnnvrMFw.png" /><figcaption>Skinnet</figcaption></figure><p>The result is a <strong>skinning weight matrix</strong> that binds the mesh to the skeleton. With this, Stage 1 is complete: our static mesh is now a fully rigged and skinned character, ready to be animated.</p><h3>3. Stage 2: Motion Generation with a Diffusion Model</h3><p>With a fully rigged and skinned model, we’ve reached the final stage: bringing it to life. To translate a text prompt like <em>“a tyrannosaurus attacks”</em> into a fluid animation, we turn to <strong>diffusion models</strong>. Our model architecture is a transformer-based denoiser that learns to generate motion by reversing a noising process. It draws inspiration from the pioneering work of <a href="https://arxiv.org/abs/2502.17327"><strong>Anytop</strong> </a>and <a href="https://arxiv.org/abs/2209.14916"><strong>MDM (Human Motion Diffusion Model)</strong></a>, but integrates our own innovations to handle diverse skeletons and achieve strong text-motion alignment.</p><p>Our diffusion-based motion generator iteratively refines a noisy pose sequence into a realistic animation, guided by both textual semantics and skeletal topology. It operates in two phases: a fixed <strong>forward process</strong> that gradually adds noise to training data, and a learned <strong>reverse process</strong> where the model is trained to predict the original, clean motion from a noisy input. During inference, we start with pure random noise and apply the model iteratively to denoise it into a coherent animation.</p><h4>A Topology-Aware Transformer for Any Skeleton</h4><p>A key challenge is creating a single model that can animate a T-Rex as well as a chicken. Adopting the core philosophy of Anytop, we built a universal model conditioned on the <strong>topology</strong> of the skeleton itself. This is achieved through a <strong>Skeletal-Temporal Transformer</strong> with dual attention mechanisms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*lTz8PJmKr-h3nCRrzydTyg.png" /><figcaption>A high-level overview of our diffusion architecture. A text prompt is encoded and used to condition a Skeletal-Temporal Transformer, which iteratively denoises a motion sequence.</figcaption></figure><p>As shown in the diagram, the core of our model relies on two specialized attention mechanisms:</p><ul><li><strong>Skeletal Attention:</strong> This operates across the joints within a single frame. Crucially, it is biased by the skeleton’s hierarchy (kinematic relations and joint distances), forcing the model to prioritize anatomically connected joints. This ensures the generated motion is physically plausible and efficient.</li><li><strong>Temporal Attention:</strong> This operates across time for each joint individually, allowing the model to learn the flow and dynamics of the motion over the entire sequence and ensure frame-to-frame coherence.</li></ul><h4>Text Conditioning and Coherence</h4><p>While the transformer provides a powerful backbone, we introduce several key components to precisely control the motion with text and enhance its quality.</p><ol><li><strong>The “Enrichment Block”</strong>: Before the transformer can process the data, we fuse four key sources of information: the <strong>noisy motion</strong> itself, the <strong>skeleton’s identity</strong> (including joint names embedded with a T5 encoder), the <strong>text prompt</strong> (encoded with SBERT), and the current <strong>diffusion timestep</strong>. This gives the model the full context needed to make an informed prediction.</li><li><strong>Cross-Attention for Text-Motion Alignment</strong>: To ensure the generated motion accurately reflects the prompt, we inject a <strong>cross-attention module</strong> after the skeletal attention block. Here, the motion features “query” the text embedding, forcing the model to constantly refer back to the user’s description at every layer of the network.</li><li><strong>A Three-Part Objective Function</strong>: To train the model, we use a composite loss function designed for accuracy, realism, and semantic consistency:</li></ol><ul><li><strong>L_simple (MSE Loss):</strong> The primary objective to minimize the error between the predicted and ground-truth motion.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*qX25X-NUehjxdhd2mgbvgA.png" /></figure><ul><li><strong>L_rot (Geodesic Loss):</strong> A specialized loss that measures the true angular distance between rotations, leading to more stable and realistic joint movements than a simple MSE.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*5qGP6E8QHgcvNnjECD8ccg.png" /></figure><ul><li><strong>L_InfoNCE (Contrastive Loss):</strong> A contrastive loss that improves generalization. It encourages the model to produce similar motion embeddings for semantically similar text prompts (e.g., &quot;walking&quot; and &quot;striding&quot;), even if performed by different characters.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*HGPGbhsmNvEDs5F7p2W-Yg.png" /></figure><p>With this diffusion-based generation, our Text2Motion pipeline is complete, capable of taking any 3D mesh and a line of text to produce a unique, high-quality animation.</p><h3>4. Results and Evaluation</h3><p>To rigorously evaluate our pipeline, we conducted quantitative and qualitative assessments on the <a href="https://truebones.gumroad.com/"><strong>Truebones Zoo dataset</strong></a>, a large collection of motions across a wide variety of animal skeletons.</p><h4>Rigging &amp; Skinning Performance (Stage 1)</h4><p>The performance of our PointNet++ model is critical, as an inaccurate rig will lead to a poor animation. We evaluated it on armature classification accuracy and joint prediction error (L1 loss). To improve robustness, we run predictions five times for each mesh using different Monte-Carlo samples and aggregate the results (majority vote for classification, median for joint positions).</p><p>Quantitatively, our model demonstrated a strong and stable learning curve, reaching a peak armature classification <strong>accuracy of over 92%</strong>. The joint prediction error showed a similarly positive trend, with the L1 loss decreasing steadily throughout the training process.</p><p>The tables below provide a more detailed look at the performance over time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/1*ghA5a-kzfmsMi9qRGN7HDw.png" /><figcaption>Table 1. Armature classification accuracy. Monte-Carlo (MC) evaluation consistently improves robustness.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*TBUCAqDLlEURuBKMYnGwgQ.png" /><figcaption><em>Table 2. Joint prediction (L1) and skinning loss. The model shows a consistent reduction in error over time.</em></figcaption></figure><h4>Motion Generation Performance (Stage 2)</h4><p>For the diffusion model, we evaluated its ability to generate high-quality motion that is both anatomically plausible and semantically aligned with the text prompt.</p><p>The results show a substantial improvement in both low-level accuracy and high-level semantic understanding, as summarized in the table below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*Z1niLDoHkyzvf_1WsiAjHg.png" /><figcaption><em>Table 3. Diffusion model performance. The model achieves significant reductions in both geometric error and semantic loss.</em></figcaption></figure><p>The sharp drop in <strong>Geodesic Joint Error</strong> indicates a substantial improvement in the accuracy of the generated poses. Similarly, the dramatic decrease in <strong>InfoNCE Loss</strong> demonstrates that the model became very effective at learning a shared semantic space where similar text prompts correspond to similar motion embeddings, even across different skeletons.</p><h4>Visual Results</h4><p>Beyond the numbers, the final test is in the visual quality of the animations. The diffusion denoiser yields motions that are temporally coherent and anatomically plausible, successfully capturing the distinct gaits and movements appropriate for each creature. Here are a couple of examples generated by our model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*995zz8C45nJwotX6u60gDw.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*Yt2wJGAA_MNffdFbHDNy-g.gif" /><figcaption>Generation for ‘A Tyrannosaurus Attacks’ ( Left) and ‘a chicken roars’ (Right)</figcaption></figure><h3>5. Conclusion and Future Work</h3><p>Our work demonstrates that a three-stage, end-to-end pipeline is a viable and powerful approach for text-to-motion generation. Through extensive experiments, we’ve shown that the explicit decoupling of rigging from motion synthesis is essential. Our PointNet++ module provides a robust foundation, achieving over <strong>92% armature classification accuracy</strong>, while our diffusion model successfully generates coherent, semantically-aligned motion that generalizes to unseen skeletons.</p><p>While the results are promising, there is always room for improvement. Our future work will focus on a few key areas:</p><ul><li><strong>Improving Data Efficiency:</strong> We plan to explore techniques to enhance the model’s performance on rare or complex skeletons.</li><li><strong>Richer Skeletal Embeddings:</strong> A promising direction is to integrate a Graph Neural Network (GNN) into the diffusion model to learn more sophisticated embeddings for each joint.</li><li><strong>Fine-Grained Control:</strong> We aim to incorporate other forms of control, such as target trajectories or key poses, to give animators even more creative freedom.</li></ul><p>The principles of Text2Motion are not limited to the animal kingdom. The ability to automatically rig, skin, and animate any mesh from text opens up possibilities across game development, VFX, virtual reality, and scientific research. By decoupling the animation process from the specific topology of a mesh, Text2Motion offers a truly general-purpose tool for the future of 3D content creation.</p><h3>Acknowledgments</h3><p>We would like to extend our sincere gratitude to the researchers and creators whose work made this project possible. Our model builds upon the foundational contributions of <a href="https://arxiv.org/abs/1706.02413"><strong>PointNet++</strong></a> and <a href="https://zhan-xu.github.io/rig-net/"><strong>RigNet</strong></a>, and is heavily inspired by the diffusion architectures of <a href="https://arxiv.org/abs/2209.14916"><strong>MDM</strong> </a>and <a href="https://arxiv.org/abs/2502.17327"><strong>Anytop</strong></a>. A special thanks to <a href="https://truebones.gumroad.com/"><strong>Truebones</strong></a><strong> </strong>for providing the excellent Zoo dataset that was the foundation for our training.</p><p>This project is open-source under an <a href="https://www.google.com/search?q=https://github.com/d0men1c0/text2motion/blob/main/LICENSE">MIT LICENSE</a>, and we hope it will be a useful resource for the community.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f437165eb96" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Customizable LLM Evaluation: Benchmarking Gemma and Beyond with Benchmark-Gemma-Models]]></title>
            <link>https://medium.com/@domenicolacavalla8/customizable-llm-evaluation-benchmarking-gemma-and-beyond-with-benchmark-gemma-models-9dc6a5266be8?source=rss-9f77f7f7f008------2</link>
            <guid isPermaLink="false">https://medium.com/p/9dc6a5266be8</guid>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Domenico Lacavalla]]></dc:creator>
            <pubDate>Fri, 23 May 2025 00:01:00 GMT</pubDate>
            <atom:updated>2025-05-23T00:01:00.816Z</atom:updated>
            <content:encoded><![CDATA[<h4>An open-source suite for robust LLM evaluation on key benchmarks, efficiency, and AI safety — flexible enough to run even on a Colab free tier.</h4><blockquote>The true power of AI isn’t just in the models we build, but in our collective ability to understand them. It’s time to equip everyone with the tools to look deeper.</blockquote><h4>Table of Contents:</h4><p>∘ <a href="#c0ae">1. LLM Evaluation for the Rest of Us — Getting Started with Custom Analysis.</a><br> ∘ <a href="#0b37">2. The Spark: How an Idea for Gemma Ignited a Broader Mission</a><br> ∘ <a href="#c0ea">3. Under the Hood: A Toolkit Forged for Flexibility, Custom Insights, and Extensibility</a><br> ∘ <a href="#b9fc">4. The Edge: Real-World Speed and an Intuitive Visual Tour</a><br> ∘ <a href="#4f3d">5. Benchmark-Gemma-Models: Your Lab for Tailored LLM Insights, Open to All</a><br> ∘ <a href="#725c">6. Conclusion: Empowering Clearer, More Accessible LLM Evaluation for All</a><br> ∘ <a href="#1b36">Thank You!</a></p><h4>1. LLM Evaluation for the Rest of Us — Getting Started with Custom Analysis.</h4><p>Let’s be honest for a moment. The world of Large Language Models is a whirlwind — exciting, yes, with new models and “breathless claims” (as someone aptly put it) appearing constantly. We see powerful AI, like Google’s Gemma, pushing boundaries and becoming more accessible. But once the initial flurry of announcements passes, many of us are left with a crucial question: how do we <em>actually</em> get under the hood and measure these marvels in a way that’s both meaningful for our specific needs and genuinely accessible, especially if we’re not operating with the kind of extensive computational resources often found in dedicated, large-scale research labs?</p><p>Too often, traditional benchmarking can feel like peering into a black box, or worse, navigating a walled garden. Results get published, leaderboards shift, but the <em>process</em> itself — the power to easily replicate, to customize for unique scenarios, to truly dig into <em>why</em> one model behaves differently from another on <em>your</em> specific dataset or task — often feels out of reach. These aren’t edge cases; they’re everyday needs for a growing community wanting to rigorously test models or evaluate efficiency on a budget GPU because that’s their deployment reality.</p><p>This is where <strong>Benchmark-Gemma-Models</strong> steps in. It’s an open-source toolkit I’ve built to cut through that complexity, and <strong>you can dive right into the code and explore it on GitHub now: </strong><a href="https://github.com/D0men1c0/Benchmark-Gemma-Models">https://github.com/D0men1c0/Benchmark-Gemma-Models</a></p><p>My goal was to design something that puts serious LLM evaluation into <em>your</em> hands. It’s engineered to be resource-friendly — allowing for meaningful comparative analysis even on a free Colab tier for many important tasks — but its core strength lies in empowering <em>your</em> custom approach. It’s about giving you the controls to design the experiments relevant to <em>you</em>, fostering a more practical and widespread understanding of what today’s LLMs can truly deliver when you get to define the terms.</p><h4><strong>2. The Spark: How an Idea for Gemma Ignited a Broader Mission</strong></h4><p>While the general need for better LLM evaluation tools was brewing, a specific concept truly set things in motion. Exploring initiatives around Google’s Gemma models, I stumbled upon a project idea — possibly a <a href="https://summerofcode.withgoogle.com/">GSoC (Google Summer of Code) 2025</a> pitch — for a <strong>“Comprehensive Benchmark Suite for Evaluating Gemma Models.”</strong></p><p>This notion of a dedicated suite for these exciting open models, an idea I saw as connected to the innovative ecosystem surrounding <strong>Google DeepMind</strong> and their work on models like Gemma, was a powerful catalyst. It wasn’t about replicating that specific proposal. Instead, the core idea — deeply and fairly evaluating these new-generation models — resonated with what I felt the broader community desperately needed: a tool not just comprehensive, but critically, <em>practical and genuinely usable by almost anyone</em>.</p><p>That GSoC concept served as the final nudge. It validated the “what if” I’d been considering and encouraged me to take that spirit of thorough, Gemma-focused evaluation, merge it with my own convictions about community needs, and build something new. This directly shaped my core vision for the toolkit:</p><ul><li><strong>True Modularity and Flexibility:</strong> It had to be adaptable. The goal was an architecture where new models, benchmarks, or even evaluation methods could be plugged in without a complete overhaul. This is where the central configuration file comes into its own, giving you, the user, precise control.</li><li><strong>Deep Customization:</strong> Beyond just picking from a list, I wanted to empower users to sculpt the evaluation to their exact research questions. The tool should bend to your needs.</li><li><strong>Open and Collaborative:</strong> In the spirit of open models, this suite had to be open-source. The hope is that it becomes a community-driven effort, fostering transparency and inviting collaboration.</li><li><strong>Radically Accessible:</strong> This was non-negotiable. The aim was to deliver powerful evaluation capabilities without demanding high-end hardware. Optimizing for environments like Google Colab’s free tier (with a T4 GPU) was a key design challenge, ensuring that insightful benchmarking isn’t a privilege.</li></ul><p>The mission became clear: to transform that initial spark, fueled by the potential I saw for better Gemma evaluation and inspired by the innovative spirit close to Google DeepMind, into a robust, community-focused tool for understanding modern LLMs.</p><h4><strong>3. Under the Hood: A Toolkit Forged for Flexibility, Custom Insights, and Extensibility</strong></h4><p>So, what exactly is Benchmark-Gemma-Models? It’s more than just a script to run canned tests. At its core, it’s a Python-based evaluation suite meticulously designed to give you deep, granular control over <em>how</em> you assess Large Language Models. This isn’t about chasing a single score; it’s about fostering genuine understanding of model behavior, tailored to your specific questions. The entire framework is built on three foundational pillars: <strong>deep customization, robust optimization, and seamless extensibility.</strong></p><p>To give you a clearer picture of how these pieces fit together, here’s a high-level look at the Benchmark-Gemma-Models architecture:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3KZFdJYVpO7KB0Zy_1PrQA.png" /><figcaption>Figure 1: High-level architecture of the Benchmark-Gemma-Models framework</figcaption></figure><p>As you can see, the process begins with <strong>your </strong><strong>Config.yaml file</strong>. This is where you define the entire evaluation landscape – specifying which components are standard (built-in) and which are your custom implementations. The <strong>Execution Orchestrator</strong> then takes these definitions and manages the workflow through the <strong>Core Engine</strong>.</p><p>Within the Core Engine, you have distinct, yet interconnected, modules:</p><ul><li><strong>Models (Default or User-Defined):</strong> Easily swap between pre-configured models like Gemma or Llama 2, or integrate your own fine-tuned versions.</li><li><strong>Datasets (Built-in or Custom):</strong> Utilize standard datasets for tasks like MMLU, GSM8K, GLUE, summarization, and translation, or, crucially, plug in your own domain-specific data.</li><li><strong>Prompts (Templates or User Inputs):</strong> Control how models are prompted, using provided templates or crafting entirely custom input strategies.</li><li><strong>Tasks (Eval Logic per Use Case):</strong> Define the specific evaluation logic for each use case, allowing for highly tailored assessments.</li><li><strong>Postprocessor (Cleaning, Formatting, etc.):</strong> Apply necessary post-processing steps to the model outputs before they head to metric calculation.</li></ul><p>The output from this pipeline then feeds into the <strong>Metrics Module</strong>, where a comprehensive suite of evaluations takes place:</p><ul><li><strong>Content Quality &amp; Similarity:</strong> BLEU, ROUGE, METEOR, BERTScore, Exact Match (EM).</li><li><strong>Behavioral &amp; Ethical Dimensions:</strong> Toxicity, Creativity.</li><li><strong>Flexibility with Hugging Face </strong><strong>evaluate:</strong> Directly integrate a wide array of metrics.</li><li><strong>Your Custom Metrics:</strong> The system is built to accommodate your own novel metric implementations.</li></ul><p>Finally, the aggregated results and analyses are presented, for example, through the <strong>Insights &amp; Streamlit Dashboard</strong>.</p><p><strong>The Power of YAML: Your Central Control Panel</strong></p><p>The backbone of this deep customization is the Config.yaml file. This is where you truly pilot the evaluation. Instead of hardcoding parameters, you define your experimental setup in a clear, human-readable format. Here’s a representative glimpse of what that configuration might look like:</p><pre>general:<br>  experiment_name: &quot;Gemma_Benchmark_Comprehensive_2025&quot;<br>  output_dir: &quot;./benchmarks_output&quot;<br>  random_seed: 42<br><br>tasks:<br>  - name: &quot;MMLU (all Subset - Templated)&quot;<br>    type: &quot;multiple_choice_qa&quot;<br>    datasets:<br>      - name: &quot;cais/mmlu&quot;<br>        source_type: &quot;hf_hub&quot;<br>        config: &quot;anatomy&quot; # Specific MMLU subject<br>        split: &quot;validation&quot;<br>        max_samples: 10 # For a very quick test<br>    handler_options:<br>      prompt_builder_type: &quot;mmlu&quot;<br>      prompt_template: # Prompt template can be defined here<br>    evaluation_metrics:<br>      - name: exact_match<br>        options: { normalize: true, ignore_case: true, ignore_punct: false }<br><br>  - name: &quot;CreativeThemeElaboration_EN&quot;<br>    type: &quot;custom_script&quot; # Uses CustomScriptTaskHandler<br>    description: &quot;Evaluate creative elaboration using custom logic.&quot;<br>    datasets:<br>      - name: &quot;sample_themes_for_elaboration_en&quot;<br>        source_type: &quot;custom_script&quot; # Uses CustomScriptDatasetLoader<br>        script_path: &quot;src/benchmark/custom_loader_scripts/my_dataset_functions.py&quot; #<br>        function_name: &quot;load_simple_csv_data&quot;<br>        split: &quot;train&quot;<br>        max_samples: 8<br>        script_args: # Arguments specific to your dataset loading function<br>            data_file_path: &quot;src/benchmark/custom_loader_scripts/data/sample_train_dataset.csv&quot;<br><br>models:<br>  - name: &quot;gemma-2b - 4quant&quot;<br>    framework: &quot;huggingface&quot;<br>    checkpoint: &quot;google/gemma-2b&quot; # Or other models like phi-2, llama3<br>    quantization: &quot;4bit&quot;<br>    torch_dtype: &quot;bfloat16&quot; # Recommended for Gemma with quantization<br>    offloading: true # Useful for memory management<br><br>advanced:<br>  batch_size: 5     # Smaller batch size for limited VRAM<br>  max_new_tokens: 5 # MMLU expects a single letter</pre><p>This level of configuration allows you to easily iterate and compare subtle variations.</p><p><strong>The Customization &amp; Optimization Engine — You Pilot the Evaluation:</strong></p><p>This is where Benchmark-Gemma-Models truly empowers you:</p><ul><li><strong>Model Handling &amp; Integration:</strong> While optimized for Gemma-family models, it’s straightforward to integrate and compare other open LLMs. The framework seamlessly interfaces with the <strong>Hugging Face Hub</strong> for accessing a vast range of pre-trained models, and it’s built on foundational libraries like <strong>PyTorch</strong> and <strong>TensorFlow</strong>, allowing you to specify model IDs, control quantization, manage loading parameters, and even point to your locally stored custom model weights.</li><li><strong>Dataset &amp; Prompt Engineering:</strong> The lifeblood of any LLM evaluation is the data and how you prompt the model. Our framework is built to allow you to easily use your own datasets, craft custom prompt templates, and experiment with few-shot strategies. This means your evaluations can be directly relevant to <em>your</em> specific domain or application.</li><li><strong>Extensible Metric &amp; Task Framework:</strong> The modular architecture means that adding new tasks or metrics isn’t an afterthought; it’s an intended use case. If a benchmark or metric doesn’t exist, you can build it in.</li><li><strong>Optimized for Actionable Insights:</strong> Significant effort has been channeled into optimizing the entire pipeline — from data loading and batching to efficient metric calculation. This ensures faster iteration times and makes it feasible to run comprehensive evaluations on substantial models (like 7B or 9B, especially with techniques like quantization) even in environments like Google Colab.</li></ul><p><strong>Important Note on Model Access and Distribution:</strong></p><p>Please be aware that Benchmark-Gemma-Models is a toolkit designed to <em>evaluate</em> Large Language Models. It provides the framework and tools to load and run benchmarks on models that you have legitimate access to (e.g., open-source models from platforms like Hugging Face Hub, or your own custom models). <strong>This toolkit does not distribute, host, or provide direct access to any pre-trained model weights, especially proprietary ones.</strong> Users are responsible for ensuring they comply with the licensing terms and usage policies of any models they choose to evaluate with this framework. Our focus is solely on providing the evaluation methodology.</p><p><strong>A Critical Note on Interpreting Your Results: Your Lab, Your Rules</strong></p><p>The numbers and insights you get from Benchmark-Gemma-Models are powerful for <em>your specific context</em>. They’re designed to help you compare models head-to-head under <em>your chosen conditions</em>, understand the impact of your tweaks (like custom prompts or quantization), and gain nuanced understanding that static leaderboards can’t offer.</p><p>However, please remember: these results are tailored for <em>your experimental setup</em> and <strong>should not be seen as directly equivalent to scores from official academic papers or public leaderboards.</strong> Those figures typically come from massive, highly resourced clusters running under rigid, standardized (and sometimes non-public) conditions, aiming for a single global number.</p><p>Benchmark-Gemma-Models, in contrast, is optimized for accessibility (running effectively even on a Colab free tier T4 GPU) and empowers <em>your practical, transparent research</em>. It’s your versatile lab to answer <em>your specific questions</em> and make informed decisions based on evaluations you design and trust. The insights are for you.</p><h4><strong>4. The Edge: Real-World Speed and an Intuitive Visual Tour</strong></h4><p>Beyond the comprehensive features and deep customization, two aspects truly set Benchmark-Gemma-Models apart for practical, everyday use: its <strong>real-world performance on accessible hardware</strong> and its <strong>intuitive visual interface</strong> for interacting with your evaluations.</p><p><strong>Optimized for Your Workflow — Yes, Even on Colab!</strong></p><p>I knew that for this toolkit to be genuinely useful to a broad audience, it couldn’t demand a supercomputer. Significant effort has gone into optimizing the entire pipeline — from efficient data loading and batching to streamlined metric computation. The goal was clear: enable meaningful research without endless waiting or prohibitive costs.</p><p>And the results speak for themselves. <strong>To give you a concrete example:</strong> running common NLP tasks like summarization or translation, focused on a subset of <strong>500 examples</strong>, with a capable <strong>2-billion parameter model</strong> (such as Gemma 2B, quantized to 4-bit), takes approximately <strong>4</strong> <strong>minutes on a free Google Colab tier utilizing a T4 GPU.</strong> This kind of speed on readily available hardware means you can iterate on your ideas faster, experiment more freely, and get actionable insights without your workflow grinding to a halt. This efficiency also makes comparative analysis of larger models, like those in the 7B or even 9B parameter range (especially when leveraging techniques like quantization), a practical reality.</p><p><strong>A Quick Visual Tour: The Streamlit Interface in Action</strong></p><p>To make interacting with Benchmark-Gemma-Models as straightforward as possible, I’ve developed an intuitive dashboard using Streamlit. This interface allows you to load your evaluation results, explore them dynamically, and visualize comparisons with ease.</p><p>Let’s walk through a few key functionalities:</p><p><strong>4.1: Loading Results &amp; Overview</strong></p><blockquote>First up, you can easily select your benchmark results file. Instantly, the dashboard parses it and gives you an overview, showing the models, tasks, and metrics covered in that specific run. This ensures you know exactly what data you’re looking at.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*XDFbQYu8jgx1zUt65HrYTQ.gif" /><figcaption>Loading results: The dashboard instantly parses your benchmark file, showing all evaluated models, tasks, and metrics at a glance.</figcaption></figure><p><strong>4.2: Comparing All Models on a Specific Task &amp; Metric</strong></p><blockquote>Want to see how all your tested models stack up? Here, I’m selecting the MMLU task and the ‘Exact Match’ metric. The interface then dynamically generates a comparison, clearly visualizing the performance of every model on that specific evaluation.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*vrRfrQaD3w2XYeqa2GQNLg.gif" /><figcaption>Comparing models: Here, we select the MMLU task and ‘Exact Match’ metric to see a direct performance comparison across all tested models.</figcaption></figure><p><strong>4. 3: Model-Specific Deep Dive Across Tasks with a Chosen Metric)</strong></p><blockquote>You can also focus on a single model to see its performance profile. In this example, I’ve selected a 9B parameter model and the ‘Toxicity’ metric. The dashboard then displays its toxicity scores across three different tasks: GSM8K, Translation, and Summarization, giving you a multi-faceted view of its behavior.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*BuzvLV0jXKQXFz8Us6DBWw.gif" /><figcaption>Model deep dive: Focusing on a 9B model and its ‘Toxicity’ score across GSM8K, Translation, and Summarization tasks.</figcaption></figure><p><strong>4. 4: Task-Specific Deep Dive Across All Metrics for a Chosen Model)</strong></p><blockquote>Finally, let’s say you’re particularly interested in how Gemma 7B performs on Summarization. You can select that model and task, and the dashboard will showcase all the different metrics calculated for it — BLEU, ROUGE, BERTScore, etc. — providing a comprehensive performance snapshot.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*ATA-jQ6td4KGmw2VDvrY_Q.gif" /><figcaption>Metric breakdown: Analyzing Gemma 7B’s performance on Summarization by viewing all its calculated metrics (BLEU, ROUGE, etc.)</figcaption></figure><p>This Streamlit dashboard transforms complex benchmark results into an approachable and interactive experience, allowing for quick exploration and insight generation, perfectly complementing the deep control offered by the YAML configuration.</p><h4><strong>5. Benchmark-Gemma-Models: Your Lab for Tailored LLM Insights, Open to All</strong></h4><p>So, who truly benefits from Benchmark-Gemma-Models, and where is this project heading? At its core, this toolkit is for anyone who yearns to look deeper into Large Language Models, to move beyond generic scores and craft evaluations that answer <em>their specific questions</em> — all without needing privileged access to massive computational clusters.</p><p><strong>Designed for Inquisitive Minds &amp; Practical Needs:</strong></p><ul><li><strong>Researchers &amp; Academics:</strong> Go beyond standard benchmarks. Design experiments with custom datasets, unique prompting strategies, or novel metrics to investigate nuanced aspects of LLM behavior, even with constrained resources.</li><li><strong>Students &amp; Learners:</strong> Gain invaluable hands-on experience. Understand the intricacies of LLM evaluation by building and running your own custom tests, and even contribute to a growing open-source project.</li><li><strong>Developers &amp; Practitioners:</strong> Before committing to a model, use Benchmark-Gemma-Models to tailor evaluations for your specific application. Compare how different open models (e.g., Gemma vs. Llama 2 on <em>your</em> data) perform on tasks critical to you, assess their efficiency profile for deployment, and perform initial responsible AI checks.</li><li><strong>AI Enthusiasts:</strong> If you’re driven by curiosity to see how models behave under different, self-defined conditions, this provides a flexible and accessible playground for experimentation.</li></ul><p>The power lies in its adaptability: from quickly assessing new open-source releases with custom configurations to deep-diving into model performance on highly specialized, domain-specific data, or even just A/B testing different prompt templates at scale.</p><p><strong>The True Edge: Unparalleled Customization &amp; Accessibility</strong></p><p>What truly sets Benchmark-Gemma-Models apart isn’t just that it <em>can</em> run on accessible hardware like Google Colab; it’s <em>what this accessibility unlocks</em>:</p><ul><li><strong>Radical Customization at Every Level:</strong> This is the cornerstone. The YAML-driven configuration (as shown in Section 3) and the modular architecture mean you’re not just picking from a menu; you are the chef. Define your own models, bring your own datasets, craft unique prompts, design specific tasks, and importantly, <strong>implement metrics in ways that might differ from standard libraries or even introduce entirely novel ones.</strong> If a particular nuance of a metric’s calculation matters to you, or if you have a unique way to quantify a model’s behavior, the framework is built to accommodate that.</li><li><strong>Accessibility as an Enabler of Customization:</strong> The optimization efforts are there to ensure that this deep level of customization is not just a theoretical possibility but a practical reality, even for those without elite hardware. It allows you to run these tailored, often iterative, experiments on significant open models (in the 7B, or even 9B parameter range with techniques like quantization) without prohibitive costs or waiting times.</li><li><strong>Focus on Your Insights, Not Just Scores:</strong> The goal is to empower you to generate actionable, comparative understanding relevant to <em>your specific context and questions</em>, rather than just chasing a position on a generic leaderboard.</li></ul><p><strong>The Journey Continues — With You!</strong></p><p>Benchmark-Gemma-Models is a dynamic project, and the road ahead is exciting. I envision expanding support for an even wider array of open-source LLMs, integrating more diverse and nuanced benchmarks, and further refining the Streamlit dashboard for even richer interactive analysis.</p><p>But the heart of this project beats with the <strong>spirit of community and open collaboration.</strong> Your insights, your use cases, and your contributions are what will truly shape its future.</p><ul><li><strong>Explore and Experiment:</strong> The best way to understand its potential is to dive in (you have the GitHub link from the introduction!). Run your own evaluations, test its limits, and see how it can serve your needs.</li><li><strong>Share Your Feedback &amp; Ideas:</strong> Encounter an issue? Have a brilliant idea for a new feature or a way to improve an existing one? The GitHub issues page is the place for discussion.</li><li><strong>Contribute Your Skills:</strong> Whether it’s code for new features, benchmarks, optimizations, or even improvements to the documentation, Pull Requests are always welcome. Let’s make this an even better resource, together.</li><li><strong>Spread the Word:</strong> If Benchmark-Gemma-Models helps you, help others discover it within the AI community.</li></ul><p>My aspiration is for this to evolve into a vibrant, go-to toolkit that truly democratizes the ability to deeply understand and critically evaluate Large Language Models.</p><h4><strong>6. Conclusion: Empowering Clearer, More Accessible LLM Evaluation for All</strong></h4><p>The landscape of Large Language Models is constantly shifting, bringing both immense potential and new challenges. As these powerful tools become more deeply integrated into our research, our products, and our daily lives, the ability to understand, evaluate, and compare them effectively, transparently, and accessibly is no longer a luxury — it’s a necessity.</p><p>With Benchmark-Gemma-Models, my goal has been to contribute a practical, open-source solution that empowers more people to engage in this critical evaluation process. By prioritizing deep <strong>customization</strong>, ensuring <strong>accessibility</strong> even on modest hardware, and fostering a platform for <strong>extensible, comparative insights</strong>, I hope this toolkit can help demystify LLM behavior and enable more informed decisions across the AI community.</p><p>This isn’t just about generating scores; it’s about fostering a deeper, more nuanced understanding of what these models can do, under conditions that <em>you</em> define and trust. It’s about equipping you with a versatile lab to explore, question, and ultimately, to innovate with greater clarity.</p><p>The journey of building and refining tools like this is an ongoing one, and the true potential lies in collaborative effort. I invite you to explore Benchmark-Gemma-Models, share your unique perspectives, and join in the mission to make LLM evaluation more open, insightful, and available to everyone. Let’s build that clearer vision, together.</p><h4><strong>Thank You!</strong></h4><p>Thank you so much for taking the time to read about Benchmark-Gemma-Models. I poured a lot of thought and effort into this project, driven by a genuine desire to make LLM evaluation more accessible and insightful for everyone.</p><p>I truly hope you find this toolkit useful, and I’m incredibly excited to see what the community does with it. Your feedback, contributions, and even just your interest mean the world.</p><p>Feel free to reach out or connect!</p><p>Best regards,</p><p>Domenico Lacavalla</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9dc6a5266be8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Examination of the Evolution of Language Among Dark Web Users]]></title>
            <link>https://medium.com/@domenicolacavalla8/examination-of-the-evolution-of-language-among-dark-web-users-67fd3397e0fb?source=rss-9f77f7f7f008------2</link>
            <guid isPermaLink="false">https://medium.com/p/67fd3397e0fb</guid>
            <category><![CDATA[criminal]]></category>
            <category><![CDATA[darkweb]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Domenico Lacavalla]]></dc:creator>
            <pubDate>Tue, 16 Jul 2024 19:33:56 GMT</pubDate>
            <atom:updated>2024-09-01T09:48:51.907Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>In this blog, the work done during the Google Summer of Code (GSoC) 2024 project with HumanAI is described.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NLxvZS58x2Qm6uK0bTGvSw.png" /><figcaption>Image credits: <a href="https://summerofcode.withgoogle.com/">Google Summer of Code</a> and <a href="https://humanai.foundation/">HumanAI</a></figcaption></figure><h3>Project Description</h3><p>The objective of this project was to analyze the evolution of language among Dark Web users using a series of Natural Language Processing (NLP) models. Several NLP models were developed and trained, including TF-IDF, LDA, BERT, and LSTM, to understand the context, sentiment, and thematic elements of forum discussions.</p><p>The <strong>code </strong>for this project can be seen at proprietary <a href="https://github.com/D0men1c0/ISSR_Darkweb">GitHuB</a> repository and in the <a href="https://github.com/humanai-foundation/ISSR/tree/main/ISSR_Dark_Web_Domenico_Lacavalla">GitHub</a> repository of the HumanAI organisation.</p><h3>Utility of Dark Web Language Analysis</h3><p>This analysis is highly useful because it allows for the examination of large volumes of data to identify the main topics discussed, along with the nuances of associated words. Understanding these elements can provide insights into the nature of criminal activities, the evolution of their language, and the connections between various slang terms and specific illicit activities. This information can be invaluable for law enforcement, cybersecurity professionals, and researchers studying the dynamics of underground online communities.</p><p>However, only one forum has been analyzed so far. By combining multiple models with data from different forums over several years, a comprehensive picture of dark web language can be obtained. This is important because there may be other forums discussing topics not covered on Dread, such as red rooms, child pornography, hired killers, cannibalism, etc.</p><p>Unlike other approaches based on a few datasets, this method allows for the analysis of a vast number of conversations, greatly enhancing the breadth and depth of insights. In this way, a unique, highly comprehensive model could be developed (requiring multiple datasets), encompassing the most important topics discussed across various forums with a broader timeline. For example, insights could be drawn from forums like SilkRoad, which was very active and where certain words were used and then fell out of use.</p><p>Additionally, associating this data with images could lead to more precise identification. The current results are already highly valuable, demonstrating the potential of this approach.</p><h3>Table of Contents:</h3><p>∘ <a href="#4b30">1. Introduction to Topic Modeling</a><br>∘ <a href="#af06">2. Choice of datasets and fields</a><br>∘ <a href="#2356">3. Preprocessing Techniques</a><br>∘ <a href="#4e63">4. Initial Approaches and Their Limitations</a><br>∘ <a href="#1a1c">5. Exploration of Clustering Approach:</a><br>∘ <a href="#a238">6. Topic Modeling with BERTopic: Key Pipeline Components and Adopted Solution</a><br>∘ <a href="#fc10">7. Baselines</a><br>∘ <a href="#2daf">8. Additional Analysis on the Baselines</a><br>∘ <a href="#1fde">9. Results Obtained</a><br>∘ <a href="#ee2a">10. Multimodal Model Development</a><br>∘ <a href="#c358">11. Future Work</a><br>∘ <a href="#8316">12. Acknowledgements</a></p><h4><strong>1. Introduction to Topic Modeling</strong></h4><p>Topic modeling is a method used to discover abstract topics within a collection of documents. By analyzing the co-occurrence patterns of words, these models can identify themes that are not explicitly tagged within the data. Popular methods include Latent Dirichlet Allocation (LDA), Non-negative Matrix Factorization (NMF), and more advanced methods like <a href="https://maartengr.github.io/BERTopic/index.html">BERTopic</a>.</p><h4>2. Choice of datasets and fields</h4><p>The <strong>CrimeBB </strong>(<a href="https://dl.acm.org/doi/10.1145/3178876.3186178">https://dl.acm.org/doi/10.1145/3178876.3186178</a>) and <strong>ExtremeBB (</strong><a href="https://doi.org/10.48550/arXiv.2111.04479">https://doi.org/10.48550/arXiv.2111.04479</a><strong>) </strong>datasets were used for this analysis, specifically the following data:</p><ul><li><strong>dread-2023–06–21</strong> scraped from Dread, updated on 2023–06–21.</li><li><strong>extremebb-white-nations 2021–12–10</strong> scraped from White Nations, updated on 2021–12–10.</li><li><strong>raidforums 2023–06–21</strong> scraped from Raid Forums, updated on 2023–06–21.</li></ul><p><strong>Dread</strong> is a popular forum on the Dark Web where users exchange opinions and reviews on various topics, including drug sales, seller reviews, password and bitcoin transactions, as well as passports and fake IDs.</p><p>The <strong>White Nations</strong> dataset from ExtremeBB covers discussions related to conspiracies, climate change, elections, and racism, reflecting a broad range of socio-political issues.</p><p><strong>Raid Forums</strong>, on the other hand, focuses on leaked and cracked accounts from social media, games, Spotify, and other platforms, highlighting discussions around data breaches and unauthorized access.</p><p><strong>Dread</strong>, <strong>White Nations</strong>, and <strong>Raid Forums</strong> all share the same table structure.</p><p>Below is an image illustrating the general structure of these tables:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*-BrAnvJoAOoNpNQ_0nVpmA.png" /><figcaption>Image credits: The CrimeBB and ExtremeBB Datasets</figcaption></figure><p>Specifically, the following tables were selected for this analysis:</p><ul><li><strong>Dread Posts</strong>: Contains 290k records.</li><li><strong>Dread Threads</strong>: Contains 75k records.</li><li><strong>White Nations Posts</strong>: Contains 52k records.</li><li><strong>Raid Forums Threads</strong>: Contains 94k records.</li></ul><p>A preliminary analysis reveals the most frequently discussed topics across these sections. Using <a href="https://networkx.org/">NetworkX</a>, a visualization tool, we can depict the relationships between these topics:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nEjEPDp7Vh4Zg-7liZdlXg.png" /><figcaption>NetworkX for Dread</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*chSjuSHUA61mr4MAzhfkMA.png" /><figcaption>NetworkX for White Nations</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OOrlH8rHd2XYlWXid4Orqg.png" /><figcaption>NetworkX for Raid Forums</figcaption></figure><p>These findings indicate that the topics observed are in line with typical discussions one would expect to find on a forum such as Dread.</p><p>Additionally, to enhance the model with multimodal capabilities, a public dataset from <a href="https://universe.roboflow.com/freakinggojo-er8b5/drug_detection_project/dataset/9">Roboflow’s Drug Detection Project</a> was used.</p><p>This dataset includes approximately 3,700 images, divided into training, testing, and validation sets, covering four topics: people, guns, drugs, and robbers. This aspect of the analysis will be discussed further in the subsequent sections.</p><h4>3. Preprocessing Techniques</h4><p><em>Before stating the preprocessing steps, it’s worth noting that while preprocessing might not be strictly necessary for models like BERT, it was still employed in this project to </em><strong><em>expedite embedding times and emphasize certain capabilities.</em></strong></p><p>Effective preprocessing plays a crucial role in ensuring the success of any topic modeling task. Here are the preprocessing steps utilized:</p><ul><li><strong>Removing HTML Characters</strong>: Stripped away any HTML tags to avoid noise.</li><li><strong>Processing URLs:</strong> URLs were identified and processed to remove generic tags like “www:” and backslashes (/). However, domain names were preserved to understand references to other sites or markets.</li><li><strong>POS Tagging and Chunking</strong>: Used part-of-speech tagging and chunking to preserve meaningful structures and distinguish proper nouns.</li><li><strong>Tokenization</strong>: Split text into individual words (tokens) for further processing.</li><li><strong>Removing Punctuation and Numbers</strong>: Excluded punctuation and numbers, as they are typically non-informative.</li><li><strong>Removing Single Characters and Multiple Spaces</strong>: Cleaned up the text by removing unnecessary single characters and multiple spaces.</li><li><strong>Preserving Proper Nouns: </strong>Proper nouns were maintained in their original form to distinguish them from common words. For instance, the name of a website could be mistaken for a common word if not preserved correctly.</li><li><strong>Removing Stopwords and Lemmatization</strong>: Eliminated common stopwords and lemmatized words to their base forms for consistency.</li></ul><p>With the pre-processing steps applied, as will be demonstrated later, the time required to achieve the embeddings was significantly reduced, while improving the metrics obtained.</p><h4>4. Initial Approaches and Their Limitations</h4><p><strong>4.1 TF-IDF:</strong></p><p>The Term Frequency-Inverse Document Frequency (TF-IDF) approach was initially employed to identify important words within the documents. The formula for TF-IDF is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/379/1*0rI07zHVkzEsaNIpRl-8Qg.png" /></figure><p>where:</p><p>TF(t,d) is the term frequency of term <em>t</em> in document <em>d</em>,calculated as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/147/1*SDb2trNHqQPlqDU0eGnt2Q.png" /></figure><p>IDF(t,D) is the inverse document frequency of term t in the document set D, given by:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/1*M8qX5-3H6e4PZyAoIxy3dQ.png" /></figure><p>While TF-IDF is effective in identifying significant words, it struggled to identify coherent clusters in this large dataset due to computational inefficiencies and its inability to capture the semantic meaning of words. The clustering results were not distinct, and the processing time was substantial.</p><p><strong>4.2</strong> <strong>LDA:</strong></p><p><a href="https://en.wikipedia.org/wiki/Latent_Dirichlet_allocation">Latent Dirichlet Allocation (LDA)</a> is a generative statistical model used to discover abstract topics within a collection of documents. The core idea of LDA is that documents are mixtures of topics, and topics are mixtures of words.</p><p>In practice, LDA assumes that each document is generated by a probabilistic process that assigns each word to one of the topics. The steps involved in LDA include choosing the number of topics, assigning each document a distribution over topics, and each word within the document a topic distribution.</p><p>Despite its theoretical strengths, LDA faced several limitations in <strong>this project:</strong></p><ul><li><strong>Relevance and Coherence</strong>: The topics identified were not distinct or relevant. The model struggled to produce meaningful and interpretable topics from the dataset.</li><li><strong>Silhouette Score</strong>: The silhouette score, which measures how similar an object is to its own cluster compared to other clusters, was 0.34, indicating poor cluster quality.</li><li><strong>Parameter Tuning</strong>: Fine-tuning parameters such as the number of topics, Dirichlet priors, and iterations did not yield significant improvements.</li></ul><p><strong>4.3 Zero-Shot Classification:</strong></p><p>Initially, zero-shot classification was explored for its potential to categorize topics without extensive training data. In this project, a predefined list of major crimes was compiled separately and used as categories to classify each record. However, this approach proved unsuccessful in terms of both accuracy and processing time, requiring over 60 hours to process 60k data points.</p><p>Subsequently, this methodology was re-evaluated by applying it not to individual records but to clusters of relevant topics. This adjustment led to a more accurate representation of topics in a significantly reduced timeframe.</p><h4>5. Exploration of Clustering Approach:</h4><p>Following the unsatisfactory results from previous approaches, the project shifted towards transforming the problem into a clustering task.</p><p>This approach integrated Sentence-BERT with dimensionality reduction algorithms (UMAP, t-SNE) and clustering via K-Means.</p><p>Each component played a crucial role in achieving meaningful results and highlighting the relevance of topics within the dataset.</p><p><strong>Sentence-BERT:</strong></p><p><a href="https://en.wikipedia.org/wiki/Sentence_embedding">Sentence-BERT (SBERT)</a> is a variant of the <a href="https://en.wikipedia.org/wiki/BERT_(language_model)">BERT</a> model tailored for generating sentence embeddings.</p><p>Unlike traditional BERT, which focuses on token-level embeddings, SBERT is optimized to encode entire sentences into fixed-dimensional vectors. It achieves this through a <em>Siamese </em>and T<em>riplet </em>network architecture during training, which enhances its ability to capture semantic similarity between sentences.</p><p><strong>UMAP (Uniform Manifold Approximation and Projection):</strong></p><p>UMAP is a dimensionality reduction technique that is effective for visualizing high-dimensional data while preserving local and global structure.</p><p>It aims to find a low-dimensional representation of data points that retains meaningful relationships between them.</p><p>By leveraging the manifold structure of the data, UMAP can provide insights into the clustering patterns present in the dataset.</p><p><strong>t-SNE (t-Distributed Stochastic Neighbor Embedding):</strong></p><p>t-SNE is another dimensionality reduction technique commonly used for visualizing high-dimensional data.</p><p>It focuses on embedding data points into a lower-dimensional space where similar items are modeled by nearby points and dissimilar items by distant points.</p><p>This method is particularly useful for exploring the structure of complex datasets and revealing clusters that might not be apparent in the original high-dimensional space.</p><p><strong>K-Means Clustering:</strong></p><p>K-Means clustering is a widely used unsupervised learning algorithm that partitions data points into K clusters based on their feature similarity.</p><p>It works by iteratively assigning data points to the nearest cluster centroid and updating the centroids based on the mean of the assigned points.</p><p><strong>Achievements and Insights:</strong></p><p>Integrating Sentence-BERT for robust sentence embeddings, coupled with UMAP and t-SNE for dimensionality reduction, provided a clear pathway to uncovering relevant topics within the dataset. This approach not only facilitated the identification of distinct clusters but also enhanced the interpretability of the results. By applying K-Means clustering on the reduced-dimensional space, we successfully segmented the data into meaningful clusters, demonstrating the effectiveness of this integrated approach in handling the inherent complexity of the dataset.</p><p>Here is an example of the cluster distribution obtained:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*SgHGmA1J7SGze41t1BUlqA.png" /><figcaption>k-means with 7 clusters</figcaption></figure><p>In which the most popular topics were:<strong> Tor-site, Bitcoin, Drugs, New Markets, Review Vendors, Closed Markets, Miner.</strong></p><p><strong>Challenges Faced:</strong></p><p>The initial approach encountered significant challenges:</p><ol><li><strong>Outlier Identification:</strong> Using K-Means clustering, there was a notable difficulty in identifying outliers and automatically delineating clusters. Unlike algorithms such as HDBSCAN, which are designed to detect outliers and adaptively determine cluster shapes and densities, K-Means relies on predefined cluster centroids and assumes clusters of roughly equal size and shape. This limitation compromised the ability to accurately capture and manage outliers within the dataset.</li><li><strong>Topic Resolution:</strong> Given the complex nature of the dataset, which suggests hierarchical relationships among topics rather than distinct, clearly delineated clusters, the rigid structure imposed by K-Means clustering was inadequate. This approach struggled to capture the nuanced interrelationships and hierarchical dependencies inherent in the data, thus limiting the depth and accuracy of the topic resolution.</li></ol><p>Despite these challenges and suboptimal results, this approach laid the groundwork for the optimal solution: the adoption of <strong>BERTopic library.</strong></p><h4>6. Topic Modeling with BERTopic: Key Pipeline Components and Adopted Solution</h4><p>The breakthrough approach involved using the BERTopic library, initially focusing on the Dread dataset, specifically the post and thread sections, to provide a general context. This step aimed to identify general topics with a smaller, cleaner subset of data (65k entries). After establishing these initial topics, the process was extended to the larger post table (260k entries) from Dread to confirm and expand upon the identified topics.</p><p>Given the excellent results obtained from Dread, the model was further reinforced by incorporating new datasets from White Nations and Raid Forums, making it more comprehensive and robust by addressing a wider range of topics. White Nations focused on post section, while Raid Forums concentrated on threads section.</p><p>Notably, pre-processing steps were not applied to these datasets, as various tests demonstrated that such steps did not yield improvements, even in terms of processing time.</p><p><strong>6.1 Introducing BERTopic</strong></p><p>BERTopic is a flexible and powerful topic modeling tool that leverages state-of-the-art embeddings and clustering algorithms to generate interpretable topics. Key features of BERTopic include the ability to handle multilingual data, the integration of advanced dimensionality reduction techniques, and robust clustering capabilities.</p><p>For more details, please refer to the <a href="https://maartengr.github.io/BERTopic/index.html">BERTopic documentation</a>.</p><p><strong>6.2 Key Components and Configuration Used</strong></p><ol><li><strong>‘SentenceTransformer:</strong> Generates sentence embeddings that handle multiple languages, ensuring accurate encoding of varied linguistic content. In this project, two specific models were utilized: <em>‘distiluse-base-multilingual-cased-v1’</em> for handling multilingual capabilities and ‘<em>all-MiniLM-L6-v2&#39;</em> chosen for its efficiency in encoding large corpora quickly. This approach enabled robust processing and analysis of diverse textual data, ensuring both accuracy and scalability across different linguistic contexts and data volumes.</li><li><strong>Maximal Marginal Relevance (MMR)</strong>: Enhances topic representation diversity by balancing relevance and diversity in selected terms.</li><li><strong>KeyBERTInspired</strong>: A representation model that leverages BERT embeddings to extract the most relevant keywords for each topic.</li><li><strong>CountVectorizer</strong>: Converts text data into a matrix of token counts, filtering out common English stop words to focus on meaningful terms.</li><li><strong>ClassTfidfTransformer</strong>: Applies TF-IDF weighting to enhance the relevance of terms for each topic, reducing the impact of frequently occurring but less informative words.</li><li><strong>UMAP (Uniform Manifold Approximation and Projection)</strong>: Reduces the dimensionality of embeddings for clustering, optimizing the balance between local and global structure preservation.</li><li><strong>HDBSCAN (Hierarchical Density-Based Spatial Clustering of Applications with Noise)</strong>: A clustering algorithm optimized for handling outliers and discovering clusters of varying shapes and densities.</li></ol><p><strong>6.3 Topic Naming</strong></p><p>In addition to the standard components of BERTopic, a crucial step in the analysis was refining the labels assigned to the topics. This was achieved through a process called <strong>Topic Naming</strong>, where two different approaches were tested:</p><p><strong>6.3.1 Zero-Shot Classification</strong></p><p>The first approach utilized Zero-Shot Classification, where a CSV list of crime categories was employed. The goal was to assign a name to each topic based on the similarity between the representative keywords provided by BERTopic and the predefined list of crimes. While this method allowed for some level of automation, it was not ideal due to several limitations:</p><ul><li><strong>Coverage Gaps</strong>: The Zero-Shot model often failed to capture all nuances of the topics, especially when the keywords had multiple interpretations or when the crime list did not cover the full spectrum of possible topics.</li><li><strong>Duplication Issues</strong>: The method frequently resulted in duplicate labels, as many crime names were similar or overlapping, requiring an excessively long list to achieve accurate topic naming.</li></ul><p><strong>6.3.2 Using Quantized LLMs: Mistral 7b</strong></p><p>The breakthrough came with the use of <strong>quantized Large Language Models (LLMs)</strong>, specifically <strong>Mistral 7b</strong>. Quantization is a technique that reduces the model size by simplifying the precision of the weights, enabling faster inference and lower resource consumption without significantly compromising performance.</p><p>By employing Mistral 7b, the process was significantly improved in the following ways:</p><ul><li><strong>Enhanced Topic Labels</strong>: Instead of relying on a static list, the model generated unique and highly representative labels for each topic. This was achieved by providing both the representative keywords and the initial documents (i.e., the starting text) associated with each topic.</li><li><strong>Efficiency</strong>: The model efficiently handled the labeling task, eliminating the need for extensive lists, thereby reducing both processing time and the potential for error.</li><li><strong>Generative Capability</strong>: As a generative model, Mistral 7b was able to produce more contextually accurate and nuanced labels, aligning closely with the content of each cluster and offering a superior level of detail and accuracy.</li></ul><p>This approach ultimately led to more optimal and distinctive topic labels, improving the overall interpretability and robustness of the model across various datasets.</p><h4>7. Baselines</h4><p><strong>7.1 First Baseline Found on Dread Thread Section: Key Parameters</strong></p><ul><li>Used the ‘distiluse-base-multilingual-cased-v1’ model for the multilingual language.</li><li>HDBSCAN with 1200 min_cluster_size.</li><li>Reduction in the number of outliers using the formula for calculating the <strong>cosine </strong>similarity between the emebeddings, yielding 27k as the number of outliers.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/208/1*vpEd6MoWa6didTt85YZeBw.png" /></figure><p><strong>7 </strong>macro topics were found concerning:</p><ul><li><strong>Drug sales</strong></li><li><strong>Bitcoin</strong></li><li><strong>Scammers and seller reviews</strong></li><li><strong>Marketplace advertising</strong></li><li><strong>Purchase reviews</strong></li><li><strong>Drug purchases</strong></li><li><strong>Orders</strong></li></ul><p>These clusters were evaluated on three aspects:</p><ul><li>use of appropriate metrics to assess cluster quality;</li><li>interpretability/visualisation of clusters;</li><li>comparison with raw data.</li></ul><p><strong>7.1.1 Metrics</strong></p><p><strong>7.1.1.1 Coherence Score C_v</strong>: assesses the semantic coherence of topics, indicating how interpretable and meaningful the topics are. The value ranges from 0 to 1, where 0 indicates no correlation and 1 perfect correlation, then higher scores suggest better topic quality.</p><p>The formula used depends on the implementation adopted, in this case we chose to use the <a href="https://radimrehurek.com/gensim/models/coherencemodel.html">Gensim library with Coherence Model</a>.</p><p><strong>7.1.1.2 Silhouette Score</strong>: assesses how similar an object is to its own cluster compared to other clusters. The value varies from -1 to 1, where 0 indicates no correlation and 1 a perfect correlation and -1 indicates an inverse perfect correlation.</p><p>Formula:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/214/1*OY945mHcH_6uhW94xI0t0A.png" /></figure><p><strong>7.1.1.3 Davies-Bouldin Score: </strong>The score is defined as the average similarity measure of each cluster with its most similar cluster, where similarity is the ratio of within-cluster distances to between-cluster distances.</p><p>Thus, clusters which are farther apart and less dispersed will result in a better score. The minimum score is zero, with lower values indicating better clustering.</p><p>Formula:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*qj_8a7YNeNGXV6L6HCteLg.png" /></figure><p><strong>7.1.1.4</strong> <strong>DOS Score (Diversity Overlapped Score)</strong>: Measures the overlap and diversity among topics. A higher score indicates a greater overlap of keywords between the different topics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/1*ZtzrL5CbM5O7MSfJHIWYLQ.png" /></figure><p>A summary table of the metrics on all baselines will be shown below.</p><p><strong>7.1.2 Visualizations</strong></p><p>Below is a brief view of the graphs for the topics:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U4Swz8x_zldaOF5whUE_Ng.png" /><figcaption>1 Baseline: Intertopic Distance Map and Similarity Matrix</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FmUdveJEhBZT3UeImo7W4Q.png" /><figcaption>1 Baseline: Bar Chart and Hierachical Clustering</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ksgi7nG3xrDNLPZtKjy2zQ.png" /><figcaption>1 Baseline: Topic Distribution</figcaption></figure><p>As can be seen, all graphs represent a very good distribution of clusters.<br>A very useful aspect is to see how the topics evolve over time, i.e. seeing the most frequent words in that particular topic at a time t1 and at a time t2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IuMmWt0RdHaiEcTykAu-_g.png" /><figcaption>1 Baseline: Evolution Over Time</figcaption></figure><p>Example topic 0, sell drugs, in 2019 is represented only by the sale of marijuana, while in 2020 there is also cocaine and xanax.</p><p><strong>7.2 Second Baseline Found on Dread Thread Section: Key Parameters</strong></p><ul><li>Used the ‘<em>all-MiniLM-L6-v2</em>’ embedding model.</li><li>HDBSCAN with min_cluster_size=200.</li><li>Reduction in the number of outliers using the formula for calculating the <strong>cosine </strong>similarity between the emebeddings, yielding 18k as the number of outliers.</li></ul><p><strong>68 </strong>topics were detected, the most important of which relate to:</p><ul><li><strong>Drug sales (marijuana, cocaine, xanax, pills, meth, fentanyl)</strong></li><li><strong>Bitcoin</strong></li><li><strong>Scammers and seller reviews</strong></li><li><strong>Marketplace advertising</strong></li><li><strong>Purchase reviews</strong></li><li><strong>Drug purchases</strong></li><li><strong>Orders</strong></li><li><strong>Closed sites (empire market, samsara market)</strong></li><li><strong>Scams</strong></li><li><strong>Sold passwords</strong></li><li><strong>Hacker attacks</strong></li><li><strong>Opsec questions</strong></li><li><strong>Document and credit card forgery</strong></li><li><strong>Chat links</strong></li></ul><p><strong>7.2.1</strong> <strong>Visualizations:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*gKjPGA_MrgKWc24IrZzRtw.png" /><figcaption>2 Baseline: Intertopic Distance Map</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jzJDJYJX6gWO_6t8Js5fCA.png" /><figcaption>2 Baseline: Topic Distribution</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1JJjyL46Qwh71e7OqNZiHw.png" /><figcaption>2 Baseline: Evolution Over Time</figcaption></figure><p><strong>7.3 Third Baseline Found on Dread Post Section: Key Parameters</strong></p><ul><li>Used the ‘<em>all-MiniLM-L6-v2</em>’ embedding model, this, together with the use of pre-processing, was an almost compulsory choice given the very high number of records, managing to achieve excellent embedding vector accuracy in only 3 hours compared to 15 initially required.</li><li>UMAP with 20 n_neighbors and 8 n_components.</li><li>HDBSCAN with 190 min_cluster_size.</li><li>Reducing the number of outliers using the formula for calculating the probability by obtaining 90k outliers out of 260k.</li></ul><p><strong>121 </strong>topics found expanding what was found with the 2 baseline previously.</p><p><strong>7.3.1</strong> <strong>Visualizations:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*1JxHVqPkVbgdKQKoP9cn8w.png" /><figcaption>3 Baseline: Intertopic Distance Map</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hMJfeS2kKPjOTY8OarkpZA.png" /><figcaption>3 Baseline: Evolution Over Time</figcaption></figure><p>This analysis confirmed the original assumption for the Dread dataset: the thread section serves as a summary of what is found in the posts, providing a general overview of the clusters.</p><p>The post section, on the other hand, delves deeper into the discovery of clusters but sacrifices the speed of fitting and processing that is achieved with clusters obtained from the thread section.</p><p><strong>7.4 Expanding Baselines to White Nations and Raid Forums</strong></p><p>Having established robust baselines with the Dread dataset, the next phase involved extending the analysis to additional datasets: <strong>White Nations</strong> and <strong>Raid Forums</strong>.</p><p>These datasets were chosen to further enhance the model’s comprehensiveness and resilience by tackling a broader spectrum of topics and data structures.</p><p>Below are the baselines of these datasets</p><p><strong>7.4.1 Fourth Baseline Found on White Nations Post Section: Key Parameters</strong></p><ul><li>Used the ‘<em>all-MiniLM-L6-v2</em>’ embedding model</li><li>UMAP with 150 n_neighbors and 10 n_components</li><li>HDBSCAN with 150 min_cluster_size.</li><li>Reducing the number of outliers using the formula for calculating the probability by obtaining 17k outliers out of 52k.</li></ul><p><strong>31 </strong>topics were detected, the most important of which relate to:</p><ul><li><strong>Socialism</strong></li><li><strong>Elections Fraud America</strong></li><li><strong>Racism Mexico</strong></li><li><strong>War</strong></li><li><strong>Elections Europe</strong></li><li><strong>Deep State</strong></li><li><strong>Trump</strong></li><li><strong>Climate Change</strong></li><li><strong>Religion</strong></li><li><strong>Scams</strong></li></ul><p><strong>7.4.1.1</strong> <strong>Visualizations:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K2b9QkrbG_6fwl8_7Fjp5Q.png" /><figcaption>4 Baseline: Topic Distribution</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XSHMn5oqV6E3EdzN_LWK5Q.png" /><figcaption>4 Baseline: Evolution Over Time</figcaption></figure><p><strong>7.4.2 Fifth Baseline Found on Raid Forums Thread Section: Key Parameters</strong></p><ul><li>Used the ‘<em>all-MiniLM-L6-v2</em>’ embedding model</li><li>UMAP with 150 n_neighbors and 10 n_components</li><li>HDBSCAN with 500 min_cluster_size.</li><li>Reducing the number of outliers using the formula for calculating the probability by obtaining 36k outliers out of 94k.</li></ul><p><strong>26 </strong>topics were detected, the most important of which relate to:</p><ul><li><strong>Social Media Hacking</strong></li><li><strong>Spotify account</strong></li><li><strong>Only Fans</strong></li><li><strong>Discord accounts</strong></li><li><strong>Netflix accounts</strong></li><li><strong>Data leak</strong></li></ul><p><strong>7.4.2.1</strong> <strong>Visualizations:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J3HQOxbqxcUmYglnZ2sFqQ.png" /><figcaption>5 Baseline: Topic Distribution</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nTysy3zs9JCioId3wi3dCw.png" /><figcaption>5 Baseline: Evolution Over Time</figcaption></figure><p><strong>7.5 Merging Baselines for a Comprehensive Model</strong></p><p>By uniting the insights and findings from the individual baselines — derived from the Dread, White Nations, and Raid Forums datasets — a new, comprehensive model has been developed. This merged model effectively encompasses all the critical topics identified across the separate analyses, resulting in a robust and extensive framework for understanding Dark Web discussions.</p><p>The combined model now covers a total of <strong>173 distinct topics</strong>. These topics span a wide range of areas, including drug sales, bitcoin transactions, scams, marketplace activities, conspiracies, data breaches, and much more. The model has been trained on an expansive dataset consisting of approximately <strong>500k documents</strong> in total. This large-scale training dataset ensures that the model is both comprehensive and resilient, capable of accurately reflecting the diverse nature of discussions across different Dark Web forums.</p><p>To facilitate accessibility and usability, the model has been made available in two formats. The first is a <strong>pickle file</strong>, which allows for seamless integration into Python-based projects. The second format is hosted directly on <strong>HuggingFace</strong> at the following link: <a href="https://huggingface.co/D0men1c0/ISSR_Dark_Web_Merged_Models_Content_White_Nations_Raid">ISSR Dark Web Merged Models: Content from White Nations and Raid Forums</a>.</p><p>Additionally, the individual models derived from the Dread, White Nations, and Raid Forums datasets are also available for use on <strong>HuggingFace</strong>. You can find all these models on the <a href="https://huggingface.co/D0men1c0">HuggingFace page</a>.</p><p>This merged model represents a significant advancement, offering a powerful tool for researchers and analysts seeking to understand and track the complex, evolving discussions within Dark Web forums.</p><h4>8. Additional Analysis on the Baselines</h4><p>To further validate and enrich the insights obtained from the baseline models, additional analyses were conducted using four distinct CSV files. These analyses provide a deeper understanding of the topics, their associated documents, sentiment trends, and temporal evolution.</p><p>Below is an overview of each analysis, with placeholders for the accompanying visualizations.</p><p><strong>8.1 Topic Information Analysis</strong></p><p>The first CSV file contains detailed information about the topics identified in the baseline models. This includes descriptions, distributions, and key metrics for each topic. By analyzing this data, we can gain insights into the prevalence and significance of various topics across the datasets.</p><p>An example visualization is a bar chart that illustrates the distribution of topics across the documents, helping to identify the most prominent topics:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*Gbt-1hyQucUdKayP3ih0IQ.png" /><figcaption>1 Baseline with 7 Topics: Topic Distribution</figcaption></figure><p><strong>8.2 Document Association and Word Clouds</strong></p><p>The second CSV file provides a mapping between the original documents and their associated topics. To visually represent the content within these documents, word clouds were generated for each topic. Word clouds offer a quick and intuitive way to grasp the most frequent terms associated with each topic, highlighting key themes and concepts.</p><p>Below is an example of a word cloud generated for one of the topics:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5flk4IalnsNX_kqd3E_qFw.png" /><figcaption>1 Baseline with 7 Topics: Documents Word Cloud</figcaption></figure><p><strong>8.3 Sentiment Analysis by Topic</strong></p><p>In the third analysis, sentiment analysis was performed on the documents within each topic. This allowed us to assess the emotional tone and polarity (positive, negative, neutral) associated with the discussions in each topic. The sentiment distribution provides valuable insights into the overall mood and potential biases present in the discussions.</p><p>An example sentiment analysis visualization is shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eE4Bhxa3lR_IcNBPT1MdlQ.png" /><figcaption>1 Baseline with 7 Topics: Sentiment Analysis</figcaption></figure><p><strong>8.4 Temporal Evolution of Topics</strong></p><p>The fourth CSV file was used to analyze the evolution of topics over time. By tracking how topics emerge, change, or fade away, we can understand the dynamics of discussions within the datasets. This temporal analysis is particularly useful for identifying trends, shifts in focus, and the impact of external events on the topics.</p><p>An example of a temporal evolution graph is shown here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9soXj3a6_GzQPhfQ0sV9jQ.png" /><figcaption>1 Baseline with 7 Topics: Temporal Evolution</figcaption></figure><p><strong>8.5 Application Across All Baselines</strong></p><p>These analyses were not only performed on the first baseline but were extended to cover all the baseline models, including those created from the Dread, White Nations, and Raid Forums datasets. Each analysis was conducted separately for each CSV file, and the corresponding visualizations were generated for all topics.</p><p>To facilitate a more detailed exploration, the results of these analyses have been compiled into HTML files, which provide a more interactive and comprehensive view of the data. These HTML files can be accessed for a deeper dive into each analysis.</p><h4>9. Results Obtained</h4><p>This section presents a detailed summary of the results obtained from evaluating the metrics applied to the outputs generated by BERTopic across different datasets. The purpose of this analysis is to ensure that the topics identified by BERTopic are meaningful, coherent, and well-clustered by leveraging several key evaluation metrics.</p><p><strong>9.1 Metric Evaluation of BERTopic Outputs</strong></p><p>To assess the quality of the topics generated by BERTopic, we applied a variety of evaluation metrics. The results of these metrics are summarized in the tables below, covering the Dread, White Nations, and Raid Forums datasets. These metrics include coherence scores, silhouette scores, Davies-Bouldin scores, and DOS (Diversity Overlapped Score), each of which provides insight into the quality and interpretability of the clusters formed by BERTopic.</p><p><strong>9.1.1 Dread Dataset Metrics</strong></p><p>The table below summarizes the metric results for the Dread dataset, with separate evaluations for the Thread and Content sections:</p><p>Thread:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*AUAYjZwBx0z3UDBi0xdKKg.png" /><figcaption>Dread Metrics Thread</figcaption></figure><p>Content:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*cjwwztQW-z3QbC4_8SZdgw.png" /><figcaption>Dread Metrics Content</figcaption></figure><p><strong>9.1.2 White Nations Dataset Metrics</strong></p><p>For the White Nations dataset, the metrics focus on the post section, reflecting its unique content related to socio-political discussions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*LSTso4KMB3ZCAF_kEzS-TQ.png" /><figcaption>White Nations Content</figcaption></figure><p><strong>9.1.3 Raid Forums Dataset Metrics</strong></p><p>The Raid Forums dataset metrics were primarily evaluated on the thread section, which provided insights into data breaches and unauthorized access:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*zp4Tx_aJCjgrB5XVGdVbVA.png" /><figcaption>Raid Forums Thread</figcaption></figure><p>These tables highlight the effectiveness of the BERTopic-generated topics, with high scores in coherence and silhouette metrics, indicating well-defined and interpretable clusters.</p><p><strong>9.2 Machine Learning Validation</strong></p><p>To further validate the quality of the embeddings and topics produced by BERTopic, machine learning models were applied. These models were used to confirm the accuracy and reliability of the topic assignments and to assess the embeddings’ effectiveness in classification tasks.</p><p><strong>9.2.1 LightGBM on Dread Threads</strong></p><p>LightGBM was applied to the thread section of the Dread dataset to validate the topics identified by BERTopic. The model was trained using the embeddings and topic labels generated, with the goal of determining whether the model could accurately replicate the cluster assignments.</p><p>The performance of the LightGBM model was measured using accuracy, precision, recall, and F1 scores, with cross-validation (k=3, 5, 10) to ensure robustness.</p><p>Dread Thread:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*WkgIjOy67lvRVf00vaQVrQ.png" /><figcaption>LightGBM Dread Thread</figcaption></figure><p>Visualisation: Dread Thread on 7 Topics</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*xVxRjmu4YfuSdKxcI_hbFA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*HdDUsmE2T0f9_0S7lzPBjA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*FgRurY5kohNzg7AyftqWkA.png" /><figcaption>Training and Validation Loss, Precision-Recall Curve, and Confusion Matrix for 7 Topics</figcaption></figure><p>Visualisation: Dread Thread on 68 clusters</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*BxnKryo1uRaS_8l_9bMEDg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*uKT8WxDdQulrzDGTJfmGEg.png" /><figcaption>Training and Validation Loss and Precision-Recall Curve for 68 Topics</figcaption></figure><p><strong>9.2.2 LSTM on Dread Posts</strong></p><p>For the post section of the Dread dataset, an LSTM model was used due to its ability to handle sequential data. This model was trained on the embeddings from BERTopic, with a focus on observing the loss and accuracy curves during training to evaluate model performance.</p><p>Below are the plots showing the loss and accuracy curves for the LSTM model:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*oM-nAPBva-N_Wje8dVeE_g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*3pUJnGjMkGE35mf6Bjd1Qg.png" /><figcaption>Accuracy and Loss LSTM for Dread Content</figcaption></figure><p>The results demonstrate that the LSTM model effectively replicated the topic classifications, validating the quality of the embeddings and topic assignments generated by BERTopic.</p><p><strong>9.3 Summary of Metric and Model Validation</strong></p><p>The combination of metric evaluations and machine learning validation confirms that the topics identified by BERTopic are not only coherent and meaningful but also reproducible across different datasets and modeling approaches. This thorough validation process ensures the reliability and robustness of the topic modeling outputs.</p><h4><strong>10. Multimodal Model Development</strong></h4><p>Building on the work done so far, a multimodal approach has been developed to further extend the capabilities of the model. This approach integrates visual data with the existing textual models, enhancing the model’s ability to analyze and interpret complex datasets. Although the visual model currently relies on a public dataset instead of images sourced from the dark web, it serves as a valuable proof of concept for the practical application of multimodal techniques.</p><p><strong>10.1 Training the Multimodal Model</strong></p><p>The multimodal model was trained using the image dataset provided by <a href="https://universe.roboflow.com/freakinggojo-er8b5/drug_detection_project/dataset/9">Roboflow’s Drug Detection Project.</a> This dataset comprises approximately 3,700 images, divided into training, testing, and validation sets, and covers four main categories: people, guns, drugs, and robbers.</p><p>The development of the multimodal model involved the following steps:</p><ol><li><strong>Embedding Extraction:</strong> Image embeddings were generated using advanced models, which were then linked to corresponding captions.</li><li><strong>Visual Model Training:</strong> The visual model was trained to derive topic representations from these embeddings.</li><li><strong>Evaluation:</strong> The model was trained using the designated training and testing sets and subsequently evaluated on the validation set, successfully identifying the four key topics: drugs, guns, people, and robbers.</li></ol><p><strong>10.2 Advantages of the Multimodal Model</strong></p><p>Integrating visual data into the model provides several key benefits:</p><ol><li><strong>Enhanced Topic Detection:</strong> The inclusion of visual data allows the model to distinguish between more specific topics. For example, it can differentiate between different types of drugs, such as yellow heroin versus brown heroin, based on visual characteristics.</li><li><strong>Improved Contextual Understanding:</strong> By combining textual and visual information, the model gains a deeper insight into the context of the data, which is particularly useful for identifying and categorizing complex topics.</li><li><strong>Increased Versatility:</strong> The ability to analyze both text and images enables the model to adapt to a wide variety of content types and contexts, making it highly versatile.</li><li><strong>Predictive Accuracy:</strong> The addition of visual data contributes to more accurate predictions and deeper insights, particularly in applications requiring detailed topic analysis and classification.</li></ol><p><strong>10.3 Visualization of Results</strong></p><p>The following visualization displays the thematic clusters identified by the multimodal model, showcasing its effectiveness in analyzing and distinguishing between textual and visual data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*KwUgrsdo2o9tSulaH41fYA.png" /><figcaption>Visual Model 4 Topics: Robbers — Guns — Drugs — People</figcaption></figure><p>This multimodal model represents a significant step forward in enhancing the model’s overall performance.</p><p>It also lays the groundwork for future developments, particularly when images from the dark web become available.</p><p>Combining these with the baseline text models will result in a robust and comprehensive multimodal approach, capable of delivering more precise and actionable insights.</p><h4>11. Future Work</h4><ul><li><strong>Incorporating Dark Web Images:</strong> Integrating actual images from the dark web into the multimodal model will provide more accurate and contextually relevant insights, enabling the model to better categorize and understand visual data specific to dark web content.</li><li><strong>Expanding Dataset and Topic Coverage:</strong> Increasing the quantity and diversity of datasets and topics will improve the model’s robustness. This includes adding more data from different forums and marketplaces, as well as expanding the range of topics to cover new and emerging discussions on the dark web.</li><li><strong>Real-Time Monitoring with Domain-Specific Language:</strong> Implementing real-time monitoring capabilities, combined with input from domain experts to refine the language used by the model, will allow for more precise tracking and analysis of evolving trends and activities on the dark web, making the model more responsive and adaptable to new developments.</li></ul><h4><strong>12. Acknowledgements</strong></h4><p>I would like to extend my heartfelt gratitude to my supervisors Jane Daquin, Andrea Underhill and the head of the organization Sergei Gleyzer for their unwavering support and guidance during the Google Summer of Code (GSoC) 2024 with HumanAI.</p><p>Their mentorship provided me with the opportunity to fully express my creativity and push the boundaries of my capabilities.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67fd3397e0fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>