Getting Started

Accord.NET is an extension to AForge.NET, a popular C# framework for computer vision and machine learning. Currently, Accord.NET provides many statistical analysis and processing functions, as well as still experimental sound analysis package.

This guide is intended to show new users how to install the Accord.NET and AForge.NET Frameworks and show how to create a simple application making use of both frameworks.


Contents

Obtaining the frameworks

Being an extension, the Accord.NET Framework requires AForge.NET to be already installed in your system. Each release of the Accord.NET Framework is always built against one particular version of the AForge.NET Framework, and compatibility is guaranteed only with this particular release. The matching version number for this particular release of AForge.NET will always be included in the release notes for a given Accord.NET release. Please note that, despite being built only against one particular version, newer releases than those indicated in the release notes may also work - albeit such scenarios will not be officially supported.


Obtaining Accord.NET

Framework releases for Accord.NET are available in the download section, with newest releases always on the top of the page. To download the framework, click one of the entries and proceed to the Release Details page.

Accord.NET download page
Accord.NET download page.
Accord.NET Release Details page
Accord.NET Release Details page.


Once a release has been selected, a page containing the release notes and links to the downloadable files will be shown on screen. Please be aware that the recommended version of AForge.NET Framework which should be used with any particular release of Accord.NET will always be available at the bottom of the release notes.

In any particular release there will be at least three download options:

  • The executable installer for binaries and source code;
  • The compressed archive file containing binaries and source code; and
  • The compressed archive file containing only .dll files.

Most users would want to download the executable installer, since it provides the easiest way to install the Accord.NET binaries, source code and documentation. The compressed files would be of interest for Linux users willing to run the framework on Mono.

The following instructions will assume the user has downloaded the executable installer. After the executable installer has finished downloading, please double-click it to start the setup process.

Obtaining AForge.NET

The official site for the AForge.NET Framework is located at http://www.aforgenet.com, though its official repository is hosted at Google Code on http://aforge.googlecode.com. Its main download page is located on http://code.google.com/p/aforge/downloads/list.

AForge.NET project hosting at Google Code
AForge.NET Framework project hosting at Google Code.
AForge.NET Framework's Download page
AForge.NET download page.


As mentioned before, each release of the Accord.NET Framework is built against one particular version of the AForge.NET Framework. Though this is a recommendation, not a requirement, ensuring we are installing the correct version of AForge.NET may reduce further incompatibilities that may arise in the future. When issuing new bug reports it is absolutely required to be using compatible versions.

Once we have determined the recommended version of AForge.NET from Accord.NET's release notes, we can proceed and download this particular release from the AForge.NET Framework's download page.


Installing the frameworks

Installing Accord.NET

After double-clicking the installer, a setup wizard will pop-in to guide the installation process. The installation procedure is very straightforward. After accepting the user's license agreement, it will be possible to customize the installation by selecting which modules should be installed.

Accord.NET Framework Installer
Accord.NET's installer
Accord.NET User's License Agreement (LGPL)
License information


Components to be installed

The installer components include the mandatory Accord.NET libraries, the documentation, the source code and the sample applications.

  • The Accord.NET libraries are the .NET assemblies which can be referenced in .NET projects, including the .XML documentation for Intellisense support.
  • The documentation includes the Compiled HTML Help file containing the documentation generated by Sandcastle.
  • The sources include the complete framework's source code which can be opened, modified and be used to recompile portions or the entire framework for your own needs (the framework is distributed under a LGPL license - please read the full license terms for details).
  • The sample applications include pre-compiled applications demonstrating what can be accomplished with the Accord.NET Framework: Most of them are detailed in the sample applications page in this wiki. Since those have been pre-compiled, they represent the biggest component available in the installer.


Accord.NET installation process


After the setup is properly configured, the installation will start copying files to your computer. By default, all files will be installed under C:\Program Files\Accord.NET

  • Source code will be available at Accord.NET\Framework\Sources;
  • Documentation will be available at Accord.NET\Framework\Docs; and

The framework's assemblies will be automatically registered to be available under Visual Studio's Add Reference Dialog but will not be registered at the GAC. If desired, you may manually compile the binaries with ngen for further speedups.

Installing AForge.NET

There are no special requirements on the installation of the AForge.NET Framework besides using the recommended version. Installation can proceed as usual, and all settings can be left on default or configured as desired. For more details on installing AForge.NET, please refer to the official AForge.NET site.

AForge.NET Framework's Installer
AForge.NET installer
AForge.NET installation process
AForge.NET installation

Obtaining documentation

Accord.NET entry in the Start Menu
Accord.NET entry in the Start Menu.

After both frameworks have been installed, Accord.NET will be ready to be used. The framework's documentation will be available in the Start Menu in the form of a Microsoft's Compiled HTML Help file.

If included documentation is not enough, please take a look on the sample applications accompanying the framework. Most questions related to framework usage can be answered by taking a quick look on how the sample applications instantiate portions of the framework to accomplish their work.

Accord.NET Framework's Documentation


If you further questions regarding the Accord.NET Framework, please refer to Accord.NET's forums. If you have questions related to AForge.NET, machine learning, artificial intelligence, imaging or other general topics, please refer to the AForge.NET Forums.


Creating a sample application

In the following example we will be creating a new application using Accord.NET. The goal of this section is to show how to add references to the Accord.NET and AForge.NET Frameworks and how to obtain on-the-fly documentation through Intellisense.


Microsoft's Visual Studio

In this example we will be using Microsoft's Visual Studio 2008 Team Edition. However any decent IDE, or even command line compilers would suffice. Free versions of Visual Studio, named Express Editions, are available on http://www.microsoft.com/express/. The open-source IDE SharpDevelop is also available on http://www.sharpdevelop.net. There is also limited support for MonoDevelop on Linux.

We will start this example by opening up Visual Studio.


Creating a new project

After Visual Studio has finished loading, click the File->New Project menu item to start creating a new project.


Selecting project type

In the New Project Dialog, select the item "Console Application" under the Visual C# category. Even if we are going to use C# in this example, please keep in mind that Accord.NET supports all .NET compatible languages such as VB.NET or C++/CLI.


Adding library references

At this point we can start adding references to our project. Right-click the project name on the Solution Browser and select "Add References"


Referencing the Accord.NET Framework

We will start by adding references to Accord.NET. Since we are going to develop a sample application which uses Support Vector Machines, we will want to add references to the Accord.MachineLearning, Accord.Statistics, Accord.Math and Accord.Core namespaces.


AForge.NET Framework's Installer

Since Accord.NET depends on AForge.NET, we have to add references to AForge.NET as well. We will be adding references to AForge.Math and AForge namespaces.


AForge.NET Framework's Installer

We are now ready to start developing our application. Besides documentation, the project has full Intellisense support to aid in development.


AForge.NET Framework's Installer

The following code demonstrates how to create and teach a SVM to recognize the classic XOR problem.


AForge.NET Framework's Installer

Once the application code is finished, we can run it by hitting F5 (or equivalently, clicking on the Start Debugging button) on Visual Studio. The application will train the aforementioned Support Vector Machine and should display the training error obtained after learning. A training error of zero indicates that the machine has learned the problem perfectly.


HMM does anyone have idea about HMM

Dear All I am trying to use HMM in handwriting Recognition , is there any one know about HMM and what kind of input should be is it should be vector , text ... or ?

thanks Mahmood