<?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: S M Hozaifa Hossain</title>
    <description>The latest articles on DEV Community by S M Hozaifa Hossain (@hozaifa1).</description>
    <link>https://dev.to/hozaifa1</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%2F4252290%2Fc31870b2-c7ca-4d24-876d-17381cf0d917.jpg</url>
      <title>DEV Community: S M Hozaifa Hossain</title>
      <link>https://dev.to/hozaifa1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hozaifa1"/>
    <language>en</language>
    <item>
      <title>How I cut CNN inference energy 915x to win the Siemens EDA HLS Hackathon 2026</title>
      <dc:creator>S M Hozaifa Hossain</dc:creator>
      <pubDate>Wed, 18 Nov 2026 16:32:49 +0000</pubDate>
      <link>https://dev.to/hozaifa1/how-i-cut-cnn-inference-energy-915x-to-win-the-siemens-eda-hls-hackathon-2026-jll</link>
      <guid>https://dev.to/hozaifa1/how-i-cut-cnn-inference-energy-915x-to-win-the-siemens-eda-hls-hackathon-2026-jll</guid>
      <description>&lt;p&gt;I won first place in the Siemens EDA Roadside Recognition Using HLS Hackathon 2026 with a small image-recognition chip design that uses 7.51 nJ per inference. The starting reference design used 6,877 nJ, so mine uses 915 times less energy. It scored 95.3% accuracy, just above the contest's 95% minimum.&lt;/p&gt;

&lt;h2&gt;
  
  
  What was the Siemens EDA HLS Hackathon 2026?
&lt;/h2&gt;

&lt;p&gt;High-level synthesis (HLS) turns C++ code into a hardware design. Siemens EDA ran this contest through its HLS Academy from 13 July to 15 October 2026. The rules call it the Accelerating Inferencing Using HLS Hackathon, and the 2026 edition was titled Roadside Recognition Using HLS.&lt;/p&gt;

&lt;p&gt;Each entrant built a hardware accelerator for a convolutional neural network (CNN). A CNN is a type of model used for image recognition. This one had to sort 20 by 20 pixel grayscale images into ten classes, including car, cyclist, pedestrian and traffic light. The lowest energy per inference won. One inference means classifying one image.&lt;/p&gt;

&lt;p&gt;A design only counted if it met three limits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;accuracy above 95%&lt;/li&gt;
&lt;li&gt;under 20 ms per inference&lt;/li&gt;
&lt;li&gt;area within 10,000,000 µm²&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My entry, ROUNDING ERROR, finished first of 24 ranked entries at 7.513 nJ. Second place was 8.333 nJ. The &lt;a href="https://hls.academy/roadside-recognition-using-hls-hackathon/" rel="noopener noreferrer"&gt;final leaderboard&lt;/a&gt; is on the HLS Academy site.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does the hackathon design flow work?
&lt;/h2&gt;

&lt;p&gt;Every full run went through the same five steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A Python script trains the CNN in Keras on 2,267 labeled images.&lt;/li&gt;
&lt;li&gt;The open-source tool hls4ml converts the trained model into C++ with fixed-point numbers.&lt;/li&gt;
&lt;li&gt;Siemens Catapult synthesizes that C++ into a hardware design.&lt;/li&gt;
&lt;li&gt;A simulation runs the hardware on ten images and records the time.&lt;/li&gt;
&lt;li&gt;Siemens PowerPro calculates the power. Energy is power multiplied by time.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Accuracy comes from 190 separate test images. All of these results come from simulation and power analysis.&lt;/p&gt;

&lt;p&gt;I also tried QKeras, a library that trains a model with its final number widths in mind. QKeras layers took 2.2 times as many clock cycles in my tests, so the winning design uses plain Keras.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where did the 915x energy reduction come from?
&lt;/h2&gt;

&lt;p&gt;Power fell about 20 times and run time fell about 45 times. Multiplied together, those give the 915x result.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Measure&lt;/th&gt;
&lt;th&gt;Reference design&lt;/th&gt;
&lt;th&gt;Final design&lt;/th&gt;
&lt;th&gt;Change&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Energy per inference&lt;/td&gt;
&lt;td&gt;6,877.2 nJ&lt;/td&gt;
&lt;td&gt;7.5134 nJ&lt;/td&gt;
&lt;td&gt;915x lower&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Power&lt;/td&gt;
&lt;td&gt;66,670 µW&lt;/td&gt;
&lt;td&gt;3,310.59 µW&lt;/td&gt;
&lt;td&gt;20x lower&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Time per inference&lt;/td&gt;
&lt;td&gt;103.15 µs&lt;/td&gt;
&lt;td&gt;2.27 µs&lt;/td&gt;
&lt;td&gt;45x shorter&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Area&lt;/td&gt;
&lt;td&gt;1,203,218 µm²&lt;/td&gt;
&lt;td&gt;60,946 µm²&lt;/td&gt;
&lt;td&gt;20x smaller&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Accuracy&lt;/td&gt;
&lt;td&gt;97.9%&lt;/td&gt;
&lt;td&gt;95.3%&lt;/td&gt;
&lt;td&gt;2.6 points lower&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The next table shows the main steps between those two designs. A filter is one feature detector in a convolution layer. The datapath width is the number of bits used for values moving through the network. The reuse factor sets how many multiplications share one hardware multiplier.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step&lt;/th&gt;
&lt;th&gt;Change&lt;/th&gt;
&lt;th&gt;Energy (nJ)&lt;/th&gt;
&lt;th&gt;Accuracy&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Reference design with 32-bit numbers&lt;/td&gt;
&lt;td&gt;6,877.2&lt;/td&gt;
&lt;td&gt;97.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Smaller kernels and fewer filters&lt;/td&gt;
&lt;td&gt;2,705.8&lt;/td&gt;
&lt;td&gt;98.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;18-bit datapath and 16-bit weights&lt;/td&gt;
&lt;td&gt;1,423.9&lt;/td&gt;
&lt;td&gt;98.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Reuse factor 1 on both convolution layers&lt;/td&gt;
&lt;td&gt;80.9&lt;/td&gt;
&lt;td&gt;98.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;Reuse factor 9 on the second convolution&lt;/td&gt;
&lt;td&gt;61.8&lt;/td&gt;
&lt;td&gt;98.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Fewer filters, 13-bit datapath and 12-bit weights&lt;/td&gt;
&lt;td&gt;31.3&lt;/td&gt;
&lt;td&gt;96.8%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;8-bit datapath and 7-bit weights&lt;/td&gt;
&lt;td&gt;17.4&lt;/td&gt;
&lt;td&gt;96.8%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;Hidden dense layer removed, 6-bit datapath&lt;/td&gt;
&lt;td&gt;12.0&lt;/td&gt;
&lt;td&gt;95.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;One convolution layer only&lt;/td&gt;
&lt;td&gt;9.2&lt;/td&gt;
&lt;td&gt;95.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;Two convolutions again, with a thin first layer&lt;/td&gt;
&lt;td&gt;8.34&lt;/td&gt;
&lt;td&gt;95.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;td&gt;One filter in the first layer, 7-bit weights&lt;/td&gt;
&lt;td&gt;7.51&lt;/td&gt;
&lt;td&gt;95.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Why did a reuse factor of 1 cut energy so much?
&lt;/h2&gt;

