Parasoft Logo
Image of whitepaper cover

Whitepaper

How to Ensure Safe & Secure Software for AI/ML-Driven Embedded Systems

Check out a preview of the pivotal advancements from our whitepaper below.

Jump to Section

Overview

Artificial intelligence (AI) and machine learning (ML) are transforming safety-critical embedded systems in industries like automotive, healthcare, and defense. From autonomous vehicles to medical diagnostics, these technologies enable revolutionary new capabilities and autonomous operations. However, their integration presents profound challenges.

Embedding AI/ML into these systems goes beyond stringent compliance. It demands reliable operation under significant constraints. AI models require substantial processing power and memory, which are often scarce in embedded hardware. More critically, the unpredictable nature of some AI models poses a direct risk to the high levels of accuracy and reliability that safety-critical applications mandate.

In this whitepaper, we will explore these challenges and the latest advancements, addressing how to:

  • System assurance. Ensuring safety, security, and reliability of AI/ML components.
  • Model stability. Freezing models post-training to guarantee consistent behavior.
  • Standards compliance. Adhering to ISO 26262 and IEC 62304 for certification.
  • Rigorous testing. Employing static analysis, unit, and HIL testing for verification.
  • Safety first. Prioritizing safety and compliance throughout the AI/ML life cycle.
Illustration of cars sensing other cars on roadway.

Challenges of AI/ML in Embedded Safety & Security-Critical Systems

Embedded devices operate under strict energy, memory, and computational limits. Some examples include medical devices, autonomous vehicles, and industrial controls. These aren’t just software projects. They’re physical things with hard limits on what they can do.

In most cases, there’s no room for a bulky computer chip or a fan to cool the component down. Another consideration is power. Many embedded systems run on batteries that need to last years. But AI models, especially big ones, guzzle power like a dry garden soaks up rain.

Even if you shrink the hardware and optimize the power, running complex AI nonstop can make things hot. Heat kills electronics. But it’s not just about the device itself.

Embedded systems often work in harsh environments: freezing cold, scorching heat, vibrating machinery, or even underwater. If the hardware can’t survive the elements, the AI becomes useless. Building AI into embedded systems isn’t just about coding smarter algorithms. It’s a constant tug-of-war between what the AI needs and what the physical world allows.

To reconcile AI’s potential with embedded realities, developers deploy strategies to effectively reduce model size and computational overhead while preserving critical performance. Such strategies include:

  • Pruning to remove less important neural pathways.
  • Quantization, which compresses numerical data into low-bit formats.

We’ll cover both of these strategies in more detail later in this whitepaper.

Additionally, determinism, certifiability, and resilience against adversarial conditions pose challenges that extend beyond performance optimization.

Strategies That Balance Performance With Reliability

The implementation of AI/ML in embedded safety-critical systems follows a structured progression. It begins by addressing fundamental hardware constraints through model optimization like pruning and quantization to ensure efficiency. Next, determinism and predictability are enforced by freezing models and using static memory allocation.

Finally, safety and certifiability are achieved by integrating explainable AI (XAI) for transparency and wrapping the model in a system of rule-based guardrails for runtime protection, ensuring compliance with stringent industry standards.

Determinism

Safety-critical systems, such as automotive braking and flight controls, require deterministic behavior, which means consistent, predictable outputs for given inputs within guaranteed time bounds. However, AI/ML models, especially neural networks, are inherently probabilistic and often exhibit nondeterministic outputs. Consider autonomous vehicles where they require split-second obstacle detection. Any unpredictable latency could delay braking by milliseconds, violating ISO 26262 safety standards.

Freezing trained models (locking weights to prevent runtime drift) and using static memory allocation to eliminate timing variability enforces determinism. This, in turn, ensures predictable, real-time responses.

Magnified glass over the word determinism

Certifiability

Safety-critical systems must comply with stringent certification standards like ISO 26262 (automotive) or IEC 62304 (medical devices). However, the “black-box” nature of many AI/ML models, with their opaque decision-making processes, poses a fundamental challenge, making it difficult to trace decisions and prove robustness.

To address this, embedded development teams can enhance system safety and certifiability by implementing guardrail architectures. In this approach, the AI model is treated as one component within a larger, managed system. The surrounding system is then designed with explicit safety layers that monitor and constrain the AI’s behavior.

This can include:

  • Rule-based checkers. Validating the AI’s outputs against a set of predefined safety rules and physical laws before they are executed.
  • Formal verification methods. Using mathematical techniques to provably bound the model’s behavior within safe operating limits.

By embedding the AI within a protective framework of this kind, teams can create a safer, more predictable, and more certifiable system overall, enabling compliance with standards like ISO 26262 or FDA guidelines.

