Machine Learning-Based Object Recognition Method and Device

Through the item recognition method based on machine learning, the convolutional neural network and Gaussian random network are used to extract text and appearance features, and the probability value of the item is calculated to achieve high-accuracy automatic identification of goods in the unmanned retail industry, solving identification inaccuracies and costs. high problem.

CN111460888BActive Publication Date: 2024-09-10PING AN TECH (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202010123160.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-02-27
Publication Date
2024-09-10
Estimated Expiration
2040-02-27

AI Technical Summary

Technical Problem

In the existing unmanned retail industry, the degree of automation of product identification is low, barcodes are easily deformed and damaged, and RFID tags are costly, resulting in low identification accuracy and reduced merchant profits.

Method used

Using an item recognition method based on machine learning, the packaging image of the target item is collected through an image acquisition device. The convolutional neural network and Gaussian random network are used to train the model, extract text features and appearance features, and calculate the probability value of the item as a suspected item to achieve automation. Identify.

Benefits of technology

It improves the accuracy and automation of product identification, reduces costs, solves the problems of inaccurate identification and high cost, and is suitable for the unmanned retail industry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111460888B
    Figure CN111460888B
Patent Text Reader

Abstract

The present invention provides an object recognition method and device based on machine learning, the method comprising: collecting a first packaging image of a target object through an image acquisition device; inputting the first packaging image into a training model to obtain a probability value of the target object being a suspected object, wherein the suspected object is one or more preset samples of the target object; and identifying the target object as a suspected object whose probability value meets a predetermined condition. The present invention solves the technical problems of inaccurate object recognition in the related art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to an object recognition method and device based on machine learning. Background Art

[0002] At present, the unmanned retail industry is extremely popular, and the identification of retail goods is a technical key. There is a huge demand in the market for unmanned retail in convenience store scenarios.

[0003] In the related art, retail goods are identified by manually aligning the barcode of the retail goods with the scanning area of ​​the scanner. This method has a low degree of automation, which affects the user experience. Secondly, due to the defects of the barcode itself, such as easy deformation and damage, the recognition accuracy of the scanner is low. In addition, there is also a method of attaching RFID (Radio Frequency Identification) tags to retail goods, and identifying them through a product identification method that combines computer vision and deep learning. However, the cost of attaching RFID tags is relatively high, such as the cost of the label itself, the labor cost of labeling, the time cost of labeling, etc., which accounts for a certain proportion of the sales price of a single product on average. In particular, the profit of some retail products is extremely low, which further reduces the profit of merchants.

[0004] With respect to the above-mentioned problems existing in the related technologies, no effective solutions have been found so far. Summary of the invention

[0005] The embodiments of the present invention provide a method and device for object recognition based on machine learning, so as to at least solve the technical problems such as inaccurate object recognition in the related art.

[0006] According to one embodiment of the present invention, there is provided an object identification method based on machine learning, comprising: acquiring a first packaging image of a target object through an image acquisition device; inputting the first packaging image into a training model to obtain a probability value that the target object is a suspected object, wherein the suspected object is one or more preset samples of the target object; and identifying the target object as a suspected object whose probability value meets predetermined conditions.

[0007] Optionally, before inputting the first packaging image into the training model to obtain the probability value of the target item being a suspected item, the method further includes: acquiring a second packaging image of the preset sample; extracting text features and appearance features of the second packaging image, wherein the appearance features include at least: color information of the second packaging image, pattern information of the second packaging image, and shape information of the preset sample; and training an initial model based on the text features and the appearance features to obtain the training model.

[0008] Optionally, training an initial model based on the text features and the appearance features to obtain the training model includes: training the convolutional neural network by using the text features and a first weight coefficient of the convolutional neural network to obtain a first training model and first model parameters of the first training model; and training the Gaussian random network by using the appearance features and a second weight coefficient of the Gaussian random network to obtain a second training model and second model parameters of the second training model.

[0009] Optionally, inputting the first packaging image into a training model to obtain a probability value that the target item is a suspected item includes: respectively inputting the first packaging image into a first training model in the training model and a second training model in the training model; calculating a first probability that a target text feature of the first packaging image is a text feature of the suspected item through the first training model; and calculating a second probability that a target appearance feature of the first packaging image is an appearance feature of the suspected item through the second training model; and calculating a probability value that the target item is the suspected item based on the first probability and the second probability.

[0010] Optionally, calculating the first probability that the target text feature of the first packaging image is the text feature of the suspected object through the first training model includes: detecting whether there is target text in the first packaging image; when detecting that the target text exists in the first packaging image, performing Chinese language model N-GRAM encoding on the target text to obtain a first character string; and performing N-GRAM encoding on the text of the suspected object to obtain a second character string; and matching the first character string with the second character string to calculate the first probability.

[0011] Optionally, the formula for calculating the probability value y of the target object being the suspected object according to the first probability and the second probability is: y=(1-α)f(W t x t )+αf(W s x s ), where f(W t x t ) represents the first probability; W t represents the first model parameter of the first training model; x t represents the target text feature; f(W s x s ) represents the second probability, W s represents the second model parameter of the second training model; s represents the target appearance feature; α represents the weight coefficient between the first probability and the second probability.

[0012] Optionally, identifying the target object as a suspected object whose probability value meets predetermined conditions at least includes: when the suspected object is a preset sample, when the probability value is greater than or equal to a threshold, identifying the target object as the suspected object; when the suspected object is multiple preset samples, selecting the maximum probability value from multiple probability values, and identifying the target object as a suspected object corresponding to the maximum probability value.

[0013] According to one embodiment of the present invention, there is also provided an object identification device based on machine learning, comprising: a first acquisition module, used to acquire a first packaging image of a target object through an image acquisition device; a calculation module, used to input the first packaging image into a training model to obtain a probability value that the target object is a suspected object, wherein the suspected object is one or more preset samples of the target object; and an identification module, used to identify the target object as a suspected object whose probability value meets a predetermined condition.

[0014] Optionally, the device also includes: a second acquisition module, used to acquire a second packaging image of the preset sample before inputting the first packaging image into the training model to obtain a probability value of the target item being a suspected item; an extraction module, used to extract text features and appearance features of the second packaging image, wherein the appearance features include at least: color information of the second packaging image, pattern information of the second packaging image, and shape information of the preset sample; a training module, used to train an initial model based on the text features and the appearance features to obtain the training model.

[0015] Optionally, the training module includes: a first training unit, used to train the convolutional neural network through the text features and the first weight coefficient of the convolutional neural network to obtain a first training model and first model parameters of the first training model; and a second training unit, used to train the Gaussian random network through the appearance features and the second weight coefficient of the Gaussian random network to obtain a second training model and second model parameters of the second training model.

[0016] Optionally, the calculation module includes: an input unit, used to input the first packaging image into the first training model in the training model and the second training model in the training model, respectively; a first calculation unit, used to calculate the first probability that the target text feature of the first packaging image is the text feature of the suspected object through the first training model; and a second calculation unit, used to calculate the second probability that the target appearance feature of the first packaging image is the appearance feature of the suspected object through the second training model; and a third calculation unit, used to calculate the probability value of the target object being the suspected object based on the first probability and the second probability.

[0017] Optionally, the first calculation unit includes: a detection subunit, detecting whether there is a target text in the first packaging image; an encoding subunit, for performing Chinese language model N-GRAM encoding on the target text to obtain a first character string when detecting the presence of the target text in the first packaging image; and performing N-GRAM encoding on the text of the suspected object to obtain a second character string; and a calculation subunit, for matching the first character string with the second character string to calculate the first probability.

[0018] Optionally, the third calculation unit is used to calculate the probability value y using the formula: y = (1-α)f(W t x t )+αf(W s x s ), where f(W t x t ) represents the first probability; W t represents the first model parameter of the first training model; x t represents the target text feature; f(W s x s ) represents the second probability, W s represents the second model parameter of the second training model; s represents the target appearance feature; α represents the weight coefficient between the first probability and the second probability.

[0019] Optionally, the identification module includes: a first identification unit, used to identify the target object as the suspected object when the suspected object is a preset sample and the probability value is greater than or equal to a threshold; a second identification unit, used to select a maximum probability value from multiple probability values ​​when the suspected object is multiple preset samples, and identify the target object as a suspected object corresponding to the maximum probability value.

[0020] According to yet another embodiment of the present invention, a storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned device embodiments when running.

[0021] According to another embodiment of the present invention, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0022] Through the present invention, the packaging image of the captured target item is input into the training model, and the probability value of the target item being a suspected item is calculated by the training model. When the probability value meets a predetermined condition, the target item is identified as a suspected item, thereby solving technical problems such as inaccurate item identification in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0024] Figure 1 It is a hardware structure block diagram of an object recognition method based on machine learning according to an embodiment of the present invention applied to a computer terminal;

