# Person Re-Identification across Data Distributions Based on General Purpose DNN Object Detector
## 3 Theory Overview
### Fully Connected Neural Networks  
The architecture of a Fully Connected Neural Network defines how neurons are organized and interconnected inside a network. Training a particular architecture involves several steps that aim to adjust the weights and thresholds of neurons. A neural network is generally composed of three parts, which are referred as layers. These are:  
* **The input layer. ** It receives information, signals, features, or measurements made in the external environment. Network inputs are usually set to maximum values. As a result of the normalization stage, the numerical accuracy of the network's mathematical operations increases. * **The hidden, intermediate, or invisible layers. ** These layers are composed of neurons that are responsible for extracting the patterns associated with the analyzed process. Most of the internal processing of the neural network takes place at the level of these layers. There may be one or more hidden layers in a network. * **The output layer. ** This layer is responsible for producing and presenting the network's final outputs, which were obtained after the processing performed by the previous layers. The fundamental component of a Fully Connected Neural Network is the perceptron [37]. The perceptron is an element that has a certain number of inputs, \(x_{i}\), \(i=1\cdots N\), and it calculates the weighted sum of these inputs. For each input \(i\), the weight \(\beta_{i}\) can take one of the values \(\{-1,1\}\). Eventually, this sum is compared with a threshold, in order to obtain the output \(y\), according to Equation (1). \[y= \begin{cases}1&\text{if }\sum_{i=1}^{N}w_{i}\cdot x_{i}\geq\theta\\ 0&\text{if }\sum_{i=1}^{N}w_{i}\cdot x_{i}<\theta\end{cases}  \tag{1}\]  
where \(w_{i}\) represents the input weights and \(\theta\) is the threshold. The condition from Equation (1) is unintelligible. Accordingly, there can be made two modifications to simplify it. First, the sum can be write as a dot product, \(\mathbf{w}\cdot\mathbf{x}=\sum_{i}w_{i}x_{i}\) where \(\mathbf{w}\) and \(\mathbf{x}\) are vectors whose components are the weights and inputs, respectively. The second change is to move the threshold to the other side of the inequality and replace it with the perceptron's bias, \(b=-threshold\). The bias represents a measure of how easily the perceptron will output 1. Using the bias rather than the threshold, the perceptron rule can be rephrased as:  
\[y= \begin{cases}1&\text{if }\mathbf{w}\cdot\mathbf{x}+b\geq 0\\ 0&\text{if }\mathbf{w}\cdot\mathbf{x}+b>0\end{cases}  \tag{2}\]The perceptron is not a complete model of decisions. Instead, a complex network of perceptrons can make better decisions. For this reason, Fully Connected networks are also known in the literature as Multi Layer Perceptrons (MLP) networks. Their goal is to approximate a function \(f\), as defined in Equation (3). The network learns the value of the parameter \(\theta\), which leads to the best approximation of the function. \[y=f(x;\theta) \tag{3}\]  
Figure 1 shows the two types of Fully Connected networks: single-layer network and multilayer network. There are situations in which neural networks do not have all the connections. Lack of a connection is equivalent to zero weight. Concerning single-layer networks, it can be seen that the number of outputs of the network coincides with the number of neurons. This type of network is generally used in model classification and linear filtering problems. Unlike single-layer networks, multilayer networks have more hidden neural layers. They are used in more complex issues, such as system identification and optimization. A multilayer network can be seen as a cascade of multiple single-layer networks. The level of complexity increases with the number of layers that are used. In 1989, the theorem of universal approximation appeared, which states that there is a neural network that is large enough to achieve any desired degree of accuracy. The theorem, on the other hand, does not specify how extensive the network might be.