<?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: Ahsan Fayyaz</title>
    <description>The latest articles on DEV Community by Ahsan Fayyaz (@star_doppel_b782d4e097c70).</description>
    <link>https://dev.to/star_doppel_b782d4e097c70</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%2F4034496%2Fe66ff9ae-ba47-4b56-a96f-811028d3c073.jpg</url>
      <title>DEV Community: Ahsan Fayyaz</title>
      <link>https://dev.to/star_doppel_b782d4e097c70</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/star_doppel_b782d4e097c70"/>
    <language>en</language>
    <item>
      <title>I Built an AI Face-Analysis Suite From Scratch — Here's What I Learned</title>
      <dc:creator>Ahsan Fayyaz</dc:creator>
      <pubDate>Fri, 17 Jul 2026 22:21:37 +0000</pubDate>
      <link>https://dev.to/star_doppel_b782d4e097c70/i-built-an-ai-face-analysis-suite-from-scratch-heres-what-i-learned-35mk</link>
      <guid>https://dev.to/star_doppel_b782d4e097c70/i-built-an-ai-face-analysis-suite-from-scratch-heres-what-i-learned-35mk</guid>
      <description>&lt;h2&gt;
  
  
  The Problem With "Which Celebrity Do I Look Like?" Tools
&lt;/h2&gt;

&lt;p&gt;If you've ever searched for a celebrity look-alike tool, you've probably noticed most of them fall into one of two camps: quiz-style pages that ask you five vague questions about your own face ("is your jaw pointed or round?"), or apps that quietly outsource the heavy lifting to a third-party face recognition API and slap a UI on top.&lt;/p&gt;

&lt;p&gt;Neither approach sat right with me. Self-assessment is unreliable — people are bad at judging their own proportions, especially in a mirror where everything is flipped and inconsistently lit. And outsourcing the model means you're limited by whatever a generic library was trained to do.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;&lt;a href="https://stardoppel.com" rel="noopener noreferrer"&gt;StarDoppel&lt;/a&gt;&lt;/strong&gt;, a suite of AI-powered face-analysis tools, with the matching engine written entirely in-house in Python rather than wrapped around an off-the-shelf face recognition library.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the Core Matching Engine Works
&lt;/h2&gt;

&lt;p&gt;The idea is simple in concept, harder in execution: read a photo, extract measurable structure, and turn that structure into a comparable score.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Landmark detection&lt;/strong&gt; — When a photo is uploaded, the model maps facial landmarks: eyes, nose, jawline, lips, and their relative positions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Proportion extraction&lt;/strong&gt; — Those landmarks get converted into a set of proportional measurements (not raw pixel distances, since photos vary wildly in scale and angle).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Distance scoring&lt;/strong&gt; — Each face gets compared against a reference database using a raw distance calculation. The smaller the distance between your measurements and a given reference face, the higher the similarity percentage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ranking&lt;/strong&gt; — For the celebrity matcher specifically, the five closest matches (by distance) are returned, sorted from closest to furthest.
Because the scoring is distance-based rather than a fixed threshold or bucket, small variations — a different angle, a different expression — can shift percentages enough to change which result lands in first place. That's a deliberate tradeoff: fixed-threshold classification is easier to explain but throws away information, while distance-based scoring preserves nuance at the cost of being slightly less "clean" to talk about.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Beyond Celebrity Matching: A Full Face-Analysis Suite
&lt;/h2&gt;

&lt;p&gt;Once the landmark-detection pipeline existed, extending it to other structural questions was a natural next step. StarDoppel now includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://stardoppel.com/face-shape-detector" rel="noopener noreferrer"&gt;Face Shape Detector&lt;/a&gt;&lt;/strong&gt; — classifies into oval, round, square, heart, diamond, or oblong based on measured width/length/jaw ratios rather than self-reported quiz answers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://stardoppel.com/face-symmetry-test" rel="noopener noreferrer"&gt;Face Symmetry Test&lt;/a&gt;&lt;/strong&gt; — compares the left and right sides of the face across multiple landmarks and returns a symmetry score&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://stardoppel.com/golden-ratio-face" rel="noopener noreferrer"&gt;Golden Ratio Face&lt;/a&gt;&lt;/strong&gt; — measures facial proportions against φ (1.618) across several ratios (eye spacing, nose-to-chin, face height) and produces an overall harmony score&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://stardoppel.com/how-old-do-i-look" rel="noopener noreferrer"&gt;Face Age Test&lt;/a&gt;&lt;/strong&gt; — estimates age from facial structure and texture markers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://stardoppel.com/eye-shapes" rel="noopener noreferrer"&gt;Eye Shape&lt;/a&gt;, &lt;a href="https://stardoppel.com/lip-shapes" rel="noopener noreferrer"&gt;Lip Shape&lt;/a&gt;, and &lt;a href="https://stardoppel.com/nose-shapes" rel="noopener noreferrer"&gt;Nose Shape Tests&lt;/a&gt;&lt;/strong&gt; — each reads a specific set of landmarks (eyelid crease and depth for eyes; fullness, symmetry, and cupid's bow curvature for lips; bridge curvature, tip angle, and nostril width for the nose) to classify that feature into recognized categories
Each tool shares the same underlying landmark-detection foundation, just pointed at a different subset of facial geometry.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Design Decisions Worth Talking About
&lt;/h2&gt;

&lt;p&gt;A few choices that came up repeatedly during development:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No account requirement.&lt;/strong&gt; Every tool works with zero signup. This meant designing the backend to be fully stateless per-request — no user session tied to a stored photo, no persistence layer for images at all.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Photos are deleted immediately after processing.&lt;/strong&gt; Each image exists on the server only long enough to generate a result. This shaped a lot of the architecture: no caching of uploaded images, no logging of raw photo data, and processing pipelines that explicitly discard the file reference once a result object is returned.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Handling ambiguous input gracefully.&lt;/strong&gt; If more than one face is detected in a frame, the system doesn't try to guess which one the user meant — it returns an error and asks for a new photo. Same behavior when no face is detected at all (blur, extreme angle, poor lighting). Silent wrong guesses are worse than an explicit "please try again."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What doesn't break the model.&lt;/strong&gt; Interestingly, makeup and facial hair don't meaningfully affect results, since the underlying bone/cartilage structure is what's being measured rather than surface texture. Masks are a different story — they remove too many reference points for a reliable read.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;The celebrity database currently reflects the actor set it was built with, sourced from IMDb — expanding and refreshing that dataset is an ongoing task, along with extending coverage beyond actors. If you're interested in the technical side of facial landmark detection, distance-based similarity scoring, or just want to see the tools in action, you can try them at &lt;a href="https://stardoppel.com" rel="noopener noreferrer"&gt;stardoppel.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Happy to answer questions about the implementation in the comments.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>machinelearning</category>
      <category>python</category>
    </item>
  </channel>
</rss>