[0025] Figure 2 is a flow chart of an object recognition method based on machine learning provided by the present invention;

[0026] Figure 3 is an example diagram of text information of a commodity provided according to an embodiment of the present invention;

[0027] Figure 4 is an example diagram of appearance packaging information of a commodity provided according to an embodiment of the present invention;

[0028] Figure 5 is a schematic diagram of a commodity identification method provided according to a specific embodiment of the present invention;

[0029] Figure 6 is a demonstration diagram of the test results of α provided according to a specific embodiment of the present invention;

[0030] Figure 7 4 is a structural block diagram of a device for identifying an object based on machine learning according to an embodiment of the present invention. DETAILED DESCRIPTION

[0031] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.

[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0033] Example 1

[0034] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a server, a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 1 is a hardware structure diagram of an object recognition method based on machine learning applied to a computer terminal according to an embodiment of the present invention. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the computer terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0035] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the object identification method based on machine learning in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the computer terminal via a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0036] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0037] In this embodiment, a method for object recognition based on machine learning is provided. Figure 2 is a flow chart of a method for object recognition based on machine learning provided by the present invention. Figure 2 As shown, the process includes the following steps:

[0038] Step S202, capturing a first packaging image of the target object by an image capturing device;

[0039] Step S204, inputting the first packaging image into the training model to obtain a probability value of the target object being a suspected object, wherein the suspected object is one or more preset samples of the target object;

