Keywords

1 Introduction

The idea of using standard barcodes for personal identification was first suggested in a 1999 patent [1]. It was assumed that personal identification would be performed at the moment a customer made an electronic payment in real time, and that the unique barcode, printed on the customer’s hand or body, would be read by means of a special device. However, further real-word implementations of personal identification using barcodes were not developed in spite of the wide use of biometric identification methods. Nevertheless, barcodes are often worn today as fashionable tattoos [2]. Barcodes on the human body do not carry any biometric characteristics relating to the individual, but could be used for personal identification if they can be generated in real time, directly from a person’s face or voice.

Assuming that such an identification procedure exists in principle, the solution may be to encode people’s faces or voices [3, 4] in the form of barcodes, without any permanent mark being affixed to the body. Such barcodes can be used in biometric, access control (AC) and video surveillance systems, content-based video retrieval systems, etc. However, there are some challenges to generating facial barcodes. One of them is variability (variations in lighting, pose and expression, etc.) in real-world facial images. Solving the problem would simplify personal identification and improve the performance and reliability of related recognition systems.

In this paper, we propose an approach for presenting facial images in the form of linear EAN-8, EAN-13 or UPS barcodes [5].

2 Brief Overview of Existing Approaches

Ten years after the patent [1] was published, the authors of [6] noted that facial identity was largely conveyed by horizontal image structure, such as eyebrows, eyes and lips lines. They demonstrated that this information could be successively represented as a set of binary strips or as a so-called biological barcode. Furthermore, they explored some invariant features of a person’s facial biological barcode. However, as noted in [6] and in further publications by these authors, an algorithm for generating such barcodes is not defined. Instead, the authors note that facial images translated into thick, straight black and white bars will never provide an exact representation of a person’s face [7].

Five years later, the most serious practical research on the problem of facial representation in the form of barcodes was published [8]. The authors proposed an algorithm for barcode generation based on searching for specific (key) points on the face, descriptions of local features, and creation of a two-dimensional color barcode. However, the algorithm is unlikely to be integrated in mobile smartphone and tablet systems in the near future due to its use of SIFT (Scale Invariant Feature Transform) and SURF (Speeded Up Robust Features) procedures for generating 2D barcodes.

The concept of a biological barcode uses an algorithm that compares two facial images, as presented in [9]. The idea of the algorithm is explained in Fig. 1. First, it calculates the brightness gradients between two specularly located bands that slide synchronously down a facial image from top to bottom, as shown in Fig. 1(a). Second, the differences between the current and mean values of the gradients are calculated and encoded. The values of the differences equal to and below zero are encoded as “0”, and those above zero are encoded as “1”, generating a binary code that represents a facial image similar to a biological barcode [6]. Figure 1(b) shows the current values of the gradients and their mean value; (c) shows the biological barcodes for each source image. The disadvantage of this approach is its inability to generate the same binary code for facial images of the same person when the facial images differ slightly. These differences could be insignificant but visible to the eye, such as variations in lighting, scale, facial pose and expression, etc. In order to solve this problem, we propose developing the ideas in [9, p. 240] for representing human faces in the form of standard linear barcodes.

Fig. 1.
figure 1

Biological barcode using binary code generation

3 An Algorithm for Generating Facial Barcodes

In general the facial barcode generation system consists of four main components: 1 – image preprocessor; 2 – feature extractor; 3 – feature coder; 4 – barcode generator.

Block 1 solves two problems. First, it analyzes the source image parameters, including the size, color and deviation from the horizontal line of the eyes. Second, it determines the rotation of the image plane depending on the results of the first analysis, adjusts the image size and corrects for brightness. Solutions for these two tasks can be found in [9]. Feature extraction is implemented in block 2 using the difference of image brightness gradients. Block 3 performs feature coding, which is the most important task. Feature coding encodes facial features using the necessary number of decimal digits. The differences between brightness gradients are first averaged into a limited number of intervals, and then the results are quantized into decimal digits from 0 to 9. The task of block 4 is simply table conversion of the results of block 3. Barcode generation also includes checksum computation for the decimal code created in block 3, and the conversion of this code into a binary matrix that graphically represents the source facial image as a barcode. Our approach makes it possible to generate linear barcodes from facial images in EAN-8 format. It can also used to generate linear barcodes in EAN-13 and UPS formats [5].

4 Generating of Facial Barcodes Based on Differences of Gradients

Feature extraction from the original image is based on calculating the difference between brightness gradients in two mirror-located windows. The windows are \(H \ge 1\) pixels high and have the width of the original image. They slide synchronously from top to bottom across the facial image with a step of \(S \ge 1\). At each step \(t\) we calculate the distance \(d(t)\) between the sub-images in the windows. These distances are the required differences of gradients. The sliding starts at the “hair/forehead” boundary, and ends at the lower border of the nose.

