olonok69/DotNet_ML

A comprehensive collection of 20+ Machine Learning, Computer Vision, NLP, and Generative AI projects — all in C# and .NET

C#

1

33 commits

updated Mar 7, 2026

See the code

README

.NET Machine Learning

.NET Machine Learning Lab

A comprehensive collection of 20+ Machine Learning, Computer Vision, NLP, and Generative AI projects — all in C# and .NET

.NET C# ONNX Runtime ML.NET License


Overview

This repository demonstrates how to build real-world Machine Learning and AI applications using the .NET ecosystem. It covers a wide range of domains — from image classification and object detection to large language models and speech recognition — all implemented in C# with production-grade libraries.


Table of Contents


Project Catalog

🔍 Computer Vision

ProjectDescriptionKey Packages
ImageClassificationTensorFlow Inception model for ImageNet classification (1000 classes)ML.NET, TensorFlow.NET
tf_image_classificationTensorFlow image scoring via ML.NET integrationML.NET 3.0, TensorFlow.NET 2.16
mlnet_image_classificationDeep learning CNN training for concrete crack detection (SDNET2018 dataset)ML.NET 4.0, ML.NET Vision
object_detectionReal-time object detection with Faster R-CNN — detects 80 COCO object categoriesONNX Runtime 1.16, ImageSharp
nsfwNSFW content classifier using a fine-tuned Vision Transformer (ViT)ONNX Runtime, ImageSharp
florence_2Multi-task vision foundation model — OCR, captioning, object detection, segmentationFlorence2, ONNX Runtime 1.18
dalle3DALL-E 3 text-to-image generation via Semantic KernelSemantic Kernel 1.19, SkiaSharp

🤖 Large Language Models & Generative AI

ProjectDescriptionKey Packages
phi3Interactive Phi-3-mini chatbot with local ONNX inference (4K context)OnnxRuntimeGenAI 0.3
phi3visionPhi-3 Vision 128K multimodal model — understands text + imagesOnnxRuntimeGenAI, Spectre.Console
ai_toolkitAI Toolkit inference with Phi-3-mini-128k (quantized INT4 ONNX)OnnxRuntimeGenAI, DirectML, CUDA
bert_onnxBERT large-uncased question-answering with ONNX RuntimeBERTTokenizers, ONNX Runtime, ML.NET
torchsharpSentiment analysis using TorchSharp (PyTorch bindings for .NET)ML.NET TorchSharp 0.22

🌐 Natural Language Processing

ProjectDescriptionKey Packages
cld_3Language detection using Google's Compact Language Detector 3 (100+ languages)Panlingo CLD3
fasttextLanguage identification using Facebook's FastText (176+ languages)Panlingo FastText

🎙️ Speech & OCR

ProjectDescriptionKey Packages
whisper_netASP.NET Core Web API for speech-to-text using OpenAI WhisperWhisper.net 1.7, NAudio
tesseract_dotnetOptical Character Recognition with multi-language supportTesseractOCR 5.3, Spectre.Console

🧠 Semantic Kernel

A suite of projects demonstrating Microsoft Semantic Kernel — the SDK that integrates LLMs with conventional programming languages.

ProjectDescriptionKey Packages
semantic_kernel/sk1Chat with Azure OpenAI using prompts & pluginsSemantic Kernel 1.15
semantic_kernel/Chroma_appRAG with Chroma vector database for semantic memorySK Connectors.Chroma
semantic_kernel/native_functionsExtend LLMs with native C# plugins (e.g., MusicLibrary)Semantic Kernel 1.16
semantic_kernel/ollamasharpRun Phi-3 locally via Ollama + Semantic KernelOllamaSharp 2.0
semantic_kernel/phi3_skPhi-3 ONNX integrated with Semantic Kernel via custom connectorSK + OnnxRuntimeGenAI
semantic_kernel/plannersAI Planners — automatic plugin orchestration with HandlebarsSK Planners.Handlebars
semantic_kernel/dalle3DALL-E 3 image generation through Semantic KernelSemantic Kernel 1.19

🛠️ Utilities

ProjectDescriptionKey Packages
extract_imagesExtract images from PDF, DOCX, PPTX, ODT, HTML, RTF documentsGroupDocs.Parser
mimeMIME type detection by inspecting file content (magic bytes)Mime-Detective

Tech Stack