[0040] The suspected object in this embodiment refers to the target object being suspected to be any preset sample among one or more preset samples.

[0041] Step S206: Identify the target object as a suspected object whose probability value meets a predetermined condition.

[0042] Through the above steps, the packaging image of the target item is input into the training model, and the probability value of the target item being a suspected item is calculated by the training model. When the probability value meets the predetermined conditions, the target item is identified as a suspected item, thereby solving the technical problems such as inaccurate item identification in the related technology.

[0043] In an optional embodiment, before the first packaging image is input into the training model to obtain the probability value of the target item being a suspected item, it also includes: collecting a second packaging image of a preset sample; extracting text features and appearance features of the second packaging image, wherein the appearance features at least include: color information of the second packaging image, pattern information of the second packaging image, and shape information of the preset sample; and training an initial model based on the text features and appearance features to obtain a training model.

[0044] In this embodiment, the image dataset of the historical version of the target object is collected in advance, and the image includes text information and appearance packaging information, wherein the text information includes the logo (trademark), name, or slogan of the object, and the appearance packaging information is the packaging design style feature information of the commodity, including the color, pattern or shape of the object. Figure 3 and Figure 4 As shown, Figure 3 is an example diagram of text information of a commodity provided according to an embodiment of the present invention, Figure 4 This is an example diagram of appearance packaging information of a commodity provided according to an embodiment of the present invention.

[0045] In an optional example, an initial model is trained based on text features and appearance features to obtain a training model, including: training a convolutional neural network through text features and a first weight coefficient of the convolutional neural network to obtain a first training model and first model parameters of the first training model; and training a Gaussian random network through appearance features and a second weight coefficient of the Gaussian random network to obtain a second training model and second model parameters of the second training model.

[0046] In an optional embodiment, first, the collected image data set is divided into a training set and a test set, wherein the training set and the test set can be divided in proportion according to the generated random numbers, for example, the training set and the test set are divided in a ratio of 8:2. If a total of 100 pictures are collected, 20 pictures are first selected as the test set by generating random numbers from 1 to 100, and the remaining 80 pictures will be used as the training set.

[0047] Secondly, the convolutional neural network and the Gaussian random network are trained according to the training set and the test set respectively, with the goal of minimizing the cost function, to obtain the first training model and the first model parameters and the second training model and the second model parameters. Among them, the initial model parameters of the convolutional neural network and the Gaussian random network (i.e., the first weight coefficient and the second weight coefficient) can be derived from the pre-training of non-commodity information, that is, trained from a large data set publicly available in academia (such as Imagenet, the Imagenet project is a large visualization database for visual object recognition software research), and then continuously iteratively reduce the optimization function to obtain, for example, in the process of iteratively reducing the gap between the output value of the convolutional neural network and the expected target, the initial weights will be continuously changed through the principle of neural network back propagation, and finally reach the parameter requirements that meet the commodity data set.

