# how to calculate quadratic features in computer vision Neural Network

I am recently watching some tutorials for deep learning from Dr Andrew Ng on Youtube. Link is hereThe Youtube video

There is a concept of number of features in convolutional neural network in TensorFlow's tutorial.

I don't quite understand why the feature is 32 or 64 here in conv layer1 or layer2?

Then I came to the video, there is also the concept of Quadratic features. It is calculated as 3 million however. But how is it calculated?

Are the two features related in concept?

• it's common to use powers of two for sizing filters or dense layers in neural networks Aug 15 '17 at 18:26

The instructor is using $$\frac{x^2}2$$. So $$\frac{2500\times 2500}2$$, and this will get approx $$3$$ millions features.
$$x_1=\text{pixel}_1$$, $$x_2 = \text{pixel}_2$$, $$\cdots$$, $$x_{2500} = \text{pixel}_{2500}$$. A quadratic function means that you take all possible combinations of $$x_ix_j$$, for example $$x_1^2$$, $$\ x_1x_2$$, $$\ x_1x_3$$, $$\ \cdots$$, $$\ x_1x_{2500}$$, etc... this will give you a better outcome than considering just a linear function..., just get all the possible combinations and count them and you will get around $$\frac{n^2}{2} = \frac{2500\ \times\ 2500}{2} \approx 3M$$