<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://afondiel.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://afondiel.github.io/" rel="alternate" type="text/html" /><updated>2026-03-14T16:10:56+00:00</updated><id>https://afondiel.github.io/feed.xml</id><title type="html">Afonso Diela - Edge AI Engineer</title><subtitle>Afonso Diela, Edge AI Engineer specializing in optimizing and deploying computer vision solutions for autonomous systems, healthcare, smart cities, and more.</subtitle><author><name>Afonso Diela</name></author><entry><title type="html">2025 Edge AI Year in Review</title><link href="https://afondiel.github.io/posts/2025-Edge-AI-Year-in-Review/" rel="alternate" type="text/html" title="2025 Edge AI Year in Review" /><published>2025-12-31T00:00:00+00:00</published><updated>2025-12-31T00:00:00+00:00</updated><id>https://afondiel.github.io/posts/2025-Edge-AI-Year-in-Review</id><content type="html" xml:base="https://afondiel.github.io/posts/2025-Edge-AI-Year-in-Review/"><![CDATA[]]></content><author><name>Afonso Diela</name></author><category term="posts" /><category term="edge-ai" /><category term="ai-efficiency" /><category term="edge-computing" /><summary type="html"><![CDATA[Traditional cloud-based AI approaches are increasingly limited by high latency, bandwidth constraints, and privacy risks, creating bottlenecks for real-time applications like autonomous vehicles and healthcare systems.]]></summary></entry><entry><title type="html">The Next AI Frontier is at the Edge</title><link href="https://afondiel.github.io/posts/the-next-ai-frontier-is-at-the-edge/" rel="alternate" type="text/html" title="The Next AI Frontier is at the Edge" /><published>2024-12-30T00:00:00+00:00</published><updated>2024-12-30T00:00:00+00:00</updated><id>https://afondiel.github.io/posts/the-next-ai-frontier-is-at-the-edge</id><content type="html" xml:base="https://afondiel.github.io/posts/the-next-ai-frontier-is-at-the-edge/"><![CDATA[<p style="text-align: center;"> <img loading="lazy" alt="Edge AI" decoding="async" class="aligncenter size-full" src="/assets/images/blog-posts/edge-ai/101/edge-ai-cover.webp" style="max-width: 100%; height: auto;" width="1280" height="720" /></p>

<p>The year 2024 was pivotal for AI, marked by breakthroughs not just in generative models but also in deploying efficient, small-scale models on edge devices. As AI systems grow in complexity, they face a fundamental challenge: balancing performance with hardware constraints. For example, based on <a href="https://semianalysis.com/2023/07/10/gpt-4-architecture-infrastructure/">current</a> knowledge and analysis, OpenAI’s GPT-4 is estimated to require over 1,000 petaFLOPS of compute. In comparison, edge devices typically operate at less than 1 TFLOP—sometimes only reaching the range of gigaFLOPS.</p>

<p>Traditional cloud-based AI approaches are increasingly limited by high latency, bandwidth constraints, and privacy risks, creating bottlenecks for real-time applications like autonomous vehicles and healthcare systems. These limitations demand a shift toward <strong>Edge AI</strong>, which processes data locally on devices, unlocking real-time capabilities while addressing privacy and efficiency concerns.</p>

<p>This article explores the engineering foundations of Edge AI, focusing on hardware optimizations, deployment pipelines, and real-world computer vision applications. By tackling challenges in scalability, efficiency, and security, Edge AI is poised to unlock the next frontier in artificial intelligence.</p>

<h2 id="introduction-to-edge-ai"><strong>Introduction to Edge AI</strong></h2>

<p><strong>Edge AI</strong> involves processing data locally on devices, reducing inference cost, offering faster decision-making, and enhanced security.</p>

<p><strong>The Four Key Advantages of Edge AI</strong>:</p>
<ul>
  <li><strong>Cost-Effective</strong>: Reduces recurring expenses by minimizing reliance on cloud infrastructure.</li>
  <li><strong>Efficient</strong>: Accelerates decision-making and improves energy efficiency by utilizing local computational power.</li>
  <li><strong>Private &amp; Secure</strong>: Processes data locally, reducing exposure to breaches and maintaining user privacy.</li>
  <li><strong>Personalized</strong>: Supports adaptive learning and customization without requiring external data transfers.</li>
</ul>

<h3 id="cloud-vs-edge-computing-vs-edge-ai"><strong>Cloud vs. Edge Computing vs. Edge AI</strong></h3>

<ul>
  <li><strong>Cloud Computing</strong>: Centralized systems process data remotely, requiring high-bandwidth communication with servers.</li>
  <li><strong>Edge Computing</strong>: Decentralizes processing by handling data closer to its source, minimizing transmission overhead.</li>
  <li>
    <p><strong>Edge AI</strong>: Combines edge computing with artificial intelligence, enabling intelligent, localized decision-making on devices like IoT sensors, drones, and smartphones.</p>
  </li>
  <li>Additional Resources: <a href="https://github.com/afondiel/computer-science-notebook/tree/master/core/systems/edge-computing/edge-ai/concepts">Edge AI Core Concepts</a></li>
</ul>

<h3 id="why-edge-ai-is-becoming-crucial"><strong>Why Edge AI is Becoming Crucial</strong></h3>

<p style="text-align: center;"> <img loading="lazy" alt="CrowdStrike Global Outage" decoding="async" class="aligncenter size-full" src="/assets/images/blog-posts/edge-ai/101/BSOD-1.webp" style="max-width: 100%; height: auto;" width="1280" height="720" /> <p style="text-align: center;">CrowdStrike Global Outage (Source: <a href="https://www.transputec.com/blogs/crowdstrike-outage-the-update/">Link</a>)</p></p>

<p>Cloud computing has long powered AI systems, but its inherent limitations—latency, bandwidth dependency, and vulnerability to outages—pose critical challenges for real-time, mission-critical applications. These shortcomings are becoming increasingly apparent as systems scale.</p>

<p>Consider the <strong><a href="https://en.wikipedia.org/wiki/2024_CrowdStrike-related_IT_outages">2024 CrowdStrike outage</a></strong>, which rendered 8.5 million Windows systems unusable with the infamous “Blue Screen of Death.” Major companies, including airlines, financial institutions, and even the London Stock Exchange, faced significant disruptions, collectively incurring an estimated <strong>$10 billion</strong> in damages. Similarly, a <strong><a href="https://x.com/OpenAI/status/1872387514960601184?t=YJTGgpNUFIU_W8uRKAVnbQ&amp;s=19">global ChatGPT outage</a></strong> caused widespread service interruptions, underscoring the fragility of cloud-dependent infrastructures.</p>

<p>These incidents highlight the risks of over-reliance on centralized systems for AI deployment. <strong>Edge AI mitigates these risks by processing data locally, enabling real-time responses, reducing reliance on network stability, and enhancing data privacy.</strong> For use cases like autonomous vehicles or industrial automation, where latency and reliability are non-negotiable, Edge AI provides a robust alternative to traditional cloud solutions.</p>

<h2 id="key-components-of-edge-ai"><strong>Key Components of Edge AI</strong></h2>

<h3 id="hardware-requirements"><strong>Hardware Requirements</strong></h3>

<p><strong>Optimized Hardware Platforms</strong>: Edge devices rely on specialized processors like Vision Processing Units (VPUs) and Neural Processing Units (NPUs). These components enable high-performance AI computation within the constraints of low power budgets, accommodating diverse workloads ranging from lightweight inference to compute-intensive vision tasks.</p>

<p><strong>Model Optimization Techniques</strong>: Running AI models on resource-constrained devices requires aggressive optimization. Techniques such as <strong>quantization</strong> (lowering precision without losing accuracy) and <strong>pruning</strong> (removing unnecessary model layers) are critical. These approaches reduce computational load while maintaining operational performance.</p>

<p><strong>Energy Efficiency</strong>: Power constraints are a defining challenge in edge environments. Energy-efficient AI models are vital for extending battery life in devices like wearables and IoT sensors. This is achieved through hardware-software co-design, ensuring that AI models utilize minimal power during inference without compromising performance.</p>