[0048] According to the above embodiment, inputting the first packaging image into the training model to obtain the probability value of the target item being the suspected item includes: respectively inputting the first packaging image into the first training model in the training model and the second training model in the training model; calculating the first probability that the target text feature of the first packaging image is the text feature of the suspected item through the first training model; and calculating the second probability that the target appearance feature of the first packaging image is the appearance feature of the suspected item through the second training model; and calculating the probability value of the target item being the suspected item based on the first probability and the second probability.

[0049] Optionally, the first training model includes: a convolution layer, a pooling layer, an excitation layer and a deconvolution layer, which are used to detect whether there is text in the packaging image of the item and, if there is text, detect the text area in the packaging image where the text is located, and input the text area into a text recognition module to calculate the similarity between the text in the packaging image and the text of a preset sample of a historical version (i.e., the first probability mentioned above); the second training model includes: a convolution layer, a pooling layer, an excitation layer and a fully connected layer, which are used to calculate the similarity between the packaging of the target item and the packaging of a preset sample of a historical version (i.e., the second probability mentioned above).

[0050] Preferably, calculating the first probability that the target text feature of the first packaging image is the text feature of the suspected object through the first training model includes: detecting whether the target text exists in the first packaging image; when detecting that the target text exists in the first packaging image, performing Chinese language model N-GRAM encoding on the target text to obtain a first character string; and performing N-GRAM encoding on the text of the suspected object to obtain a second character string; matching the first character string with the second character string to calculate the first probability.

[0051] In an optional embodiment, assume that there are two strings: string 1 and string 2, calculate the N-GRAM of string 1 and the N-GRAM of string 2 respectively, find the number of their common substrings, and define the N-GRAM distance between the two strings based on the common substrings; then obtain the text similarity probability by matching the N-GRAM distance between the two strings and the probability of the number of common substrings.

[0052] In an example, taking string 1 as coca and string 2 as coco, according to the formula: |G N (s)|+|G N (t)|-2×|G N (s)∩G N (t)|, and get the N-GRAM distance score between string 1 and string 2. Among them, |G N (s)| is the N-GRAM set of string 1, |G N(t)| is the N-GRAM set of string 2, and the value of N is generally 2 or 3. Assume that N=2, and there is 1 substring co shared by string 1 and string 2, and each string is divided into 2 segments. Then according to the above formula, we get: 2+2-2*1=2.

[0053] According to the above example, the smaller the N-GRAM distance between two strings, the closer the two strings are. When the two strings are completely equal, the distance between them is 0. Finally, the N-GRAM distance score between the two strings is normalized to [0, 1] to obtain the text similarity (i.e., the first probability mentioned above).

[0054] In an optional embodiment, the formula for calculating the probability value y of the target object being a suspected object according to the first probability and the second probability is: y = (1-α)f(W t x t )+αf(W s x s ), where f(W t x t ) represents the first probability; W t represents the first model parameter of the first training model; x t represents the target text feature; f(W s x s ) represents the second probability, W s represents the second model parameter of the second training model; x s represents the target appearance feature; α represents the weight coefficient between the first probability and the second probability. In this embodiment, after obtaining the first probability and the second probability, the two probability values ​​are weighted to obtain the similarity between the target object and the suspected object (ie, the above-mentioned probability value y).

[0055] In one example, identifying a target item as a suspected item whose probability value meets a predetermined condition includes at least: when the suspected item is a preset sample, when the probability value is greater than or equal to a threshold, identifying the target item as a suspected item; when the suspected item is multiple preset samples, selecting the maximum probability value from the multiple probability values, and identifying the target item as a suspected item corresponding to the maximum probability value.

[0056] In this embodiment, when there is only one historical version of the target item (i.e., the above-mentioned preset sample), if the calculated probability value y between the target item and a suspected item is greater than or equal to a threshold value (e.g., 90%), the target item is identified as a suspected item; when there are multiple historical versions of the target item (i.e., the above-mentioned preset samples), the probability value y between the target item and each suspected item is calculated separately to obtain multiple probability values, and the preset sample corresponding to the largest probability value y is selected from the multiple probability values, and the target item is identified as the preset sample corresponding to the largest probability value y.

