<?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: Gelu Vac</title>
    <description>The latest articles on DEV Community by Gelu Vac (@geluvac).</description>
    <link>https://dev.to/geluvac</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%2F2465993%2Fbca890a9-109e-4078-9680-415b1e3f573c.jpg</url>
      <title>DEV Community: Gelu Vac</title>
      <link>https://dev.to/geluvac</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/geluvac"/>
    <language>en</language>
    <item>
      <title>The Pitfalls of Migrating from Xamarin.Forms to .NET MAUI</title>
      <dc:creator>Gelu Vac</dc:creator>
      <pubDate>Sat, 03 Oct 2026 18:13:21 +0000</pubDate>
      <link>https://dev.to/geluvac/the-pitfalls-of-migrating-from-xamarinforms-to-net-maui-17o2</link>
      <guid>https://dev.to/geluvac/the-pitfalls-of-migrating-from-xamarinforms-to-net-maui-17o2</guid>
      <description>&lt;h2&gt;
  
  
  Why the migration is not a simple upgrade
&lt;/h2&gt;

&lt;p&gt;On paper, migrating from Xamarin.Forms to .NET MAUI looks like a namespace change. In practice, the time goes into three areas: custom renderers, navigation, and plugins that are no longer maintained. Microsoft's support for Xamarin ended in May 2024, and the apps still on it are getting harder to publish as Apple and Google raise their minimum SDK requirements.&lt;br&gt;
The mechanical part is relatively easy. The project moves to the single-project format, &lt;code&gt;Xamarin.Forms&lt;/code&gt; becomes &lt;code&gt;Microsoft.Maui.Controls&lt;/code&gt;, and &lt;code&gt;Xamarin.Essentials&lt;/code&gt; is built directly into the framework. Automated upgrade tools and AI assistants handle this part well.&lt;br&gt;
What they don't handle well is understanding why a custom renderer existed, what the code assumed about the order in which pages load, or what hidden behavior an old plugin provided. This article walks through those pitfalls, with code examples and solutions that work in real projects.&lt;/p&gt;
&lt;h2&gt;
  
  
  From renderers to handlers
&lt;/h2&gt;

&lt;p&gt;The biggest conceptual change is that MAUI no longer customizes controls through inheritance, but through mappers: dictionaries that link each property of a cross-platform control to the native code that applies it.&lt;br&gt;
In Xamarin.Forms, removing the underline from an &lt;code&gt;Entry&lt;/code&gt; on Android meant writing an entire renderer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;assembly&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;ExportRenderer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BorderlessEntry&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BorderlessEntryRenderer&lt;/span&gt;&lt;span class="p"&gt;))]&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;BorderlessEntryRenderer&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;EntryRenderer&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;BorderlessEntryRenderer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Context&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;base&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;OnElementChanged&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ElementChangedEventArgs&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Entry&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;base&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;OnElementChanged&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Control&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;Control&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Background&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In MAUI, the same effect comes from adding an entry to the existing mapper, usually in &lt;code&gt;MauiProgram.cs&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;Microsoft&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Maui&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Handlers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EntryHandler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Mapper&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AppendToMapping&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Borderless"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;view&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;view&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="k"&gt;not&lt;/span&gt; &lt;span class="n"&gt;BorderlessEntry&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="cp"&gt;#if ANDROID
&lt;/span&gt;    &lt;span class="n"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PlatformView&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Background&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="cp"&gt;#elif IOS || MACCATALYST
&lt;/span&gt;    &lt;span class="n"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PlatformView&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;BorderStyle&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;UIKit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;UITextBorderStyle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;None&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="cp"&gt;#endif
&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Pitfall 1: mappers are global
&lt;/h1&gt;

&lt;p&gt;A renderer applied only to the type registered with &lt;code&gt;ExportRenderer&lt;/code&gt;. An entry added to &lt;code&gt;EntryHandler.Mapper&lt;/code&gt; applies to every &lt;code&gt;Entry&lt;/code&gt; in the app. The &lt;code&gt;if (view is not BorderlessEntry) return;&lt;/code&gt; check in the example above is not optional. Without it, every form in the app loses its border, and the bug only shows up during testing, on screens you weren't looking at.&lt;/p&gt;

&lt;h1&gt;
  
  
  Pitfall 2: OnElementChanged has no direct equivalent
&lt;/h1&gt;

&lt;p&gt;Old renderers mixed three things in &lt;code&gt;OnElementChanged&lt;/code&gt;: creating the native control, subscribing to events, and unsubscribing. In MAUI these are separate. For a custom handler, the native control is created in &lt;code&gt;CreatePlatformView&lt;/code&gt;, subscriptions go in &lt;code&gt;ConnectHandler&lt;/code&gt;, and cleanup goes in &lt;code&gt;DisconnectHandler&lt;/code&gt;. Moving the old code without splitting it across these three methods usually leads to memory leaks or events that fire twice.&lt;br&gt;
Also watch when &lt;code&gt;DisconnectHandler&lt;/code&gt; gets called. In early MAUI versions it had to be called manually, while newer versions have a configurable policy via &lt;code&gt;HandlerProperties.DisconnectPolicy&lt;/code&gt;. Check the documentation for the .NET version you're using.&lt;/p&gt;
&lt;h1&gt;
  
  
  Pitfall 3: the temptation of compatibility renderers
&lt;/h1&gt;

&lt;p&gt;MAUI lets you register old renderers through &lt;code&gt;AddCompatibilityRenderer&lt;/code&gt;. That's useful for getting the app running quickly, but it's technical debt: the compatibility package is marked obsolete and doesn't benefit from the new pipeline's optimizations. My recommendation is to use it only as an intermediate step, with a clear ticket for each remaining renderer.&lt;/p&gt;
&lt;h1&gt;
  
  
  Pitfall 4: the native control type has changed
&lt;/h1&gt;

&lt;p&gt;Old code often cast to specific native classes. In MAUI, &lt;code&gt;handler.PlatformView&lt;/code&gt; may be a MAUI-derived class (for example &lt;code&gt;MauiTextField&lt;/code&gt; on iOS), not the UIKit or Android class you knew. A wrong cast doesn't produce a compile error but an &lt;code&gt;InvalidCastException&lt;/code&gt; at runtime, usually on only one platform.&lt;/p&gt;
&lt;h2&gt;
  
  
  Shell and navigation
&lt;/h2&gt;

&lt;p&gt;Shell existed in Xamarin.Forms too, but many older apps used &lt;code&gt;NavigationPage&lt;/code&gt;, &lt;code&gt;TabbedPage&lt;/code&gt;, and &lt;code&gt;MasterDetailPage&lt;/code&gt;. In MAUI, Shell becomes the recommended approach, and moving to it changes more than the syntax.&lt;/p&gt;
&lt;h1&gt;
  
  
  Pitfall 5: Shell doesn't accept every page type
&lt;/h1&gt;

&lt;p&gt;A &lt;code&gt;ShellContent&lt;/code&gt; must contain a &lt;code&gt;ContentPage&lt;/code&gt;. A &lt;code&gt;TabbedPage&lt;/code&gt; or &lt;code&gt;FlyoutPage&lt;/code&gt; (formerly &lt;code&gt;MasterDetailPage&lt;/code&gt;) placed inside Shell is not supported. Tabs and the side menu are defined through the Shell structure (&lt;code&gt;TabBar&lt;/code&gt;, &lt;code&gt;Tab&lt;/code&gt;, &lt;code&gt;FlyoutItem&lt;/code&gt;). If the app had tabs nested inside detail pages, the structure has to be rethought, not just moved.&lt;/p&gt;
&lt;h1&gt;
  
  
  Pitfall 6: routes and parameters
&lt;/h1&gt;

&lt;p&gt;Pages that don't appear in the Shell visual hierarchy must be registered explicitly, otherwise navigation fails at runtime:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;Routing&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;RegisterRoute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;nameof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;PatientDetailPage&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;PatientDetailPage&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;Shell&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GoToAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;$"&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="k"&gt;nameof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;PatientDetailPage&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s"&gt;?id=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;patient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two details take the most time. First, the &lt;code&gt;//&lt;/code&gt; prefix means an absolute route and resets the navigation stack, which is right after login but wrong in a list-detail flow. Second, query string parameters are text. For complex objects, use the parameter dictionary (or &lt;code&gt;ShellNavigationQueryParameters&lt;/code&gt; in recent versions, valid for a single navigation) and receive them through &lt;code&gt;IQueryAttributable&lt;/code&gt;, not through manual serialization in the URL.&lt;/p&gt;

&lt;h1&gt;
  
  
  Pitfall 7: page lifecycle
&lt;/h1&gt;

&lt;p&gt;With &lt;code&gt;ContentTemplate&lt;/code&gt;, Shell creates pages the first time they are shown, not when the app starts. Code that assumed a ViewModel already existed (for example, subscribing in a constructor to messages sent by another page) can miss events. In addition, pages in tabs usually stay in memory, so &lt;code&gt;OnAppearing&lt;/code&gt; is called every time you return, not just once. Data-loading logic needs to be idempotent.&lt;/p&gt;

&lt;h1&gt;
  
  
  Pitfall 8: dependency injection in pages
&lt;/h1&gt;