<ul>
  <li>Additional Resources: <a href="https://github.com/afondiel/Edge-AI-Platforms">Edge-AI Hardware Platforms</a></li>
</ul>

<h3 id="end-to-end-edge-ai-stack"><strong>End-to-End Edge AI Stack</strong></h3>

<p style="text-align: center;">
  <img loading="lazy" decoding="async" class="aligncenter size-full" src="/assets/images/blog-posts/edge-ai/101/qualcomm_ai_stack.png" style="max-width: 100%; height: auto;" width="1280" height="720" />
<p style="text-align: center;">The Qualcomm AI Stack. (Source: <a href="https://www.qualcomm.com/developer/artificial-intelligence">Link</a>)</p>
</p>

<p>The Edge AI stack comprises layers that work together to deliver optimized performance for real-world applications:</p>

<table>
  <thead>
    <tr>
      <th><strong>Layer</strong></th>
      <th><strong>Components</strong></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>Applications</strong></td>
      <td>Object detection, image segmentation, landmark detection, image generation, speech recognition</td>
    </tr>
    <tr>
      <td><strong>AI Frameworks and Runtimes</strong></td>
      <td>TensorFlow, PyTorch, ONNX, Qualcomm Neural Processing SDK, AI Engine Direct, ONNX Runtime, Direct ML, LiteRT</td>
    </tr>
    <tr>
      <td><strong>Developer Tools</strong></td>
      <td>Profilers, debuggers, compilers, math libraries, SoC accelerators, emulation support</td>
    </tr>
    <tr>
      <td><strong>System Software</strong></td>
      <td>SoC and accelerator drivers, system interfaces, virtualization layers</td>
    </tr>
    <tr>
      <td><strong>Operating Systems</strong></td>
      <td>Android, Windows, Linux, Zephyr, Ubuntu, QNX</td>
    </tr>
    <tr>
      <td><strong>Hardware</strong></td>
      <td>CPU, GPU, NPU, sensing hubs</td>
    </tr>
  </tbody>
</table>

<ul>
  <li>Additional Resources: <a href="https://github.com/afondiel/computer-science-notebook/blob/master/core/systems/edge-computing/edge-ai/concepts/deployment/end-to-end-edge-ai-deployment-pipeline.md">End-to-End Edge AI Deployment Pipeline</a>, <a href="https://github.com/afondiel/computer-science-notebook/tree/master/core/systems/edge-computing/edge-ai/lab/examples">Edge AI Frameworks</a>, <a href="https://github.com/afondiel/Edge-AI-Model-Zoo">Edge AI Model Zoo</a></li>
</ul>

<h2 id="applications-and-use-cases"><strong>Applications and Use Cases</strong></h2>

<p>Edge AI has become indispensable across industries where real-time decision-making, efficiency, and privacy are critical. Below are key sectors leveraging Edge AI for transformative impact:</p>

<h3 id="smart-devices-and-wearables"><strong>Smart Devices and Wearables</strong></h3>

<p>Edge AI powers real-time data processing in devices like smartwatches and fitness trackers, enabling precise health monitoring and personalized feedback. By processing data locally, these devices eliminate latency and enhance privacy, making them reliable tools for fitness enthusiasts and medical monitoring alike.</p>

<h3 id="healthcare-monitoring"><strong>Healthcare Monitoring</strong></h3>

<p>Edge AI facilitates continuous, real-time patient monitoring through wearable sensors and connected medical devices. By detecting anomalies early, such as irregular heartbeats or oxygen saturation drops, these systems support timely interventions and improve patient outcomes without requiring cloud dependency.</p>

<h3 id="industrial-iot-and-manufacturing"><strong>Industrial IoT and Manufacturing</strong></h3>

<p>In manufacturing, Edge AI transforms operational efficiency through predictive maintenance and real-time quality control. Sensors on production equipment analyze data on-site, identifying potential failures before they occur. Meanwhile, edge-based defect detection ensures product quality, reducing waste and operational downtime.</p>

<h3 id="autonomous-vehicles"><strong>Autonomous Vehicles</strong></h3>

<p>Self-driving vehicles demand split-second decision-making. Edge AI processes high volumes of sensor data—such as lidar, radar, and cameras—directly within the vehicle, eliminating the delays of cloud communication. This ensures reliable navigation, collision avoidance, and adaptability in dynamic environments, critical for passenger safety.</p>

<h2 id="case-study-real-time-segmentation-deployment-using-qualcomm-ai-hub"><strong>Case Study: Real-Time Segmentation Deployment Using Qualcomm AI Hub</strong></h2>

<p style="text-align: center;"> <img loading="lazy" decoding="async" class="aligncenter size-full" src="/assets/images/blog-posts/edge-ai/101/ffnet-seg.png" style="max-width: 100%; height: auto;" width="1280" height="720" /></p>

<p>This case study demonstrates how to deploy a semantic segmentation model optimized for edge devices using <a href="https://aihub.qualcomm.com/">Qualcomm AI Hub</a> in just four simple steps. The example leverages <strong>FFNet</strong>, a model tailored for efficient edge-based semantic segmentation, tested on the <a href="https://www.cityscapes-dataset.com/">Cityscapes dataset</a>.</p>

<p>Applications like <strong>autonomous driving</strong>, <strong>augmented reality</strong>, and <strong>mobile robotics</strong> require real-time segmentation capabilities, making this deployment pipeline crucial for performance-critical scenarios.</p>

<h3 id="deployment-steps"><strong>Deployment Steps</strong></h3>

<p><a href="https://colab.research.google.com/github/afondiel/afondiel.github.io/blob/main/assets/images/blog-posts/edge-ai/101/lab/Deploy_RT_Segmentation_Model_On_Real_Device.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open notebook in Colab" /></a></p>

<ol>
  <li><strong>Configure Qualcomm AI Hub</strong><br />
Begin by setting up your Qualcomm AI Hub environment for deployment:
    <div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">import</span> <span class="nn">qai_hub</span>
<span class="n">ai_hub_api_token</span> <span class="o">=</span> <span class="n">get_ai_hub_api_token</span><span class="p">()</span>
<span class="err">!</span><span class="n">qai</span><span class="o">-</span><span class="n">hub</span> <span class="n">configure</span> <span class="o">--</span><span class="n">api_token</span> <span class="err">$</span><span class="n">ai_hub_api_token</span>
</code></pre></div>    </div>
  </li>
  <li><strong>Load and Summarize the Model</strong><br />
Let’s load the pre-trained FFNet model and analyzing its architecture for key metrics:
    <div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">from</span> <span class="nn">qai_hub_models.models.ffnet_40s</span> <span class="kn">import</span> <span class="n">Model</span>
<span class="n">model</span> <span class="o">=</span> <span class="n">Model</span><span class="p">.</span><span class="n">from_pretrained</span><span class="p">()</span>

<span class="n">input_shape</span> <span class="o">=</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">1024</span><span class="p">,</span> <span class="mi">2048</span><span class="p">)</span>
<span class="n">stats</span> <span class="o">=</span> <span class="n">summary</span><span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="n">input_size</span><span class="o">=</span><span class="n">input_shape</span><span class="p">,</span> <span class="n">col_names</span><span class="o">=</span><span class="p">[</span><span class="s">"num_params"</span><span class="p">,</span> <span class="s">"mult_adds"</span><span class="p">])</span>
</code></pre></div>    </div>
  </li>
  <li><strong>Evaluate FFNet Variants</strong><br />
We can test high-resolution and low-resolution variants of FFNet to determine the best fit for your device’s constraints:
    <div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># Example: High-resolution variant
</span><span class="kn">from</span> <span class="nn">qai_hub_models.models.ffnet_40s</span> <span class="kn">import</span> <span class="n">Model</span>

<span class="c1"># Example: Low-resolution variant
# from qai_hub_models.models.ffnet_78s_lowres import Model
</span></code></pre></div>    </div>
  </li>
  <li><strong>Benchmark Performance</strong><br />
We run cloud-based and on-device simulations to benchmark the model:
    <div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># Cloud-based demo