[0057] Optionally, after the target item is identified as a suspected item whose probability value meets the predetermined conditions, the method further includes: querying the price information of the suspected item; and outputting the amount to be settled of the target item according to the price information. In this embodiment, taking the unmanned retail scenario as an example, after the target item is identified, the item to be settled and the price information of the item to be settled (i.e., the above-mentioned settlement rules) are determined, and then the price information is output so that the user can pay for the item to be settled.

[0058] The following is a further description of the embodiment of the present invention in conjunction with a specific embodiment:

[0059] Figure 5 is a schematic diagram of a commodity identification method provided according to an embodiment of the present invention, such as Figure 5 As shown, firstly, a packaging image of a target product (i.e., the first packaging image) is obtained through a camera, and the packaging image of the target product is input into a training model.

[0060] For the recognition of text features, based on the input target product image, the historically saved packaging image (i.e., the second packaging image mentioned above) is retrieved to detect the packaging feature vector; the real feature vector (i.e., the valid text area) in the packaging feature vector is extracted through a Gaussian random network; the text area is input into the text recognition module, and the similarity between the text in the target packaging image and the text in the historically saved packaging image is calculated by calculating the N-GRAM code (i.e., the first probability mentioned above).

[0061] For the recognition of appearance features, based on the appearance features of the input target product image (i.e., the above-mentioned target appearance features), historically saved packaging images are retrieved, the historically saved packaging images are randomly cropped to obtain random patches, and the similarity between the appearance features of the target product and the appearance features of the historically saved packaging images is calculated through a Gaussian random network (i.e., the above-mentioned second probability).

[0062] Finally, the recognized text features and appearance features are fused and classified to determine that the target product is one of the item samples in the historically preserved image, such as Cola.

[0063] In this embodiment, the target product packaging design style is identified, the packaging text area is detected, and the packaging text is recognized; finally, the recognition results are integrated. The weight adjustment parameter α between the text feature and the appearance feature can be determined through multiple experiments, such as α = 0.1, 0.2, 0.4, 0.6, etc. According to multiple experiments, when α = 0.4, the effect is the best. The experimental results are shown as follows Figure 6 As shown, Figure 6 It is a demonstration diagram of the test results of α provided according to a specific embodiment of the present invention.

[0064] Finally, the recognition accuracy is compared with other methods in the related art. For example, the probability statistics of the target product suspected to be multiple preset products are shown in Table 1.

[0065] Table 1

[0066]

[0067] In this embodiment, as shown in Table 1, when α=0.4, assuming that there are k=4 item samples, the probability that the target commodity is suspected to be each item sample is calculated by the calculation method of gk+SC in the related technology, which are 60.03, 61.78, 61.43, and 61.08 respectively; obviously, the highest probability is 61.78; and the probability that the target commodity is suspected to be each item sample calculated by the fusion network (FusionNet) of the embodiment of the present invention is 85.17, 86.39, 85.86, and 85.69 respectively, among which the highest probability is 86.39. The item sample corresponding to the probability 86.39 is determined as the final commodity to be settled. Obviously, the recognition result of the embodiment of the present invention has a higher accuracy.

[0068] Through the above-mentioned embodiment, the text features and appearance features of the target product are identified through machine learning to determine the target product, which solves the technical problem of inaccurate product identification in the related technology. The technical solution of the embodiment of the present invention has the advantages of high degree of automation, low cost, high accuracy, etc. In the unmanned retail industry, when shopping and checking out, barcodes, labels and other signs of the product are not required. The characteristics of the product packaging itself are learned through a large number of product images, which realizes the ability to automatically identify product images, thereby improving the recognition efficiency of products.

[0069] Example 2

[0070] In this embodiment, a device for object identification based on machine learning is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0071] Figure 7 is a structural block diagram of an object recognition device based on machine learning according to an embodiment of the present invention. Figure 7 As shown, the device includes: a first acquisition module 702, used to acquire a first packaging image of a target object through an image acquisition device; a calculation module 704, connected to the first acquisition module 702, used to input the first packaging image into a training model to obtain a probability value of the target object being a suspected object, wherein the suspected object is one or more preset samples of the target object; and an identification module 706, connected to the calculation module 704, used to identify the target object as a suspected object whose probability value meets a predetermined condition.

