Author: cesarsouza

Principal Component Analysis (PCA) is a technique for exploratory data analysis with many success applications in several research fields. It is often used in image processing, data analysis, data pre-processing, visualization and is often used as one of the most basic building steps in many complex algorithms.

One of the most popular resources for learning about PCA is the excellent tutorial due to Lindsay I Smith. On her tutorial, Lindsay gives an example application for PCA, presenting and discussing the steps involved in the analysis.

This said, the above technical report aims to show, discuss and otherwise present the reader to the Principal Component Analysis while also reproducing all Lindsay’s example calculations using the Accord.NET Framework. The report comes with complete source C# code listings and also has a companion Visual Studio solution file containing all sample source codes ready to be tinkered inside a debug application.

While the text leaves out the more detailed discussions about the exposed concepts to Lindsay and does not addresses them in full details, it presents some practical examples to reproduce most of the calculations given by Lindsay on her tutorial using solely Accord.NET.

If you like a practical example on how to perform matrix operations in C#, this tutorial may help getting you started.

After a preliminary article on hidden Markov models, some months ago I had finally posted the article on Hidden Conditional Random Fields (HCRF) on CodeProject. The HCRF is a discriminative model, forming the generative-discriminative pair with the hidden Markov model classifers.

This CodeProject article is a second on a series of articles about sequence classification, the first being about Hidden Markov Models. I’ve used this opportunity to write a little about generative versus discriminative models, and also provide a brief discussion on how Vapnik’s ideas apply to these learning paradigms.

All the code available on those articles are also available within the Accord.NET Framework. Those articles provide good examples on how to use the framework and can be regarded as a practical implementation on how to use those models with the framework.

So a few days ago I bought a Windows Phone device. So far, I am impressed with the Windows Phone ecosystem. The nicest thing is that I was finally able to test an app I’ve been eager to try for months: Point and Call.

The app author, Antti Savolainen, was kind enough to share some details about his app. It uses part of the SVMs framelet from Accord.NET to do the digit recognition, mostly based on one of the earlier CodeProject articles I’ve posted in the past. Needless to say, Antti did an awesome job, as the SVM part was surely just a tiny fraction of all the work in preprocessing, adjusting, locating, and doing the right things at the right times that I would never be able to figure out alone. Surely, he and his company, Sadiga, deserves all the credits for this neat app!

If you would like find more interesting uses of the Accord.NET Framework, don’t forget to check the framework’s publication page for details!

In the meantime, this article is also serving as a hook to a future article, an article about Hidden Conditional Random Fields (HCRFs). The HCRF models can serve the same purpose as the HMMs but can be generalized to arbitrary graph structures and be trained discriminatively, which could be an advantage on classification tasks.

when trying to create a SlimDX.Direct3D9.Direct3D object, most likely you will be able to solve this by placing D3DX9_43.dll into your output folder. Please note that the proper solution would be to install the full DirectX 9 runtime into your system, but it may be too much for some quick testing.

A similar error may occur when using SharpDX, but in SharpDX’s case, the error message will be much more helpful and actually tell you what is missing.

I’ve recently started to record videos to demonstrate some capabilities of the Accord.NET Framework. Surprisingly, there were only a few, free, opensource applications to achieve this goal – and none of them had all the features I needed.

It is, until I decided to roll my own.

Screencast Capture Lite is a tool for recording the desktop screen and saving it to a video file, preserving quality as much as possible. However, this does not mean it produces gigantic files which take a long time to be uploaded to the web. The application encodes everything using solely H624 in an almost lossless setting.

As a demonstration, please take a look on the Youtube video sample shown below. However, note that Youtube actually reduced the quality of the video, even if you watch it in HD. The local copy produced by Screencast Capture has an even higher quality than what is being shown, while the generated video file occupied less than 2 megabytes on disk.

And by the way what would be a better approach to demonstrate the capabilities of the Accord.NET frameworks other than writing this application using them?

Well, actually this application has been created specifically for two things:

With the beginning of this year, I would like to share a video I wish I had found earlier. It is about the recent breakthrough given by Deep Neural Networks in the field of speech recognition – which, despite I had known was a breakthrough, I didn’t know it was already leading to such surprising great results.

Deep neural networks are also available in the Accord.NET Framework. However, they’ve been a very recent addition – if you find any issues, bugs, or just wish to collaborate on development, please let me know!

Deep neural networks have been listed as a recent breakthrough in signal and image processing applications, such as in speech recognition and visual object detection. However, is not the neural networks which are the new things here; but rather, the learning algorithms. Neural Networks have existed for decades, but previous learning algorithms were unsuitable to learn networks with more than one or two hidden layers.

But why more layers?

The Universal Approximation Theorem (Cybenko 1989; Hornik 1991) states that a standard multi-layer activation neural network with a single hidden layer is already capable of approximating any arbitrary real function with arbitrary precision. Why then create networks with more than one layer?

To reduce complexity. Networks with a single hidden layer may arbitrarily approximate any function, but they may require an exponential number of neurons to do so. We can borrow a more tactile example from the electronics field. Any boolean function can be expressed using only a single layer of AND, OR and NOT gates (or even only NAND gates). However, one would hardly use only this to fully design, let’s say, a computer processor. Rather, specific behaviors would be modeled in logic blocks, and those blocks would then be combined to form more complex blocks until we create a all-compassing block implementing the entire CPU.

The use of several hidden layers is no different. By allowing more layers we allow the network to model more complex behavior with less activation neurons; futhermore the first layers of the network may specialize on detecting more specific structures to help in the later classification. Dimensionality reduction and feature extraction could have been performed directly inside the network on its first layers rather than using specific separate algorithms.

Do computers dream of electric sheep?

The key insight in learning deep networks was to apply a pre-training algorithm which could be used to tune individual hidden layers separately. Each layer is learned separately without supervision. This means the layers are able to learn features without knowing their corresponding output label. This is known as a pre-training algorithm because, after all layers have been learned unsupervised, a final supervised algorithm is used to fine-tune the network to perform the specific classification task at hand.

As shown in the class diagram on top of this post, Deep Networks are simply cascades of Restricted Boltzmann Machines (RBMs). Each layer of the final network is created by connecting the hidden layers of each RBM as if they were hidden layers of a single activation neural network.

Now, the most interesting part about this approach will given now. It is about one specific detail on how the RBMs are learned, which in turn allows a very interesting use of the final networks. As each layer is a RBM learned using an unsupervised algorithm, they can be seen as standard generative models. And if they are generative, they can be used to reconstruct what they have learned. And by sequentially alternating computation and reconstruction steps initialized with a random observation vector, the networks may produce patterns which have been created using solely they inner knowledge about the concepts it has learned. This may be seen fantastically close to the concept of a dream.

The new release also includes k-dimensional trees, also known as kd-trees, which can be use to speed up nearest neighbor lookups in algorithms which need it. They are particularly useful in algorithms such as the mean shift algorithm for data clustering, which has been included as well; and in instance classification algorithms such as the k-nearest neighbors.

Quite some time ago, Accord.NET had been upgraded to .NET 4.0. This upgrade was made to advantage of some of the unique platform features. However, this was a drawback for those users who were still bound to .NET 3.5 and would like to use (or continue using) the framework.

So, some weeks ago I did finish creating a compatibility layer providing .NET3.5 support for the newest version of the framework. While some features had to be left aside, most of the framework is currently functional. A few features, however, had to be removed. Those include the Accord.Audio modules, support for CancellationTokens on processor-intensive learning algorithms, some parallel processing capabilities and some of the Expression Tree manipulation in some numeric optimization algorithms and in Decision Trees.

With time, some of those could be re-implemented to work correctly under 3.5 as needed. You can leave a request, if you would like. Stay tuned!