</span><span class="o">%</span><span class="n">run</span> <span class="o">-</span><span class="n">m</span> <span class="n">qai_hub_models</span><span class="p">.</span><span class="n">models</span><span class="p">.</span><span class="n">ffnet_40s</span><span class="p">.</span><span class="n">demo</span>

<span class="c1"># Simulate edge deployment
</span><span class="o">%</span><span class="n">run</span> <span class="o">-</span><span class="n">m</span> <span class="n">qai_hub_models</span><span class="p">.</span><span class="n">models</span><span class="p">.</span><span class="n">ffnet_40s</span><span class="p">.</span><span class="n">export</span> <span class="o">--</span> <span class="o">--</span><span class="n">device</span> <span class="s">"Xiaomi 12 Pro"</span>
</code></pre></div>    </div>
  </li>
  <li><strong>Optimize and Deploy</strong><br />
Finally, we profile the model for edge execution, optimize it for hardware constraints, and deploy it to the device.
    <div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># Compile for real device deployment
</span><span class="o">%</span><span class="n">run</span> <span class="o">-</span><span class="n">m</span> <span class="n">qai_hub_models</span><span class="p">.</span><span class="n">models</span><span class="p">.</span><span class="n">ffnet_40s</span><span class="p">.</span><span class="n">demo</span> <span class="o">--</span> <span class="o">--</span><span class="n">device</span> <span class="s">"Xiaomi 12 Pro"</span> <span class="o">--</span><span class="n">on</span><span class="o">-</span><span class="n">device</span>
</code></pre></div>    </div>
    <h3 id="outcome-analysis-and-interpretation">Outcome: Analysis and Interpretation</h3>
  </li>
</ol>

<p style="text-align: center;"> <img loading="lazy" decoding="async" class="aligncenter size-full" src="/assets/images/blog-posts/edge-ai/101/lab/job_qai_hub.png" style="max-width: 100%; height: auto;" width="1280" height="720" /><p style="text-align: center;">FFNet_40s profiling job on  <a href="https://aihub.qualcomm.com">Qualcomm AI Hub</a></p></p>

<p>This step-by-step pipeline demonstrates the trade-offs between performance and efficiency in cloud vs. edge deployments. By optimizing models like FFNet, you can achieve robust, real-time inference capabilities on resource-constrained devices. Below is a summary of the model’s performance on the target platforms for a single inference.</p>

<table>
  <thead>
    <tr>
      <th>Target</th>
      <th>Inference time (ms)</th>
      <th>Peak Memory Usage (MB)</th>
      <th>Interpretation</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Cloud Server</td>
      <td>0.005*</td>
      <td>1777*</td>
      <td>The cloud server provides the baseline performance.</td>
    </tr>
    <tr>
      <td>Hosted Device</td>
      <td>60.0</td>
      <td>7 - 22</td>
      <td>The hosted device has higher inference time and Peak Memory Usage compared to the cloud server.</td>
    </tr>
    <tr>
      <td>Physical Device</td>
      <td>58.6</td>
      <td>5 - 23</td>
      <td>The physical device demonstrates similar inference time and peak memory usage compared to the hosted device, highlighting a strong correlation between the simulation and the real device.</td>
    </tr>
  </tbody>
</table>

<p>Check out the full notebook code: <a href="https://github.com/afondiel/afondiel.github.io/blob/main/assets/images/blog-posts/edge-ai/101/lab/Deploy_RT_Segmentation_Model_On_Real_Device.ipynb">Here</a></p>

<h2 id="challenges-and-limitations"><strong>Challenges and Limitations</strong></h2>

<p style="text-align: center;"> <img loading="lazy" alt="The model efficiency equation - Brainchip" decoding="async" class="aligncenter size-full" src="/assets/images/blog-posts/edge-ai/101/the-model-efficiency-eq-brainchip.png" style="max-width: 100%; height: auto;" width="1280" height="720" /> <p style="text-align: center;">The model efficiency equation - <a href="https://brainchip.com/">BrainChip</a></p></p>

<h3 id="computing-power-constraints"><strong>Computing Power Constraints</strong></h3>

<p>Unlike centralized cloud servers with virtually unlimited resources, edge devices operate under tight power and hardware constraints. Running compute-intensive AI models on devices with limited processing power often requires significant trade-offs in latency and throughput.</p>

<h3 id="model-accuracy-vs-efficiency"><strong>Model Accuracy vs. Efficiency</strong></h3>

<p>Striking a balance between accuracy and efficiency remains a core challenge in edge deployments. High-accuracy models often demand greater computational resources than edge devices can provide. Techniques such as <strong>knowledge distillation</strong>, <strong>pruning</strong>, and <strong>quantization</strong> are essential to deliver models that are both effective and deployable in resource-constrained environments.</p>

<h3 id="security-concerns"><strong>Security Concerns</strong></h3>

<p>Edge AI’s localized processing enhances privacy by keeping sensitive data on devices, but it also introduces new vulnerabilities. Threats such as firmware attacks, unauthorized access, and malware targeting edge endpoints can compromise the integrity of deployed systems. Robust security measures, including encryption, hardware-based security modules, and regular updates, are critical to safeguarding edge AI deployments.</p>

<h2 id="future-developments"><strong>Future Developments</strong></h2>

<p>Edge AI is evolving rapidly, driven by advancements in hardware, software, and deployment paradigms. These developments are shaping the future of real-world AI applications.</p>

<h3 id="emerging-technologies"><strong>Emerging Technologies</strong></h3>

<p style="text-align: center;"> <img loading="lazy" alt="brainchip" decoding="async" class="aligncenter size-full" src="/assets/images/blog-posts/edge-ai/101/brainchip_ces_2022_clean.png" style="max-width: 100%; height: auto;" width="1280" height="720" /> <p style="text-align: center;"><a href="https://brainchip.com/akida-foundations/">BrainChip</a> Akida: An Event-Based Neuromorphic AI Processor</p></p>

<p>The next generation of Edge AI systems will benefit from co-designed AI models and hardware accelerators, enabling highly efficient end-to-end deployments. Startups and industry leaders alike are exploring novel methods to reduce costs and power consumption, critical for scaling edge solutions.</p>

<p>One promising direction is <strong>federated learning</strong>, which trains AI models across distributed devices while keeping data localized. This paradigm not only enhances privacy but also minimizes the need for large-scale data transfers.</p>

<ul>
  <li>Additional Resources: <a href="https://github.com/afondiel/computer-science-notebook/blob/master/core/ai-ml/ml-notes/ml-optimization/federated-learning/federated-learning-edge-ai-basics-notes.md">Federated Learning</a></li>
</ul>

<h3 id="industry-trends"><strong>Industry Trends</strong></h3>

<p>Major players are pivoting their strategies to capitalize on the growing importance of Edge AI:</p>
<ul>
  <li><strong><a href="https://www.intel.com/content/www/us/en/artificial-intelligence/overview.html">Intel</a></strong>: Introduced <a href="https://www.intel.com/content/www/us/en/developer/tools/tiber/ai-cloud.html">Tiber AI Cloud</a> to bridge cloud-scale development with edge deployment.</li>
  <li><strong><a href="https://www.nvidia.com/en-us/edge-computing/">NVIDIA</a></strong>: Launched the <a href="https://www.nvidia.com/en-us/ai/">NIM</a> platform, offering full-stack optimization for edge AI computation.</li>
  <li><strong><a href="https://ai.google.dev/edge">Google</a></strong>: Rebranded TensorFlow Lite as <a href="https://developers.googleblog.com/en/tensorflow-lite-is-now-litert/">LiteRT</a>, simplifying deployment for mobile, web, and embedded edge applications.</li>
  <li>
    <p><strong><a href="https://www.qualcomm.com/research/artificial-intelligence">Qualcomm</a></strong>: Expanded its <a href="https://www.qualcomm.com/news/releases/2024/02/qualcomm-continues-to-bring-the-generative-ai-revolution-to-devi#:~:text=Qualcomm%20AI%20Hub%20offers%2075,on%20Hugging%20Face%20and%20GitHub.">AI Hub</a> with over 75 optimized models for on-device applications.</p>
  </li>
  <li>Further Reading: <a href="https://github.com/afondiel/computer-science-notebook/tree/master/core/systems/edge-computing/edge-ai/industry-applications">Edge AI Players &amp; Ecosystems</a></li>
</ul>

<h2 id="conclusion"><strong>Conclusion</strong></h2>

<p>Edge AI is reshaping how artificial intelligence integrates into our daily lives and industries. By moving computation closer to the source, it overcomes the limitations of cloud computing, enabling real-time, efficient, and secure AI applications.</p>

<p>The journey of Edge AI is just beginning. With advancements in hardware efficiency, federated learning, and robust deployment pipelines, the potential to unlock transformative applications in healthcare, automotive, and IoT is immense. As we refine this technology, Edge AI will stand at the forefront of intelligent systems for years to come.</p>

<h2 id="references"><strong>References</strong></h2>

<ul>
  <li>[1] <a href="https://mlsysbook.ai/">Machine Learning Systems - Principles and Practices of Engineering Artificially Intelligent Systems, Vijay Janapa Reddi</a></li>
  <li>[2] <a href="https://semianalysis.com/2023/07/10/gpt-4-architecture-infrastructure/">GPT-4 Architecture, Infrastructure, Training Dataset, Costs, Vision, MoE - Semianalysis</a></li>
  <li>[3] <a href="https://openai.com/index/ai-and-compute/">AI and compute, 2018 - OpenAI</a></li>
  <li>[4] <a href="https://resources.nvidia.com/en-us-fleet-command/what-is-edge-computing">What Is Edge Computing? - NVIDIA</a></li>
  <li>[5] <a href="https://brainchip.com/akida-foundations/">BrainChip Akida Platforms</a></li>
</ul>]]></content><author><name>Afonso Diela</name></author><category term="posts" /><category term="edge-ai" /><category term="on-device-ai" /><category term="segmentation" /><category term="optimization" /><category term="autonomous systems" /><summary type="html"><![CDATA[Traditional cloud-based AI approaches are increasingly limited by high latency, bandwidth constraints, and privacy risks, creating bottlenecks for real-time applications like autonomous vehicles and healthcare systems. These limitations demand a shift toward **Edge AI**, which processes data locally on devices, unlocking real-time capabilities while addressing privacy and efficiency concerns.]]></summary></entry><entry><title type="html">The Top 5 Skills I Learned From The University of Toronto Self-Driving Cars Specialization (2023)</title><link href="https://afondiel.github.io/posts/self-driving-cars-specialization-U-of-T-review/" rel="alternate" type="text/html" title="The Top 5 Skills I Learned From The University of Toronto Self-Driving Cars Specialization (2023)" /><published>2023-09-27T00:00:00+01:00</published><updated>2023-09-27T00:00:00+01:00</updated><id>https://afondiel.github.io/posts/self-driving-cars-specialization-U-of-T-review</id><content type="html" xml:base="https://afondiel.github.io/posts/self-driving-cars-specialization-U-of-T-review/"><![CDATA[<p><img src="https://miro.medium.com/v2/resize:fit:700/1*xhjICZk3fsN1mxvlCkP9NQ.jpeg" alt="Image 48" /></p>

<p>Autonomoose — The University of Toronto-Waterloo self-driving car research platform (source: <a href="https://www.autonomoose.net/">link</a>).</p>

<p>I recently completed the <a href="https://www.coursera.org/specializations/self-driving-cars">Self-Driving Cars Specialization</a> from the <a href="https://www.utoronto.ca/">University of Toronto</a> on Coursera, and in this article, I’ll highlight the top 5 skills I’ve acquired during this course. But, before diving into that, let me give you the reasons that propelled me to enroll in this program.</p>

<ul>
  <li><strong>A child’s dream</strong></li>
</ul>

<p><a href="https://twitter.com/muntudiela/status/1683560038097383425/photo/1">My passion</a> for cars has been burning brightly since I was a child. My father was a mechanic, and I used to help him in his garage performing some basic tasks such as checking the oil and changing tires. His love for cars and driving inspired me to pursue a career in the automotive industry.</p>

<ul>
  <li><strong>Market Growth</strong></li>
</ul>

<p>I’ve been working for over 5 years now as a software engineer. As the industry pivots to sustainable and data-driven technologies, car brands and OEMs are harnessing high-quality data to create more futuristic transportation. This leads to a growing demand for software engineers specializing in self-driving cars. As a result, market forecasting suggests that by <a href="https://www.mckinsey.com/industries/automotive-and-assembly/our-insights/disruptive-trends-that-will-transform-the-auto-industry/de-DE">2030</a>, up to 15% of new car sales could be fully autonomous, <a href="https://www.mckinsey.com/industries/automotive-and-assembly/our-insights/autonomous-drivings-future-convenient-and-connected">generating $300–400 billion in revenue by 2035</a>.</p>

<ul>
  <li><strong>The potential to save thousands of lives</strong></li>
</ul>

<p>A 2015 study conducted by the National Highway Traffic Safety Administration (<a href="https://www.nhtsa.gov/">NHTSA</a>) revealed that human error was responsible for over 94% of road accidents. A <a href="https://www.nhtsa.gov/press-releases/traffic-crash-death-estimates-2022#:~:text=The%20National%20Highway%20Traffic%20Safety,42%2C939%20fatalities%20reported%20for%202021.">recent projection</a> for 2022 traffic fatalities estimated that 42,795 people died in car crashes in the US and 20,600 in <a href="https://transport.ec.europa.eu/news-events/news/road-safety-eu-fatalities-below-pre-pandemic-levels-progress-remains-too-slow-2023-02-21_en">Europe</a>. Self-driving cars have the potential to reduce these fatalities and make driving safer, more enjoyable, inclusive, and sustainable.</p>

<ul>
  <li><strong>Canada:</strong> <a href="https://www.utoronto.ca/news/artificial-intelligence-u-t"><strong>The “Motherland” of AI</strong></a></li>
</ul>

<p>Finally, I took this course from the <a href="https://www.coursera.org/learn/intro-self-driving-cars">University of Toronto (U of T)</a> due to its prominent reputation in the AI field. <a href="https://www.utoronto.ca/">U of T</a> is home to some of <a href="https://web.cs.toronto.edu/news-events/news/global-news-u-of-t-ai-pioneers-highlighted-as-key-players-in-industry-innovation#:~:text=Tracing%20the%20genesis%20of%20modern,and%20co%2Dfounder%20of%20OpenAI.">the world’s leading AI experts</a>, including <a href="https://awards.acm.org/about/2018-turing">the 2018 ACM Turing Award Laureates</a>, <a href="https://en.wikipedia.org/wiki/Geoffrey_Hinton">Geoffrey Hinton</a>, <a href="https://en.wikipedia.org/wiki/Yann_LeCun">Yann LeCun</a>, and <a href="https://en.wikipedia.org/wiki/Yoshua_Bengio">Yoshua Bengio</a>, who are often referred to as “the godfathers of AI”. But also, the new wave of AI pioneers such as <a href="https://www.linkedin.com/in/ilya-sutskever">Ilya Sutskever</a>, from OpenAI and <a href="https://ca.linkedin.com/in/aidangomez?challengeId=AQGX_X3kft-ZBAAAAYkrEqYuOzk4gM9fyZfLxIIKD68GIbJIcKuEE5E8U1eWlpWdGwIBkLM8u1XCky4f8wDvhw122KeMve_abA&amp;submissionId=f39fb92c-7d45-6f17-f1fd-135212ac747b&amp;challengeSource=AgHCXSnDn5nkBQAAAYkrEvtxKk6jbz9qzjR4ZCt6n5m3WRpyTiOMdp4XJYHvzqE&amp;challegeType=AgHzu-rctg-yoQAAAYkrEvt0la02IgH-YE1E6_Y1nBzhhUSGB_yMOo0&amp;memberId=AgHTfqZibgV7aQAAAYkrEvt3JI-eLP3vTXd65Q66AqroKSM&amp;recognizeDevice=AgF9iogSyI57oQAAAYkrEvt704lkFwbfKFAxAmKIsLlRVtENX_Qr">Aidan Gomez</a>, from <a href="https://cohere.com/">Cohere</a>, who co-wrote the <a href="https://arxiv.org/abs/1706.03762">Transformers paper</a> that led to the birth of Large Language Models (LLMs) such as <a href="https://platform.openai.com/docs/guides/gpt">OpenAI’s GPT</a> models, among others.</p>