[0072] Optionally, the above-mentioned device also includes: a second acquisition module, used to acquire a second packaging image of a preset sample before inputting the first packaging image into the training model to obtain a probability value of the target item being a suspected item; an extraction module, used to extract text features and appearance features of the second packaging image, wherein the appearance features at least include: color information of the second packaging image, pattern information of the second packaging image, and shape information of the preset sample; a training module, used to train an initial model based on the text features and appearance features to obtain a training model.

[0073] Optionally, the training module includes: a first training unit, used to train the convolutional neural network through text features and a first weight coefficient of the convolutional neural network to obtain a first training model and first model parameters of the first training model; and a second training unit, used to train the Gaussian random network through appearance features and a second weight coefficient of the Gaussian random network to obtain a second training model and second model parameters of the second training model.

[0074] Optionally, the calculation module 704 includes: an input unit, used to input the first packaging image into the first training model in the training model and the second training model in the training model respectively; a first calculation unit, used to calculate the first probability that the target text feature of the first packaging image is the text feature of the suspected object through the first training model; and a second calculation unit, used to calculate the second probability that the target appearance feature of the first packaging image is the appearance feature of the suspected object through the second training model; and a third calculation unit, used to calculate the probability value of the target object being the suspected object based on the first probability and the second probability.

[0075] Optionally, the first computing unit includes: a detection subunit, detecting whether there is a target text in the first packaging image; an encoding subunit, for performing Chinese language model N-GRAM encoding on the target text to obtain a first character string when detecting the presence of the target text in the first packaging image; and performing N-GRAM encoding on the text of the suspected object to obtain a second character string; and a computing subunit, for matching the first character string with the second character string to calculate a first probability.

[0076] Optionally, the third calculation unit is used to calculate the probability value y using the formula: y=(1-αfWtxt+αfWsxs, where fWtxt represents the first probability; Wt represents the first model parameter of the first training model; x t represents the target text feature; f(W s x s ) represents the second probability, W s represents the second model parameter of the second training model; x s represents the target appearance feature; α represents the weight coefficient between the first probability and the second probability.

[0077] Optionally, the identification module 706 includes: a first identification unit, used to identify the target object as a suspected object when the suspected object is a preset sample and the probability value is greater than or equal to a threshold; a second identification unit, used to select a maximum probability value from multiple probability values ​​when the suspected object is multiple preset samples, and identify the target object as a suspected object corresponding to the maximum probability value.

[0078] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0079] Example 3

[0080] An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0081] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:

[0082] S1, capturing a first packaging image of a target object by an image capturing device;

[0083] S2, inputting the first packaging image into a training model to obtain a probability value of the target object being a suspected object, wherein the suspected object is one or more preset samples of the target object;

[0084] S3, identifying the target object as a suspected object whose probability value meets a predetermined condition.

[0085] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

[0086] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0087] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0088] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0089] S1, capturing a first packaging image of a target object by an image capturing device;

[0090] S2, inputting the first packaging image into a training model to obtain a probability value of the target object being a suspected object, wherein the suspected object is one or more preset samples of the target object;

[0091] S3, identifying the target object as a suspected object whose probability value meets a predetermined condition.

[0092] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0093] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0094] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for object recognition based on machine learning, characterized in that: include: Capturing a first packaging image of the target object by an image acquisition device; Inputting the first packaging image into a training model to obtain a probability value that the target object is a suspected object, wherein the suspected object is one or more preset samples of the target object; Identify the target object as a suspected object whose probability value meets a predetermined condition; The step of inputting the first packaging image into a training model to obtain a probability value of the target object being a suspected object includes: The first packaged image is input into a first training model in the training model and a second training model in the training model respectively; the first training model is a convolutional neural network, and the convolutional neural network includes: a convolutional layer, a pooling layer, an excitation layer and a deconvolution layer; the second training model is a Gaussian random network, and the Gaussian random network includes: a convolutional layer, a pooling layer, an excitation layer and a fully connected layer; Calculating a first probability that the target text feature of the first packaging image is the text feature of the suspected object by using the first training model; and calculating a second probability that the target appearance feature of the first packaging image is the appearance feature of the suspected object by using the second training model; Calculating a probability value that the target object is the suspected object according to the first probability and the second probability; The calculating, by the first training model, a first probability that the target text feature of the first packaging image is the text feature of the suspected object comprises: Detecting whether there is target text in the first packaging image; In the case of detecting that there is a target text in the first packaging image, performing Chinese language model N-GRAM encoding on the target text to obtain a first character string; and performing N-GRAM encoding on the text of the suspected object to obtain a second character string; The first string is matched with the second string to determine the number of common substrings, based on the number of common substrings, the number of substrings in the first string, and the number of substrings in the second string, a distance score between the first string and the second string is calculated using a predetermined formula, and the first probability is calculated based on the distance score.