CategoryTechnologies
Runtime.NET 8.0 (C# 12)
ML FrameworksML.NET, TorchSharp, TensorFlow.NET
Inference EnginesONNX Runtime, OnnxRuntimeGenAI
LLMsPhi-3, Phi-3 Vision, BERT, GPT (via Azure OpenAI)
OrchestrationMicrosoft Semantic Kernel, Handlebars Planners
Vision ModelsFlorence-2, Faster R-CNN, ViT, Inception
SpeechWhisper.net (OpenAI Whisper)
OCRTesseract, Florence-2
Image ProcessingSixLabors.ImageSharp, SkiaSharp
Vector StoresChroma DB
WebASP.NET Core, Kestrel
ContainersDocker (Whisper API, Ollama, Chroma)

Prerequisites

Model Downloads (project-specific):

ModelDownloadUsed By
Phi-3 Mini ONNXhuggingface-cli download microsoft/Phi-3-mini-4k-instruct-onnx --include cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/* --local-dir .phi3, phi3_sk, ai_toolkit
Phi-3 Vision ONNXhuggingface-cli download microsoft/Phi-3-vision-128k-instruct-onnx-cpu --include cpu-int4-rtn-block-32-acc-level-4/* --local-dir .phi3vision
BERT Large ONNXHuggingFace (convert to ONNX)bert_onnx
Florence-2 ONNXflorence2-sharpflorence_2
FastText Modelslid.176.bin / fasttext217.binfasttext
Tesseract tessdatatessdatatesseract_dotnet
Whisper ggml-baseAuto-downloaded on first runwhisper_net
Faster R-CNN ONNXONNX Model Zooobject_detection

Optional Docker Services:

# Ollama (for local LLM inference)
docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
ollama run phi3

# Chroma (for vector store / RAG)
docker run -it --rm -p 8000:8000/tcp chromadb/chroma:latest

API Keys (for cloud-based projects):

  • Azure OpenAI API key — required for sk1, dalle3, planners

Getting Started

  1. Clone the repository

    git clone https://github.com/your-username/DotNet_ML.git
    cd DotNet_ML
    
  2. Navigate to any project folder

    cd phi3
    
  3. Restore dependencies and run

    dotnet restore
    dotnet run
    

Each project is self-contained with its own .sln and .csproj. Refer to the project-specific section above for any required model downloads or configuration.


License

This project is licensed under the terms of the MIT License.

olonok69/DotNet_ML

A comprehensive collection of 20+ Machine Learning, Computer Vision, NLP, and Generative AI projects — all in C# and .NET

C#

1

33 commits

updated Mar 7, 2026

See the code

README

.NET Machine Learning

.NET Machine Learning Lab

A comprehensive collection of 20+ Machine Learning, Computer Vision, NLP, and Generative AI projects — all in C# and .NET

.NET C# ONNX Runtime ML.NET License


Overview

This repository demonstrates how to build real-world Machine Learning and AI applications using the .NET ecosystem. It covers a wide range of domains — from image classification and object detection to large language models and speech recognition — all implemented in C# with production-grade libraries.


Table of Contents


Project Catalog

🔍 Computer Vision

ProjectDescriptionKey Packages
ImageClassificationTensorFlow Inception model for ImageNet classification (1000 classes)ML.NET, TensorFlow.NET
tf_image_classificationTensorFlow image scoring via ML.NET integrationML.NET 3.0, TensorFlow.NET 2.16
mlnet_image_classificationDeep learning CNN training for concrete crack detection (SDNET2018 dataset)ML.NET 4.0, ML.NET Vision
object_detectionReal-time object detection with Faster R-CNN — detects 80 COCO object categoriesONNX Runtime 1.16, ImageSharp
nsfwNSFW content classifier using a fine-tuned Vision Transformer (ViT)ONNX Runtime, ImageSharp
florence_2Multi-task vision foundation model — OCR, captioning, object detection, segmentationFlorence2, ONNX Runtime 1.18
dalle3DALL-E 3 text-to-image generation via Semantic KernelSemantic Kernel 1.19, SkiaSharp

🤖 Large Language Models & Generative AI

ProjectDescriptionKey Packages
phi3Interactive Phi-3-mini chatbot with local ONNX inference (4K context)OnnxRuntimeGenAI 0.3
phi3visionPhi-3 Vision 128K multimodal model — understands text + imagesOnnxRuntimeGenAI, Spectre.Console
ai_toolkitAI Toolkit inference with Phi-3-mini-128k (quantized INT4 ONNX)OnnxRuntimeGenAI, DirectML, CUDA
bert_onnxBERT large-uncased question-answering with ONNX RuntimeBERTTokenizers, ONNX Runtime, ML.NET
torchsharpSentiment analysis using TorchSharp (PyTorch bindings for .NET)ML.NET TorchSharp 0.22

🌐 Natural Language Processing

ProjectDescriptionKey Packages
cld_3Language detection using Google's Compact Language Detector 3 (100+ languages)Panlingo CLD3
fasttextLanguage identification using Facebook's FastText (176+ languages)Panlingo FastText

🎙️ Speech & OCR

ProjectDescriptionKey Packages
whisper_netASP.NET Core Web API for speech-to-text using OpenAI WhisperWhisper.net 1.7, NAudio
tesseract_dotnetOptical Character Recognition with multi-language supportTesseractOCR 5.3, Spectre.Console

🧠 Semantic Kernel

A suite of projects demonstrating Microsoft Semantic Kernel — the SDK that integrates LLMs with conventional programming languages.

ProjectDescriptionKey Packages
semantic_kernel/sk1Chat with Azure OpenAI using prompts & pluginsSemantic Kernel 1.15
semantic_kernel/Chroma_appRAG with Chroma vector database for semantic memorySK Connectors.Chroma
semantic_kernel/native_functionsExtend LLMs with native C# plugins (e.g., MusicLibrary)Semantic Kernel 1.16
semantic_kernel/ollamasharpRun Phi-3 locally via Ollama + Semantic KernelOllamaSharp 2.0
semantic_kernel/phi3_skPhi-3 ONNX integrated with Semantic Kernel via custom connectorSK + OnnxRuntimeGenAI
semantic_kernel/plannersAI Planners — automatic plugin orchestration with HandlebarsSK Planners.Handlebars
semantic_kernel/dalle3DALL-E 3 image generation through Semantic KernelSemantic Kernel 1.19

🛠️ Utilities

ProjectDescriptionKey Packages
extract_imagesExtract images from PDF, DOCX, PPTX, ODT, HTML, RTF documentsGroupDocs.Parser
mimeMIME type detection by inspecting file content (magic bytes)Mime-Detective

Tech Stack

CategoryTechnologies
Runtime.NET 8.0 (C# 12)
ML FrameworksML.NET, TorchSharp, TensorFlow.NET
Inference EnginesONNX Runtime, OnnxRuntimeGenAI
LLMsPhi-3, Phi-3 Vision, BERT, GPT (via Azure OpenAI)
OrchestrationMicrosoft Semantic Kernel, Handlebars Planners
Vision ModelsFlorence-2, Faster R-CNN, ViT, Inception
SpeechWhisper.net (OpenAI Whisper)
OCRTesseract, Florence-2
Image ProcessingSixLabors.ImageSharp, SkiaSharp
Vector StoresChroma DB
WebASP.NET Core, Kestrel
ContainersDocker (Whisper API, Ollama, Chroma)

Prerequisites

Model Downloads (project-specific):

ModelDownloadUsed By
Phi-3 Mini ONNXhuggingface-cli download microsoft/Phi-3-mini-4k-instruct-onnx --include cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/* --local-dir .phi3, phi3_sk, ai_toolkit
Phi-3 Vision ONNXhuggingface-cli download microsoft/Phi-3-vision-128k-instruct-onnx-cpu --include cpu-int4-rtn-block-32-acc-level-4/* --local-dir .phi3vision
BERT Large ONNXHuggingFace (convert to ONNX)bert_onnx
Florence-2 ONNXflorence2-sharpflorence_2
FastText Modelslid.176.bin / fasttext217.binfasttext
Tesseract tessdatatessdatatesseract_dotnet
Whisper ggml-baseAuto-downloaded on first runwhisper_net
Faster R-CNN ONNXONNX Model Zooobject_detection

Optional Docker Services:

# Ollama (for local LLM inference)
docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
ollama run phi3

# Chroma (for vector store / RAG)
docker run -it --rm -p 8000:8000/tcp chromadb/chroma:latest

API Keys (for cloud-based projects):

  • Azure OpenAI API key — required for sk1, dalle3, planners

Getting Started

  1. Clone the repository

    git clone https://github.com/your-username/DotNet_ML.git
    cd DotNet_ML
    
  2. Navigate to any project folder

    cd phi3
    
  3. Restore dependencies and run

    dotnet restore
    dotnet run
    

Each project is self-contained with its own .sln and .csproj. Refer to the project-specific section above for any required model downloads or configuration.


License

This project is licensed under the terms of the MIT License.

Languages

C#

100.0%