&lt;p&gt;MAUI has built-in DI, and Shell can resolve pages and ViewModels from the container if they are registered in &lt;code&gt;MauiProgram.cs&lt;/code&gt;. Pay attention to the lifetime you choose: a page registered as a singleton keeps its state between navigations, while a transient one loses it. Code that used &lt;code&gt;DependencyService.Get&amp;lt;T&amp;gt;()&lt;/code&gt; still works, but this is a good moment to move it to constructor injection.&lt;/p&gt;

&lt;h2&gt;
  
  
  Plugins that no longer exist
&lt;/h2&gt;

&lt;p&gt;In many projects, plugins block the migration more than your own code does. The Xamarin ecosystem was built on community-maintained packages: some were abandoned, some were folded into the framework, and others were rewritten under a different name. The first step is an inventory of every NuGet package, with a replacement for each one.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Xamarin.Essentials - built into MAUI - namespaces change (&lt;code&gt;Microsoft.Maui.Devices&lt;/code&gt;, &lt;code&gt;Microsoft.Maui.Storage&lt;/code&gt;, &lt;code&gt;Microsoft.Maui.ApplicationModel&lt;/code&gt;, etc.)&lt;/li&gt;
&lt;li&gt;Plugin.Permissions - &lt;code&gt;Permissions&lt;/code&gt; (built in) - similar API, but manifest/Info.plist declarations are still required&lt;/li&gt;
&lt;li&gt;Plugin.Connectivity - &lt;code&gt;Connectivity&lt;/code&gt; (built in)&lt;/li&gt;
&lt;li&gt;Plugin.Media - MediaPicker (built in) - for full camera control, CommunityToolkit.Maui.Camera&lt;/li&gt;
&lt;li&gt;Xamarin.CommunityToolkit - CommunityToolkit.Maui - many APIs renamed; check behaviors and converters one by one&lt;/li&gt;
&lt;li&gt;Rg.Plugins.Popup - Mopups or Popup from CommunityToolkit.Maui - Mopups keeps a similar API, faster migration&lt;/li&gt;
&lt;li&gt;FFImageLoading - standard &lt;code&gt;Image&lt;/code&gt; or community forks for MAUI - the original package is no longer maintained&lt;/li&gt;
&lt;li&gt;Xamarin.Forms.Maps - Microsoft.Maui.Controls.Maps - requires &lt;code&gt;UseMauiMaps()&lt;/code&gt; in &lt;code&gt;MauiProgram.cs&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;SkiaSharp.Views.Forms - SkiaSharp.Views.Maui.Controls - requires UseSkiaSharp()&lt;/li&gt;
&lt;li&gt;Lottie (Xamarin) - &lt;code&gt;SKLottieView&lt;/code&gt; from SkiaSharp.Extended.UI.Maui&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;MessagingCenter&lt;/code&gt; - &lt;code&gt;WeakReferenceMessenger&lt;/code&gt; from CommunityToolkit.Mvvm - &lt;code&gt;MessagingCenter&lt;/code&gt; is marked obsolete&lt;/li&gt;
&lt;li&gt;Visual Studio App Center - Sentry, Firebase Crashlytics, etc. - App Center was retired in March 2025&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Pitfall 9: the plugin “works”, but only on one platform
&lt;/h1&gt;

&lt;p&gt;Some packages have versions that install without errors in a MAUI project but cover only some platforms or depend on old native libraries. The build passes, and the problem appears in the iOS build, at publishing time, or on the first run on a real device. Check on NuGet which frameworks each package targets (for example &lt;code&gt;net8.0-android&lt;/code&gt;, &lt;code&gt;net8.0-ios&lt;/code&gt;) and the date of its latest release.&lt;/p&gt;

&lt;h1&gt;
  
  
  Pitfall 10: hidden behaviors
&lt;/h1&gt;

&lt;p&gt;Old plugins often did things you couldn't see in your code. Plugin.Media, for example, requested permissions on its own and could compress or rotate the image. &lt;code&gt;MediaPicker&lt;/code&gt; doesn't do all of that, so after migration you may get photos several MB in size or with the wrong orientation. Every replacement has to be tested for behavior, not just for compilation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Small pitfalls that eat up time
&lt;/h2&gt;

&lt;p&gt;None of the issues below is hard, but together they can add whole days to an estimate.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Image resources&lt;/strong&gt;. In the single project, images live in &lt;code&gt;Resources/Images&lt;/code&gt; and must follow Android rules: lowercase letters, digits and underscores, no hyphens. SVG files are converted to PNG at build time and are referenced in XAML with the &lt;code&gt;.png&lt;/code&gt; extension.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Layouts&lt;/strong&gt;. Default spacing values have changed, &lt;code&gt;RelativeLayout&lt;/code&gt; has moved to the compatibility package, and &lt;code&gt;Frame&lt;/code&gt; is replaced by &lt;code&gt;Border&lt;/code&gt;. Screens look “almost” the same, which is more dangerous than looking obviously broken.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Device APIs&lt;/strong&gt;. &lt;code&gt;Device.RuntimePlatform&lt;/code&gt; becomes &lt;code&gt;DeviceInfo.Platform&lt;/code&gt;, and &lt;code&gt;Device.BeginInvokeOnMainThread&lt;/code&gt; becomes &lt;code&gt;MainThread.BeginInvokeOnMainThread&lt;/code&gt; or &lt;code&gt;Dispatcher&lt;/code&gt;. The old code compiles with warnings, so it's easy to ignore.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ListView vs. CollectionView&lt;/strong&gt;. &lt;code&gt;ListView&lt;/code&gt; still exists, but &lt;code&gt;CollectionView&lt;/code&gt; is the recommended option and behaves differently for selection, separators and row height.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compiled bindings&lt;/strong&gt;. Adding x:DataType in XAML brings a visible performance gain and catches, at compile time, wrong bindings that failed silently in Xamarin.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trimming and AOT&lt;/strong&gt;. Release builds can strip code accessed through reflection (serialization, dynamically configured DI). An app that works perfectly in Debug can stop at startup in Release. Test the Release build on a real device in the first week, not at the end.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion: a lower-risk strategy
&lt;/h2&gt;

&lt;p&gt;A successful migration starts with the inventory, not the code. The order that has worked best in practice is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Inventory every NuGet package, custom renderer, effect and DependencyService call, with a replacement decided for each.&lt;/li&gt;
&lt;li&gt;Do the mechanical part (single project, namespaces, Essentials) and get the app compiling, temporarily using compatibility renderers where needed.&lt;/li&gt;
&lt;li&gt;Build and run the Release build on real devices, on both platforms, before any other change.&lt;/li&gt;
&lt;li&gt;Rewrite renderers as handlers or mappers, one at a time, with visual tests on every affected screen.&lt;/li&gt;
&lt;li&gt;Move navigation to Shell only after everything else is stable. It's the change with the biggest impact on behavior.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;MAUI is a cleaner and faster framework than Xamarin.Forms, and the handler model makes customization much simpler once you understand it. The real cost of the migration lies in what the old code did implicitly. If you identify those things early, the estimate stays realistic and the app reaches the stores without surprises.&lt;/p&gt;

</description>
      <category>xamarin</category>
      <category>maui</category>
      <category>migration</category>
      <category>ios</category>
    </item>
    <item>
      <title>Real-Time Speaker Diarization</title>
      <dc:creator>Gelu Vac</dc:creator>
      <pubDate>Sat, 03 Oct 2026 18:08:02 +0000</pubDate>
      <link>https://dev.to/geluvac/real-time-speaker-diarization-21pb</link>
      <guid>https://dev.to/geluvac/real-time-speaker-diarization-21pb</guid>
      <description>&lt;h2&gt;
  
  
  Real-Time Speaker Diarization
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Algorithms, web implementation and applications in drone detection by the acoustic fingerprint of their motors
&lt;/h2&gt;

&lt;p&gt;This article presents the principles and practical implementation of speaker diarization – the automatic identification of the person speaking at a given moment in a continuous audio stream. Starting from the Fourier transform, the Mel scale and the MFCC coefficients, we explore classical and modern speaker identification algorithms, as well as the challenges of implementing them in the browser using the Web Audio API. In the second part, we show that the same set of techniques, applied to the signals emitted by the electric motors of unmanned aerial vehicles (UAVs/drones), can form the basis of an acoustic drone detection and identification system – a field with applications in security, air traffic management and critical infrastructure protection.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. INTRODUCTION
&lt;/h2&gt;

&lt;p&gt;In any conversation involving several participants – from a medical consultation to a board meeting or a journalistic interview – the question “who spoke?” is just as important as “what was said?”. Speaker diarization is the task of segmenting an audio stream into homogeneous regions attributed to a single speaker, answering the question “who speaks when?” without assuming prior knowledge of the identity of the people involved [1].&lt;/p&gt;

&lt;p&gt;The field has evolved dramatically over the last decade: while in the 2000s systems relied on Gaussian mixture models (GMM) and the BIC distance, today deep neural architectures produce speaker embeddings (x-vectors, d-vectors) with performance exceeding human discrimination ability under noisy conditions [2, 3]. Nevertheless, efficient implementation in resource-constrained environments – browser, embedded systems, edge computing – remains an open challenge of immediate practical interest.&lt;/p&gt;