2. The method according to claim 1, characterized in that Before inputting the first packaging image into a training model to obtain a probability value that the target object is a suspected object, the method further includes: Acquire a second packaging image of the preset sample; Extracting text features and appearance features of the second packaging image, wherein the appearance features at least include: color information of the second packaging image, pattern information of the second packaging image, and shape information of the preset sample; An initial model is trained based on the text features and the appearance features to obtain the training model.

3. The method according to claim 2, characterized in that Training an initial model based on the text features and the appearance features to obtain the training model includes: The convolutional neural network is trained by the text features and the first weight coefficient of the convolutional neural network to obtain a first training model and first model parameters of the first training model; and the Gaussian random network is trained by the appearance features and the second weight coefficient of the Gaussian random network to obtain a second training model and second model parameters of the second training model.

4. The method according to claim 1, characterized in that: The formula for calculating the probability value y that the target object is the suspected object according to the first probability and the second probability is: y=(1-α)f(W t x t )+αf(W s x s ), Among them, f(W t x t ) represents the first probability; W t represents the first model parameter of the first training model; x t represents the target text feature; f(W s x s ) represents the second probability, W s represents the second model parameter of the second training model; s represents the target appearance feature; α represents the weight coefficient between the first probability and the second probability.

5. The method according to claim 1, characterized in that: Identifying the target object as a suspected object whose probability value meets a predetermined condition at least includes: In the case where the suspected object is a preset sample, when the probability value is greater than or equal to a threshold, identifying the target object as the suspected object; In the case that the suspected object is a plurality of preset samples, a maximum probability value is selected from the plurality of probability values, and the target object is identified as a suspected object corresponding to the maximum probability value.

6. An object recognition device based on machine learning, characterized in that: include: A first acquisition module, used for acquiring a first packaging image of a target object through an image acquisition device; a calculation module, configured to input the first packaging image into a training model to obtain a probability value that the target object is a suspected object, wherein the suspected object is one or more preset samples of the target object; An identification module, configured to identify the target object as a suspected object whose probability value meets a predetermined condition; The calculation module includes: an input unit, used to input the first packaging image into the first training model in the training model and the second training model in the training model respectively; the first training model is a convolutional neural network, and the convolutional neural network includes: a convolutional layer, a pooling layer, an excitation layer and a deconvolution layer; the second training model is a Gaussian random network, and the Gaussian random network includes: a convolutional layer, a pooling layer, an excitation layer and a fully connected layer; a first calculation unit, used to calculate the first probability that the target text feature of the first packaging image is the text feature of the suspected object through the first training model; and a second calculation unit, used to calculate the second probability that the target appearance feature of the first packaging image is the appearance feature of the suspected object through the second training model; a third calculation unit, used to calculate the probability value of the target object being the suspected object according to the first probability and the second probability; The first calculation unit includes: a detection subunit, used to detect whether there is a target text in the first packaging image; an encoding subunit, used to perform Chinese language model N-GRAM encoding on the target text to obtain a first character string when the target text is detected in the first packaging image; and N-GRAM encoding the text of the suspected object to obtain a second character string; a calculation subunit, used to match the first character string with the second character string to determine the number of common substrings, calculate the distance score between the first character string and the second character string based on the number of common substrings, the number of substrings in the first character string, and the number of substrings in the second character string using a predetermined formula, and calculate the first probability based on the distance score.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • A method and apparatus for image recognition

    CN109214383A

  • Vision-based commodity identification detection method and device

    CN109635690A

  • Real-time identification of moving objects in video images

    US20190005361A1