Commodity identification method, device, equipment and computer-readable storage medium
By constructing the channels of fully connected layers and convolutional layers in the product feature recognition model, combined with the residual network model, the problem of insufficient product recognition accuracy in unmanned supermarkets is solved, and higher recognition accuracy and operating efficiency are achieved.
Patent Information
- Application Number
- CN201911267919.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-11
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2039-12-11
AI Technical Summary
Existing image recognition technology has insufficient accuracy in product identification in unmanned supermarkets, which limits the normal operation and user experience of unmanned supermarkets.
By constructing a channel between the fully connected layer and the convolutional layer in the product feature recognition model, the feature vector output by the fully connected layer is used to guide the convolutional layer optimization process to improve the recognition accuracy of product features, and combined with the residual network model structure. Training to improve the learning efficiency and recognition accuracy of the model.
It significantly improves the accuracy of product recognition, can more accurately identify products in images to be recognized, reduces manual intervention, and improves the operating efficiency and user experience of unmanned supermarkets.
Smart Images

Figure CN112949672B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image recognition technology, and in particular to a commodity recognition method, device, equipment and computer-readable storage medium. Background Art
[0002] In recent years, with the vigorous development of artificial intelligence (AI) technology, AI technology is no longer a "high-tech" technology in the ivory tower. It has been invested in more and more practical applications, making the lives and work of the majority of users more intelligent.
[0003] Taking unmanned supermarkets as an example, facial recognition technology and image recognition technology are typically applied. Facial recognition technology can help accurately locate consumers in the supermarket in real time and accurately grasp their location and behavior. Image recognition technology can automatically analyze the status of goods on supermarket shelves in real time, collect consumers' actions before and after taking goods in real time, and judge consumers' purchase or return behavior through system analysis. The combination of the two has promoted the realization of unmanned smart supermarkets.
[0004] At the same time, it should be understood that unmanned supermarkets rely on the ever-improving AI technology. However, in actual applications, it is found that the accuracy of commodity recognition achieved by existing image recognition technology still needs to be improved, which to a certain extent limits the normal operation and user experience of unmanned supermarkets. Summary of the invention
[0005] The embodiments of the present application provide a commodity recognition method, apparatus, device, and computer-readable storage medium for improving the recognition accuracy of commodities in an image to a certain extent.
[0006] In a first aspect, an embodiment of the present application provides a commodity identification method, the method comprising:
[0007] Acquire a target image to be identified;
[0008] Input the target image into the product feature recognition model for product feature recognition processing to obtain product feature information corresponding to the target image, wherein the product feature recognition model outputs the feature vector output by the fully connected layer to the convolution layer, so that the convolution layer performs optimization processing according to the feature vector output by the fully connected layer;
[0009] Identify products in the target image based on product feature information.
[0010] In an exemplary embodiment, the optimization process includes:
[0011] The feature vector output by the fully connected layer is converted into a first feature vector whose dimension corresponds to the dimension of the convolutional layer;
[0012] Multiply the first eigenvector by the second eigenvector corresponding to the convolutional layer, and use the product as the weight coefficient;
[0013] Multiply the weight coefficient by the second eigenvector corresponding to the convolution layer to obtain the third eigenvector, which is used as the output of the convolution layer.
[0014] In an exemplary embodiment, when a convolutional layer includes multiple sub-convolutional layers, each sub-convolutional layer is optimized separately.
[0015] In an exemplary embodiment, acquiring a target image to be identified includes:
[0016] Obtaining an initial image to be recognized;
[0017] The initial image is input into the binary classification model for product image screening processing, and the product image after the background image is removed from the initial image is obtained as the target image to be identified.
[0018] In an exemplary embodiment, before inputting the target image into the commodity feature recognition model for commodity feature recognition processing, the method further includes:
[0019] Obtaining a training set, wherein the training set includes images corresponding to different commodity feature information;
[0020] The initial model is trained according to the training set and the preset loss function, and the trained model is used as the product feature recognition model.
[0021] In an exemplary embodiment, the model structure of the commodity feature recognition model is a residual network model structure.
[0022] In an exemplary embodiment, identifying the commodity in the target image according to the commodity feature information includes:
[0023] Matching the product feature information with different product feature information in the product feature information set;
[0024] The commodity corresponding to the matched target commodity feature information is determined as the commodity recognition result of the target image.
[0025] In a second aspect, an embodiment of the present application provides a commodity identification device, the device comprising:
[0026] An acquisition unit, used for acquiring a target image to be identified;
[0027] An input unit, used to input a target image into a commodity feature recognition model for commodity feature recognition processing to obtain commodity feature information corresponding to the target image, wherein the commodity feature recognition model outputs a feature vector output by the fully connected layer to the convolutional layer, so that the convolutional layer performs optimization processing according to the feature vector output by the fully connected layer;
[0028] The recognition unit is used to recognize the commodity in the target image according to the commodity feature information.
[0029] In an exemplary embodiment, the optimization process includes:
[0030] The feature vector output by the fully connected layer is converted into a first feature vector whose dimension corresponds to the dimension of the convolutional layer;
[0031] Multiply the first eigenvector by the second eigenvector corresponding to the convolutional layer, and use the product as the weight coefficient;
[0032] Multiply the weight coefficient by the second eigenvector corresponding to the convolution layer to obtain the third eigenvector, which is used as the output of the convolution layer.
[0033] In an exemplary embodiment, when a convolutional layer includes multiple sub-convolutional layers, each sub-convolutional layer is optimized separately.
[0034] In an exemplary embodiment, the acquisition unit is specifically configured to:
[0035] Obtaining an initial image to be recognized;
[0036] The initial image is input into the binary classification model for product image screening processing, and the product image after the background image is removed from the initial image is obtained as the target image to be identified.
[0037] In an exemplary embodiment, the apparatus further comprises a training unit for:
[0038] Obtaining a training set, wherein the training set includes images corresponding to different commodity feature information;
[0039] The initial model is trained according to the training set and the preset loss function, and the trained model is used as the product feature recognition model.
[0040] In an exemplary embodiment, the model structure of the commodity feature recognition model is a residual network model structure.
[0041] In an exemplary embodiment, the identification unit is specifically configured to:
[0042] Matching the product feature information with different product feature information in the product feature information set;
[0043] The commodity corresponding to the matched target commodity feature information is determined as the commodity recognition result of the target image.
[0044] In a third aspect, an embodiment of the present application further provides a commodity identification device, including a processor and a memory, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps of any commodity identification method provided in the embodiment of the present application are executed.
[0045] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a plurality of instructions suitable for loading by a processor to execute the steps in any one of the commodity identification methods provided in the embodiments of the present application.
[0046] From the above content, it can be concluded that the embodiments of the present application have the following beneficial effects:
[0047] The product feature recognition model builds a channel between the fully connected layer and the convolutional layer. The feature vector output by the fully connected layer at the high level of the model can be output to the convolutional layer at the bottom level of the model. Since the feature vector output by the fully connected layer is used to represent the characteristics of the product and contains the characteristic information of the product, it can guide the convolutional layer to perform optimization processing, pay more attention to the characteristics of the product, and have a higher degree of specificity for the characteristics of the product to be identified. Furthermore, after the product feature recognition model inputs the target image to be identified, it can output product feature information with higher accuracy to a certain extent, and more accurate product recognition results can be obtained based on the product feature information. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0049] Figure 1 This is a schematic diagram of a scenario in an embodiment of the present application;
[0050] Figure 2 This is a flow chart of a commodity identification method according to an embodiment of the present application;
[0051] Figure 3 This is another scenario schematic diagram of an embodiment of the present application;
[0052] Figure 4 This is a flow chart of an optimization process in the commodity identification method of the present application embodiment;
[0053] Figure 5 This is another scenario schematic diagram of an embodiment of the present application;
[0054] Figure 6 This is another flow chart of the commodity identification method according to the embodiment of the present application;
[0055] Figure 7 This is a flow chart of training a commodity feature recognition model in an embodiment of the present application;
[0056] Figure 8 It is a structural diagram of the residual network model structure of an embodiment of the present application;
[0057] Fig. 9 This is another flow chart of the commodity identification method according to the embodiment of the present application;
[0058] Fig.10 This is a structural schematic diagram of a commodity identification device according to an embodiment of the present application;
[0059] Fig.11 It is a structural schematic diagram of a commodity identification device according to an embodiment of the present application. DETAILED DESCRIPTION
[0060] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0061] In the following description, the specific embodiments of the present application will be described with reference to the steps and symbols performed by one or more computers, unless otherwise stated. Therefore, these steps and operations will be mentioned several times as being performed by a computer, and the computer execution referred to herein includes the operation of a computer processing unit by an electronic signal representing data in a structured form. This operation converts the data or maintains it at a location in the memory system of the computer, which can be reconfigured or otherwise change the operation of the computer in a manner familiar to testers in the field. The data structure maintained by the data is a physical location in the memory, which has specific characteristics defined by the data format. However, the principles of the present application are described in the above text, which does not represent a limitation, and testers in the field will understand that the various steps and operations described below can also be implemented in hardware.
[0062] The principles of the present application may be operated using many other general or specific purpose computing, communication environments or configurations. Examples of well-known computing systems, environments and configurations suitable for use with the present application may include, but are not limited to, handheld phones, personal computers, servers, multiprocessor systems, microcomputer-based systems, mainframe computers, and distributed computing environments, including any of the above systems or devices.
[0063] The terms "first", "second", and "third" in this application are used to distinguish different objects rather than to describe a specific order. In addition, the terms "include", "have", and any variations thereof are intended to cover non-exclusive inclusions.
[0064] First of all, before introducing the embodiments of the present application, the relevant content about the application background of the embodiments of the present application is introduced.
[0065] The commodity identification method mentioned in the embodiment of the present application may be executed by a commodity identification device, or different types of commodity identification devices such as a server device, a physical host or a user equipment (UE) integrated with the commodity identification device. The commodity identification device may be implemented in hardware or software, and the UE may specifically be a terminal device such as a smart phone, a tablet computer, a laptop computer, a PDA, a desktop computer or a personal digital assistant (PDA).
[0066] The commodity identification device may also be divided into multiple devices and jointly execute the commodity identification method provided in the embodiment of the present application, such as Figure 1 A scenario diagram of an embodiment of the present application is shown, in which a camera device deployed on-site in an unmanned supermarket, such as a PDA 101, a tablet computer 102 or a laptop computer 103, can capture images of goods on the shelves, and upload the images to be identified to a server 105 via a network 104. The server 105 identifies the goods, and then the server 105 can analyze the status of goods on the supermarket shelves and their distribution strategies.
[0067] The camera device may be a camera, or may be a device including a camera, such as the PDA 101, tablet computer 102, and laptop computer 103 mentioned above; the network 104 may include various connection types, such as wired or wireless communication links or optical fiber cables, etc.; the server 105 may be a server cluster composed of multiple servers, etc., and the server 105 may also be a cloud server. Any number of camera devices, networks 104, and servers 105 may be provided according to actual needs.
[0068] The commodity recognition method can be applied not only to unmanned supermarket scenarios but also to ordinary supermarket scenarios. For example, staff can collect images of commodities on commodity shelves through PDAs, smart phones and other devices with cameras at the supermarket site, and upload the images to be recognized to a server or transmit them to a physical host in the supermarket for commodity recognition. Of course, the device can also directly collect images of commodities on commodity shelves at the supermarket site and perform commodity recognition.
[0069] In the existing related technologies, the recognition model used in the commodity identification process has low recognition accuracy, which makes it impossible to accurately identify the commodities in the image to be identified. Especially when the commodity display is more complicated, the participation of staff is still required to meet the accuracy requirements of commodity identification.
[0070] Based on the above-mentioned defects of the existing related technologies, the embodiments of the present application provide a commodity identification method, which at least overcomes the defects of the existing related technologies to a certain extent.
[0071] Figure 2 A schematic diagram of a process of identifying a commodity in an embodiment of the present application is shown. Figure 2 As shown, the commodity identification method provided in the embodiment of the present application may specifically include the following steps:
[0072] Step S201, obtaining a target image to be identified;
[0073] Step S202, inputting the target image into the commodity feature recognition model for commodity feature recognition processing to obtain commodity feature information corresponding to the target image, wherein the commodity feature recognition model outputs the feature vector output by the fully connected layer to the convolutional layer, so that the convolutional layer performs optimization processing according to the feature vector output by the fully connected layer;
[0074] Step S203: Identify the commodity in the target image according to the commodity feature information.
[0075] Combination Figure 3 Another scenario schematic diagram of an embodiment of the present application is shown in Figure 2 In the technical solution proposed in the illustrated embodiment, the product feature recognition model constructs a channel between the fully connected layer and the convolutional layer, and the feature vector output by the fully connected layer at the high level of the model can be output to the convolutional layer at the bottom level of the model. Since the feature vector output by the fully connected layer is used to represent the features of the product and contains the feature information of the product, the convolutional layer can be guided to perform optimization processing, continuously integrate the underlying detail features and the high-level semantic features, pay more attention to the features of the product, and have higher specificity for the features of the product to be identified. Furthermore, after the product feature recognition model inputs the target image to be identified, it can output product feature information with higher accuracy to a certain extent, and a more accurate product recognition result can be obtained based on the product feature information.
[0076] In addition, since the feature vector output by the fully connected layer at the high level of the model can be output to the convolutional layer at the bottom level of the model, the convolutional layer can pay more attention to the characteristics of the goods and have a higher degree of specificity for the characteristics of the goods to be identified. Therefore, during the training process of the model, we can focus on the characteristic parts of the goods and filter out the smooth areas, so that the model can achieve better learning and convergence effects, thereby achieving the purpose of improving learning efficiency.
[0077] The following continues Figure 2 The specific implementation methods of each step of the illustrated embodiment are described in detail:
[0078] In an exemplary embodiment, as a specific implementation of the optimization process mentioned in step S202 above, Figure 4 A schematic diagram of a process flow of the optimization process of an embodiment of the present application is shown, and the optimization process may include steps S401 to S403:
[0079] Step S401, converting the feature vector output by the fully connected layer into a first feature vector whose dimension corresponds to the dimension of the convolutional layer;
[0080] Step S402, multiplying the first eigenvector by the second eigenvector corresponding to the convolutional layer, and using the obtained product as a weight coefficient;
[0081] Step S403: multiply the weight coefficient by the second eigenvector corresponding to the convolution layer to obtain a third eigenvector as the output of the convolution layer.
[0082] It is easy to understand that the product feature recognition model includes multiple layers. The target image is input into the product feature recognition model, that is, it is first converted into a feature vector through the input layer (Input Layer) in the product feature recognition model. The feature vector then passes through the convolution layer to extract the underlying product features. The underlying product features extracted by the convolution layer (that is, the feature map in the usual sense) are then output to the fully connected layer, and converted into high-level product features by the fully connected layer. At this time, the high-level product features obtained by the fully connected layer are different from the existing related technologies in that a new channel can be constructed between the fully connected layer and the convolution layer through the embodiment of the present application, and output to the convolution layer.
[0083] At this time, the feature vector extracted by the convolution layer can be dot-producted with the feature vector output by the fully connected layer as a weight coefficient indicating the correlation. The greater the correlation, the greater the value, and the smaller the correlation, the smaller the value. Therefore, the weight coefficient can continue to be dot-producted with the feature vector extracted by the convolution layer. Feature areas with large weights are retained, and interference areas without features or with small weights are filtered out, so as to achieve the purpose of using high-level semantic information to guide the bottom layer to focus on places with features.
[0084] Since the dimension of the feature vector output by the fully connected layer may be different from that of the convolutional layer, that is, the number of channels is different, the feature vector output by the fully connected layer can be transformed into a feature vector with the same dimension as the convolutional layer before performing subsequent dot products.
[0085] For example, if the dimension of the convolution layer is 1000 (the size of the feature map is h*w, h*w=1000), then the feature vector output by the fully connected layer is converted into a feature vector of 1000 dimensions; if the dimension of the convolution layer is 500 (the size of the feature map is h*w, h*w=500), then the feature vector output by the fully connected layer is converted into a feature vector of 500 dimensions. The feature vector output by the fully connected layer can be understood as a feature matrix. For example, if a feature vector of 2000 dimensions is to be converted into a feature vector of 1000 dimensions, then the feature vector output by the fully connected layer will be 2000*1000 after conversion.
[0086] In an exemplary embodiment, Figure 5 Another scenario schematic diagram of an embodiment of the present application is shown. When a convolution layer includes multiple sub-convolution layers, each sub-convolution layer can be optimized separately.
[0087] like Figure 5 As shown, the convolution layer includes sub-convolution layer 1, sub-convolution layer 2 and sub-convolution layer 3. A channel is constructed between each sub-convolution layer and the fully connected layer. The feature vectors output by the fully connected layer at the high level of the model can be output to different sub-convolution layers at the bottom level of the model, thereby guiding each sub-convolution layer to perform optimization processing, pay more attention to the characteristics of the goods, and have higher specificity for the characteristics of the goods to be identified.
[0088] During the optimization process, if the dimensions of each sub-convolutional layer are different, the feature vector output by the fully connected layer will correspond to different feature vectors converted from each sub-convolutional layer.
[0089] It should be noted that Figure 5 Although three sub-convolutional layers are shown in the figure, the convolutional layer is not limited to be composed of only three sub-convolutional layers. According to actual needs, the convolutional layer can have any number of sub-convolutional layers.
[0090] In an exemplary embodiment, Figure 6 Another flow chart of the commodity identification method of the present application embodiment is shown as Figure 2 The specific implementation of step S201 in the corresponding embodiment may include:
[0091] Step S601, obtaining an initial image to be recognized;
[0092] It can be understood that the target image input into the commodity feature recognition model may also be a preprocessed image. Correspondingly, before preprocessing, an initial image to be recognized is obtained, and the initial image includes the image of the commodity to be recognized.
[0093] Step S602: Input the initial image into the binary classification model to perform product image screening processing, and obtain the product image after the background image is removed from the initial image as the target image to be identified.
[0094] In the embodiment of the present application, a binary classification process can be performed on the image of the commodity to be identified. It should be understood that the image captured at the supermarket site includes, in addition to the commodity, shelves and other irrelevant background images. In order to eliminate the interference of the background image on the recognition of commodity features, a binary classification model can be trained to classify dense, irregular, and different commodity images into one category without distinction, while regular background images, i.e., long strip-shaped shelf images (including commodity label images on the shelves) and solid color, large-area wall images can be classified into another category. The commodity image is screened and processed by the binary classification model, and the commodity image after the background image is eliminated from the initial image is extracted as the target image to be identified, further improving the effective image information in the target image.
[0095] Among them, the binary classification model can be obtained by training the initial model with a training set including different product images and background images in the supermarket combined with a loss function.
[0096] For example, after removing the background image in the initial model, the binary classification model can also add a corresponding product identification (ID) for each product in the remaining product images. When the product image is subsequently input into the product feature recognition model, the product feature recognition model can extract the product features one by one according to the product ID and identify the product, so as to further facilitate product recognition and improve the recognition efficiency of product recognition.
[0097] In an exemplary embodiment, for Figure 2 The commodity feature recognition model mentioned in step S202 of the corresponding embodiment is as follows: Figure 7 A schematic diagram of a process of training a commodity feature recognition model in an embodiment of the present application is shown. The commodity recognition method provided in the embodiment of the present application may also include a training process of the model:
[0098] Step S701, obtaining a training set, wherein the training set includes images corresponding to different commodity feature information;
[0099] Before training the product feature recognition model, the training set required for the training model can be pre-configured. For example, images corresponding to the product features of each minimum inventory unit can be configured according to the product stock keeping unit (SKU) in the supermarket, and the images can be summarized to form a training set. Alternatively, images corresponding to the corresponding product features can be configured according to the products that can be stored and planned to be stored in the supermarket, and the images can be summarized to form a training set.
[0100] The camera device can be a camera or a device including a camera to collect product images on site in the supermarket and upload them to the server. The server will extract product features based on the collected product images, and combine them with the product semantic information assigned by the staff to form images with different product feature information; alternatively, a product recognition device or product recognition equipment that executes the product recognition method of the embodiment of the present application can collect product images on site in the supermarket and combine them with the product semantic information assigned by the staff to form images with different product feature information.
[0101] Step S702: train the initial model according to the training set and the preset loss function, and use the trained model as a commodity feature recognition model.
[0102] After obtaining the training set, the model can be trained in combination with the loss function. That is, the images in the training set are input into the initial model for forward propagation. The loss function is then calculated based on the product feature recognition results output by the model. Backward propagation is performed based on the loss function to adjust the model parameters. The purpose of training the model is achieved through multiple forward and backward propagations.
[0103] Among them, exemplarily, the loss function may include at least one of a cross entropy loss function, a triplet loss function, and a center loss function.
[0104] Cross entropy loss function:
[0105]
[0106] Among them, y and i are two sample labels, p i represents the probability distribution of the true label, q i is the probability distribution of the predicted label of the trained model, L ID To measure p i With q i similarity, or through the probability distribution q i To express the probability distribution p i The difficulty level, L ID The smaller it is, the smaller the difference between the two distributions is.
[0107] Triplet loss function:
[0108] LTriplet =[d p -d n +α] + ,
[0109] Among them, d p and d n is the characteristic distance between the positive sample pair and the negative sample pair, α is the margin setting used to select difficult sample pairs, generally set to 0.3, and the triplet loss function can make the distance between objects of the same type smaller and the distance between objects of different types farther.
[0110] Center loss function:
[0111]
[0112] Among them, yi is the label of the jth image, c yi is the cluster center of the yi label, f tj L represents the features before the fully connected layer, and β represents the amount of training data segmentation, that is, the size of the mini-batch. C It is used to represent the sum of the squares of the distances from the feature of each sample in each training data to the center of the feature. Minimizing the centerloss loss function can increase the distance between classes and reduce the distance within a class.
[0113] Among them, since the tripletloss loss function only considers d p and d n , ignoring the absolute distance between positive and negative sample pairs, for example, d p = 0.3 and d n = 0.5, their loss value is 0.3-0.5+0.3=0.1, while the other pair d p =1.3 and d n = 1.5 is also 0.1. Although the loss values are the same, the latter pair obviously failed to cluster the positive sample pairs, and the former pair did not separate the negative sample pairs. Therefore, a set of loss functions can be combined with the center loss function to make up for the defects of the tripletloss loss function.
[0114] If the cross entropy loss function, the triplet loss function, and the center loss function are combined as the final loss function, the final loss function can be:
[0115] L f =L ID +L Triplet +βL C ,
[0116] Here, β can be taken as 0.0005.
[0117] In an exemplary embodiment, the model structure of the commodity feature recognition model in the embodiment of the present application may be a residual network model structure, that is, the model structure of the initial model before training is a residual network model structure.
[0118] In the residual network model structure, a residual block structure can be formed between two convolutional layers, between a convolutional layer and a fully connected layer, or between different layers.
[0119] Combination Figure 8 A structural schematic diagram of the residual network model structure is shown, where x represents the input of the residual block, F(x) represents the output of the residual block before the second layer activation function, that is, F(x)=W2σ(W1x), where W1 and W2 represent the weights of the first layer and the second layer, σ represents the relu activation function, and finally the output of the residual block is σ(F(x)+x).
[0120] When there is no shortcut connection (i.e. Figure 8 Right side from x to The residual block is an ordinary 2-layer network when the optimal output is x. The network in the residual block can be a fully connected layer or a convolutional layer. Assume that the output of the second layer network before the activation function is H(x). If the optimal output in this 2-layer network is the input x, then for the network without shortcut connection, it needs to be optimized to H(x)=x; for the network with shortcut connection, that is, the residual block, if the optimal output is x, then it only needs to optimize F(x)=H(x)-x to 0. The latter optimization is simpler than the former. Since the residual network model structure uses skip connections, the gradient vanishing problem caused by increasing the depth in the deep neural network is alleviated.
[0121] Exemplarily, the residual network model structure of the embodiment of the present application can be a ResNet50 residual network model structure, which includes multiple convolutional layers, and the convolutional layers are connected to the softmax layer, whose output number is the number of categories in the training set. For example, if 2000 product types are provided in the training set, the number of categories is set to 2000, and if it is 10000, it is set to 10000. Due to the introduction of the residual network model structure, the low-level detail information and high-level feature information can be further integrated, making the product feature recognition model easy to train and avoiding the problem of gradient explosion.
[0122] In an exemplary embodiment, as a specific implementation of the above step S203, as follows Figure 8 Another flowchart of the commodity identification method according to the embodiment of the present application is shown, step S203 may include:
[0123] Step S901, matching the commodity feature information with different commodity feature information in the commodity feature information set;
[0124] It is understandable that one-to-one corresponding product feature information can be extracted or established in advance based on the products in the product library, and summarized to form a product feature information set for recording product features and subsequent product matching.
[0125] Step S902: determining the commodity corresponding to the matched target commodity feature information as the commodity recognition result of the target image.
[0126] After obtaining the product features in the current target image through the product feature recognition model, it can be matched with different product feature information in the product feature information set, thereby matching the corresponding target product feature information. The product corresponding to the target product feature information is the product recognition result obtained by identifying the product in the target image.
[0127] In order to better implement the commodity identification method provided in the embodiment of the present application, the embodiment of the present application also provides a commodity identification device.
[0128] See also Fig.10 , Fig.10 This is a schematic diagram of a structure of a commodity identification device according to an embodiment of the present application. In the embodiment of the present application, the commodity identification device 1000 may specifically include the following structure:
[0129] An acquisition unit 1001 is used to acquire a target image to be identified;
[0130] The input unit 1002 is used to input the target image into the commodity feature recognition model for commodity feature recognition processing to obtain commodity feature information corresponding to the target image, wherein the commodity feature recognition model outputs the feature vector output by the fully connected layer to the convolution layer, so that the convolution layer performs optimization processing according to the feature vector output by the fully connected layer;
[0131] The identification unit 1003 is used to identify the commodity in the target image according to the commodity feature information.
[0132] In an exemplary embodiment, the optimization process includes:
[0133] Convert the feature vector output by the fully connected layer into a first feature vector whose dimension corresponds to the dimension of the convolutional layer;
[0134] Multiply the first eigenvector by the second eigenvector corresponding to the convolutional layer, and use the product as the weight coefficient;
[0135] Multiply the weight coefficient by the second eigenvector corresponding to the convolution layer to obtain the third eigenvector, which is used as the output of the convolution layer.
[0136] In an exemplary embodiment, when a convolutional layer includes multiple sub-convolutional layers, each sub-convolutional layer is optimized separately.
[0137] In an exemplary embodiment, the acquisition unit 1001 is specifically configured to:
[0138] Obtaining an initial image to be recognized;
[0139] The initial image is input into the binary classification model for product image screening processing, and the product image after the background image is removed from the initial image is obtained as the target image to be identified.
[0140] In an exemplary embodiment, the apparatus further comprises a training unit 1004, configured to:
[0141] Obtaining a training set, wherein the training set includes images of different commodity feature information;
[0142] The initial model is trained according to the training set and the preset loss function, and the trained model is used as the product feature recognition model.
[0143] In an exemplary embodiment, the model structure of the commodity feature recognition model is a residual network model structure.
[0144] In an exemplary embodiment, the identification unit 1003 is specifically configured to:
[0145] Matching the product feature information with different product feature information in the product feature information set;
[0146] The commodity corresponding to the matched target commodity feature information is determined as the commodity recognition result of the target image.
[0147] This application also provides a commodity identification device, see Fig.11 , Fig.11 A schematic diagram of the structure of a commodity identification device of the present application is shown. Specifically, the commodity identification device provided by the present application includes a processor 1101, and the processor 1101 is used to execute the computer program stored in the memory 1102 to implement the following Figures 1 to 9 Corresponding to each step of the commodity identification method in any embodiment; or, the processor 1101 is used to execute the computer program stored in the memory 1102 to implement the following Fig.10 The functions of each unit in the corresponding embodiment.
[0148] Exemplarily, the computer program may be divided into one or more modules / units, one or more modules / units are stored in the memory 1102, and executed by the processor 1101 to complete the present application. One or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the computer device.
[0149] The commodity identification device may include, but is not limited to, the processor 1101 and the memory 1102. Those skilled in the art will appreciate that the illustration is merely an example of the commodity identification device and does not constitute a limitation on the commodity identification device. The commodity identification device may include more or fewer components than shown in the illustration, or may combine certain components, or may include different components. For example, the commodity identification device may also include an input / output device, a network access device, a bus, etc. The processor 1101, the memory 1102, the input / output device, and the network access device are connected via a bus.
[0150] The processor 1101 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the commodity identification device, and uses various interfaces and lines to connect various parts of the entire commodity identification device.
[0151] The memory 1102 can be used to store computer programs and / or modules. The processor 1101 implements various functions of the computer device by running or executing the computer programs and / or modules stored in the memory 1102 and calling the data stored in the memory 1102. The memory 1102 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the commodity identification device (such as audio data, video data, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0152] Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described commodity identification device, equipment and its corresponding units can refer to the following. Figures 1 to 9 The description of the commodity identification method in any embodiment will not be repeated here in detail.
[0153] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0154] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the present application as follows: Figures 1 to 9 For the steps in the commodity identification method in any embodiment, the specific operations can be referred to as follows Figures 1 to 9 The description of the commodity identification method in any embodiment will not be repeated here.
[0155] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0156] Due to the instructions stored in the computer-readable storage medium, the present application can be executed. Figures 1 to 9 Corresponding to the steps in the commodity identification method in any embodiment, therefore, the present application can be implemented as follows Figures 1 to 9For the beneficial effects that can be achieved by the commodity identification method in any embodiment, please refer to the previous description in detail, which will not be repeated here.
[0157] The commodity identification method, device, equipment and computer-readable storage medium provided by the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A commodity identification method, characterized in that: The method comprises: Acquire a target image to be identified; Inputting the target image into a commodity feature recognition model for commodity feature recognition processing to obtain commodity feature information corresponding to the target image, wherein the commodity feature recognition model outputs the feature vector output by the fully connected layer to the convolutional layer, so that the convolutional layer performs optimization processing according to the feature vector output by the fully connected layer; When the target image is input into the commodity feature recognition model, it is first converted into a feature vector through the input layer in the commodity feature recognition model; the feature vector then passes through the convolution layer in the commodity feature recognition model to extract the bottom commodity features to obtain the bottom commodity features; the bottom commodity features are input into the fully connected layer to be converted into high-level commodity features, a new channel is constructed between the fully connected layer and the convolution layer, and the feature vector output by the fully connected layer at the high level of the model is output to the convolution layer at the bottom level of the model; The optimization process includes: Converting the feature vector output by the fully connected layer into a first feature vector whose dimension corresponds to the dimension of the convolutional layer; Multiplying the first feature vector by the second feature vector corresponding to the convolutional layer, and using the obtained product as a weight coefficient indicating the correlation; Multiplying the weight coefficient by the second eigenvector corresponding to the convolution layer to obtain a third eigenvector as the output of the convolution layer, so as to retain feature regions with high correlation and filter interference regions; The commodity in the target image is identified according to the commodity feature information.
2. The method according to claim 1, characterized in that When the convolution layer includes multiple sub-convolution layers, the optimization process is performed on each of the sub-convolution layers respectively.
3. The method according to claim 1, characterized in that The obtaining of the target image to be identified comprises: Obtaining an initial image to be recognized; The initial image is input into a binary classification model to perform product image screening processing, and a product image is obtained after the background image is removed from the initial image, which is used as the target image to be identified.
4. The method according to claim 1, characterized in that: Before inputting the target image into the commodity feature recognition model for commodity feature recognition processing, the method further includes: Acquire a training set, wherein the training set includes images corresponding to different commodity feature information; The initial model is trained according to the training set and the preset loss function, and the trained model is used as the commodity feature recognition model.
5. The method according to claim 1, characterized in that: The model structure of the commodity feature recognition model is a residual network model structure.
6. The method according to claim 1, characterized in that The identifying the commodity in the target image according to the commodity feature information includes: Matching the product feature information with different product feature information in a product feature information set; The commodity corresponding to the matched target commodity feature information is determined as the commodity recognition result of the target image.
7. A commodity identification device, characterized in that: The device comprises: An acquisition unit, used for acquiring a target image to be identified; An input unit is used to input the target image into a commodity feature recognition model for commodity feature recognition processing to obtain commodity feature information corresponding to the target image, wherein the commodity feature recognition model outputs the feature vector output by the fully connected layer to the convolution layer, so that the convolution layer performs optimization processing according to the feature vector output by the fully connected layer; when the target image is input into the commodity feature recognition model, it is first converted into a feature vector through the input layer in the commodity feature recognition model; the feature vector then passes through the convolution layer in the commodity feature recognition model to extract the underlying commodity features to obtain the underlying commodity features; the underlying commodity features are input into the fully connected layer , converted into high-level commodity features, a new channel is constructed between the fully connected layer and the convolutional layer, and the feature vector output by the fully connected layer at the high level of the model is output to the convolutional layer at the bottom level of the model; the optimization process includes: converting the feature vector output by the fully connected layer into a first feature vector whose dimension corresponds to the dimension of the convolutional layer; multiplying the first feature vector by the second feature vector corresponding to the convolutional layer, and using the product as a weight coefficient indicating the correlation; multiplying the weight coefficient by the second feature vector corresponding to the convolutional layer to obtain a third feature vector, and using it as the output of the convolutional layer to retain feature areas with high correlation and filter out interference areas; The identification unit is used to identify the commodity in the target image according to the commodity feature information.
8. A commodity identification device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a computer program, and the processor executes the commodity identification method according to any one of claims 1 to 6 when calling the computer program in the memory.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the commodity identification method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Image classification method based on convolutional neural network and apparatus thereof
CN107292352A
Image classification method and device, server, user terminal, and storage medium
CN108304882A
Quick detection method for objective on the basis of multi-scale characteristic pattern
CN108510012A
A method for generating a convolution neural network model and an image enhancement method
CN109544482A
Neural network training method, face recognition method and system and storage medium
CN109711358A