<h2 id="course-overview"><strong>Course Overview</strong></h2>

<h2 id="structure-and-contents"><strong>Structure and Contents</strong></h2>

<p>The s<a href="https://www.coursera.org/specializations/self-driving-cars">pecialization</a> consists of 4 modules, each with video lectures, quizzes, and assignments. However, to ensure a comprehensive understanding and alignment with common self-driving car architectures in today’s industry, I have restructured the courses into 5 modules:</p>

<ol>
  <li><strong>Introduction to Self-Driving Cars (‘The Fundamentals’):</strong> gives a comprehensive overview of the state-of-the-art in the autonomous driving industry. It includes a brief history, terminology clarifications, design considerations, safety assessment, as well as the challenges and future of the technology.</li>
  <li><strong>State Estimation and Localization:</strong> teaches topics such as sensors for localization, state estimation methods, sensor fusion, and Kalman filters.</li>
  <li><strong>Environment Perception:</strong> covers how to identify and track objects in the environment using cameras and LiDAR, as well as how to segment objects and create 3D models of the world.</li>
  <li><strong>Motion Planning:</strong> teaches how to plan safe and efficient paths for self-driving cars, and how to deal with uncertainty and unexpected events</li>
  <li><strong>Control:</strong> covers how to control the actuators of a self-driving car, such as the steering wheel, brakes, and accelerator. As well as how to deal with disturbances and optimize the control system.</li>
</ol>

<h2 id="prerequisites"><strong>Prerequisites</strong></h2>

<p>Building a self-driving car is a complex task that requires expertise across multiple fields, including computer science, linear algebra, statistics, physics, and robotics. Familiarity with simulation tools such as <a href="https://carla.org/">Carla Simulator</a> is also beneficial.</p>

<blockquote>
  <p>Notes: I curated this <a href="https://github.com/afondiel/SDCS-Prerequisites-UofT">awesome list</a>, where you can find all the prerequisites for the course.</p>
</blockquote>

<h2 id="instructors-and-community-forum"><strong>Instructors and community forum</strong></h2>

<p>The instructors are Professor <a href="https://www.trailab.utias.utoronto.ca/stevenwaslander">Steven Waslander</a> and <a href="https://experts.engineering.utoronto.ca/jonathan-kelly">Jonathan Kelly</a>, who have over 30 years of experience in engineering and autonomous robotics research. Industry experts from leading companies such as <a href="https://zoox.com/">Zoox</a> and <a href="https://oxa.tech/">Oxbotica</a> provide real-world insights during the courses. Learners can also join a forum to ask questions and interact with instructors and peers worldwide.</p>

<p>Here are the top 5 skills I’ve learned from this <a href="https://www.coursera.org/specializations/self-driving-cars">specialization</a>.</p>

<h2 id="1-how-to-build-a-self-driving-car-at-scale"><strong>1. How to Build a Self-Driving Car at Scale</strong></h2>

<p>Driving is a challenging task that requires us to sense the world around us and make difficult decisions while navigating a complex environment. Humans are not perfect drivers, and as a result, <a href="https://www.cdc.gov/injury/features/global-road-safety/index.html">1.3 million</a> people die in road traffic crashes each year. Self-driving cars have the potential to reduce these fatalities, but they must outperform humans in every aspect of driving. Building such a system is therefore a complex challenge that must be addressed carefully.</p>

<p>The first stage of the self-driving car design is to define an Operational Design Domain (ODD). The ODD specifies the conditions and environments in which the car is designed to operate. Based on the ODD, we can define three types of driving dynamic tasks (DDTs):</p>

<ul>
  <li><strong>Operational driving</strong>: The car’s ability to control its motion, such as steering, braking, and accelerating.</li>
  <li><strong>Tactical driving</strong>: The car’s ability to detect objects and events that immediately affect the driving task and to react to them appropriately. This is also known as object and event detection and response (OEDR).</li>
  <li><strong>Strategical driving</strong>: the car’s ability to plan how to get from point A to point B and make decisions accordingly.</li>
</ul>

<p>In today’s industry, we use the <a href="https://www.sae.org/">SAE J3016</a> standard to classify the DDTs in terms of driving automation levels.</p>

<p><img src="https://miro.medium.com/v2/resize:fit:700/1*e1DxgG2ziuMepNQoikhiQg.png" alt="Image 49" /></p>

<p><a href="https://www.sae.org/">SAE J3016</a> — the level of driving automation. (source: <a href="https://www.sae.org/">link</a>)</p>

<p>The SAE J3016 standard defines six levels of driving automation, from Level 0 (no driving automation) to Level 5 (full driving automation). The progression moves gradually from driver-assistance features to automated driving features. This allows us to establish the specific roles of the system and the driver in performing the DDT.</p>

<p>The next step is to define the software and hardware components that are needed to meet the automation requirements. These components must comply with safety standards and regulations of the geographic area where the vehicle will operate.</p>

<ul>
  <li><strong>Self-driving car hardware architecture</strong></li>
</ul>

<p><img src="https://miro.medium.com/v2/resize:fit:700/1*we5qxXKVx4MVMNIfH_6rjg.png" alt="Image 50" /></p>

<p>Self-driving car hardware components. (Source: <a href="https://www.coursera.org/learn/intro-self-driving-cars/lecture/LrLty/lesson-1-sensors-and-computing-hardware">link</a>)</p>

<p>A basic self-driving car hardware architecture consists of various sensors collecting environmental and vehicle data, and a central computer. These are two categories of sensors: <strong>exteroceptive</strong>, which captures surroundings (cameras, lidar, radar, and ultrasonic sensors), and <strong>proprioceptive</strong>, which tracks the vehicle itself (IMUs, GNSS/GPS, and wheel odometry).</p>

<p>The central computer is the “brain” of the self-driving car. It is responsible for processing the data from sensors and making driving decisions. Notable computing systems include NVIDIA DRIVE PX/AGX and Intel &amp; Mobileye EyeQ. Some brands, like Waymo and <a href="https://www.autoevolution.com/news/hardware-4-teardown-shows-how-tesla-shifted-resources-toward-the-autopilot-computer-219735.html#">Tesla</a>, develop their unique hardware computer, while others rely on AI chip suppliers like <a href="https://www.autoevolution.com/news/hardware-4-teardown-shows-how-tesla-shifted-resources-toward-the-autopilot-computer-219735.html#">Nvidia, Intel, and AMD</a>, <a href="https://camo.githubusercontent.com/b4b1616a6e53e285a6f3da14668c7437b134daf2ec154e5d77a1cc04467fc597/687474703a2f2f7777312e70727765622e636f6d2f707266696c65732f323031362f30362f30382f31333437323330382f536f757263655f566973696f6e5f53797374656d735f496e74656c6c6967656e63655f496e666f677261706869632e4a5047">among others</a>.</p>

<ul>
  <li><strong>Design a scalable software stack</strong></li>
</ul>

<p>There are currently two software architectures commonly used in the autonomous industry: Modular and <a href="https://arxiv.org/pdf/1604.07316.pdf">End-to-End</a> approaches. Vehicle brands choose their approach based on their needs and resources. For example, <a href="https://www.youtube.com/watch?v=hA_-MkU0Nfw">Waymo</a> uses a modular approach, whereas <a href="https://www.tesla.com/videos/full-self-driving-hardware-all-tesla-cars">Tesla</a> uses an End-to-End one, relying only on cameras and a single neural network.</p>

<p>The specialization focuses on modular software stacks, which are more flexible and cheaper to scale for large and complex projects.</p>

<p><img src="https://miro.medium.com/v2/resize:fit:700/1*fbvE-irLXNGCaHGTNubicg.png" alt="Image 51" /></p>

<p>Self-driving car s<a href="https://www.coursera.org/learn/intro-self-driving-cars/lecture/RQCqM/lesson-3-software-architecture">oftware architecture</a> (Source: <a href="https://www.coursera.org/learn/intro-self-driving-cars/lecture/RQCqM/lesson-3-software-architecture">link</a>)</p>

<p>The 5 core modules of the software stack are:</p>

<ol>
  <li><strong>Environment mapping:</strong> maps objects around the vehicle for collision avoidance, ego-motion tracking, and planning.</li>
  <li><strong>Visual perception:</strong> identifies location and relevant environment elements for driving tasks.</li>
  <li><strong>Motion planning:</strong> decides actions based on perception and mapping data.</li>
  <li><strong>Controller:</strong> adjusts steering, throttle, brake, and gear settings to follow the planned path.</li>
  <li><strong>System supervisor:</strong> monitors the car and warns of subsystem failure.</li>
</ol>

<blockquote>
  <p><strong>Note</strong>: for additional insights, refer to <a href="https://github.com/afondiel/Self-Driving-Cars-Specialization/blob/main/Course1-Introduction-to-Self-Driving-Cars/course1-w2-notes.md">Course I, Chapter 2</a> notes on my GitHub.</p>
</blockquote>

<ul>
  <li><strong>Build a safety assessment strategy for self-driving cars.</strong></li>
</ul>

<p><img src="https://miro.medium.com/v2/resize:fit:700/1*UfWDub3ClCqJvm5BYGegqA.png" alt="Image 52" /></p>

<p>Uber Self-Driving Car Crash in 2017 (Source: link)</p>

<p>Vehicle safety has been a top priority in the automotive industry, with continuous advancements in safety technology, from seatbelts and airbags to advanced driver assistance systems (ADAS). The self-driving car is the result of years of research and innovation in vehicle and road safety.</p>

<blockquote>
  <p>“Self-driving cars are the natural extension of active safety and obviously something we should do.” — Elon Musk</p>
</blockquote>

<p>The specialization covers some of the common safety frameworks for self-driving cars. These include ISO 26262-ASIL, ISO/PAS 21448-SOTIF, FMEA, fault tree analysis, and HAZOP. The specialization also covers how vehicle brands are using these frameworks to analyze specific scenarios and hazards during and after self-driving car deployment.</p>

<blockquote>
  <p><strong>Note</strong>: For additional insights, refer to <a href="https://github.com/afondiel/Self-Driving-Cars-Specialization/blob/main/Course1-Introduction-to-Self-Driving-Cars/course1-w3-notes.md">Course I</a>, <a href="https://github.com/afondiel/Self-Driving-Cars-Specialization/blob/main/Course1-Introduction-to-Self-Driving-Cars/course1-w3-notes.md">Chapter 3</a> notes on my GitHub.</p>
</blockquote>

<p>In 2017 the NHTSA suggested a <a href="https://www.nhtsa.gov/sites/nhtsa.gov/files/documents/13069a-ads2.0_090617_v9a_tag.pdf">safety policy framework</a> to support entities (brands and stakeholders) in the development, testing, and deployment of automated driving systems (ADS) of Levels 3–5. The framework describes 12 rules split into three classes: a system engineering approach to safety, autonomy design, and testing and crash mitigation.</p>

<p>The NHTSA encourages these entities to provide voluntary safety self-assessment (VSSA) disclosures to the public to show how they are addressing safety. Many companies in the industry including Waymo, Zoox, Apple, GM, and Ford, among others have shared their safety policies and strategies. You can find their VSSA Disclosures <a href="https://www.nhtsa.gov/automated-driving-systems/voluntary-safety-self-assessment">here</a>.</p>

<h2 id="2-how-self-driving-car-sees-the-world-and-understands-its-environment"><strong>2. How self-driving car sees the world and</strong> understands <strong>its environment</strong></h2>

<p>The self-driving car uses a set of sensors including Cameras, LiDAR, and Radar to perceive and understand its surroundings. The perception module takes the raw sensor measurements and performs two important tasks:</p>

<ol>
  <li><strong>Localizing the ego-vehicle in space</strong>. This means determining the car’s position, orientation, and velocity.</li>
  <li><strong>Classifying and locating the important elements of the environment</strong>. This includes other vehicles, pedestrians, cyclists, and objects such as traffic signs and lights.</li>
</ol>

<p><strong>Self-Driving Car Perception Pipeline</strong></p>

<p><img src="https://miro.medium.com/v2/resize:fit:700/1*lz-79wWOMMfuhKXhKykKVA.png" alt="Image 53" /></p>

<p>Self-Driving Car Perception Pipeline. (Source: <a href="https://www.coursera.org/learn/intro-self-driving-cars/lecture/RQCqM/lesson-3-software-architecture">link</a>)</p>

<p>The three core components of the Perception stack are:</p>

<ul>
  <li><strong>Localization,</strong> which takes the information from GPS, Inertial Measurements Unit (IMU), and wheel odometry sensors to output the vehicle’s location and orientation in space.</li>
  <li><strong>Dynamic object detection,</strong> which uses camera and LIDAR data to create 3D bounding boxes of dynamic objects, such as other vehicles, pedestrians, and cyclists. It also tracks these objects over time and predicts their future path.</li>
  <li><strong>Static object detection,</strong> which takes camera and LiDAR data to locate important elements in the scene such as lanes, road signs, and traffic lights.</li>
</ul>

<p>Building a reliable perception stack is crucial for a self-driving car, just as eyes are important for human drivers to see the world. The specialization covers state-of-the-art methods used to build each of these components of the perception stack, including 3D computer vision, visual features, FeedForward, Convolution Neural Networks, 2D object detection, and Semantic segmentation.</p>

<blockquote>
  <p><strong>Note</strong>: For additional insights, refer to <a href="https://github.com/afondiel/Self-Driving-Cars-Specialization/blob/main/Course3-Visual-Perception-for-Self-Driving-Cars">Course 3 notes</a> on my GitHub.</p>
</blockquote>

<p>At the end of this module, I was able to apply these skills to build a basic self-driving car perception stack in Carla Simulator. The system uses camera data to estimate 3D drivable space, performs lane estimation, and 2D object detection to avoid obstacles in the road.</p>

<p><img src="https://miro.medium.com/v2/resize:fit:700/1*lopiGtDmLHykcwV9MlbCew.png" alt="Image 54" /></p>

<p>Left Image: Semantic segmentation of the scene. Right image: Lane detection of legal drivable space</p>

<p>The system takes as input semantic segmentation output from the <a href="https://arxiv.org/pdf/1511.00561v3.pdf">SegNet</a> model outputs lane detection and performs obstacle avoidance.</p>

<p><img src="https://miro.medium.com/v2/resize:fit:700/1*RETa2G1cRQoRMy4sL_XY-w.png" alt="Image 55" /></p>

<p>Obstacle detection and 3D bird view of the scene, where the pink lines represent legal drivable space. The red lines represent the safety distance with the vehicle in front. The green line represents</p>

<blockquote>
  <p>If you want to find out more about this project, chekout this <a href="https://github.com/diesimo-ai/self-driving-car-projects/tree/main/p7-self-driving-car-environment-perception">GitHub repository</a>.</p>
</blockquote>

<p>The perception stack suggested in the specialization is cheap to scale. Therefore, the solutions used in this project could be extended to meet the requirements of even more complex applications</p>

<p><img src="https://miro.medium.com/v2/resize:fit:700/1*o3ozjDrLEpBYp2NDiZPumA.png" alt="Image 56" /></p>

<p>The Waymo Driver perception sensors configuration. (Image credit: <a href="https://medium.com/u/1e12980dc791?source=post_page---user_mention--6470b36fe7ed--------------------------------">Waymo Team</a>)</p>

<p>For example, the <a href="https://waymo.com/blog/2021/10/the-waymo-driver-handbook-perception.html">Waymo Driver</a> uses a suite of cameras, lidar, and radar sensors to get a complete understanding of its environment. It then relies on sensor fusion to enhance the benefits of each sensor. For example, the lidar provides 3D depth information and object detection, the camera captures visual appearance, and the radar is used in poor weather conditions, and to track moving objects.</p>

