<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ali Abbas Shah</title>
    <description>The latest articles on DEV Community by Ali Abbas Shah (@alyabbas11).</description>
    <link>https://dev.to/alyabbas11</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4056956%2F1ff3ed94-fd83-47ee-ac30-9894035c4a49.jpg</url>
      <title>DEV Community: Ali Abbas Shah</title>
      <link>https://dev.to/alyabbas11</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alyabbas11"/>
    <language>en</language>
    <item>
      <title>How I Built an AI That Detects C/C++ Security Vulnerabilities (F1 0.925)</title>
      <dc:creator>Ali Abbas Shah</dc:creator>
      <pubDate>Tue, 11 Aug 2026 12:56:49 +0000</pubDate>
      <link>https://dev.to/alyabbas11/how-i-built-an-ai-that-detects-cc-security-vulnerabilities-f1-0925-4ifp</link>
      <guid>https://dev.to/alyabbas11/how-i-built-an-ai-that-detects-cc-security-vulnerabilities-f1-0925-4ifp</guid>
      <description>&lt;p&gt;Finder of one bug in a million lines is still sleeping, but the models have started watching.&lt;/p&gt;

&lt;p&gt;Static analysis tools like Flawfinder and Cppcheck have been the industry standard for years, but they work on predefined rules. They miss what they were never told to look for.&lt;/p&gt;

&lt;p&gt;This is the story of &lt;strong&gt;SecureScan AI&lt;/strong&gt; — a deep learning model that reads C/C++ source code like a language model reads text, and flags vulnerabilities the way a code reviewer would. We built it for our Deep Learning lab at Air University Lahore, and it runs as a free web demo at &lt;a href="https://securescan-ai.vercel.app" rel="noopener noreferrer"&gt;securescan-ai.vercel.app&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why CodeBERT instead of rules
&lt;/h2&gt;

&lt;p&gt;CodeBERT is a BERT-family transformer pre-trained by Microsoft on both natural language and code pairs. It does not look for bug patterns — it has learned the &lt;em&gt;meaning&lt;/em&gt; of code. That matters because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It generalizes to vulnerability types it was never explicitly trained on&lt;/li&gt;
&lt;li&gt;It catches logic-level issues, not just lexical signatures like &lt;code&gt;strcpy&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;It embeds context: what a variable flows into, what a buffer feeds&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The task is sequence labeling (or per-function binary classification): given a function, predict &lt;code&gt;Vulnerable&lt;/code&gt; or &lt;code&gt;Safe&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The architecture
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C/C++ source code
       |
       v
microsoft/codebert-base  (125M params, first 6 layers frozen)
       |
       v
2 stacked BiLSTM layers  (hidden 256, bidirectional = 512-dim)
       |
       v
MLP head  (512 -&amp;gt; 256 -&amp;gt; 128 -&amp;gt; 2, ReLU + BatchNorm)
       |
       v
Vulnerable or Safe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why a BiLSTM on top of a transformer? CodeBERT alone scored &lt;strong&gt;F1 0.8612&lt;/strong&gt; on our benchmark. Adding the BiLSTM layers gave the model a sequential view of the token flow — it models how one line's taint propagates into the next. Without the BiLSTM, F1 dropped to &lt;strong&gt;0.8832&lt;/strong&gt; (-4.2%).&lt;/p&gt;

&lt;h2&gt;
  
  
  The data: 600,000+ labeled samples
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Dataset&lt;/th&gt;
&lt;th&gt;Language&lt;/th&gt;
&lt;th&gt;Samples&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;BigVul&lt;/td&gt;
&lt;td&gt;C / C++&lt;/td&gt;
&lt;td&gt;~188,000&lt;/td&gt;
&lt;td&gt;Real CVEs + NVD entries&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DiverseVul&lt;/td&gt;
&lt;td&gt;C / C++&lt;/td&gt;
&lt;td&gt;~319,000&lt;/td&gt;
&lt;td&gt;Diverse CVE coverage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;FormAI&lt;/td&gt;
&lt;td&gt;Multi&lt;/td&gt;
&lt;td&gt;~246,000&lt;/td&gt;
&lt;td&gt;AI-generated, labeled&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Total: 600,000+ labeled vulnerability samples.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Results and ablation study
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Configuration&lt;/th&gt;
&lt;th&gt;F1&lt;/th&gt;
&lt;th&gt;Delta&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Full model (CodeBERT + BiLSTM + MLP)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.9252&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;reference&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Without BiLSTM&lt;/td&gt;
&lt;td&gt;0.8832&lt;/td&gt;
&lt;td&gt;-4.2%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Without CodeBERT (GloVe)&lt;/td&gt;
&lt;td&gt;0.7950&lt;/td&gt;
&lt;td&gt;-8.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Without dropout&lt;/td&gt;
&lt;td&gt;0.8910&lt;/td&gt;
&lt;td&gt;-3.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unidirectional LSTM&lt;/td&gt;
&lt;td&gt;0.9056&lt;/td&gt;
&lt;td&gt;-2.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;F1 0.9252, accuracy 89.3%&lt;/strong&gt;, with inference at 42ms on GPU and 380ms on CPU — fast enough to serve as a free web demo, no GPU required.&lt;/p&gt;