&lt;p&gt;This article has a twofold purpose:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;to present, in sufficient technical detail, the mathematical and algorithmic foundations of speaker diarization, with an emphasis on implementability in JavaScript using the Web Audio API; and&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;to show that the same acoustic feature extraction pipeline can be adapted for detecting and identifying drones by the sound signature of their motors – an active research field with applications in national security, urban planning and airspace protection [4, 5].&lt;/p&gt;
&lt;h2&gt;
  
  
  2. FROM WAVEFORM TO FINGERPRINT: AUDIO SIGNAL PROCESSING
&lt;/h2&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  2.1 The Fourier transform and the frequency domain
&lt;/h2&gt;

&lt;p&gt;The raw audio signal is a sequence of acoustic pressure values sampled at a fixed rate (typically 44,100 Hz for consumer audio). Although the time-domain waveform contains all the information, it is not suitable for extracting discriminative speaker features. The Discrete Fourier Transform (DFT) – and its efficient implementation, the FFT – projects the signal into the frequency domain, revealing the distribution of energy across sinusoidal components.&lt;/p&gt;

&lt;p&gt;In practice, the analysis is performed on short windows (typically 20–40 ms), with overlap (10–15 ms), yielding a time-frequency representation called a spectrogram. Each window is multiplied by a window function (Hamming, Hann) to reduce the effect of spectral leakage at the window edges.&lt;/p&gt;

&lt;h2&gt;
  
  
  2.2 The Mel scale and the filterbank
&lt;/h2&gt;

&lt;p&gt;Human perception of pitch is not linear with respect to physical frequency: the ear discriminates low frequencies more finely than high ones. The Mel scale, proposed by Stevens, Volkmann and Newman in 1937, approximates this non-linearity:&lt;/p&gt;

&lt;p&gt;A mel filterbank consists of M triangular filters distributed uniformly on the Mel scale, applied to the FFT power spectrum. The energy of each filter is log-compressed (to compress the dynamic range, similarly to the auditory system), yielding a vector of M values representing the mel spectrum of the current window. Typical values are M = 26 or 40.&lt;/p&gt;

&lt;h2&gt;
  
  
  2.3 Mel-Frequency Cepstral Coefficients (MFCC)
&lt;/h2&gt;

&lt;p&gt;The MFCC coefficients, introduced by Davis and Mermelstein in 1980 [6], are obtained by applying the Discrete Cosine Transform (DCT) to the log-energies of the mel filterbank. The DCT decorrelates the components (since the mel filterbanks overlap), condensing the vocal information into the first 12–13 coefficients:&lt;/p&gt;

&lt;p&gt;The coefficient c₀ (k=0) corresponds to the total energy of the frame and is often excluded from the feature vector for speaker identification, since it reflects the loudness of speech rather than the identity of the speaker. The MFCC vectors c₁–c₁₃ capture the characteristics of the vocal tract – the shape of the oral cavity, its length, the position of the tongue – stable features of vocal identity.&lt;/p&gt;

&lt;p&gt;The complete feature vector for a frame often also includes the delta coefficients (Δ-MFCC, the temporal derivative) and delta-delta coefficients (ΔΔ-MFCC), which capture the temporal dynamics of speech. To these are sometimes added the fundamental frequency (pitch, F₀) – estimated by autocorrelation on the time-domain signal – and the spectral centroid, which measures the “brightness” of the voice.&lt;/p&gt;

&lt;p&gt;Key point: The performance of any voice identification system depends critically on the quality of feature extraction. Cepstral Mean Normalization (CMN) – subtracting the session mean from each MFCC vector – reduces the influence of channel characteristics (microphone, room acoustics). L2 normalization (projection onto the unit sphere) is a robust, temporally stable alternative that allows the Euclidean distance to be used as a consistent comparison metric.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. SPEAKER IDENTIFICATION AND DIARIZATION ALGORITHMS
&lt;/h2&gt;

&lt;h2&gt;
  
  
  3.1 Gaussian Mixture Models (GMM-UBM)
&lt;/h2&gt;

&lt;p&gt;The classical approach, dominant in the 2000s, models the distribution of each speaker’s MFCC vectors with a Gaussian Mixture Model (GMM). A Universal Background Model (UBM) trained on a large corpus of speakers is adapted by Maximum A Posteriori (MAP) estimation to the data of each specific speaker – yielding a personalized GMM at low computational cost [7]. Identification is performed by a likelihood ratio test against the UBM.&lt;/p&gt;

&lt;p&gt;The limitations of GMM-UBM are its sensitivity to channel variations and the need for at least a few tens of seconds of training data per speaker. These limitations motivated the development of methods based on latent subspaces.&lt;/p&gt;

&lt;h2&gt;
  
  
  3.2 I-vectors and Factor Analysis
&lt;/h2&gt;

&lt;p&gt;Dehak et al. (2011) [2] proposed representing a speaker session as a low-dimensional vector (typically 400) – the i-vector – which simultaneously encodes speaker identity and channel variables in a total variability subspace. The model assumes that the GMM supervector can be written as the sum of a background supervector and a total variability term: , where T is the total variability matrix and w is the session’s i-vector.&lt;/p&gt;

&lt;p&gt;Classification is performed with Linear Discriminant Analysis (LDA) or Probabilistic LDA (PLDA), which separate intra-speaker variability from inter-speaker variability. I-vectors dominated the NIST Speaker Recognition Evaluation (SRE) competitions for almost a decade.&lt;/p&gt;

&lt;h2&gt;
  
  
  3.3 X-vectors and Deep Neural Networks
&lt;/h2&gt;

&lt;p&gt;Deep neural architectures have redefined the state of the art in speaker identification. Snyder et al. (2018) [3] propose x-vectors: a DNN model trained for speaker classification on windows of a few seconds, from whose intermediate layers compact embeddings (typically 512-dimensional) are extracted. A statistical aggregation layer (mean + standard deviation pooling) allows processing of variable-length sequences.&lt;/p&gt;

&lt;p&gt;X-vectors, combined with PLDA and data augmentation (added noise, simulated reverberation), reduced the identification error rate by 50–70% compared to i-vectors on standard benchmarks. More recent models – ECAPA-TDNN, ResNet-based speaker models – achieve even higher performance, with an EER (Equal Error Rate) below 1% on clean datasets [1, 8].&lt;/p&gt;

&lt;h2&gt;
  
  
  3.4 Diarization vs. Verification vs. Identification
&lt;/h2&gt;

&lt;p&gt;Three related tasks must be distinguished: (1) Speaker verification – is person X the one speaking? (binary classification); (2) Speaker identification – which of N known speakers is speaking? (multi-class classification); (3) Speaker diarization – segmenting the audio stream into regions attributed to speakers without prior knowledge of their identity, with the number of speakers unknown a priori [1].&lt;/p&gt;

&lt;p&gt;A typical diarization pipeline includes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;voice activity detection (VAD),&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;feature extraction,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;clustering (k-means, spectral clustering, or DBSCAN on embeddings),&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;optionally re-segmentation with HMM or Viterbi.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The standard evaluation metric is the DER (Diarization Error Rate), the sum of the missed speech, false alarm and speaker confusion rates.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. BROWSER IMPLEMENTATION: WEB AUDIO API AND NEAREST-CENTROID
&lt;/h2&gt;

&lt;h2&gt;
  
  
  4.1 The Web Audio API and the constraints of the browser environment
&lt;/h2&gt;

&lt;p&gt;The Web Audio API [9] natively provides, in the browser, access to the microphone stream via getUserMedia(), signal processing with AnalyserNode (real-time FFT, configured via fftSize = 2048), and precise timing via AudioContext. Implementation in JavaScript imposes significant constraints compared to server-side systems: the lack of explicit SIMD for matrix operations, single-threaded execution on the main thread (although Web Workers and AudioWorklets partially alleviate this), and a latency of ~16 ms imposed by requestAnimationFrame.&lt;/p&gt;

&lt;p&gt;These constraints make it impossible to run large DNN models (x-vectors, ECAPA-TDNN) directly in the browser without ONNX Runtime Web or TensorFlow.js – and even with these frameworks, real-time inference on models with millions of parameters is only marginally feasible on modest hardware. The practical alternative is a lightweight classifier: nearest-centroid with a Euclidean metric in the L2-normalized feature space.&lt;/p&gt;

&lt;h2&gt;
  
  
  4.2 The real-time feature extraction pipeline
&lt;/h2&gt;

&lt;p&gt;The practical implementation processes frames of 2048 samples (≈46 ms at 44.1 kHz) on each requestAnimationFrame cycle. Only frames with RMS &amp;gt; θ (a configurable energy threshold) are included in the collection buffer of the current utterance – a simplified voice activity detection that is nevertheless effective under low-noise conditions.&lt;/p&gt;

&lt;p&gt;At the end of an utterance (detected when speech recognition stops or via a silence timer), the raw MFCC vectors of the collected frames are averaged, and the mean is L2-normalized – yielding the L2 fingerprint of the current utterance:&lt;/p&gt;

&lt;p&gt;This order – averaging the raw vectors, followed by normalization – is critical. Per-frame normalization followed by averaging causes vector cancellation: the mean of vectors on the unit sphere may be a vector of near-zero norm, devoid of discriminative power. Normalizing the raw mean produces a stable centroid, reproducible for the same speaker.&lt;/p&gt;

&lt;h2&gt;
  
  
  4.3 The nearest-centroid classifier with adaptive threshold