The principle behind the calculation of the difference between gradients and the sliding window coding is illustrated in Fig. 2. Here (a) is the image the with initial and final location of the two rectangular windows; \(U\) is the upper window, \(D\) is the lower window, \(H\) is the window height (b) shows the curve representing the distance values \(d(t)\) between the corresponding fragments of the images “covered by the windows” versus the number of steps \(t = 1, 2,...,T\).

Let the original image have the size of \(M\times N=112\times 92\) pixels. Assume that the initial window height is \(H=10\). Let us transform the image into an EAN-8 barcode. In total we have \(T=L\cdot mod\) sliding steps, where \(L\) is the code length and \(mod\) is the interval of smoothing. For the purpose of generating a barcode in EAN-8 format, the parameter \(L=7\). The parameter \(mod\geqslant 8\), in general, is chosen from the condition:

$$\begin{aligned} T = L \cdot mod \le M-H. \end{aligned}$$
(1)

The value of \(T\) should fall approximately on the lower border of the nose area (or, in some cases, between the nose and lips). This will exclude the lower part of the face and thus eliminate the influence of emotion on the stability of barcode generation. Otherwise it is necessary to increase the size of the source image in block 1 until condition (1) is met.

Now we define the distance \(d(t)\) between the windows:

$$\begin{aligned} d(t) = \Vert U(t) - D(t)\Vert , \forall t=1, 2,..,T. \end{aligned}$$
(2)

Results of (2) are shown in Fig. 3(a) and they are normalized in block 3:

$$\begin{aligned} d(t) = d(t)/max(d), \forall t=1, 2,..,T. \end{aligned}$$
(3)

These values are averaged over the time interval of \(mod\), then quantized into decimal digits from 0 to 9 by means of the scale factor \(scale\):

$$\begin{aligned} \bar{d}(l) = f\{scale[\sum _{j=1}^{mod} d(mod(l-1)+j)]/mod\}, \forall l=1, 2,..,T, \end{aligned}$$
(4)

where \(f(.)\) is the nearest integer value; \(scale\) is the scale factor \(9 < scale < 10\).

The result (4) is shown in Fig. 3(b). This result is transferred from block 3 to block 4 where the final 8-digit barcode is generated. The 8th digit is the checksum for the first 7 digits from block 4. The lower part of Fig. 3(b) shows an example of the final barcode.

Fig. 2.
figure 2

Calculation of the difference between gradients and sliding window coding

Fig. 3.
figure 3

Normalizing and coding processes

5 Experiments

The proposed method for generating facial barcodes was tested on images from the Face 94 database [10]. The first 100 classes with 11 images in each class were used to generate EAN-8 barcodes. We used \(112\times 92\) pixel images in GRAY format.

5.1 Test 1

We generated barcodes for the images without any preprocessing and with the following coding parameters: \(H=23\); \(S=1\); \(T=56\); \(L=7\); \(mod=8\); \(scale=9.5\).

In Test 1, about 70 % of the barcodes generated for faces of the same class matched. An example from Test 1 is shown in Fig. 4. The middle column shows the barcodes derived from facial images of the same class and the phase correlation between the corresponding distance vectors (we an almost 100 % similarity). We experimented with barcode generation for facial images with different facial expressions, changes in the eyes (open or closed), mirror reflections of the original image, variations in scale, pose, as well as with shadows on facial images from local lighting. Our results clearly demonstrate that the barcode remains stable in all these cases.

Fig. 4.
figure 4

Results of generating facial barcodes based on the gradient method

5.2 Test 2

The purpose of Test 2 was to test the stability of barcode generation against changes in the brightness of test images. Test 2 used the same parameters as Test 1. However, in contrast to Test 1, the brightness of the test images varied from 140 % to 60 % relative to the brightness of the original images in Face94 database. The results of Test 2 are shown in Table 1. It may be noted that when brightness changes by \(\pm 20\,\%\) relative to the initial brightness, the result is stable. However, when brightness changes by \(\pm 40\,\%\) relative to the initial brightness, the number of matching barcodes generated decreases by almost 50 %.

Table 1. Results of the Test 2

6 Conclusion

This paper deals with the problem of generating linear EAN-8 barcodes from facial images. We discussed the history of the problem and the known approaches. The proposed method of generating standard type linear barcodes from facial images is based on using the difference of image brightness gradients. It involves averaging the gradients into a limited number of intervals, quantization of the results into decimal digits from 0 to 9, and table conversion into the final barcode. The proposed solution is computationally low-cost and does not require the use of specialized image processing software, which makes it possible to generate facial barcodes in mobile systems. Test results showed that the proposed method is a new solution for use in real-world practice. It ensures the stability of generated barcodes for the mirror reflection of the original image, as well as in cases of scale, pose and facial expression variations and shadows on facial images from local lighting. Furthermore, the method generates standard barcodes directly from the facial images, and thus contains information about a person’s face.