• This repository has been archived on 12/Dec/2023
  • Stars
    star
    118
  • Rank 299,923 (Top 6 %)
  • Language
    C#
  • Created about 7 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

MNIST for ML Beginners using C#

This sample is a very simple WPF application which recognizes hand-written digits using the pre-built MNIST convolutional model. The MNIST problem is Machine Learning's Hello World program.

MNIST is a simple computer vision dataset which consists of hand written digits like as shown below.

MNIST

This tutorial comes with a pre-built CNTK model which is trained to look at these hand-written digits and predict what these digits are.

CNTK is a deep learning library in which this model is built in. For now, we will just basically load this model as a resource into your .NET application and evaluate on it. Follow the steps below to get going.

Get Started

Step 1: Download and Install

If you are new to .NET, go ahead and download Visual Studio 2017 and select only the '.NET desktop development' section as shown below.

workload install

Step 2: Download MNIST tutorial code

Clone or download this github repo. Open up the MNIST solution (MNIST.sln) file in Visual Studio 2017.                 workload install

Step 3: Understand Solution Structure

This solution consits of two projects 'Digitz' (C# project building a windows app using the CNTK pre-built MNIST model) and 'Training' (Python project, which generates the MNIST model using CNTK). Don't worry about the Python project for now.

 workload install  

Step 4: Configure and build your Project for Launch

Set the start-up project to be 'Digitz' project as shown below and then go ahead and build your application by using the right-click 'build' option.

startupproject

Step 5: Launch MNIST application

Launch the app by clicking the green start button at the top or F5 on your keyboard. Draw out a hand-written digit and click 'Recognize' to see if this works for you!

app running

Congrats! you have just completed the helloworld program for Machine Learning.

TL;DR

The sample provides you an example of how you can use Machine Learning and AI in your .NET apps today. The sample basically loads the pre-built model 'digit.model' and takes the bitmap image that user draws out, converts that into an optimized multi-dimensional exchange type Tensor and then calls CNTK evaluate method to evaluate on the model.

The evaluate method from CNTK returns a list of floats (0 - 9) predicting the confidence for each of these digits. The highest confidence digit is then displayed in the app.

This sample also introduces Tensor, Tensor is an exchange type for homogenous multi-dimensional data for 1 to N dimensions. The motivation behind introducing Tensor is to make it easy for Machine Learning library vendors like CNTK, Tensorflow, Caffe, Scikit-Learn to port their libraries over to .NET with minimal dependencies in place.  Tensor is designed to provide the following characteristics.

To learn more about Tensor follow our blog post and GitHub repo.

To follow a video tutorial on this app being used you can also follow this video. https://channel9.msdn.com/Events/Connect/2017/t126

More Repositories

1

eShopOnContainers

Cross-platform .NET sample microservices and container based application that runs on Linux Windows and macOS. Powered by .NET 7, Docker Containers and Azure Kubernetes Services. Supports Visual Studio, VS for Mac and CLI based environments with Docker CLI, dotnet CLI, VS Code or any other code editor. Moved to https://github.com/dotnet/eShop.
C#
24,535
star
2

eShopOnWeb

Sample ASP.NET Core 8.0 reference application, powered by Microsoft, demonstrating a layered application architecture with monolithic deployment model. Download the eBook PDF from docs folder.
C#
10,161
star
3

eShopOnDapr

A sample .NET distributed application based on eShopOnContainers, powered by Dapr.
C#
1,530
star
4

News

News on .NET Architecture Guidance, eShopOnContainers and all the reference apps in dotnet-architecture
1,104
star
5

eBooks

.NET Architecture e-Books
1,102
star
6

eShopModernizing

Modernizing existing .NET Framework, hypothetically legacy backoffice eShop web apps (traditional ASP.NET WebForms and MVC) with Windows Containers and Azure Cloud
JavaScript
920
star
7

eshop-mobile-client

eShop mobile & desktop client built with .NET MAUI
C#
534
star
8

eShopOnBlazor

Migration of a traditional ASP.NET Web Forms app to Blazor
JavaScript
503
star
9

HealthChecks

Experimental Health Checks for building services, such as with ASP.NET Core
C#
454
star
10

eShopOnContainersAI

eShopOnContainers with AI, ML and Bots features
JavaScript
407
star
11

PerformanceMonitor

.NET Core Application Performance Monitor
C#
236
star
12

eShopOnAzure

Azure version of the eShopOnContainers, with implementations based on Azure services.
C#
223
star
13

eShopOnUWP

Universal Windows Platform line of business application showcasing the latest Windows 10 capabilities such as Fluent Design System, Ink and Windows Hello.
C#
162
star
14

Messaging

.NET Core Application blocks for message-based communication
158
star
15

grpc-for-wcf-developers

gRPC for WCF Developers guidance samples
C#
135
star
16

RecommendationEngine

Recommendation Engine using Azure ML Studio to recommend related movies.
C#
101
star
17

explore-docker

C#
8
star
18

.github

3
star