&lt;/h2&gt;

&lt;p&gt;Each detected speaker is associated with a centroid – the L2-normalized (and re-normalized) mean of the last K fingerprints. A new utterance is identified by its Euclidean distance to each known centroid:&lt;/p&gt;

&lt;p&gt;If the minimum distance exceeds a threshold θ, a new speaker is declared. The optimal threshold is , where  is the Euclidean distance between the two known centroids – this is calibrated automatically after the first two speakers are detected. Before calibration, the initial threshold θ₀ = 0.5 works reasonably in the L2-normalized space, where typical intra-speaker distances are 0.05–0.25 and inter-speaker distances 0.5–1.4.&lt;/p&gt;

&lt;p&gt;A further improvement: after K₀ = 5 utterances from the first speaker, the threshold is recalibrated from the observed intra-speaker variance: , where  is the mean Euclidean distance of the samples from their centroid. This makes the system adaptive to the type of voice and the acoustic conditions of the room.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. DRONE DETECTION BY ACOUSTIC FINGERPRINT
&lt;/h2&gt;

&lt;h2&gt;
  
  
  5.1 The acoustic signature of UAVs
&lt;/h2&gt;

&lt;p&gt;Multirotor unmanned aerial vehicles (quadcopters, hexacopters, etc.) produce a characteristic sound signal, determined by three main sources:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;the rotation of the brushless electric motors, which generates tones at the switching frequency of the ESC controllers and their harmonics;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;the aerodynamic sound of the propellers – air-cutting noise (blade passing frequency, ) and blade-tip turbulence;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;the structural resonance of the frame.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The BPF is the dominant and distinctive frequency: a typical quadcopter (DJI Phantom 4) with 2-blade propellers and RPM ≈ 8,000–10,000 produces a BPF ≈ 267–333 Hz. Models with different configurations (hex, octo, multiple blades) have distinct, identifiable spectral fingerprints [4, 5].&lt;/p&gt;

&lt;p&gt;Unlike the human voice – wide band 80–8,000 Hz, variable formant structure – the sound of a drone motor is quasi-periodic, with energy concentrated in the BPF and its harmonics (2×BPF, 3×BPF...). This makes identification easier under ideal conditions, but more fragile to RPM variations (which depend on the maneuver being executed) and to urban environmental noise.&lt;/p&gt;

&lt;h2&gt;
  
  
  5.2 Transferring voice identification techniques to UAVs
&lt;/h2&gt;

&lt;p&gt;Jeon et al. (2017) [4] demonstrated that a deep neural network trained on mel spectrograms of drone sounds can detect the presence of a drone with &amp;gt;95% accuracy at distances of up to 80 m in semi-controlled environments. Al-Emadi et al. (2019) [5] extended the approach to identifying the specific model (DJI Phantom vs. Parrot Bebop vs. background), using MFCC and CNN, obtaining 98% accuracy on the test set.&lt;/p&gt;

&lt;p&gt;The parallel with speaker identification is direct: instead of the vocal tract, the acoustic signature is determined by the motor + propeller configuration; instead of formants, we track the BPF and its harmonics. The technical pipeline:&lt;/p&gt;

&lt;p&gt;FFT → mel filterbank → MFCC → L2 normalization → nearest-centroid or DNN classifier&lt;/p&gt;

&lt;p&gt;transfers almost without modification, with a few domain-specific adjustments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Frequency band of interest: 100–4,000 Hz (vs. 80–8,000 Hz for voice);&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;FFT window size: 4,096–8,192 samples for better frequency resolution at low BPFs;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Number of mel filters: 32–64 (more, in order to capture the fine harmonics);&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Augmentation with synthetic pitch-shifting to cover RPM variations.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5.3 Multi-microphone acoustic detection and localization
&lt;/h2&gt;

&lt;p&gt;One advantage of acoustic detection over radar or LiDAR is the low cost of the sensors. A microphone array allows not only detecting presence, but also estimating the direction of arrival (DOA) through beamforming or MUSIC (Multiple Signal Classification). The time difference of arrival (TDOA) between pairs of microphones, combined with triangulation, can localize the drone in 3D space.&lt;/p&gt;

&lt;p&gt;Emerging commercial systems (DroneShield, Dedrone – although predominantly based on RF and video) integrate acoustic detection as an additional layer, especially for small drones with a low radar signature. Recent research explores distributed microphone networks, processed at the edge computing level with centralized aggregation – an architecture that benefits directly from the lightweight feature extraction techniques discussed in Section 4.&lt;/p&gt;

&lt;h2&gt;
  
  
  5.4 Challenges and limitations
&lt;/h2&gt;

&lt;p&gt;The main challenges of acoustic drone detection are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Urban noise – road traffic, air conditioning, wind – spectrally overlapping with the BPF frequencies;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;RPM variation depending on the maneuvers executed, which shifts the BPF by ±30%;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The maximum effective range, limited to 50–100 m in urban conditions (vs. 200–300 m in rural environments);&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Detection latency – a rapid-response system requires inference under 200 ms, which limits model complexity.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The same challenges exist, by analogy, in voice identification in noisy environments: overlapping speech, variable background noise, emotional variations in vocal pitch. The solutions developed in ASR and speaker recognition – noise data augmentation, adaptive beamforming, robust VAD based on spectral energy – are directly applicable to acoustic UAV detection.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. COMPARATIVE EVALUATION AND FUTURE DIRECTIONS
&lt;/h2&gt;

&lt;h2&gt;
  
  
  6.1 Lightweight vs. DNN: when is nearest-centroid sufficient?
&lt;/h2&gt;

&lt;p&gt;The nearest-centroid classifier in the L2-MFCC space is viable in scenarios with a small number of speakers (2–4), relatively controlled acoustic conditions and latency requirements under 50 ms (execution in the browser or on ARM Cortex-M4+ microcontrollers). On the VoxCeleb1 dataset (7,000+ speakers), nearest-centroid with MFCC yields an EER of approximately 15–20%, compared to 1–3% for DNN models. The gap narrows significantly when the number of speakers is small and training data is abundant [1, 3].&lt;/p&gt;

&lt;p&gt;For drone detection, where the number of models to identify is small (tens, not thousands) and the acoustic signature is more stable than the human voice, nearest-centroid MFCC achieves performance comparable to CNN models on benchmarks with SNR &amp;gt; 10 dB [4].&lt;/p&gt;

&lt;h2&gt;
  
  
  6.2 Integrating pre-trained models via ONNX Runtime Web
&lt;/h2&gt;

&lt;p&gt;A promising direction for improving browser performance without sacrificing accessibility is the use of ONNX Runtime Web with WebAssembly (and, where available, WebGPU). Small models of the SpeakerNet or audio MobileNet type, exported in ONNX format, can run inference for a 2-second frame in under 100 ms on mainstream hardware, paving the way for lightweight x-vectors directly in the browser.&lt;/p&gt;

&lt;p&gt;Similarly, pre-trained drone detection models (CNNs on 1–2 second mel spectrograms, with ~500K parameters) are small enough for ONNX Web deployment, with potential use in security applications accessible to the general public (e.g. mobile apps for citizens reporting aerial intrusions).&lt;/p&gt;

&lt;h2&gt;
  
  
  6.3 Privacy and ethical considerations
&lt;/h2&gt;

&lt;p&gt;Voice identification systems raise legitimate privacy questions: collecting voiceprints constitutes processing of biometric data under the GDPR and similar regulations. Implementations that process exclusively locally (browser, edge) and do not transmit audio data or fingerprints to a server offer stronger guarantees than cloud solutions. The privacy-by-design principle recommends: local processing, volatile fingerprints (reset when the session closes), and explicit user consent.&lt;/p&gt;

&lt;p&gt;In the drone domain, acoustic detection does not raise the same privacy issues as video surveillance, but national regulations on the interception of communications and airspace monitoring require clear legal frameworks for the operators of detection systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. CONCLUSIONS
&lt;/h2&gt;

&lt;p&gt;Speaker diarization – the automatic identification of the person speaking in an audio stream – relies on an elegant mathematical pipeline:&lt;/p&gt;

&lt;p&gt;FFT → mel filterbank → MFCC → L2 normalization → nearest-centroid or DNN classification.&lt;/p&gt;

&lt;p&gt;Browser implementation with the Web Audio API is feasible for scenarios with two to four speakers, provided that a few critical details are respected: excluding c₀ from the MFCC vector, averaging the raw vectors before normalization, and adaptive calibration of the decision threshold.&lt;/p&gt;

&lt;p&gt;The same pipeline, with minor adjustments to the filterbank and analysis window parameters, proves effective for detecting and identifying drones by the acoustic fingerprint of their motors. The technical convergence between the two domains opens opportunities for knowledge transfer, shared datasets and unified multi-task architectures.&lt;/p&gt;

&lt;p&gt;As UAVs proliferate in urban and peri-urban airspace, lightweight acoustic detection systems, deployable on low-cost edge devices, will become an essential complementary element of the aerial security ecosystem – and the knowledge accumulated in speech processing represents technical capital that transfers directly to this new field of applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  REFERENCES
&lt;/h2&gt;

&lt;p&gt;[1] Park, T.J., Kanda, N., Dimitriadis, D., Han, K.J., Watanabe, S., &amp;amp; Narayanan, S. (2022). "A review of speaker diarization: Recent advances with deep learning." Computer Speech &amp;amp; Language, 72, 101317. &lt;a href="https://doi.org/10.1016/j.csl.2021.101317" rel="noopener noreferrer"&gt;https://doi.org/10.1016/j.csl.2021.101317&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[2] Dehak, N., Kenny, P.J., Dehak, R., Dumouchel, P., &amp;amp; Ouellet, P. (2011). "Front-End Factor Analysis for Speaker Verification." IEEE Transactions on Audio, Speech, and Language Processing, 19(4), 788–798. &lt;a href="https://doi.org/10.1109/TASL.2010.2064307" rel="noopener noreferrer"&gt;https://doi.org/10.1109/TASL.2010.2064307&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[3] Snyder, D., Garcia-Romero, D., Sell, G., Povey, D., &amp;amp; Khudanpur, S. (2018). "X-Vectors: Robust DNN Embeddings for Speaker Recognition." Proc. ICASSP, Calgary, Canada, pp. 5329–5333.&lt;/p&gt;

&lt;p&gt;[4] Jeon, H., Kim, Y., Kim, D., Kim, J., &amp;amp; Kim, J. (2017). "Empirical Study of Drone Sound Detection in Real-Life Environment with Deep Neural Network." Proc. 25th European Signal Processing Conference (EUSIPCO), Kos, Greece, pp. 1858–1862.&lt;/p&gt;

&lt;p&gt;[5] Al-Emadi, S., Al-Ali, A., Mohammad, A., &amp;amp; Al-Ali, A. (2019). "Audio-Based Drone Detection and Identification Using Deep Learning." Proc. 2019 15th International Wireless Communications &amp;amp; Mobile Computing Conference (IWCMC), pp. 459–464.&lt;/p&gt;

&lt;p&gt;[6] Davis, S.B., &amp;amp; Mermelstein, P. (1980). "Comparison of Parametric Representations for Monosyllabic Word Recognition in Continuously Spoken Sentences." IEEE Transactions on Acoustics, Speech, and Signal Processing, 28(4), 357–366. &lt;a href="https://doi.org/10.1109/TASSP.1980.1163420" rel="noopener noreferrer"&gt;https://doi.org/10.1109/TASSP.1980.1163420&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[7] Reynolds, D.A., Quatieri, T.F., &amp;amp; Dunn, R.B. (2000). "Speaker Verification Using Adapted Gaussian Mixture Models." Digital Signal Processing, 10(1–3), 19–41. &lt;a href="https://doi.org/10.1006/dspr.1999.0361" rel="noopener noreferrer"&gt;https://doi.org/10.1006/dspr.1999.0361&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[8] Anguera, X., Bozonnet, S., Evans, N., Fredouille, C., Friedland, G., &amp;amp; Vinyals, O. (2012). "Speaker Diarization: A Review of Recent Research." IEEE Transactions on Audio, Speech, and Language Processing, 20(2), 356–370. &lt;a href="https://doi.org/10.1109/TASL.2011.2125954" rel="noopener noreferrer"&gt;https://doi.org/10.1109/TASL.2011.2125954&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[9] Smus, B. (2013). Web Audio API: Advanced Sound for Games and Interactive Apps. O'Reilly Media. ISBN: 978-1-449-33268-5.&lt;/p&gt;

&lt;p&gt;[10] MDN Web Docs. (2024). "Web Audio API." Mozilla Developer Network. &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API&lt;/a&gt;&lt;/p&gt;

</description>
      <category>voice</category>
      <category>drone</category>
      <category>detection</category>
      <category>diarization</category>
    </item>
    <item>
      <title>Security by Design in the Age of Artificial Intelligence: Fundamentals, Risks and Resilience Strategies</title>
      <dc:creator>Gelu Vac</dc:creator>
      <pubDate>Mon, 13 Apr 2026 14:49:33 +0000</pubDate>
      <link>https://dev.to/geluvac/security-by-design-in-the-age-of-artificial-intelligence-fundamentals-risks-and-resilience-19eh</link>
      <guid>https://dev.to/geluvac/security-by-design-in-the-age-of-artificial-intelligence-fundamentals-risks-and-resilience-19eh</guid>
      <description>&lt;p&gt;We live in a time when artificial intelligence has moved from being an emerging technology to a critical infrastructure. Algorithms decide what information we see, what transactions are suspicious, what diagnoses are likely, and increasingly, what decisions are optimal for organizations and governments. Companies like OpenAI, Google DeepMind, and Anthropic have accelerated the development of advanced models, making artificial intelligence a central element of the digital economy. In this context, security can no longer be an afterthought or a reactive mechanism. It must be an integral part of the system architecture from the moment of its conception. &lt;/p&gt;

&lt;p&gt;Over the past two decades, digital transformation has been accelerated by cloud, mobility, and big data. In recent years, however, artificial intelligence (AI) has become the main driver of innovation.&lt;br&gt;
But this revolution comes at a cost: the attack surface is growing exponentially.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security by Design&lt;/strong&gt; is not just about installing additional controls or enforcing stricter access policies. It means deeply integrating security principles into the technological DNA of a system. In the AI ​​era, this approach becomes vital, because the complexity of models, their dependence on massive data, and the often opaque nature of algorithms create an environment in which vulnerabilities can be subtle but devastating.&lt;/p&gt;

&lt;p&gt;The concept of &lt;strong&gt;Security by Design (SbD)&lt;/strong&gt; involves integrating security from the design phase of a system, not as a later stage or a “patch” after vulnerabilities appear. In the AI ​​era, this approach becomes critical because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI models are dependent on massive data.&lt;/li&gt;
&lt;li&gt;Algorithms can be manipulated.&lt;/li&gt;
&lt;li&gt;Automated decisions can have a major impact on users.&lt;/li&gt;
&lt;li&gt;AI systems can be exploited in new ways (prompt injection, model inversion, data poisoning).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Security by Design in the AI ​​era means &lt;strong&gt;responsible design, technical resilience, and solid governance&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  From traditional security to algorithmic security
&lt;/h2&gt;

&lt;p&gt;The concept of Security by Design is not new. It has been promoted since the 1990s in the field of application security and IT infrastructure. It initially appeared in the field of software security and IT infrastructures, being supported and formalized by organizations such as the National Institute of Standards and Technology (NIST) that developed frameworks such as the NIST Cybersecurity Framework, which promotes the integration of security into all stages of the life cycle. The idea was simple: it is more efficient and safer to prevent vulnerabilities by design than to correct them after the system has been compromised.&lt;/p&gt;

&lt;p&gt;Classic principles include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Principle of least privilege&lt;/li&gt;
&lt;li&gt;Defense in depth&lt;/li&gt;
&lt;li&gt;Fail secure&lt;/li&gt;
&lt;li&gt;Zero Trust&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In traditional systems, security focused on perimeter protection, authentication, encryption and vulnerability management. In the case of artificial intelligence, however, the object of protection is no longer only the infrastructure, but also the model itself. The algorithm becomes a critical asset. Training data becomes an attack surface. Automated decisions can have major legal and ethical implications.&lt;/p&gt;

&lt;p&gt;Thus, security must be extended beyond servers and networks, to the algorithmic and epistemic level of the system, respectively, in the AI ​​context, traditional principles must be extended to cover:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Training data security&lt;/li&gt;
&lt;li&gt;Model integrity&lt;/li&gt;
&lt;li&gt;Robustness against adversarial attacks&lt;/li&gt;
&lt;li&gt;Explicability and auditability&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Vulnerabilities specific to the AI ​​era
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Data poisoning
&lt;/h3&gt;

&lt;p&gt;An AI system can be compromised not only through unauthorized access, but also through manipulation of the data on which it relies. Data poisoning attacks, in which malicious data is introduced into the training set, can subtly alter the behavior of the model. The result is not an obvious error, but a strategic degradation of performance or an intentional deviation of decisions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data poisoning&lt;/strong&gt; is a type of attack in which the adversary compromises the integrity of an artificial intelligence model by deliberately introducing malicious data into the training set. Unlike attacks that target the system after implementation, data poisoning acts “at the source”, affecting the learning process of the model and influencing its long-term behavior. The injected data can be designed either to degrade the overall performance (unavailability or decreased accuracy) or to create a “backdoor” so that the model reacts erroneously only in the presence of a specific pattern or trigger. For example, a spam detection system could be trained with manipulated messages so that certain malicious expressions are later considered legitimate. The vulnerability is amplified in scenarios where the data comes from open, collaborative or automatically collected sources, without rigorous validation. From a Security by Design perspective, preventing data poisoning involves strict verification of the provenance of the data, auditing of datasets, anomaly detection mechanisms and controlled separation of data streams used for training.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adversarial Attacks
&lt;/h3&gt;

&lt;p&gt;Adversarial attacks are another sophisticated category of threats in which an adversary subtly manipulates the input data of an artificial intelligence model to cause systematic classification or decision errors, without the changes being obvious to human users. In the case of computer vision models, for example, adding minimal perturbations - invisible to the naked eye - to an image can cause the system to misidentify an object (a traffic sign can be misclassified, with serious implications for autonomous vehicles). Similarly, in natural language processing, the insertion of specially constructed linguistic structures or tokens can skew the interpretation of the model. These attacks exploit the mathematical sensitivity of neural networks to small variations in the multidimensional data space, demonstrating that high performance on standard data does not guarantee robustness under adversarial conditions. From a Security by Design perspective, countermeasures include adversarial training, robust input validation, and monitoring for abnormal model behavior in production.&lt;/p&gt;

