{
  "id": 581194,
  "title": "45th Place Solution",
  "content": "<h2>📌 Overall Pipeline</h2>\n<h2><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F20494358%2Fc25bdb0481db5bc1c963c88ed302a9e7%2FScreenshot%202025-05-29%20080115.png?generation=1748480516747567&amp;alt=media\" alt=\"\"></h2>\n<p>\n  <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F20494358%2Ff57317ddbcd475b65230ae91e8c2d529%2Fraw%20-%201%20-%200.6018.png?generation=1748481063375807&amp;alt=media\">\n  <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F20494358%2F4ec57b7582f39832f50747c37739a11a%2Fraw%20-%202%20-%200.6519.png?generation=1748481084171094&amp;alt=media\">\n</p>\n<p>\n  <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F20494358%2F1ca6a33da4f9ce67f915ae65f6a9bf3e%2Fsubmit%20-%201%20-%200.5767.png?generation=1748480999371391&amp;alt=media\">\n  <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F20494358%2F95453b57ae0e79fef2e0d61f05d32bc4%2Fsubmit%20-%200%20-%200.6029.png?generation=1748480925349989&amp;alt=media\">\n</p>\n<h3>1️⃣ Bitmap Generation (SDXL-Turbo)</h3>\n<ul>\n<li>I used the <strong>SDXL-Turbo</strong> model to generate bitmap images.</li>\n<li><strong>Prompt Engineering</strong> to improve diversity and quality:<ul>\n<li><code>prefix_prompt = \"flat color illustration,\"</code></li>\n<li><code>suffix_prompt = \",inspired by Tom Whalen, vibrant palette, bold outlines, simple shapes, app icon.\"</code></li></ul></li>\n<li>For each prompt, I generated <strong>5 images</strong>.</li>\n</ul>\n<hr>\n<h3>2️⃣ Initial SVG Conversion (vtracer)</h3>\n<ul>\n<li>For each bitmap image, I used <strong>vtracer</strong> to convert it into an SVG.</li>\n<li>After experiments, I found that these <strong>three parameters</strong> significantly affect the SVG file size:<ul>\n<li><code>speckle_values = [10, 20, 40]</code></li>\n<li><code>layer_diff_values = [64, 128]</code></li>\n<li><code>color_precision_values = [4, 5, 6, 8]</code></li></ul></li>\n<li>I tried different combinations of these parameters to find the smallest file (<strong>&lt;10k</strong>) while keeping visual quality.</li>\n</ul>\n<hr>\n<h3>3️⃣ SVG Optimization (scour)</h3>\n<ul>\n<li>I applied <strong>scour</strong> to optimize each SVG file generated by vtracer.</li>\n<li>Then, I used <strong>SSIM (Structural Similarity Index)</strong> to:<ul>\n<li>Find the SVG that is visually closest to the original bitmap.</li>\n<li>Ensure the file size is close to 10k.</li></ul></li>\n</ul>\n<hr>\n<h3>4️⃣ OCR Hallucination Defense</h3>\n<ul>\n<li>I added a subtle <strong>\"O\"</strong> character in the image to defend against OCR hallucination issues.</li>\n<li>This idea was inspired by the notebook:  <br>\n<a href=\"https://www.kaggle.com/code/richolson/let-s-defeat-ocr-easy-lb-boost\" target=\"_blank\">Let's Defeat OCR - Easy LB Boost</a>  <br>\nBig thanks to <a href=\"https://www.kaggle.com/richolson\" target=\"_blank\">@richolson</a>!</li>\n</ul>\n<hr>\n<h3>5️⃣ Best SVG Selection</h3>\n<ul>\n<li>I used <strong>PaliGemma2</strong> and an <strong>aesthetic predictor</strong> to select the final SVG that is:<ul>\n<li>Visually appealing.</li>\n<li>Aligned with the prompt.</li></ul></li>\n</ul>\n<hr>\n<p>✨ Thank you for reading my solution! Happy Kaggle-ing! ✨</p>",
  "comments": [
    {
      "id": 3212219,
      "author_name": "Arseniy Kan",
      "author_url": "",
      "post_date": "2025-05-29T14:04:54.667000",
      "content": "<p>Neat solution!</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "comment_count": 1,
  "messages": [
    {
      "id": 3211846,
      "postDate": "2025-05-29T00:59:52.033Z",
      "content": "<h2>📌 Overall Pipeline</h2>\n<h2><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F20494358%2Fc25bdb0481db5bc1c963c88ed302a9e7%2FScreenshot%202025-05-29%20080115.png?generation=1748480516747567&amp;alt=media\" alt=\"\"></h2>\n<p>\n  <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F20494358%2Ff57317ddbcd475b65230ae91e8c2d529%2Fraw%20-%201%20-%200.6018.png?generation=1748481063375807&amp;alt=media\">\n  <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F20494358%2F4ec57b7582f39832f50747c37739a11a%2Fraw%20-%202%20-%200.6519.png?generation=1748481084171094&amp;alt=media\">\n</p>\n<p>\n  <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F20494358%2F1ca6a33da4f9ce67f915ae65f6a9bf3e%2Fsubmit%20-%201%20-%200.5767.png?generation=1748480999371391&amp;alt=media\">\n  <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F20494358%2F95453b57ae0e79fef2e0d61f05d32bc4%2Fsubmit%20-%200%20-%200.6029.png?generation=1748480925349989&amp;alt=media\">\n</p>\n<h3>1️⃣ Bitmap Generation (SDXL-Turbo)</h3>\n<ul>\n<li>I used the <strong>SDXL-Turbo</strong> model to generate bitmap images.</li>\n<li><strong>Prompt Engineering</strong> to improve diversity and quality:<ul>\n<li><code>prefix_prompt = \"flat color illustration,\"</code></li>\n<li><code>suffix_prompt = \",inspired by Tom Whalen, vibrant palette, bold outlines, simple shapes, app icon.\"</code></li></ul></li>\n<li>For each prompt, I generated <strong>5 images</strong>.</li>\n</ul>\n<hr>\n<h3>2️⃣ Initial SVG Conversion (vtracer)</h3>\n<ul>\n<li>For each bitmap image, I used <strong>vtracer</strong> to convert it into an SVG.</li>\n<li>After experiments, I found that these <strong>three parameters</strong> significantly affect the SVG file size:<ul>\n<li><code>speckle_values = [10, 20, 40]</code></li>\n<li><code>layer_diff_values = [64, 128]</code></li>\n<li><code>color_precision_values = [4, 5, 6, 8]</code></li></ul></li>\n<li>I tried different combinations of these parameters to find the smallest file (<strong>&lt;10k</strong>) while keeping visual quality.</li>\n</ul>\n<hr>\n<h3>3️⃣ SVG Optimization (scour)</h3>\n<ul>\n<li>I applied <strong>scour</strong> to optimize each SVG file generated by vtracer.</li>\n<li>Then, I used <strong>SSIM (Structural Similarity Index)</strong> to:<ul>\n<li>Find the SVG that is visually closest to the original bitmap.</li>\n<li>Ensure the file size is close to 10k.</li></ul></li>\n</ul>\n<hr>\n<h3>4️⃣ OCR Hallucination Defense</h3>\n<ul>\n<li>I added a subtle <strong>\"O\"</strong> character in the image to defend against OCR hallucination issues.</li>\n<li>This idea was inspired by the notebook:  <br>\n<a href=\"https://www.kaggle.com/code/richolson/let-s-defeat-ocr-easy-lb-boost\" target=\"_blank\">Let's Defeat OCR - Easy LB Boost</a>  <br>\nBig thanks to <a href=\"https://www.kaggle.com/richolson\" target=\"_blank\">@richolson</a>!</li>\n</ul>\n<hr>\n<h3>5️⃣ Best SVG Selection</h3>\n<ul>\n<li>I used <strong>PaliGemma2</strong> and an <strong>aesthetic predictor</strong> to select the final SVG that is:<ul>\n<li>Visually appealing.</li>\n<li>Aligned with the prompt.</li></ul></li>\n</ul>\n<hr>\n<p>✨ Thank you for reading my solution! Happy Kaggle-ing! ✨</p>",
      "rawMarkdown": "## 📌 Overall Pipeline\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F20494358%2Fc25bdb0481db5bc1c963c88ed302a9e7%2FScreenshot%202025-05-29%20080115.png?generation=1748480516747567&alt=media)\n---\n\n<p style=\"display: flex; gap: 10px; justify-content: center;\">\n  <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F20494358%2Ff57317ddbcd475b65230ae91e8c2d529%2Fraw%20-%201%20-%200.6018.png?generation=1748481063375807&alt=media\" width=\"45%\" />\n  <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F20494358%2F4ec57b7582f39832f50747c37739a11a%2Fraw%20-%202%20-%200.6519.png?generation=1748481084171094&alt=media\" width=\"45%\" />\n</p>\n\n<p style=\"display: flex; gap: 10px; justify-content: center;\">\n  <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F20494358%2F1ca6a33da4f9ce67f915ae65f6a9bf3e%2Fsubmit%20-%201%20-%200.5767.png?generation=1748480999371391&alt=media\" width=\"45%\" />\n  <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F20494358%2F95453b57ae0e79fef2e0d61f05d32bc4%2Fsubmit%20-%200%20-%200.6029.png?generation=1748480925349989&alt=media\" width=\"45%\" />\n</p>\n\n\n### 1️⃣ Bitmap Generation (SDXL-Turbo)\n- I used the **SDXL-Turbo** model to generate bitmap images.\n- **Prompt Engineering** to improve diversity and quality:\n  - `prefix_prompt = \"flat color illustration,\"`\n  - `suffix_prompt = \",inspired by Tom Whalen, vibrant palette, bold outlines, simple shapes, app icon.\"`\n- For each prompt, I generated **5 images**.\n\n\n\n---\n\n### 2️⃣ Initial SVG Conversion (vtracer)\n- For each bitmap image, I used **vtracer** to convert it into an SVG.\n- After experiments, I found that these **three parameters** significantly affect the SVG file size:\n  - `speckle_values = [10, 20, 40]`\n  - `layer_diff_values = [64, 128]`\n  - `color_precision_values = [4, 5, 6, 8]`\n- I tried different combinations of these parameters to find the smallest file (**<10k**) while keeping visual quality.\n\n---\n\n### 3️⃣ SVG Optimization (scour)\n- I applied **scour** to optimize each SVG file generated by vtracer.\n- Then, I used **SSIM (Structural Similarity Index)** to:\n  - Find the SVG that is visually closest to the original bitmap.\n  - Ensure the file size is close to 10k.\n\n---\n\n### 4️⃣ OCR Hallucination Defense\n- I added a subtle **\"O\"** character in the image to defend against OCR hallucination issues.\n- This idea was inspired by the notebook:  \n  [Let's Defeat OCR - Easy LB Boost](https://www.kaggle.com/code/richolson/let-s-defeat-ocr-easy-lb-boost)  \n  Big thanks to [@richolson](https://www.kaggle.com/richolson)!\n\n---\n\n### 5️⃣ Best SVG Selection\n- I used **PaliGemma2** and an **aesthetic predictor** to select the final SVG that is:\n  - Visually appealing.\n  - Aligned with the prompt.\n\n---\n\n✨ Thank you for reading my solution! Happy Kaggle-ing! ✨",
      "votes": 10
    },
    {
      "id": 3212219,
      "postDate": "2025-05-29T14:04:54.667Z",
      "content": "<p>Neat solution!</p>",
      "rawMarkdown": "Neat solution!"
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-20T09:10:40Z",
  "competition_id": 89659,
  "competition_slug": "drawing-with-llms",
  "team_id": 13567187,
  "solution_url": "/competitions/drawing-with-llms/writeups/t-m-anh-nguy-n-duy-45th-place-solution"
}