Skip to content

bluetickconsultants/abstract-images-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generating Abstract images using Neural Networks



Artificial neural networks are comprised of node layers containing an input layer, one or more hidden layers, and an output layer. Each node connects to another and has an associated weight and threshold value.

For generating random colored images we will develop an ANN architecture that takes each pixel value as an input. All inputs are modified by weight and summed. For handling the n-dimensional data as an input we can use the techniques mentioned below.


Techniques used


       1 . Numpy
       2 . Statistics 
       3 . Activation functions 
       4 . OpenCV

Selecting the size of an image as an input in the form of height and weight ex: image width = 216 and image height = 216 which gives us a black image.


Neural Network Architecture


For creating a Neural Network we need to define input data, Hidden layers, and the number of neurons per layer, and the Activation Function. Suppose we have (512,512) images. what neural network does is will collect every pixel value fun{i,j} to computer r,g,b,a values. So total we are having 5 input dimension data. Each pixel converts into 5 different values to generate r,g,b, a, and bias values. Value = min(image height and image width) Input1 = i / value - 0.5 Input2 = j / value - 0.5 Z = sqt(input1 + input2) Z1 = random value from -1 to 1 Alpha Z2 = random value from -1 to 1 Bias

These input values were added with some random weights along with the activation function for each neuron. On selecting the color mode the values get changes for the output layer.


Activation Functions used


         1 . sigmoid
         2 . relu 
         3 . Softmax
         4 . Tanh 

Selecting Color Mode


The output layers depend on which color mode we select. Using RGB, CMYK, and HSV, and HSL we generated our images. If we are not using any color mode just the input data were gone through a neural network and gives 3 output layers for R, G, B channels. But if we use color mode each pixel again goes under their own maths calculation for changing the values.

Some images generated with RGB color mode

Some images generated with HSV and HSL color Mode

Converting input values into specified color mode

Changing input data into CMYK format by adding their input weights The R, G, B values are divided by 255 to change the range from 0 to 1. R = R / 255 , G = G / 255 , B = B / 255 Value k can be calculated from RGB k = 1 - max(R,G,B) The cyan color will be calculated from red and k[black] c = (1-R-K) / (1-K) The Magenta color will be calculated from green and black m = (1-G-K) / (1-K) The yellow color will be calculated from blue and black y = (1-B-K) / (1 - K)

Some images were generated using CMYK color mode

Useful Information

References

Other Projects

To view all other open source projects visit

Author

Bluetick Consultants LLP