&lt;h3&gt;
  
  
  Model Inversion &amp;amp; Data Extraction
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Model Inversion&lt;/strong&gt; is an attack technique in which an adversary attempts to reconstruct sensitive information about the data used to train a model, using only access to the final (black-box or sometimes white-box) model. The central idea is that machine learning models “retain” to some extent statistical characteristics of the training data. If the model is strategically interrogated, the attacker can approximate individual data or sensitive features associated with a particular user. For example, in a facial recognition system or a medical model trained on clinical data, an attacker could reconstruct facial features or information about a specific patient. The vulnerability arises especially when the model is overfitted or when its responses provide detailed probability scores, which can be exploited for reverse inference. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Extraction&lt;/strong&gt; (or model extraction / training data extraction) goes even further, aiming at directly extracting fragments of data stored by the model during training. In the case of large language models, this can mean regenerating portions of sensitive texts accidentally included in datasets (personal data, API keys, confidential information). Attackers use iterative queries, strategic formulations or optimization techniques to “squeeze” the model of stored information. The risk is amplified when the models are integrated into public applications and provide very detailed answers. From a Security by Design perspective, protection against these attacks involves limiting the granularity of the outputs, using regularization and differential privacy techniques in the training phase, as well as implementing robust mechanisms for monitoring and filtering the generated answers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prompt Injection (in LLMs)
&lt;/h3&gt;

&lt;p&gt;Unlike traditional attacks on web applications or infrastructure, prompt injection does not exploit a classic programming bug, but the very probabilistic and contextual nature of the model.&lt;/p&gt;

&lt;p&gt;Prompt Injection is a technique by which a user inserts malicious instructions into an apparently legitimate input, with the aim of modifying the behavior of the model and causing it to ignore the rules or restrictions established by the system.&lt;/p&gt;

&lt;p&gt;Typically, a system based on LLM works as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There is a system prompt (internal instructions, invisible to the user).&lt;/li&gt;
&lt;li&gt;There is a user prompt (user input).&lt;/li&gt;
&lt;li&gt;The model generates a response based on the entire context.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The vulnerability arises because the model treats all text as a sequence of tokens, without making a rigid structural distinction between system and user instructions. Thus, a user can try to "overwrite" the initial rules with a specially constructed input.&lt;/p&gt;

&lt;p&gt;Security by Design in the AI ​​era involves anticipating these scenarios and designing the system so that it is robust, resilient and able to detect behavioral deviations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Integrating Security into the AI ​​Lifecycle
&lt;/h2&gt;

&lt;p&gt;An AI system goes through several stages: data collection, model training, validation, deployment, and ongoing operation. Each of these phases should be treated as a critical control point.&lt;/p&gt;

&lt;p&gt;In the data collection phase, security means verifying sources, ensuring the integrity of datasets, and protecting sensitive data through anonymization or pseudonymization. Data is the foundation of the model; if this foundation is compromised, the entire system becomes fragile.&lt;/p&gt;

&lt;p&gt;In the training phase, the infrastructure must be isolated and monitored. Models must be versioned, and each experiment must be documented to allow for later auditing. The integrity of generated artifacts must be verified through cryptographic mechanisms, and access to computing resources must be limited according to the principle of least privilege.&lt;/p&gt;

&lt;p&gt;At the time of deployment, API security becomes essential. Rate limiting, multifactor authentication, and monitoring for abnormal behavior are measures that reduce the risk of system exploitation. In the operational phase, continuous monitoring of model performance and detection of model drift are essential to prevent degradation or manipulation of its behavior.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Security by Design therefore means a continuity of control, not a single event.&lt;/u&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Zero Trust and the new paradigm of trust
&lt;/h2&gt;

&lt;p&gt;In the AI ​​era, the concept of trust must be rethought. The Zero Trust model, which assumes that no user or system is implicitly trusted, becomes extremely relevant. Access to AI models and associated data should only be granted based on clear and verifiable policies.&lt;/p&gt;

&lt;p&gt;This approach is all the more important as AI systems are integrated into complex ecosystems, distributed in the cloud, and connected to multiple data sources. The lack of segmentation or granular access controls can turn a minor incident into a major breach.&lt;/p&gt;

&lt;p&gt;Zero Trust applied to AI is not limited to authentication; it also involves continuous validation of system behavior, verification of model integrity, and permanent analysis of user interactions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Regulation, governance and accountability
&lt;/h2&gt;

&lt;p&gt;As AI becomes critical infrastructure, regulation becomes inevitable. The European Union has introduced the AI ​​Act, which classifies AI systems according to risk and imposes strict requirements for those considered high-risk. In parallel, the GDPR establishes clear obligations on data protection and the right to explanation.&lt;/p&gt;

&lt;p&gt;These legislative frameworks are not obstacles to innovation, but catalysts for the adoption of Security by Design. They force organizations to document processes, implement audit mechanisms and ensure transparency.&lt;br&gt;
AI governance thus becomes a central element of security. It is not enough for a system to perform; it must be accountable, explainable and compliant with legal norms.&lt;/p&gt;

&lt;h2&gt;
  
  
  The ethical dimension of security
&lt;/h2&gt;

&lt;p&gt;Security in the age of AI is not just a technical issue. It is also an ethical one. A model that discriminates or produces biased results can generate damage as serious as a data breach.&lt;/p&gt;

&lt;p&gt;Companies like Microsoft and IBM have developed Responsible AI frameworks that include principles of fairness, transparency, and accountability. These initiatives show that Security by Design must also include protection against social and moral risks.&lt;/p&gt;

&lt;p&gt;Ultimately, &lt;u&gt;security is not just about protecting the system, but also protecting the people affected by its decisions&lt;/u&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Red Teaming and Operational Resilience
&lt;/h2&gt;

&lt;p&gt;A secure system is not one that has not been attacked, but one that has been rigorously tested and proven resilient. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Red Teaming&lt;/strong&gt; in the context of AI systems is a structured process through which specialized teams simulate real-world attacks to identify vulnerabilities before they are exploited in the operational environment, directly contributing to increasing the resilience of the system. Unlike traditional testing, red teaming involves a creative adversarial approach, in which experts try to circumvent model restrictions through prompt injection, adversarial attacks, data exfiltration attempts, or manipulation of algorithmic behavior. The goal is not just to discover specific technical errors, but to assess the ability of the entire architecture - model, infrastructure, access controls, and organizational processes - to withstand real-world pressures. By integrating red teaming into the continuous development and operations (MLOps) cycle, organizations can transform security from a reaction to incidents into a proactive mechanism for strengthening operational resilience, ensuring the safe and stable operation of AI systems in dynamic and potentially hostile conditions.&lt;/p&gt;

&lt;p&gt;This practice transforms security from a defensive to a proactive process. Instead of reacting to incidents, organizations anticipate and model risk scenarios.&lt;/p&gt;

&lt;h2&gt;
  
  
  Future Challenges
&lt;/h2&gt;

&lt;p&gt;As AI evolves towards autonomous systems and agents capable of making complex decisions independently, the attack surface will continue to grow. The integration of AI into critical infrastructure, financial systems, or healthcare systems will amplify the potential impact of vulnerabilities.&lt;/p&gt;

&lt;p&gt;Security by Design must evolve with technology. Collaboration between engineers, security experts, lawyers, ethicists, and policymakers will be required. Without this interdisciplinary approach, the complexity of AI systems may outstrip our ability to control them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Security as the Foundation of Trust
&lt;/h2&gt;

&lt;p&gt;In the age of artificial intelligence, security is no longer a technical detail, but the foundation of digital trust. Without Security by Design, AI systems can become vulnerable, manipulable, and potentially dangerous tools. With Security by Design, they can become catalysts for progress, supporting innovation in a responsible and sustainable way.&lt;/p&gt;