<h2 id="3-how-self-driving-car-figures-out-where-it-is-in-the-world"><strong>3. How self-driving car figures out where it is in the world</strong></h2>

<p><img src="https://miro.medium.com/v2/resize:fit:700/1*vVMHxfybuy7Cq9Sh2Ocw0w.png" alt="Image 57" /></p>

<p>Self-Driving Car Localization (Source: <a href="https://www.coursera.org/learn/state-estimation-localization-self-driving-cars/">link</a>)</p>

<p>In order to navigate safely and accurately in the world, a self-driving car must know its position. This is done by performing localization and mapping. The car uses a variety of sensors, such as inertial measurement units (IMUs), global positioning systems (GPS), and wheel odometry to produce accurate vehicle positioning. Some localization modules also use LIDAR and camera data for higher precision.</p>

<p>The raw sensor measurements can be noisy due to sensor imperfections, so it is crucial to eliminate these errors to get the accurate vehicle’s location and motion. <em>State estimation</em> is the process of determining the most likely value of some of those measurements. Vehicle localization relies on the map of the environment where the car will drive.</p>

<p><strong>The Self-Driving Car Localization and Mapping Pipeline</strong></p>

<p><img src="https://miro.medium.com/v2/resize:fit:700/1*IqFIiqgvMhKcr6KaqpVYUg.png" alt="Image 58" /></p>

<p>The Self-Driving Car Localization and Mapping Pipeline (source: link)</p>

<p>The three core modules for mapping environment module covered in the specialization are:</p>

<ul>
  <li><strong>The occupancy grid map</strong>, constructed mainly from LIDAR data, portrays static objects in grid cells with occupancy probabilities, accommodating uncertainty.</li>
  <li><strong>The localization map</strong>, derived from LIDAR or camera data, refines ego state estimation.</li>
  <li><strong>The detailed road map,</strong> offers road segment information for motion planning, such as lane marking and signs, combining pre-recorded and real-time data.</li>
</ul>

<p>Environment mapping and localization are vital parts of the self-driving car stack since they enable the car to have a globally consistent representation of the world. The specialization covers a wide range of methods and algorithms to build each module of the mapping and localization pipeline. These include state estimation methods (least square, linear and nonlinear Kalman filters), sensor fusion, typical vehicle localization sensor models (GPS, IMU, and LiDAR), LiDAR scan matching, and ICP algorithms.</p>

<blockquote>
  <p><strong>Note</strong>: For additional insights, refer to <a href="https://github.com/afondiel/Self-Driving-Cars-Specialization/blob/main/Course2-State-Estimation-and-Localization-for-Self-Driving-Cars/">Course 2 notes</a> on my GitHub.</p>
</blockquote>

<p>Based on the tools I learned from the specialization, I was able to build a filter-based self-driving car state estimator to determine the vehicle’s position and orientation on the roadway. The system takes a variety of data streams from Lidar, IMU, and GNSS and performs the following tasks:</p>

<ul>
  <li><strong>Taks 1:</strong> performs the filter prediction step and the correction step</li>
  <li><strong>Task 2:</strong> handles the effects of <strong>sensor miscalibration</strong> on the vehicle pose estimates.</li>
  <li><strong>Task 3:</strong> implication of <strong>sensor dropout</strong>. Examine the drift and the uncertainty in the position estimate changes when sensor measurements are unavailable.</li>
</ul>

<p>Here is the output for Task 1.</p>

<p><img src="https://miro.medium.com/v2/resize:fit:700/1*ZNZSJRVvfLbdP2KUV1PTcw.png" alt="Image 59" /></p>

<p>From left to right: Ground Truth and trajectory estimate. And the estimator error (blue) and uncertainty bounds (red).</p>

<p>Interestingly, we can see that the estimator output is quite accurate relative to the Ground Truth. On the other hand, the estimator error (blue plot) remains within the uncertainty bounds (red plot), which gives an indication of how well the model fits the actual dynamics of the vehicle, and how well the estimator is performing overall.</p>

<blockquote>
  <p>If you are interested in finding more, check out the entire project on my <a href="https://github.com/diesimo-ai/self-driving-car-projects/tree/main/p5-self-driving-vehicle-state-estimation-on-roadway">GitHub</a>.</p>
</blockquote>

<h2 id="4-how-self-driving-car-decides-to-navigate-the-world-safely"><strong>4. How self-driving car decides to navigate the world safely</strong></h2>

<p><img src="https://miro.medium.com/v2/resize:fit:700/1*JsiY5P3qHMUU9mkLnG1tdg.gif" alt="Image 60" /></p>

<p>Credit Image — <a href="https://medium.com/u/1e12980dc791?source=post_page---user_mention--6470b36fe7ed--------------------------------">Waymo Team</a> (Source: <a href="https://waymo.com/blog/2021/03/expanding-waymo-open-dataset-with-interactive-scenario-data-and-new-challenges.html">link</a>)</p>

<p>To navigate the world safely, a self-driving car must deal with multiple scenarios in a complex environment. This includes other vehicles, pedestrians, cyclists, and static objects on the road. The car must also obey traffic laws. Motion planning is the process of finding a safe and efficient path for the car to follow.</p>

<p>The motion planning module gets information from the environment mapping and perception components, such as the vehicle’s position, a detailed map, and an occupancy grid. It then predicts the future state of the environment, creates the best trajectory path, and generates the velocity profile for the control stack.</p>

<p><strong>Self-Driving Car Motion Planning Pipeline</strong></p>

<p>Building an accurate motion planning stack is so challenging that it often requires decomposing the problem into 3 layers of abstraction as follows:</p>

<p><img src="https://miro.medium.com/v2/resize:fit:700/1*aSy_kQNxIRRTkJNSHeQjfw.png" alt="Image 61" /></p>

<p>Self-Driving Car Motion Planning Pipeline. (Source: <a href="https://www.coursera.org/learn/intro-self-driving-cars/lecture/RQCqM/lesson-3-software-architecture">link</a>)</p>

<ul>
  <li><strong>Mission Planner:</strong> focuses on long-term planning. It computes the optimal path for the self-driving car from its current position to a given destination. It takes into account factors such as the car’s starting and ending points, the desired speed, and the traffic conditions.</li>
  <li><strong>Behavior Planner:</strong> handles short-term decisions by generating safe maneuvers for the mission path. This includes choices like merging lanes based on desired speed and nearby vehicles’ behavior, along with associated road constraints.</li>
  <li><strong>Local Planner:</strong> takes data from behavior planning, the occupancy grid, vehicle limits, and dynamic objects and continuously generates smooth and safe path trajectories that the car can follow.</li>
</ul>

<p>Although autonomous motion planning is a very active research field, evolving rapidly, the specialization covers state-of-the-art methods and algorithms to build an effective motion planning stack. Some of the topics covered include:</p>

<ul>
  <li>Mission planner algorithms, such as Dijkstra and A-star (A*). 2D occupancy grid generation.</li>
  <li>Behavioural Planner concepts, like Finite State Machines(FSM), rule-based systems, Machine Learning-based: reinforcement learning, and <a href="https://arxiv.org/pdf/1604.07316.pdf">end-to-end learning</a>. But also, motion prediction and collision-checking methods.</li>
  <li>Local planner methods for path planning: sampling-based, variational, lattice planner, path optimization, and velocity profile generation.</li>
</ul>

<blockquote>
  <p>Note: For additional insights, refer to <a href="https://github.com/afondiel/Self-Driving-Cars-Specialization/tree/main/Course4-Motion-Planning-for-Self-Driving-Cars">Course-4</a> notes on my GitHub.</p>
</blockquote>

<p>Using the skills I gained from the specialization, I built a self-driving car motion planner stack that can handle real-world scenarios encountered by autonomous vehicles every day. The system takes a planned map in the Carla Simulator and navigates safely and collision-free to the final goal.</p>

