Skip to main content

Mathematical Model

The FaceLog recognition pipeline relies on mathematical transformations that convert images into numerical representations.

These representations allow the system to compare faces using distance metrics.


Image Representation

An image is represented as a three-dimensional matrix:

XRm×n×3X \in \mathbb{R}^{m \times n \times 3}

Where:

  • (m) = image height
  • (n) = image width
  • (3) = RGB color channels

Face Detection Using Convolution

Face detection relies on convolution operations applied across the image.

S(i,j)=m=0kn=0kX(i+m,j+n)W(m,n)S(i, j) = \sum_{m=0}^{k} \sum_{n=0}^{k} X(i + m, j + n) \cdot W(m, n)

Where:

  • (X) represents the image matrix
  • (W) represents the convolution kernel
  • (S(i,j)) represents the resulting feature map

This operation highlights visual patterns that indicate the presence of a face.


Embedding Generation

After detecting a face, the system generates an embedding vector using a neural network.

e=fθ(X)e = f_\theta(X)

Where:

  • (X) is the input face image
  • (f_\theta) is the neural network
  • (e) is the resulting embedding vector

Embeddings encode facial characteristics into a numerical representation.


Face Comparison

To determine whether two embeddings represent the same person, the system computes the Euclidean distance:

d(x,y)=i=1n(xiyi)2d(x,y) = \sqrt{\sum_{i=1}^{n}(x_i - y_i)^2}

If the distance is sufficiently small, the embeddings are considered to represent the same individual.

note

Image Processing and Facial Recognition: - DeepFace v0.0.85: Library for facial analysis and recognition.