&lt;p&gt;Building secure AI is not about slowing down development, but making it sustainable. In a world where algorithms increasingly influence reality, security becomes the invisible architecture that supports the future.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bibliography
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Pearlson, Keri &amp;amp; Novaes Neto, Nelson. „What is Secure-by-Design AI?” &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://mitsloan.mit.edu/ideas-made-to-matter/working-definitions/what-is-secure-by-design-ai" rel="noopener noreferrer"&gt;Definition and framework for integrating security as a basic principle in the design of AI systems&lt;/a&gt;. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;ETSI EN 304 223 - Securing Artificial Intelligence (SAI) &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.etsi.org/deliver/etsi_en/304200_304299/304223/02.01.01_60/en_304223v020101p.pdf" rel="noopener noreferrer"&gt;Security technical standard for AI systems, which includes "secure design" principles in the different stages of the AI ​​lifecycle&lt;/a&gt;. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;UK Government - Code of Practice for the Cyber Security of AI &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.gov.uk/government/publications/ai-cyber-security-code-of-practice/code-of-practice-for-the-cyber-security-of-ai" rel="noopener noreferrer"&gt;Best practices guide for designing and operating AI securely, including the principle of secure design&lt;/a&gt;.
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Prasad, Anand. „A Policy Roadmap for Secure by Design AI: Building Trust Through Security-First Development” &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://seceon.com/a-policy-roadmap-for-secure-by-design-ai-building-trust-through-security-first-development/" rel="noopener noreferrer"&gt;Article discussing the need to shift the AI ​​security paradigm from reactive to proactive&lt;/a&gt;.
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Abbas, Rianat et al. „Secure by design - enhancing software products with AI-Driven security measures” &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.researchgate.net/publication/390611686_Secure_by_design_-_enhancing_software_products_with_AI-Driven_security_measures" rel="noopener noreferrer"&gt;Study addressing the integration of AI-based security measures within Secure by Design&lt;/a&gt;.
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ai</category>
      <category>security</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Deliberate Hybrid Design: Building Systems That Gracefully Fall Back from AI to Deterministic Logic</title>
      <dc:creator>Gelu Vac</dc:creator>
      <pubDate>Mon, 06 Apr 2026 13:52:12 +0000</pubDate>
      <link>https://dev.to/geluvac/deliberate-hybrid-design-building-systems-that-gracefully-fall-back-from-ai-to-deterministic-logic-1mna</link>
      <guid>https://dev.to/geluvac/deliberate-hybrid-design-building-systems-that-gracefully-fall-back-from-ai-to-deterministic-logic-1mna</guid>
      <description>&lt;p&gt;In the last decade, Artificial Intelligence has moved from experimental labs into the backbone of mainstream products. From recommendation systems and fraud detection to code assistants and autonomous vehicles, machine learning (ML) models now influence critical decisions at scale. Yet as powerful as these systems are, they are also inherently probabilistic and occasionally unreliable. Anyone who has wrestled with a large language model (LLM) that confidently produces incorrect information knows this firsthand.&lt;br&gt;
This unpredictability is not a flaw - it’s a feature of statistical models. But it does create a serious engineering challenge: how do we build dependable products on top of inherently uncertain components?&lt;br&gt;
The answer, increasingly, lies in a design philosophy that is both pragmatic and strategic: &lt;strong&gt;deliberate hybrid design&lt;/strong&gt;. Rather than treating AI as a standalone “brain,” we integrate it with deterministic, rule-based components - and ensure there is a &lt;strong&gt;graceful fallback path&lt;/strong&gt; when AI fails, is uncertain, or is not required.&lt;br&gt;
This article explores how to apply this philosophy in real-world software systems, why it matters, and how to design AI-enabled solutions that are robust, explainable, and trustworthy.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Myth of AI Supremacy
&lt;/h2&gt;

&lt;p&gt;The rise of AI has created a strong narrative: if Machine Learning can outperform humans on a task, why not let it run everything? But this mindset - “AI-first” or “AI-only” - can be dangerous. It leads to brittle architectures, opaque decision-making, and poor user experiences.&lt;br&gt;
Consider a few examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Autonomous driving&lt;/strong&gt;: State-of-the-art perception systems detect objects and predict trajectories. But when conditions are unclear - fog, sensor failure, or conflicting signals - the system must hand over control or switch to rule-based safety protocols.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fraud detection&lt;/strong&gt;: Machine learning models flag suspicious transactions with impressive accuracy. Yet final decisions often depend on deterministic business rules (e.g., legal compliance thresholds) or &lt;strong&gt;require human review&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Chatbots and copilots&lt;/strong&gt;: Generative AI can draft messages or code snippets. But when the confidence score is low or the consequences are high (e.g., financial transactions, medical recommendations), &lt;strong&gt;the system should defer to validated templates or manual input&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In each case, &lt;strong&gt;the most reliable solutions are hybrid&lt;/strong&gt; - combining probabilistic inference with deterministic control. This isn’t a fallback of weakness; it’s a design choice that maximizes robustness.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Hybrid Systems Win
&lt;/h2&gt;

&lt;p&gt;There are several compelling reasons to design AI systems with deterministic components and fallback paths:&lt;/p&gt;

&lt;h4&gt;
  
  
  a. Reliability and Safety
&lt;/h4&gt;

&lt;p&gt;AI models can fail in unpredictable ways: edge cases, data drift, adversarial input, or low-confidence predictions. Deterministic logic provides a safety net, ensuring that critical operations continue under known, tested conditions.&lt;/p&gt;

&lt;h4&gt;
  
  
  b. Explainability and Compliance
&lt;/h4&gt;

&lt;p&gt;Regulated domains - healthcare, finance, law - require transparent decision-making. A hybrid approach allows us to explain final decisions even if an ML model contributed part of the reasoning.&lt;/p&gt;

&lt;h4&gt;
  
  
  c. Performance and Efficiency
&lt;/h4&gt;

&lt;p&gt;AI is computationally expensive. In many scenarios, we can use simple rules to handle routine cases and reserve AI for ambiguous or high-value decisions. This not only improves performance but also reduces costs.&lt;/p&gt;

&lt;h4&gt;
  
  
  d. User Trust
&lt;/h4&gt;

&lt;p&gt;Users are more likely to trust a system that admits uncertainty and defers when appropriate. &lt;strong&gt;Graceful fallback demonstrates design maturity and builds credibility over time&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Architecture of Deliberate Hybrid Design
&lt;/h2&gt;

&lt;p&gt;Designing hybrid systems is not an afterthought - it requires planning at the architectural level. A deliberate hybrid system typically includes four layers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Sensing / Input Layer&lt;/strong&gt; – Collects data or user input.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI Layer&lt;/strong&gt; – Performs probabilistic inference, classification, prediction, or generation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deterministic Layer&lt;/strong&gt; – Enforces rules, policies, and business logic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fallback / Escalation Layer&lt;/strong&gt; – Defines what happens when AI output is unreliable or ambiguous.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let’s explore each in more detail.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Confidence as a First-Class Citizen&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;A foundational principle in hybrid design is &lt;strong&gt;confidence scoring&lt;/strong&gt;. Whether you’re dealing with a classifier, a recommender, or a large language model (LLM), &lt;strong&gt;you need a way to quantify uncertainty&lt;/strong&gt;. This could be a probability score, entropy measure, thresholded similarity, or custom metric.&lt;br&gt;
Once you have a confidence signal, you can define thresholds that trigger deterministic behavior. For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;High confidence&lt;/strong&gt;: Accept AI output automatically.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Medium confidence&lt;/strong&gt;: Pass output through a rule-based validation layer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Low confidence&lt;/strong&gt;: Trigger fallback (e.g., human review, default rule, or simpler algorithm).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This tiered approach allows systems to dynamically adjust their behavior based on how “sure” they are - a cornerstone of graceful fallback.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Multi-Layer Decision Logic&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;In many applications, decisions don’t have to be binary (AI vs. rules). Instead, they can flow through multiple layers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Pre-filter with rules&lt;/strong&gt;: Before invoking AI, use deterministic logic to discard irrelevant input or enforce hard constraints.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Apply AI model&lt;/strong&gt;: Perform classification, prediction, or generation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validate with rules&lt;/strong&gt;: Post-process the AI output using deterministic checks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fallback or escalate&lt;/strong&gt;: If validation fails, fallback to a safe default, prompt for human review, or invoke a simpler model.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For example, a medical triage chatbot might:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Validate that symptoms fall within known categories.&lt;/li&gt;
&lt;li&gt;Use an AI model to suggest possible causes.&lt;/li&gt;
&lt;li&gt;Apply clinical rules to flag life-threatening risks.&lt;/li&gt;
&lt;li&gt;Escalate to a human doctor if the risk is high or the model is uncertain.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This layered flow ensures that each decision is made at the right level of complexity and accountability.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Human-in-the-Loop as a Design Pattern&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Graceful fallback&lt;/em&gt; doesn’t always mean reverting to rules - sometimes, it means involving humans strategically. “Human-in-the-loop” (HITL) systems use people to validate or override AI decisions in critical moments.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In document review, AI can classify and prioritize, while humans verify.&lt;/li&gt;
&lt;li&gt;In autonomous systems, humans can assume control when conditions are unclear.&lt;/li&gt;
&lt;li&gt;In support chatbots, unresolved conversations can seamlessly escalate to human agents.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The key is designing &lt;strong&gt;handoffs that feel natural&lt;/strong&gt; - not as emergency patches, but as integral parts of the user experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  Case Studies: Hybrid Design in Practice
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Case Study 1: E-commerce Recommendation Engine
&lt;/h3&gt;

&lt;p&gt;A major retailer built a product recommendation system powered by deep learning. However, they faced two issues: legal restrictions on personalized offers in certain regions and customer complaints about irrelevant suggestions.&lt;/p&gt;

&lt;p&gt;The solution was a hybrid pipeline:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Stage 1&lt;/strong&gt;: Business rules filtered out restricted categories and enforced legal constraints.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stage 2&lt;/strong&gt;: The AI model generated ranked recommendations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stage 3&lt;/strong&gt;: A rule-based validator ensured diversity and compliance before display.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fallback&lt;/strong&gt;: If the AI model produced low-confidence results, a deterministic “bestsellers” list was shown instead.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Result&lt;/strong&gt;: higher user satisfaction, full regulatory compliance, and reduced reliance on expensive model inference.&lt;/p&gt;

&lt;h3&gt;
  
  
  Case Study 2: Industrial Predictive Maintenance