&lt;p&gt;The biggest single drop came from changing both convolution layers from a reuse factor of 100 to 1. Energy fell 17.6 times, from 1,423.9 nJ to 80.9 nJ.&lt;/p&gt;

&lt;p&gt;Power rose 2.3 times, from 15,358 µW to 35,360 µW, because each multiplication now had its own hardware. Run time fell 40.5 times, from 92.7 µs to 2.29 µs. Since energy is power multiplied by time, the faster design used far less energy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why did one filter in the first layer work best?
&lt;/h2&gt;

&lt;p&gt;The first convolution reads the whole image and produces a 16 by 16 output. It and the stages right after it handle the most data, so each filter there is expensive. My final design has one filter in that layer. A pooling step then shrinks the output to 8 by 8.&lt;/p&gt;

&lt;p&gt;The second convolution works on that smaller map, so its 12 filters cost much less. This thin-then-wide shape beat every single-convolution design that passed the accuracy limit.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;Final value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Datapath&lt;/td&gt;
&lt;td&gt;6 bits, 2 fractional&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Weights&lt;/td&gt;
&lt;td&gt;7 bits, 5 fractional&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Saturation and rounding&lt;/td&gt;
&lt;td&gt;On&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;First convolution&lt;/td&gt;
&lt;td&gt;Kernel 5, 1 filter, pool 2, reuse 1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Second convolution&lt;/td&gt;
&lt;td&gt;Kernel 5, 12 filters, pool 1, reuse 20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dense layers&lt;/td&gt;
&lt;td&gt;One final layer, reuse 240&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Why was 95% accuracy hard to keep at 6 bits?
&lt;/h2&gt;

&lt;p&gt;The flow feeds raw pixel values from 0 to 255 into the hardware. A 6-bit number with 2 fractional bits cannot go above 7.75, so any brighter pixel gets clipped to that maximum. The network ends up seeing something close to a black-and-white version of the image.&lt;/p&gt;

&lt;p&gt;Clipping made accuracy jump unpredictably between neighboring settings, so I tested full grids of bit widths. Rounding shows how sensitive the design was. Turning it off on the final design dropped accuracy to 21.6%.&lt;/p&gt;

&lt;p&gt;The final design got 181 of 190 test images right. One fewer would have been 94.7%, below the limit. Each image moves the score by 0.53 points on a test set this small, so 95.3% is a narrow pass.&lt;/p&gt;

&lt;h2&gt;
  
  
  How many experiments did it take?
&lt;/h2&gt;

&lt;p&gt;I logged 365 full runs between 7 September and 10 October 2026, all at the contest's 4 ns clock. A full run took roughly 10 to 35 minutes. An accuracy-only check took 1 to 2 minutes, so I used those in large batches to filter designs first.&lt;/p&gt;

&lt;p&gt;My run of the unmodified reference design measured 6,877.2 nJ, and one leaderboard entry sat at 6,878 nJ, which told me my setup matched the organizers' scoring.&lt;/p&gt;

&lt;h2&gt;
  
  
  What would I try next?
&lt;/h2&gt;

&lt;p&gt;My target was 6.0 nJ, and I stopped at 7.51 nJ. Reaching 6.0 nJ would need total power of about 2,700 µW. Designs of this shape already spend about 2,080 µW before the second convolution and the dense layer. The largest parts are the FIFO buffers between layers (about 600 µW), the first convolution (about 540 µW) and the softmax output layer (478 µW).&lt;/p&gt;

&lt;p&gt;The contest settings could not remove those blocks. With access to the full flow, I would start by replacing the softmax output with a simple largest-value selector and using fewer FIFO buffers. I have not tested either change. I would also measure accuracy on a much larger image set, because 190 images make it hard to separate a real gain from noise.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://hozaifa.dev/about" rel="noopener noreferrer"&gt;S M Hozaifa Hossain&lt;/a&gt; is a semiconductor device and neuromorphic hardware researcher from Bangladesh, an EEE graduate of the University of Dhaka (2026) and a CREST 2027 Research Fellow at Silicon River Bangladesh.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>hardware</category>
      <category>machinelearning</category>
      <category>cpp</category>
      <category>python</category>
    </item>
  </channel>
</rss>
