Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Podcasts & Audio BriefingsCrowdStrike: China’s 15th Five-Year Plan: What You Need to Know(24.09.2026 um 13:00 Uhr)
Malware / Trojaner / VirenClickFix: 17.000 URLs zeigen Copy-and-Paste als KI-freie Malware-Falle(24.09.2026 um 13:18 Uhr)
Malware / Trojaner / VirenIT Security News Hourly Summary 2026-09-24 13h : 12 posts(24.09.2026 um 13:00 Uhr)
IT Security NachrichtenPlanet Labs Opens Berlin Satellite Factory(24.09.2026 um 13:02 Uhr)
IT Security NachrichtenRedesigning Security Architecture in the Agentic AI Era(24.09.2026 um 13:00 Uhr)
Sicherheitslücken (CVE)[NEU] [hoch] Rancher: Schwachstelle ermöglicht Cross-Site Scripting(24.09.2026 um 12:59 Uhr)
Sicherheitslücken (CVE)[NEU] [kritisch] WordPress: Schwachstelle ermöglicht Codeausführung(24.09.2026 um 12:59 Uhr)
Podcasts & Audio BriefingsCrowdStrike: China’s 15th Five-Year Plan: What You Need to Know(24.09.2026 um 13:00 Uhr)
Malware / Trojaner / VirenClickFix: 17.000 URLs zeigen Copy-and-Paste als KI-freie Malware-Falle(24.09.2026 um 13:18 Uhr)
Malware / Trojaner / VirenIT Security News Hourly Summary 2026-09-24 13h : 12 posts(24.09.2026 um 13:00 Uhr)
IT Security NachrichtenPlanet Labs Opens Berlin Satellite Factory(24.09.2026 um 13:02 Uhr)
IT Security NachrichtenRedesigning Security Architecture in the Agentic AI Era(24.09.2026 um 13:00 Uhr)
Sicherheitslücken (CVE)[NEU] [hoch] Rancher: Schwachstelle ermöglicht Cross-Site Scripting(24.09.2026 um 12:59 Uhr)
Sicherheitslücken (CVE)[NEU] [kritisch] WordPress: Schwachstelle ermöglicht Codeausführung(24.09.2026 um 12:59 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

How I Built an AI-Powered Adult (Porn) Content Scanner for Windows (And the Engineering Challenges I Didn't Expect)

Building an AI-Powered Content Scanner for Windows: Performance, Multithreading and GPU Acceleration in .NET Building software always looks straightforward from the outside. You load a machine learning model, point it at some images,…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!




Building an AI-Powered Content Scanner for Windows: Performance, Multithreading and GPU Acceleration in .NET



Building software always looks straightforward from the outside.



You load a machine learning model, point it at some images, and display the results.



At least that's what I thought when I started building DetectNix Vision, a Windows desktop application that performs local AI-powered image analysis without uploading user data to the cloud.



In reality, the project became a deep dive into performance optimization, memory management, multithreading, GPU acceleration, and user experience.



This article covers the engineering challenges I encountered and the architectural decisions I made while building the software from the perspective of a senior developer.









The Original Goal



The initial goal was simple:




  • Scan images stored on a Windows PC

  • Detect potentially explicit or sensitive content

  • Keep all processing local

  • Support both CPU and GPU execution

  • Process large image collections efficiently

  • Remain responsive while scanning



Privacy was a major requirement.



I didn't want users uploading personal files to third-party services. Everything needed to run locally on the user's machine.



That decision immediately influenced every technical choice that followed.









Challenge #1: Model Loading Performance



One of the first mistakes I made was loading the AI model too frequently.



A modern computer vision model can be hundreds of megabytes in size. Loading it repeatedly creates significant startup overhead and quickly destroys performance.



My initial implementation worked perfectly during testing because I was only processing a handful of images.



Once I started testing larger image collections, the bottleneck became obvious.






The Solution



I moved to a singleton-style architecture where the model is loaded once during application startup and remains resident in memory.




private readonly InferenceSession _session;

public VisionEngine()
{
_session = CreateSession();
}






This reduced initialization costs dramatically and ensured every image could reuse the same loaded model.



The lesson here is simple:




AI models should usually be treated like databases or connection pools, not disposable objects.




Load them once. Reuse them often.









Challenge #2: CPU Usage Was Out of Control



The next issue appeared when processing thousands of images.



The obvious approach is:




foreach(var image in images)
{
Analyze(image);
}






Unfortunately, this wastes modern hardware.



A single image analysis might only use a fraction of the available CPU resources.



My first instinct was to parallelize everything.




Parallel.ForEach(images, image =>
{
Analyze(image);
});






This certainly increased throughput.



It also created new problems.









Challenge #3: Too Much Parallelism



Many developers assume that more threads automatically equals more performance.



With machine learning workloads, that's often not true.



I discovered that excessive parallelism caused:




  • Increased memory consumption

  • Context switching overhead

  • Reduced GPU efficiency

  • System responsiveness issues



The application became faster in benchmarks but slower in real-world usage.



The operating system was spending too much time managing threads instead of performing useful work.






The Solution



I implemented a controlled worker model.



Instead of allowing unlimited concurrency, I created a configurable processing pool.




var maxSessions = Math.Min(Environment.ProcessorCount, 4);






This allowed me to tune throughput while keeping resource usage predictable.



In practice, a carefully controlled number of workers consistently outperformed unrestricted parallel execution.



This was one of the most valuable lessons from the project:




The fastest architecture is rarely the one with the most threads.










Challenge #4: GPU Acceleration Isn't Automatic



Many users assume that installing a graphics card means software automatically becomes faster.



Unfortunately, that's not how machine learning inference works.



Supporting GPU acceleration introduced several challenges:




  • Detecting available hardware

  • Selecting execution providers

  • Handling driver differences

  • Supporting systems without compatible GPUs

  • Providing reliable CPU fallback



A failed GPU initialization could not be allowed to crash the application.






The Solution



The startup sequence attempts GPU initialization first.



If that fails, the application transparently falls back to CPU execution.




try
{
EnableGpuProvider();
}
catch
{
EnableCpuProvider();
}






This approach ensured the software would run on virtually any Windows machine.



Performance varies significantly between systems, but functionality remains consistent.









Challenge #5: Memory Pressure During Large Scans



Scanning a directory containing 50 images is easy.



Scanning a directory containing 100,000 images is a different problem entirely.



Early versions accumulated too much data in memory.



This resulted in:




  • Increased garbage collection activity

  • Higher memory usage

  • Reduced throughput

  • Longer scan times






The Solution



I switched to a streaming pipeline.



Instead of loading large batches of files, images are processed incrementally.




foreach(var file in Directory.EnumerateFiles(path))
{
Process(file);
}






This dramatically reduced memory consumption and allowed scans of extremely large collections without exhausting system resources.



Sometimes the simplest optimization is simply processing less data at once.









Challenge #6: Keeping the UI Responsive



Desktop users have very little tolerance for frozen applications.



A scan that takes several minutes is acceptable.



An application that stops responding for several minutes is not.



Initially, image analysis was competing with the user interface thread.



The result was predictable.



Windows marked the application as "Not Responding."






The Solution



I completely separated the scanning pipeline from the UI layer.



The scanner runs on background workers while the UI receives progress updates.




await Task.Run(() =>
{
StartScan();
});






This allowed users to:




  • Browse results

  • Pause scans

  • View progress

  • Continue interacting with the application



Even during intensive processing.



The difference in perceived quality was enormous.









Challenge #7: Handling Real-World Image Collections



Developers often test with ideal data.



Users never provide ideal data.



Real-world collections contain:




  • Corrupted files

  • Unsupported formats

  • Zero-byte images

  • Huge images

  • Tiny images

  • Invalid metadata



The software needed to continue scanning even when individual files failed.






The Solution



Every image is treated as potentially invalid.



Failures are isolated and logged.




try
{
Analyze(image);
}
catch(Exception ex)
{
LogError(ex);
}






A single bad file should never stop an entire scan.



This significantly improved reliability.









Challenge #8: Finding the Right Balance Between Accuracy and Speed



One of the biggest engineering trade-offs involved balancing:




  • Scan speed

  • Detection accuracy

  • Hardware requirements

  • User expectations



Larger models generally improve accuracy.



They also increase:




  • Memory usage

  • Startup times

  • Processing times



Smaller models improve responsiveness but may sacrifice precision.



There is no universally correct answer.



The optimal balance depends on the target audience and intended use case.



For DetectNix Vision, I prioritized a solution that delivered strong accuracy while remaining practical on average consumer hardware.









Additional Engineering Decisions Worth Mentioning






Why I Chose ONNX Runtime



After evaluating several options, I standardized on ONNX Runtime.



Benefits included:




  • Excellent .NET support

  • GPU acceleration support

  • Cross-hardware compatibility

  • Consistent inference performance

  • Easy deployment with Windows applications



Most importantly, it allowed me to focus on building the product instead of maintaining machine learning infrastructure.






Why I Built a Prediction Engine Pool



Creating inference sessions can be expensive.



Rather than constantly creating and disposing resources, I implemented a reusable engine pool.



Benefits included:




  • Reduced allocations

  • Lower startup overhead

  • Better throughput

  • More predictable memory usage



This became particularly important when users scanned tens of thousands of files.






Why Privacy Became a Competitive Advantage



Initially, local processing was simply a technical requirement.



Over time it became one of the product's strongest differentiators.



Many competing solutions upload content to cloud services for analysis.



DetectNix Vision performs all scanning locally.



Benefits include:




  • No image uploads

  • Faster processing

  • Improved privacy

  • No internet dependency

  • Better suitability for business environments



Sometimes architectural decisions become product features.



This was one of those cases.









What I'd Do Differently



Looking back, there are several things I would prototype earlier:




  1. GPU support

  2. Threading architecture

  3. Memory profiling

  4. Large-scale stress testing



Many performance issues don't appear until the software processes thousands of files under real-world conditions.



Building those tests earlier would have saved significant development time.









Key Takeaways



Building AI-powered desktop software taught me that machine learning is only a small part of the problem.



The real challenges often involve traditional software engineering:




  • Resource management

  • Concurrency

  • Reliability

  • User experience

  • Performance optimization



The AI model itself might take months to train.



But creating a fast, stable, user-friendly application around that model can easily take longer.



For me, the most important lesson was this:




Success comes from engineering the entire system, not just the AI.




Users don't care how sophisticated your model is if the application is slow, unstable, or difficult to use.



They care that it works.



And that's where software engineering still matters most.









dotnet #csharp #machinelearning #ai

CTI Threat Relationship Graph2 Knoten / 1 Relationen
CVE / Incident Software MITRE ATT&CK CWE Weakness IoC
SOC Incident Playbook: Remote Code Execution (RCE) Defense
title: Detect Exploitation - How I Built an AI-Powered Adult (Porn) Content Scanner for Windows (And the Engineering Challenges I Didn't Expect)
id: d66241cf-0e96-41c6-acea-c154adecb3e5
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-24
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-24"
        description = "YARA Signature for "
    strings:
        $str = "How I Built an AI-Powered Adul" ascii wide
    condition:
        any of them
}
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich How I Built an AI-Powered Adult (Porn) C.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten How I Built an AI-Powered Adult (Porn) Content Scanner for Windows (And the Engineering Challenges I Didn't Expect)

Thematisch verwandte Begriffe: Built, AIPowered, Adult, Porn · 6 Treffer

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-97152 | Nanomsg versions 0.5-beta through 1.x before 1.2.3 has a remotely exploi…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel TTP ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick