Diego Malagrida Neural Classifier ↑ Top

AuthorDiego Malagrida

Published17 Jul 2026

Sectionai

Length2 min

Neural Classifier

Animal images classified with features written by hand and a network written from scratch, every step visible and the accuracy reported as it came out.

A sheet of nine animal classes (elephant, giraffe, horse, lion, pig, rabbit, sheep, tiger, zebra), and below it a lion with its occlusion overlay and support heatmap.
The nine Open Images classes, and the evidence the app prints for one prediction.
Nine examples from the AwA2 animal dataset, with a tiger image, its occlusion overlay and support heatmap below.
AwA2 examples with varied backgrounds, and the evidence for a tiger prediction.

Overview

A desktop application that classifies animal images with nothing borrowed: handcrafted colour, texture and shape features, PCA and Fisher selection, and neural networks implemented from scratch.

Nothing in the pipeline is a call into a library that already knows the answer. The features are RGB and HSV histograms, texture descriptors and shape descriptors computed from the image; the dimensionality is cut by PCA and the features ranked by Fisher’s criterion; the training samples are drawn by Monte Carlo; and the classifiers (softmax regression and multilayer networks) are written out in Java, backpropagation included. The app shows its evidence for a prediction: the original, an occlusion overlay and a support heat map of the pixels the decision rested on.

The numbers are reported as they came out, not as a claim. On the nine-class Open Images subset the best network reaches 58.52% accuracy and 58.08% macro-F1, with softmax and PCA-96 a little behind at 55.93%; on the 50 classes of AwA2, with its noisy crops, the same network gets 34.89% and 29.55%. For a from-scratch handcrafted pipeline those are the baselines worth writing down: a pretrained network would beat them and would have answered a different question.

The repository is private; the datasets are not in it either way, since the images and the generated files are far larger than the code.

javamachine-learningcomputer-vision

← All projects