&lt;h2&gt;
  
  
  What surprised us
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Class imbalance is the real enemy.&lt;/strong&gt; Vulnerable samples are rare in real-world code (roughly 1 in 16). We used BCE with 16:1 class-balancing weights, and this mattered more than any architectural change. Dropping it or the dropout layer cost 3-4% F1.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How much the frozen encoder carries.&lt;/strong&gt; CodeBERT alone (0.8612) beats a hand-built GloVe + BiLSTM pipeline (0.7950) by a huge margin — pre-training on code is worth more than careful feature engineering.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hyperparameter optimization actually works.&lt;/strong&gt; We ran VAE-driven hyperparameter search mid-project and it lifted our best configuration from 92.68% to 94.82% before final evaluation.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would do next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sliding-window tokenization&lt;/strong&gt; — 512-token truncation cuts off real functions mid-body; windowing with overlap would preserve them&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Per-line vs per-function&lt;/strong&gt; labeling — per-line localization would make the tool actually usable by developers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real-time IDE integration&lt;/strong&gt; — an LSP or VS Code extension that flags code as you type&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Live demo: &lt;a href="https://securescan-ai.vercel.app" rel="noopener noreferrer"&gt;securescan-ai.vercel.app&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Source: &lt;a href="https://github.com/aly-abbas11/SecureScan-AI" rel="noopener noreferrer"&gt;github.com/aly-abbas11/SecureScan-AI&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;src.models.securescan_model&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;SecureScanModel&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;transformers&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;AutoTokenizer&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;torch&lt;/span&gt;

&lt;span class="n"&gt;model&lt;/span&gt;     &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;SecureScanModel&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;tokenizer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;AutoTokenizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_pretrained&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;microsoft/codebert-base&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;code&lt;/span&gt;      &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;char buf[10]; strcpy(buf, user_input);&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;inputs&lt;/span&gt;    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;tokenizer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;return_tensors&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;pt&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;truncation&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;max_length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;512&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;torch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;no_grad&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;logits&lt;/span&gt;     &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;model&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;inputs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;input_ids&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;inputs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;attention_mask&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="n"&gt;prediction&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Vulnerable&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;logits&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;argmax&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;item&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Safe&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Result: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;prediction&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# Result: Vulnerable
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;MIT licensed. Built with Salman Tanveer and Hammad Ali. If you build security tooling or have ideas on improving code-tokenization for transformers, I would love to hear from you in the comments.&lt;/p&gt;

</description>
      <category>security</category>
      <category>ai</category>
      <category>machinelearning</category>
      <category>python</category>
    </item>
    <item>
      <title>How to Automate Your GitHub Profile &amp; Build a Live Job Radar with Python</title>
      <dc:creator>Ali Abbas Shah</dc:creator>
      <pubDate>Fri, 31 Jul 2026 18:42:05 +0000</pubDate>
      <link>https://dev.to/alyabbas11/how-to-automate-your-github-profile-build-a-live-job-radar-with-python-4g57</link>
      <guid>https://dev.to/alyabbas11/how-to-automate-your-github-profile-build-a-live-job-radar-with-python-4g57</guid>
      <description>&lt;p&gt;Transform your static developer portfolio into a dynamic, self-updating resume by learning how to automate your GitHub profile using Python and GitHub Actions. In my latest repository, I built a Live Remote Job Radar—an automated job board that fetches fresh tech roles daily and injects them straight into my dynamic GitHub README. By leveraging CI/CD pipelines, CRON jobs, and basic Python API integration, this setup not only showcases real-world engineering skills to recruiters but also guarantees a green contribution graph every single day. Check out my live setup and grab the open-source code on my GitHub to start building your own automated, standout developer portfolio today!  &lt;a href="https://github.com/aly-abbas11" rel="noopener noreferrer"&gt;github.com/aly-abbas11&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
