Building Perceptrons and its Applications in Cyber Security

Recently I was asked to start exploring AI and its impact on cloud security for work. I decided to take the time and get my hands dirty by exploring the basics of PyTorch and AI. In this article, we’ll explore the most fundamental AI algorithm, the perceptron, and apply it to classify flowers based on their petals and sepals length. Later, we will discuss the potential impact of AI on cyber security.

Rosenblatt’s perceptron is the first model of a programmatically described neuron. The perceptron works by taking a series of inputs (x_1 outside of x_n), each representing an attribute of a different object, multiply them at random by the specified weights, and do a sum.

Based on this sum of all weighted attributes, the object is classified as belonging to a category or not (output .) 1 related or . for 0 Not to be related), after which a margin of error is calculated, and the weight is adjusted accordingly. with each instance (a row of attributes X_1 outside of X_n), the weights of each variable are updated, and this moves the dividing line between the two categories, as seen in the figure below:

After each iteration, the weights of each variable and the bias (y-intercept) are calculated as follows:

For each variable, the weight change is classified as the discrepancy between the predicted and desired outcome time learning rate (a multiplier on the weight) and the var itself. It is then added or subtracted from the weight of the associated variable. The same is done for the bias before the net iteration.

Since the perceptron is basically based on a linear equation, a clear linear boundary must exist between the two categories for the perceptron to operate well, as it updates its boundary with each item used in training. does. However, in some cases, if no “clean dividing line exists,” the assumption can run in an infinite loop.

Making a perceptron is fairly easy and requires only three actions:

Fit — which trains according to the data set and adjusts the weights with each example.

Net Input – which calculates the weighted sum of all inputs.

Predict – which can be used to estimate the category of an object after training.