A method for re-identification of objects, comprising steps: obtaining a pair of images, wherein each image represents an object; applying a convolutional neural network to the pair of images, wherein the CNN comprises: a first convolutional layer; a first max pooling layer, which follows the first convolutional layer, wherein the first convolutional layer and the first max pooling layer are applied to each image separately to determine a feature map for each image; a cross-input neighborhood differences layer, which is applied to the feature maps to produce neighborhood difference maps wherein the cross-input neighborhood differences layer computes the difference between the value at each location of one feature map and each value in a surrounding neighborhood of the corresponding location of the other feature map; a patch summary layer, which is applied to the neighborhood difference maps to produce patch summary feature maps, wherein said patch summary feature maps of said neighborhood difference maps computes a holistic representation of the differences in each said neighborhood of the neighborhood difference maps; a first fully connected layer, which is applied to the patch summary feature maps to produce a feature vector representing higher order relationships in the patch summary feature maps; a second fully connected layer, which is applied to the feature vector representing higher order relationships to produce two scores representing positive pair and negative pair classes; a softmax layer, which is applied to the two scores to produce positive pair and negative pair probabilities; and outputting the positive pair probability to signal whether the two images represent the same object or not, wherein the steps are performed in a processor. obtaining a pair of images, wherein each image represents an object; applying a convolutional neural network to the pair of images, wherein the CNN comprises: a first convolutional layer; a first max pooling layer, which follows the first convolutional layer, wherein the first convolutional layer and the first max pooling layer are applied to each image separately to determine a feature map for each image; a cross-input neighborhood differences layer, which is applied to the feature maps to produce neighborhood difference maps wherein the cross-input neighborhood differences layer computes the difference between the value at each location of one feature map and each value in a surrounding neighborhood of the corresponding location of the other feature map; a patch summary layer, which is applied to the neighborhood difference maps to produce patch summary feature maps, wherein said patch summary feature maps of said neighborhood difference maps computes a holistic representation of the differences in each said neighborhood of the neighborhood difference maps; a first fully connected layer, which is applied to the patch summary feature maps to produce a feature vector representing higher order relationships in the patch summary feature maps; a second fully connected layer, which is applied to the feature vector representing higher order relationships to produce two scores representing positive pair and negative pair classes; a softmax layer, which is applied to the two scores to produce positive pair and negative pair probabilities; and outputting the positive pair probability to signal whether the two images represent the same object or not, wherein the steps are performed in a processor. a first convolutional layer; a first max pooling layer, which follows the first convolutional layer, wherein the first convolutional layer and the first max pooling layer are applied to each image separately to determine a feature map for each image; a cross-input neighborhood differences layer, which is applied to the feature maps to produce neighborhood difference maps wherein the cross-input neighborhood differences layer computes the difference between the value at each location of one feature map and each value in a surrounding neighborhood of the corresponding location of the other feature map; a patch summary layer, which is applied to the neighborhood difference maps to produce patch summary feature maps, wherein said patch summary feature maps of said neighborhood difference maps computes a holistic representation of the differences in each said neighborhood of the neighborhood difference maps; a first fully connected layer, which is applied to the patch summary feature maps to produce a feature vector representing higher order relationships in the patch summary feature maps; a second fully connected layer, which is applied to the feature vector representing higher order relationships to produce two scores representing positive pair and negative pair classes; a softmax layer, which is applied to the two scores to produce positive pair and negative pair probabilities; and outputting the positive pair probability to signal whether the two images represent the same object or not, wherein the steps are performed in a processor.