0% found this document useful (0 votes)
17 views

AI Lab 3

The document discusses using a Hamming neural network to classify objects in satellite images. It describes the theoretical basis, structure, and algorithm of the Hamming network. The network calculates Hamming distances between input and reference images to perform classification by associating inputs with the closest matching references.

Uploaded by

Vika Pohorila
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

AI Lab 3

The document discusses using a Hamming neural network to classify objects in satellite images. It describes the theoretical basis, structure, and algorithm of the Hamming network. The network calculates Hamming distances between input and reference images to perform classification by associating inputs with the closest matching references.

Uploaded by

Vika Pohorila
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

National Aviation University

Faculty of cybersecurity, computer and software engineering


Department of Information Technologies Security

Laboratory work № 3
Subject «Artificial intelligence technologies»
Topic: «Development of software for the implementation of the Hamming
network»

Done by: Viktoriia Pohorila

Group CS 372

Accepted by: Skuratovskii R. V.

Kyiv, 2022
The goal of the work. Gain practical skills in using the Heming network to
solve practical problems.
Theoretical information
The theoretical basis of laboratory work is the information presented in
sections 8 of the textbook: Rudenko OG, Bodyansky EV Artificial neural
networks.

Hamming networks
The Hamming network performs the task of pattern association, or
classification, based on measuring the
Hamming distance. The network is a pattern associate of n-dimensional binary
vectors labeled with m-class labels (m-class patterns).
A new vector x' is associated with class pattern xi with the minimum Hamming
distance, a Hamming distance being the number of different bits in the two
patterns. The Hamming network is similar to the Hopfield network, but it has two
layers of connections. The first layer contains connections between all the n inputs,
and all the m outputs. The second layer is a fully connected recurrent network with
m neurons (similar to the Hopfield network). All nodes use linear threshold
activation functions. The first layer of connections is finding the difference
between the number n and the Hamming distance between the input pattern x' and
each of the m-class patterns used to calculate the connection weights in advance.
The second layer of connections is calculating the maximum of these values
for finding the best matched- class pattern.
Using a Hamming network has several advantages: it requires fewer
connections than the Hopfield network, and it implements the "optimum minimum
error classifier when bit errors are random and independent”, that is, the network
always converges and finds the output node with the maximum value.
Hamming neural network classification
Classification of natural objects using Hamming neural network method is
performed by comparing the satellite image supplied to the input and the reference
image, and then calculates the Hamming distance. Accordingly, the lower the
Hamming distance, the better the result of satellite image classification, which is
expressed in the formula:

Hamming neural network method is to decide which image of the reference


vector closest to the input vector. The decision in the Hamming neural network is
taken recurrently layer. In recurrently layer is present on one neuron for each
reference image.
Idea of using a Hamming neural network method for natural objects
classification and identifying areas burned by forest fires and illegal logging
conclude in the calculating Hamming distance in the process of classification of
satellite images.
The input data to the neural network of the Hamming served in the form of a
matrix, which determines the number of neurons in the input network. In the case
of the classification of satellite images, this feature allows most accurately identify
each class.
Hamming neural network consists of two layers, its structure is shown in Figure 1.
Hamming neural network is composed of two layers of processing. The first
layer is a neural network with direct links, in which the Hamming distance is
calculated by comparing the reference image and supplied to the space image
input. The second layer is a modified Hopfield neural network. The dimension m
of the first layer is determined by the number of reference images (classes). The
dimension m of the second layer is equal to the dimension of the first layer of the
neural network. Neurons have a first layer on n synapses which are connected to
the inputs X1 ... Xm. The neurons of the second layer are interconnected negative
feedback synaptic connections. The only synapse with positive feedback for each
neuron is connected to its axon.
Adapting a mathematical model of Hamming neural network method is
implement the use of vectors of reference images of different dimensions that are
stored in the neural network itself. Given the fact that you are using satellite
images with different spatial resolution, the number of values in the vectors of
reference images is significantly different for the classification of objects of natural
origin in the Southern Urals. The vectors of the reference master image of the same
area obtained on the basis of satellite images Landsat 8 OLI / TIRS and Sentinel-
2A, the length will vary significantly due to the fact that the sensor Landsat 8 OLI /
TIRS has a spatial resolution of 30 meters per pixel, and sensor Sentinel- 2A
produce shooting with a spatial resolution of 10 meters per pixel. Therefore, if the
vector of the reference image is made on the basis of satellite image obtained from
the sensor Landsat 8 OLI / TIRS has 15 values, the vector of the reference image
made on the basis of satellite image obtained Sentinel- 2A sensor has 135 values.
The dimensions of the vectors differ nine times.
The problem of classification of objects of natural origin in the Southern
Urals, using reference images of the vectors of different dimensions made on the
basis of satellite images with different spatial resolution implements an algorithm
based at the Hamming neural network method.
In the initialization step the first layer weights and the activation threshold
value assigned the following functions:

where x is a memorable way, I is the corresponding components of the vector


x; j is an image number; n is a dimension vector x; m is a number of stored images

where Tk is a threshold activation function functioning Hamming Neural


Network algorithm is as follows:
1. The input is pre-processed vector data, derived from satellite imagery.

Further, the state of neurons is calculated Hamming layer (the first layer)

Thereafter, the obtained values are used to initialize the second layer of
axons:

At the second phase of the neural network are calculated Hamming new
states of neurons of the second layer:

and the values of the second layer of axons:

Activation function f is given by the threshold, and, the F value should be


large enough to ensure that any possible argument values do not lead to saturation.
3. At the third step is checked to change the output of the second layer in the
last iteration. If changes have occurred, then the transition to the second stage of
the neural network operation algorithm Hamming. If there is no change, the
procedure ends.
From the description of operation of the Hamming neural network algorithm
seen that the role of the first layer is required to select the data to be classified.
Also, as in the Kohonen neural network and Hopfield neural network, in the
Hamming neural network weights between the layers are presented in the form of
matrices, denoted by W. Hamming neural network is stable if it matrix is
symmetric and has zeros on the main diagonal, or if wii = wjj , and wii = 0 for all i.
Stability Hamming neural network is proved by means of Lyapunov function,
the meaning of which is always in a decreasing function when changing the state
of the neural network. Ultimately, this function reaches a minimum, and stops
changing, it ensures the stability of the Hamming neural network. The Lyapunov
function is expressed in the formula:

where E is an artificial energy networks; the weight of the output neuron i to


input neuron j; the output neuron j - external input neuron j; the threshold of
neuron j.
The change in energy E, due to changes in the state j- neuron is calculated as
follows:

If the value of NET neuron j greater than the threshold, then the expression in
the brackets will be positive. From the equations (9), (10) that the output of neuron
j varies in the positive direction or remains unchanged, which means that it can
only have a positive value or be zero. value must be negative. This implies
energy Hamming neural network must either decrease or remain unchanged.

If the value of NET is below the threshold, then the value of takes only
negative values or zero. Consequently, the energy Hamming neural network
decreases, or remains unchanged.
If the value of NET is equal to the threshold, the value is zero and the energy
of Hamming neural network remains unchanged.
Due to the continuous striving to reduce the energy needed to achieve the
minimum and stop changes. Therefore, this fact proves the stability of the
Hamming neural network.
Symmetry Hamming neural network is an important condition for stability.
To optimize the classification of a naturally occurring process objects in the
Southern Urals, using Hamming neural network method chosen technique of using
associative memory, the essence of which is to maximize the reference line and fed
to the input of the neural network image.
Of course, when using a large number of standard classes and input data in
the form of vector data, derived from satellite images, there is a problem of
incorrect associations of reference and input images, but in order to avoid this
problem in the process of classification of natural origin of objects, use a two-tier
structure, which consists of untied Hamming memory and network decision.
Unleashed associative memory calculates the Hamming distance by dividing
an input vector into disjoint modules or local window and performs a full
Hamming associative memory on each module independently.
Unleashed Hamming associative memory works as follows: the key memory
is divided into the same images as reference vectors, then the Hamming distance is
calculated and displayed the closest matching template.

You might also like