In this section, we are going to describe and implement two features that can be used to identify GAN samples. These features include the centroid and the slope. We will briefly describe what information about images these features provide and give an implementation.
Feature extraction
Centroid
The centroid draws inspiration from the centroid or geometric center defined in mathematics and physics, whereby it represents the arithmetic mean position of all the points in the figure. In computer vision parlance, the centroid is an image moment: a weighted average (moment) of the image pixels' intensities.
In our context, the centroid represents the arithmetic mean row in a column. For each column in an image, we transform...