Design of Commodity Settlement System Based on Deep Learning

In order to solve the problem that the salesmen need to scan the bar code of commodity price one by one in supermarket settlement system, a commodity settlement system is proposed. The system hardware includes smart phone, PC and LCD. The image information is obtained after the smart phone scans goods, then the acquired image is uploaded to the upper computer, which identifies commodity and obtains the unit price of goods through the image, finally, the payment QR code is displayed on the LCD screen. Without scanning the cods again at the checkout counter, the payment could be accomplished in a manner that saved time and manpower cost.


Introduction
Commodity identification technology can be roughly divided into bar code identification, Radio-frequency identification and image identification. According to the general survey of the current market, most retail stores and supermarkets in China use the method of scanning the unique bar code of commodities to carry out quantity statistics and total price calculation, and then settle the account. In this way, the labor intensity of the cashier is high during the peak sales period, and the settlement efficiency is even lower, if the bar code is lost. This method of identification using RFID technology is less used in supermarket settlement, because it also has some problems, such as high cost of RFID, and easy to be interfered by water and metal. Compared with the former two methods, the image recognition method has more advantages, with low price, only need image acquisition equipment, fast recognition, and can identify multiple goods. The commodity settlement system studied in this paper adopts the image identification technology. It uses deep learning to recognize multiple commodity images, and develops a set of commodity settlement system, which can automatically identify commodity information, generate corresponding payment QR code, and then complete the settlement with the help of the current mobile payment platform. The implementation process of the system is to first obtain the image of the settlement goods through the mobile terminal, then upload the image to the upper computer for commodity identification, then obtain the unit price of the goods from the database, and finally display the payment QR code through the LCD screen.The commodity settlement system based on deep learning designed in this paper is shown in Figure 1. It mainly consists of the following equipment: 1) A Mobile phone with camera. The image of the product is obtained through a mobile phone camera similar to a supermarket scanning gun, but it directly scans the outer packaging of multiple products, rather than scanning the barcode.
2) A host computer with the function of image analysis and processing, and it stores the information of all supermarket commodities. The main functions of the host computer is as follows: Receive the image information from the smart phone to complete the identification of goods; Search for the price of goods in the database, and transmit the processed results to the LCD display; Add, delete, modify and query the information of commodity database.
3) LCD display with QR code display. By scanning the QR code, customers can enter the details page of the purchased goods list, and then pay through WeChat or Alipay after confirmation.

Deep Learning
With the development of computer vision, deep learning and hardware technology, convolutional neural networks, an important sector of deep learning, have made a break through in the field of computer vision, image and video analytics, creating new avenues for smart applications. The best systems are based on deep learning,in the fields of images classification, image detection, optical character recognition and face recognition.Since 2012, CNN and other deep learning technologies have occupied the mainstream position in the field of images recognition. In the commodity settlement system designed in this paper, we use the deep learning method with significant advantages, in order to realize the commodity recognition function.
We will illustrate the topological structure of CNN in this section, and the topology of CNN as illustrated in figure 2. A typical CNN consists of input layer, hidden layer and output layer. The hidden layer is mainly composed of convolution layer, pooling layer and full connection layer. The convolution layer and pooling layer are generally connected alternately by local connection. The full connection layer is generally distributed in the last few layers of the network.   Figure 3 shows schematic diagram of convolution kernel operation. The convolution is performed by sliding the kernel on the image, usually starting from the upper left corner, so that the kernel is moved at all locations within the image boundary. Each kernel position corresponds to an output pixel. The output pixel value is calculated by multiplying the pixel value of the underlying image and the kernel value of each unit in the kernel, and then adding all these numbers. The output at the position k of the j-th output characteristic graph of the l-th convolution layer can be expressed by the input characteristic graph of the l-th layer as equation (1).
Where xj (l+1) is the output characteristic graph of layer l, namely, the input characteristic graph of layer l+1, and x j (l) are the input characteristic graph of layer l. The symbol * represents the convolution operation. σ(·) is the activation function, and n (l) is the number of input characteristic graphs of layer l. For each output characteristic graph x (l + 1) , there are n(l) convolution kernels and 1 offset term associated with it respectively. Wi,j (l) is the convolution kernel between the j-th output characteristic graph of the l-th layer and the i-th input characteristic graph of the l-th layer. bj (l) is the offset term corresponding to the j-th output characteristic graph of the l-th layer.
y j1 l-1 ,y j2 l-1 ,···,y jn l-1 are k×k adjacent neurons connected by the previous convolution layer and neurons j of pooling layer.
The pooling layer extracts the relative position of features. The feature can still be extracted in other positions when the image is shifted, because the pooling layer is highly robust to translation, tilt, distortion, deformation, etc.

Tensor Flow Platform
Tensorflow is an open source software library, which mainly uses data flow graph for numerical calculation. The nodes in tensorflow graph represent mathematical operations, and the edges of tensorflow graph represent the multidimensional data array (tensor) between them. Flexible architecture allows you to easily deploy to any computing device. Therefore, the design uses TensorFlow platform to implement CNN, installs TensorFlow on Ubuntu Linux, and uses of Python programming language.
 download the Anaconda3-5.0.0-Linux-x86.sh installer to the path /home/bella/downloads/, open the terminal to install Anaconda, Type the following command and then press enter:  Building convolutional neural networks on TensorFlow. The convolution neural network designed in this paper includes those: three convolution layers, three pooling layers, two local response normalization layers, three fully connected layers. Convolution layer and nonlinear layer are arranged alternately for several times, and finally these layers are connected to SoftMax classifier through fully connected layer. The structure of convolution neural networks designed in this paper is shown in Figure 4.