Resilience Against Adversarial Conditions

Embedded systems often operate in uncontrolled environments like industrial robots and drones. They face adversarial attacks such as malicious inputs designed to fool ML models, such as perturbed sensor data causing misclassification. A specific example of this is a hacked insulin pump’s ML dosing algorithm could overdose patients if adversarial inputs bypass security checks.

For resilience against adversarial conditions, there are a couple of ways to harden models.

  • Adversarial training, which means exposing them to perturbed data during development.
  • Input sanitization techniques, such as noise filtering, while runtime monitors track anomalies like sudden confidence drops to flag potential attacks.

Teams can further mitigate risks by securing update protocols, such as cryptographically signed OTA patches, and redundancy, like voting systems across multiple models. These measures create layered defenses that align AI/ML flexibility with the rigid safety and security requirements of embedded systems.

Acceptance of Risk

The probabilistic nature of AI/ML outputs, like confidence intervals, mirrors the statistical reliability metrics used for hardware components. While the sources of risk differ, the core principles of risk mitigation apply equally. Those core principles are:

  • Redundancy
  • Verification
  • Transparency
  • Adaptive safeguards

Organizations establish risk acceptance criteria for hardware failures in safety-critical systems, like defining tolerable failure rates for components like sensors or processors. Similarly, they must define risk thresholds for AI/ML-driven systems.

This process involves quantifying and qualifying the risks introduced by AI/ML in the context of the system’s safety goals, regulatory requirements, and societal expectations. For example, an autonomous vehicle developer might determine that a neural network’s misclassification error rate must not exceed a certain threshold to align with overall system safety targets. This is akin to how a hardware component’s failure rate is bounded.

However, there are key distinctions in how teams assess and manage risks. Physical degradation, manufacturing defects, or environmental stressors are often the root cause of hardware failures. These failures are probabilistic but relatively well-characterized through historical data and standardized testing, like mean time between failures (MTBF).

AI/ML risks, by contrast, stem from algorithmic uncertainty, data dependencies, and emergent behaviors that may defy deterministic analysis. For instance, a machine learning model might perform flawlessly in testing but fail unpredictably when exposed to novel, real-world scenarios not represented in its training data.

Despite these differences, the foundational principle remains the same: organizations must define acceptable levels of risk based on the system’s operational context, potential harm, and mitigation capabilities.

Regulatory standards like ISO 26262 for automotive systems and IEC 61508 for industrial safety already require rigorous risk classification for hardware and software. An example of this is Automotive Safety Integrity Levels (ASILs).

For AI/ML, analogous frameworks are emerging. ISO 21448, safety of the intended functionality (SOTIF) for autonomous systems, addresses performance limitations of AI-driven components. These frameworks emphasize that AI/ML risks must be bounded, validated, and continuously monitored to ensure they remain within acceptable thresholds—just like hardware risks.

In practice, this means organizations should:

Ai Image circular with lines and AI in middle

Align AI/ML risk criteria with system safety goals.

Define acceptable failure probabilities for AI/ML outputs, such as object detection errors in self-driving cars, that match the system’s overall safety targets.

Icon of a lightbulb

Leverage cross-disciplinary expertise.

Combine traditional safety engineering (FMEA, fault-tree analysis) with AI-specific methods (explainability tools, robustness testing) to holistically assess risks.

blue icon with triangle and explanation point in the center

Adopt dynamic risk management.

Unlike static hardware components, AI/ML systems may evolve via updates or retraining, for instance, necessitating ongoing risk reassessment.

Summary

The integration of AI and ML into embedded safety-critical systems presents both opportunities and challenges. While AI-driven automation enhances system capabilities, it also introduces complexities such as nondeterminism, compliance hurdles, and security vulnerabilities. Ensuring reliability requires a combination of model optimization techniques, specialized hardware, and rigorous verification methodologies.

Techniques like pruning, quantization, and specialized hardware enable AI to function efficiently within embedded constraints. However, safety and compliance demand additional measures:

  • Freezing models.
  • Implementing rule-based safeguards.
  • Applying verification practices like static analysis, unit testing, and coverage analysis.

These strategies help mitigate AI’s inherent unpredictability and align with safety standards like ISO 26262 and IEC 62304. Ultimately, successfully deploying AI in embedded systems depends on balancing innovation with regulatory compliance. As AI-specific verification methods evolve, integrating traditional software safety practices with AI-aware techniques will be essential to ensuring AI-driven embedded systems remain safe, reliable, and certifiable in real-world applications.

Team of developers

Ready to dive deeper?

Get Full Whitepaper