<p><img src="https://miro.medium.com/v2/resize:fit:700/1*3jqE5B3ZQn0Vu2LNwl1BcA.gif" alt="Image 62" /></p>

<p>The planner receives a set of waypoints in a given road network on Carla Simulator, and avoids static and dynamic obstacles while tracking the center line of a lane, and while also handling stop signs.</p>

<blockquote>
  <p>If you are interested in finding more about this project, check out this <a href="https://github.com/diesimo-ai/self-driving-car-projects/tree/main/p10-self-driving-car-motion-planner">GitHub repo</a>.</p>
</blockquote>

<p>This planning stack can serve as a foundation for a more intricate project and can be gradually adjusted to meet additional requirements. For example, Waymo uses a rule-based motion planner combined with machine learning and reinforcement learning for their self-driving car, <a href="https://waymo.com/waymo-driver/?ncr=">The Waymo Driver</a>.</p>

<p><img src="https://miro.medium.com/v2/resize:fit:700/1*6gqFs9MWnZ9TtUooJTbC0Q.png" alt="Image 63" /></p>

<p>Waymo Driver navigating around San Francisco, California. (Image credit: <a href="https://medium.com/u/1e12980dc791?source=post_page---user_mention--6470b36fe7ed--------------------------------">Waymo Team</a>)</p>

<h2 id="5-how-self-driving-car-applies-the-driving-commands-to-move-through-the-world"><strong>5. How self-driving car applies the driving commands to move through the world</strong></h2>

<p><img src="https://miro.medium.com/v2/resize:fit:700/1*xP4UTESJTvJ85WXlT4O4vw.png" alt="Image 64" /></p>

<p>Self-driving car controller (source: link)</p>

<p>In order for a self-driving car to move safely through the world, it needs to apply driving commands to actuators, such as braking and throttle to move forward and steering commands to turn left and right. The vehicle controller executes the planned path trajectory generated by the motion planner to get the self-driving car to the destination goal while complying with speed constraints and road regulations.</p>

<p>The vehicle controller decomposes the control problem into longitudinal and lateral control.</p>

<p><img src="https://miro.medium.com/v2/resize:fit:700/1*gQDyXjrCc7ML8umsM40BzQ.png" alt="Image 65" /></p>

<p>Self-driving car controller pipeline. (Source: link)</p>

<ul>
  <li><strong>The longitudinal controller</strong> regulates the throttle, gears, and braking system to achieve the correct velocity.</li>
  <li><strong>The lateral controller</strong> outputs the steering angle required to maintain the planned trajectory.</li>
</ul>

<p>Both controllers calculate current errors, track the performance of the local plan, and adjust the existing actuation commands to minimize the errors going forward. One of the biggest challenges in the field is to find the “perfect” controller that can minimize these errors close to zero.</p>

<p>There are many types of controllers used in the driving industry today. For longitudinal control two types of controllers are covered: Proportional-Integral-Derivative (PID), the Feed Forward, and the feedback controller. For Laterall controller: Geometric controllers such as Pure pursuit (carrot following), Stanley, and Model Predictive Controller (MPC).</p>

<blockquote>
  <p><strong>Note</strong>: For additional insights, refer to the <a href="https://github.com/afondiel/Self-Driving-Cars-Specialization/tree/main/Course1-Introduction-to-Self-Driving-Cars">Course I, Module 5 &amp; 6</a> on my GitHub.</p>
</blockquote>

<p>Using the skills I gained, I built a real-world self-driving car controller in the Carla simulator. The system follows waypoints and navigates safely and efficiently along the racetrack. The controller receives a sorted list of waypoints, which are evenly spaced along the track. The waypoints are the reference signals, which include the vehicle’s desired position and speed.</p>

<p><img src="https://miro.medium.com/v2/resize:fit:700/1*bNn-8cSCFqMVXMYGKI3cfQ.png" alt="Image 66" /></p>

<p>Path trajectory of waypoints where the vehicle navigates.</p>

<p>For longitudinal control, I implemented the PID Controller, which takes the desired speed as the reference and outputs throttle and break. While, for lateral control, I used the Stanley controller which takes the waypoints and outputs the steering. Combining both the longitudinal and lateral controllers produces the following speed profile and trajectory.</p>

<p><img src="https://miro.medium.com/v2/resize:fit:700/1*hSUgT_x5rg5gdvDhCVrvnQ.png" alt="Image 67" /></p>

<p>On the left: Waypoints and vehicle trajectory. On the right: vehicle speeds(orange) compared to the desired speeds(blue), bounds thresholds (green).</p>

<p>The controller tracks the reference speed well and follows the path with very little error.</p>

<blockquote>
  <p>If you are interested in finding more, check out the entire project on my <a href="https://github.com/diesimo-ai/self-driving-car-projects/tree/main/p3-self-driving-vehicle-control">GitHub</a>.</p>
</blockquote>

<h2 id="conclusion"><strong>Conclusion</strong></h2>

<p>I particularly enjoyed the hands-on projects, which helped me develop my skills in autonomous driving and gain practical experience. Despite being fully built on the Carla simulator, the projects are based on real-life data tested on <a href="https://www.autonomoose.net/">Autonomoose</a> (U of T-Waterloo self-driving car platform).</p>

<p>As Zoox CTO Jesse Levinson <a href="https://youtu.be/QlKAyXxn_dc?si=eRb1vJoe_wv8C6_7">said</a>, “If You Can’t Simulate it, You Can’t Make it.” Simulators allow engineers to test complex scenarios with multiple agents in different variations, including dangerous situations that would be too risky to try on real roads. We can then transfer the knowledge learned in the simulation into the real world by doing some fine-tuning.</p>

<p>On the other hand, I found it would be helpful to have a coverage of C++ in the specialization, given that over 95% of embedded systems code is in C/C++. Additionally, some hands-on exercises on how to build and apply deep learning models to perception and motion planning problems could also be beneficial.</p>

<p>After completing this specialization, I am convinced that self-driving cars will revolutionize transportation and make the world a safer place, and I am eager to take part in this exciting mission.</p>

<h2 id="references">References</h2>

<p>[1] <a href="https://www.coursera.org/specializations/self-driving-cars">Self-Driving Cars Specializations</a> — Coursera</p>

<p>[2] <a href="https://github.com/afondiel/Self-Driving-Cars-Specialization">Self-Driving Cars Specialization — GitHub Notes &amp; Assignments</a></p>

<p>[3] <a href="https://github.com/diesimo-ai/self-driving-car-projects">Self-Driving Cars Specialization — Full projects (You may want to check this out! )</a></p>

<p>[4] <a href="https://injuryfacts.nsc.org/motor-vehicle/historical-fatality-trends/deaths-and-rates/">Car Crash Deaths and Rates</a></p>

<p>[5] <a href="https://www.mckinsey.com/industries/automotive-and-assembly/our-insights/disruptive-trends-that-will-transform-the-auto-industry/de-DE">Automotive revolution — perspective towards 2030, McKinsey &amp; Company</a></p>

<p>[6] <a href="https://techboomers.com/udacity-coursera-self-driving-car">Udacity vs. Coursera: Which Has the Better Self-Driving Cars Program? (2022)</a></p>]]></content><author><name>Afonso Diela</name></author><category term="posts" /><category term="self-driving cars" /><category term="robotics" /><category term="autonomous systems" /><summary type="html"><![CDATA[Self-driving cars could save thousands of lives in the near future.]]></summary></entry><entry><title type="html">Welcome to my blog!</title><link href="https://afondiel.github.io/posts/welcome-to-my-blog/" rel="alternate" type="text/html" title="Welcome to my blog!" /><published>2022-12-04T00:00:00+00:00</published><updated>2022-12-04T00:00:00+00:00</updated><id>https://afondiel.github.io/posts/welcome-to-my-blog</id><content type="html" xml:base="https://afondiel.github.io/posts/welcome-to-my-blog/"><![CDATA[<p>You’ll find my blog post here in the future thanks for being patient.</p>]]></content><author><name>Afonso Diela</name></author><category term="posts" /><summary type="html"><![CDATA[You’ll find my blog post here in the future thanks for being patient.]]></summary></entry></feed>