&lt;/h3&gt;

&lt;p&gt;An industrial IoT platform used machine learning to predict equipment failures. But false-positives were costly, and false-negatives were dangerous.&lt;/p&gt;

&lt;p&gt;The hybrid solution combined:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rules&lt;/strong&gt;: Safety-critical thresholds (e.g., temperature &amp;gt; 120°C) triggered immediate shutdown.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI&lt;/strong&gt;: Predictive models forecasted potential failures based on historical data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fallback&lt;/strong&gt;: If predictions were low-confidence or conflicted with sensor data, the system defaulted to conservative rule-based safety actions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Result: downtime was reduced without compromising safety - and operators trusted the system more.&lt;/p&gt;

&lt;h2&gt;
  
  
  Patterns for Graceful Fallback
&lt;/h2&gt;

&lt;p&gt;Here are some proven design patterns you can apply in your own systems:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Default Response Pattern&lt;/strong&gt;: Provide a deterministic “safe answer” if AI is uncertain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rule-Gated AI Pattern&lt;/strong&gt;: Use rules to constrain AI input/output within acceptable boundaries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Confidence Escalation Pattern&lt;/strong&gt;: Route low-confidence cases to human review or secondary logic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shadow Mode Pattern&lt;/strong&gt;: Run AI in parallel with existing rule-based systems, comparing outputs before full deployment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tiered Complexity Pattern&lt;/strong&gt;: Start with simple logic; escalate to more complex (AI) methods only when needed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;: These patterns are not mutually exclusive - they often work best in combination.&lt;/p&gt;

&lt;h2&gt;
  
  
  Organizational Mindset: Engineering for Uncertainty
&lt;/h2&gt;

&lt;p&gt;Building hybrid systems is not just a technical challenge - it’s a cultural one. It requires teams to shift their mindset:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;From “&lt;strong&gt;AI will solve it&lt;/strong&gt;” TO “&lt;strong&gt;AI is a tool, not an oracle&lt;/strong&gt;”;&lt;/li&gt;
&lt;li&gt;From “&lt;strong&gt;deterministic vs. probabilistic&lt;/strong&gt;” TO “&lt;strong&gt;deterministic and probabilistic&lt;/strong&gt;”;&lt;/li&gt;
&lt;li&gt;From “&lt;strong&gt;one-size-fits-all&lt;/strong&gt;” TO “&lt;strong&gt;context-aware decision flows&lt;/strong&gt;”.
This mindset influences everything: architecture, testing, DevOps, product design, and even how you communicate capabilities to users.
It also means measuring success differently. Instead of chasing model accuracy alone, &lt;strong&gt;focus on system reliability, user trust, and graceful degradation&lt;/strong&gt; under uncertainty.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion: Hybrid Is the Future
&lt;/h2&gt;

&lt;p&gt;The era of AI-only systems is ending. As we integrate machine learning (ML) into mission-critical workflows, &lt;strong&gt;robustness matters as much as intelligence&lt;/strong&gt;. &lt;em&gt;Deliberate hybrid design&lt;/em&gt; - the thoughtful fusion of probabilistic models, deterministic logic, and human judgment - is how we get there.&lt;br&gt;
The best systems of the future will not be those that rely on AI blindly. They will be those that &lt;strong&gt;understand when to trust the model, when to fall back, and when to escalate&lt;/strong&gt;. They will embrace uncertainty not as a weakness, but as a design constraint.&lt;br&gt;
And they will succeed because of it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Takeaways:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;AI is powerful but inherently uncertain; deterministic logic provides safety, transparency, and reliability.&lt;/li&gt;
&lt;li&gt;Design fallback paths intentionally - don’t bolt them on after failures occur.&lt;/li&gt;
&lt;li&gt;Use confidence scoring, layered decision flows, and human-in-the-loop mechanisms.&lt;/li&gt;
&lt;li&gt;Measure system success in terms of robustness, trust, and graceful degradation - not just model performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In software architecture, as in aviation, the most advanced autopilot is only as good as its ability to hand control back to a human pilot. Deliberate hybrid design ensures that when - not if - AI falters, the system continues to serve users reliably and safely.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key references
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;“Hierarchical Fallback Architecture for High Risk Online Machine Learning Inference” – Gustavo Polleti et al. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Proposes a hierarchical fallback architecture for robustness in ML systems; includes fallback modes when inference fails. &lt;/li&gt;
&lt;li&gt;This aligns with the idea of switching from a neural path to fallback logic under failure conditions. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://arxiv.org/html/2501.17834v1" rel="noopener noreferrer"&gt;https://arxiv.org/html/2501.17834v1&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;“Hybrid AI Reasoning: Integrating Rule-Based Logic with LLMs” (Preprint) &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Explores blending deterministic rule logic with transformer-based models. &lt;/li&gt;
&lt;li&gt;Mentions dual-stream frameworks and fallback or validation layers. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.preprints.org/manuscript/202504.1453/v1" rel="noopener noreferrer"&gt;https://www.preprints.org/manuscript/202504.1453/v1&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;“Modular Design Patterns for Hybrid Learning and Reasoning Systems” &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Surveys many hybrid architectures, laying out patterns for mixing symbolic/rule and statistical (neural) systems. &lt;/li&gt;
&lt;li&gt;Useful for seeing how fallback or integration can appear in practical systems. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://arxiv.org/abs/2102.11965" rel="noopener noreferrer"&gt;https://arxiv.org/abs/2102.11965&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;“Taxonomy of Hybrid Architectures Involving Rule-Based Systems” &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Based on clinical decision systems in healthcare. Shows how rule-based logic is used alongside ML. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://pubmed.ncbi.nlm.nih.gov/37355025/" rel="noopener noreferrer"&gt;https://pubmed.ncbi.nlm.nih.gov/37355025/&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;“Hybrid Neuro-Symbolic Learning and Reasoning for Resilient Systems” &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mentions fallback actions conceived as “Force Minimal Operation” in hybrid systems. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.sciencedirect.com/science/article/pii/S0960148125020658" rel="noopener noreferrer"&gt;https://www.sciencedirect.com/science/article/pii/S0960148125020658&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;“Unlocking the Potential of Generative AI through Neuro-symbolic Architectures” &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Systematic study of architectures that integrate symbolic and neural components. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://arxiv.org/html/2502.11269v1" rel="noopener noreferrer"&gt;https://arxiv.org/html/2502.11269v1&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Bibliography
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Amershi, S. et al. (2019). Guidelines for Human-AI Interaction. CHI ’19. &lt;a href="https://www.microsoft.com/en-us/research/wp-content/uploads/2019/01/Guidelines-for-Human-AI-Interaction-camera-ready.pdf" rel="noopener noreferrer"&gt;https://www.microsoft.com/en-us/research/wp-content/uploads/2019/01/Guidelines-for-Human-AI-Interaction-camera-ready.pdf&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Varshney, K. R. (2017). Engineering Safety in Machine Learning. 2017 Information Theory and Applications Workshop. &lt;a href="https://ieeexplore.ieee.org/document/7888195" rel="noopener noreferrer"&gt;https://ieeexplore.ieee.org/document/7888195&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Sculley, D. et al. (2015). Hidden Technical Debt in Machine Learning Systems. NeurIPS. &lt;a href="https://proceedings.neurips.cc/paper_files/paper/2015/file/86df7dcfd896fcaf2674f757a2463eba-Paper.pdf" rel="noopener noreferrer"&gt;https://proceedings.neurips.cc/paper_files/paper/2015/file/86df7dcfd896fcaf2674f757a2463eba-Paper.pdf&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Ribeiro, M. T. et al. (2016). "Why Should I Trust You?": Explaining the Predictions of Any Classifier. KDD. &lt;a href="https://arxiv.org/abs/1602.04938" rel="noopener noreferrer"&gt;https://arxiv.org/abs/1602.04938&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Aston Jonathan (2024). The evolution of hybrid AI: where deterministic and statistical approaches meet. &lt;a href="https://www.capgemini.com/be-en/insights/expert-perspectives/the-evolution-of-hybrid-aiwhere-deterministic-and-probabilistic-approaches-meet/" rel="noopener noreferrer"&gt;https://www.capgemini.com/be-en/insights/expert-perspectives/the-evolution-of-hybrid-aiwhere-deterministic-and-probabilistic-approaches-meet/&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Google Cloud (2023). Machine Learning Design Patterns. (Lakshmanan, Robinson, Munn). O’Reilly. &lt;a href="https://www.oreilly.com/library/view/machine-learning-design/9781098115777/" rel="noopener noreferrer"&gt;https://www.oreilly.com/library/view/machine-learning-design/9781098115777/&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Microsoft (2022). Responsible AI Standard v2. (Sections on fallback and human oversight). &lt;a href="https://cdn-dynmedia-1.microsoft.com/is/content/microsoftcorp/microsoft/final/en-us/microsoft-brand/documents/Microsoft-Responsible-AI-Standard-General-Requirements.pdf" rel="noopener noreferrer"&gt;https://cdn-dynmedia-1.microsoft.com/is/content/microsoftcorp/microsoft/final/en-us/microsoft-brand/documents/Microsoft-Responsible-AI-Standard-General-Requirements.pdf&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>architecture</category>
    </item>
  </channel>
</rss>
