Commodity recognition method and device based on image segmentation

Through the methods of image segmentation and feature vector matching, the problem of low product recognition accuracy is solved, and more efficient and accurate product recognition is achieved.

CN114821062BActive Publication Date: 2025-08-29GUANGZHOU YOUMI INFORMATION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210492264.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-07
Publication Date
2025-08-29
Estimated Expiration
2042-05-07

AI Technical Summary

Technical Problem

The existing product recognition methods have the problem of low accuracy, especially when facing images of different products in the same background and products in the same background, the recognition error rate is high.

Method used

By detecting and segmenting the product subject area in the product image to be identified by an image segmentation method, the feature vector of the target image is extracted, and matched with the pre-constructed product image feature library to determine the product identification.

Benefits of technology

It improves the accuracy and reliability of product recognition, reduces the interference of image background on recognition results, and improves recognition efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114821062B_ABST
    Figure CN114821062B_ABST
Patent Text Reader

Abstract

The present invention discloses a commodity recognition method and device based on image segmentation, which includes: when a commodity image is detected and a commodity recognition operation needs to be performed, the commodity image is input into a commodity image main segmentation model to obtain a corresponding target image; the target image is input into an image feature extraction model to obtain a target feature vector; based on the target feature vector and each existing feature vector in a commodity image feature library, a target existing feature vector that matches the target feature vector is determined, and based on the image feature-commodity identification correspondence corresponding to the commodity image feature library, the commodity identification of the target existing feature vector is determined as the commodity recognition result of the commodity image. It can be seen that the present invention can not only ensure the recognition speed of the commodity image, but also effectively reduce the interference of the image background on the commodity recognition result, thereby improving the accuracy and reliability of the commodity recognition result to improve the precision of commodity recognition, and improve the efficiency of determining the commodity recognition result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a commodity recognition method and device based on image segmentation. Background Art

[0002] With the rapid development of the e-commerce industry, product recognition technology plays a vital role. Specifically, e-commerce platforms store vast amounts of product image data. Product recognition technology enables e-commerce platforms to better manage product data, helping advertisers analyze advertising designs for similar products and discover the potential popularity of different products.

[0003] Currently, product recognition methods for product images mainly include using target detection technology to detect the product location in the product image to eliminate interference from large-area background information, or extracting global features of the product image and matching the extracted global features with product images in the feature library to derive the product category in the product image. However, practice has shown that the former has a matching score that is no less than that of images of the same background but different products, as the latter requires direct extraction of features from the entire image. Therefore, it is highly affected by the background template and is prone to product recognition errors when different products correspond to completely identical image templates. It can be seen that both of the above-mentioned product recognition methods have the problem of low product recognition accuracy. Therefore, it is particularly important to provide a new product recognition method for product images to improve product recognition accuracy. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a commodity recognition method and device based on image segmentation, which can improve the accuracy of commodity recognition.

[0005] In order to solve the above technical problems, the first aspect of the present invention discloses a commodity identification method based on image segmentation, the method comprising:

[0006] When a product image to be identified is detected and a product identification operation needs to be performed, the product image to be identified is input into a predetermined product image subject segmentation model to obtain a target image corresponding to the product to be identified in the product image to be identified, and the correlation between the target image and the background of the product image to be identified is lower than a preset correlation threshold;

[0007] Inputting the target image into a pre-built image feature extraction model to obtain a target feature vector corresponding to the target image;

[0008] Based on the target feature vector and each existing feature vector in the product image feature library, a target existing feature vector that matches the target feature vector is determined, and based on the image feature-product identification correspondence corresponding to the product image feature library, the product identification corresponding to the target existing feature vector is determined as the product identification result corresponding to the product image to be identified.

[0009] As an optional embodiment, in the first aspect of the present invention, before determining a target existing feature vector that matches the target feature vector based on the target feature vector and each existing feature vector in the product image feature library, the method further includes:

[0010] performing a dimensionality reduction operation on the target feature vector to update the target feature vector;

[0011] Furthermore, before performing a dimensionality reduction operation on the target feature vector to update the target feature vector, the method further includes:

[0012] Determine the first dimension information of the target feature vector, and obtain the second dimension information corresponding to all existing feature vectors in the product image feature library;

[0013] Determine whether the first dimensional information matches the second dimensional information. When it is determined that the first dimensional information does not match the second dimensional information, trigger the execution of the operation of performing a dimensionality reduction operation on the target feature vector to update the target feature vector; when it is determined that the first dimensional information matches the second dimensional information, trigger the execution of the operation of determining a target existing feature vector that matches the target feature vector based on the target feature vector and each existing feature vector in the product image feature library.

[0014] As an optional embodiment, in the first aspect of the present invention, determining a target existing feature vector that matches the target feature vector based on the target feature vector and each existing feature vector in the product image feature library includes:

[0015] Calculating the cosine similarity between the target feature vector and each existing feature vector in the product feature database;

[0016] It is determined whether there is at least one target cosine similarity greater than or equal to a preset cosine similarity threshold among all the cosine similarities. If yes, the similar existing feature vectors corresponding to all the target cosine similarities are determined as target existing feature vectors that match the target feature vector.

[0017] As an optional embodiment, in the first aspect of the present invention, determining the product identification corresponding to the target existing feature vector based on the image feature-product identification correspondence corresponding to the product image feature library as the product identification result corresponding to the product image to be identified includes:

[0018] Calculating the number of all the similar existing feature vectors, and determining the product identification corresponding to each of the similar existing feature vectors based on the image feature-product identification correspondence relationship corresponding to the product image feature library;

[0019] Determine, based on the quantity and the commodity identifiers corresponding to all the similar existing feature vectors, the commodity identifier corresponding to the target existing feature vector as the commodity recognition result corresponding to the commodity image to be recognized;

[0020] The step of determining the commodity identification corresponding to the target existing feature vector based on the quantity and the commodity identifications corresponding to all the similar existing feature vectors as the commodity identification result corresponding to the commodity image to be identified includes:

[0021] When the number is 1, determining the commodity identification corresponding to the similar existing feature vector as the commodity recognition result corresponding to the commodity image to be recognized;

[0022] When the number is greater than 1, the commodity identification corresponding to the target similar existing feature vector is determined as the commodity recognition result corresponding to the commodity image to be recognized; or

[0023] When the number is greater than 1 and less than a preset number threshold, the commodity identification corresponding to the target similar existing feature vector is determined as the commodity recognition result corresponding to the commodity image to be recognized; when the number is greater than or equal to the preset number threshold, the commodity recognition result corresponding to the commodity image to be recognized is determined based on the first commodity identification corresponding to the target similar existing feature vector and the second commodity identification corresponding to each remaining similar existing feature vector;

[0024] The target similar existing feature vector is the similar existing feature vector having the largest cosine similarity with the target feature vector among all the similar existing feature vectors, and the remaining similar existing feature vectors are the similar existing feature vectors of all the similar existing feature vectors except the target similar existing feature vector.

[0025] As an optional embodiment, in the first aspect of the present invention, determining a product recognition result corresponding to the product image to be recognized based on the first product identification corresponding to the target similar existing feature vector and the second product identification corresponding to each remaining similar existing feature vector includes:

[0026] Determine whether there is a product identifier that is identical to the first product identifier among all the second product identifiers;

[0027] When it is determined that there is a product identifier identical to the first product identifier among all the second product identifiers, determining the product identifier corresponding to the target similar existing feature vector as the product recognition result corresponding to the product image to be recognized;

[0028] When it is determined that there is no product identifier identical to the first product identifier among all the second product identifiers, an auxiliary factor corresponding to the product image to be identified is determined, and based on the auxiliary factor, a target product identifier whose correlation with the auxiliary factor is greater than or equal to a preset correlation threshold is selected from the first product identifier and all the second product identifiers, and the target product identifier is determined as the product identification result corresponding to the product image to be identified.

[0029] As an optional embodiment, in the first aspect of the present invention, before inputting the product image to be identified into the product image subject segmentation model to obtain the target image of the product in the product image to be identified, the method further includes:

[0030] The image segmentation model is trained based on a predetermined training sample data set to obtain a product image main body segmentation model;

[0031] The training sample dataset includes a plurality of training product images, each of which is a product image with its image background segmented, and all of the training product images include first-category training product images, or all of the training product images include first-category training product images and second-category training product images; wherein the image background segmentation results of all first-category training product images in the first-category training product images are manually annotated, and all of the second-category training product images in the second-category training product images are generated based on the first-category training product images;

[0032] Furthermore, each second training product image in the second type of training product images is specifically generated by:

[0033] For any first training product image in the first category of training product images, crop the product main area image in the first training product image according to the annotation result of the first training product image; perform data augmentation operation on the product main area image to obtain a data-enhanced image, and randomly paste the data-enhanced image onto different promotional image templates, adjust the pixel value of the data-enhanced image at the pasting position of the promotional image template to the first pixel value, and adjust the pixel value at the remaining position of the promotional image template to the second pixel value, to obtain a second training product image.

[0034] As an optional embodiment, in the first aspect of the present invention, the image background segmentation result of each first training product image in the first category of training product images is annotated based on a segmentation result map corresponding to each first training product image;

[0035] For each first training product image of the first category of training product images, a segmentation result image corresponding to the first training product image is generated by:

[0036] Inputting the original image corresponding to the first training product image into a predetermined image segmentation network to obtain three original feature maps of different sizes corresponding to the original image;

[0037] Inputting the three original feature maps into three different convolutional layers in the segmentation branch of the image segmentation network respectively to obtain an output feature map of each convolutional layer;

[0038] Determining a target size of an output feature map obtained by passing the original feature map of the largest size among the three original feature maps through the corresponding convolution layer, and upsampling the output feature maps obtained by passing the two original feature maps of non-largest size through the corresponding convolution layer so that the size of the output feature maps obtained by passing the two original feature maps of non-largest size through the corresponding convolution layer is equal to the target size;

[0039] The three output feature maps of the same size are spliced ​​to obtain a spliced ​​feature map, which is then input into the feature fusion convolution layer to obtain the target feature map after feature fusion.

[0040] Normalizing the original pixel value corresponding to each pixel point in the target feature map to obtain the target pixel value corresponding to each pixel point in the target feature map;

[0041] For each pixel point in the target feature map, a target pixel value corresponding to the pixel point is compared with a reference pixel value to obtain a comparison result, and the target pixel value corresponding to the pixel point is mapped to a set pixel value according to the comparison result;

[0042] A segmentation result map corresponding to the training product image is generated according to the set pixel values ​​corresponding to all pixel points in the target feature map.

[0043] A second aspect of the present invention discloses a commodity identification device based on image segmentation, the device comprising:

[0044] an image segmentation module configured to, upon detecting the presence of a commodity image requiring commodity recognition, input the commodity image into a predetermined commodity image subject segmentation model to obtain a target image corresponding to the commodity in the commodity image, wherein the correlation between the target image and the background of the commodity image is less than a preset correlation threshold;

[0045] A feature vector extraction module is used to input the target image into a pre-built image feature extraction model to obtain a target feature vector corresponding to the target image;

[0046] a feature vector determination module, configured to determine a target existing feature vector that matches the target feature vector based on the target feature vector and each existing feature vector in the product image feature library;

[0047] The recognition result determination module is used to determine the commodity identification corresponding to the target existing feature vector according to the image feature-commodity identification correspondence corresponding to the commodity image feature library as the commodity recognition result corresponding to the commodity image to be identified.

[0048] As an optional embodiment, in the second aspect of the present invention, the device further includes:

[0049] a feature vector updating module configured to perform a dimensionality reduction operation on the target feature vector to update the target feature vector before the feature vector determining module determines a target existing feature vector that matches the target feature vector based on the target feature vector and each existing feature vector in the product image feature library;

[0050] an information determination module, configured to determine first dimensional information of the target feature vector and obtain second dimensional information corresponding to all existing feature vectors in the product image feature library before the feature vector updating module performs a dimensionality reduction operation on the target feature vector to update the target feature vector;

[0051] A judgment module is used to judge whether the first dimensional information matches the second dimensional information. When the judgment result is no, the feature vector updating module is triggered to perform the operation of performing a dimensionality reduction operation on the target feature vector to update the target feature vector; when the judgment result is yes, the feature vector determination module is triggered to perform the operation of determining a target existing feature vector that matches the target feature vector based on the target feature vector and each existing feature vector in the product image feature library.

[0052] As an optional embodiment, in the second aspect of the present invention, the feature vector determination module determines, based on the target feature vector and each existing feature vector in the product image feature library, a target existing feature vector that matches the target feature vector, specifically comprising:

[0053] Calculating the cosine similarity between the target feature vector and each existing feature vector in the product feature database;

[0054] It is determined whether there is at least one target cosine similarity greater than or equal to a preset cosine similarity threshold among all the cosine similarities. If yes, the similar existing feature vectors corresponding to all the target cosine similarities are determined as target existing feature vectors that match the target feature vector.

[0055] As an optional embodiment, in the second aspect of the present invention, the recognition result determination module determines the product identification corresponding to the target existing feature vector based on the image feature-product identification correspondence corresponding to the product image feature library, and uses the determination as the product recognition result corresponding to the product image to be identified, specifically including:

[0056] Calculating the number of all the similar existing feature vectors, and determining the product identification corresponding to each of the similar existing feature vectors based on the image feature-product identification correspondence relationship corresponding to the product image feature library;

[0057] Determine, based on the quantity and the commodity identifiers corresponding to all the similar existing feature vectors, the commodity identifier corresponding to the target existing feature vector as the commodity recognition result corresponding to the commodity image to be recognized;

[0058] Furthermore, the recognition result determination module determines the product identification corresponding to the target existing feature vector based on the quantity and the product identifications corresponding to all the similar existing feature vectors, and uses the product identification as the product recognition result corresponding to the product image to be identified, specifically including:

[0059] When the number is 1, determining the commodity identification corresponding to the similar existing feature vector as the commodity recognition result corresponding to the commodity image to be recognized;

[0060] When the number is greater than 1, the commodity identification corresponding to the target similar existing feature vector is determined as the commodity recognition result corresponding to the commodity image to be recognized; or

[0061] When the number is greater than 1 and less than a preset number threshold, the commodity identification corresponding to the target similar existing feature vector is determined as the commodity recognition result corresponding to the commodity image to be recognized; when the number is greater than or equal to the preset number threshold, the commodity recognition result corresponding to the commodity image to be recognized is determined based on the first commodity identification corresponding to the target similar existing feature vector and the second commodity identification corresponding to each remaining similar existing feature vector;

[0062] The target similar existing feature vector is the similar existing feature vector having the largest cosine similarity with the target feature vector among all the similar existing feature vectors, and the remaining similar existing feature vectors are the similar existing feature vectors of all the similar existing feature vectors except the target similar existing feature vector.

[0063] As an optional embodiment, in the second aspect of the present invention, the recognition result determination module determines the product recognition result corresponding to the product image to be identified based on the first product identifier corresponding to the target similar existing feature vector and the second product identifier corresponding to each remaining similar existing feature vector, specifically including:

[0064] Determine whether there is a product identifier that is identical to the first product identifier among all the second product identifiers;

[0065] When it is determined that there is a product identifier identical to the first product identifier among all the second product identifiers, determining the product identifier corresponding to the target similar existing feature vector as the product recognition result corresponding to the product image to be recognized;

[0066] When it is determined that there is no product identifier identical to the first product identifier among all the second product identifiers, an auxiliary factor corresponding to the product image to be identified is determined, and based on the auxiliary factor, a target product identifier whose correlation with the auxiliary factor is greater than or equal to a preset correlation threshold is selected from the first product identifier and all the second product identifiers, and the target product identifier is determined as the product identification result corresponding to the product image to be identified.

[0067] As an optional embodiment, in the second aspect of the present invention, the device further includes:

[0068] a model training module configured to train the image segmentation model based on a predetermined training sample data set to obtain a product image main segmentation model before the image segmentation module inputs the product image to be identified into the product image main segmentation model to obtain a target image of the product in the product image to be identified;

[0069] The training sample dataset includes a plurality of training product images, each of which is a product image with its image background segmented, and all of the training product images include first-category training product images, or all of the training product images include first-category training product images and second-category training product images; wherein the image background segmentation results of all first-category training product images in the first-category training product images are manually annotated, and all of the second-category training product images in the second-category training product images are generated based on the first-category training product images;

[0070] Furthermore, each second training product image in the second type of training product images is specifically generated by:

[0071] For any first training product image in the first category of training product images, crop the product main area image in the first training product image according to the annotation result of the first training product image; perform data augmentation operation on the product main area image to obtain a data-enhanced image, and randomly paste the data-enhanced image onto different promotional image templates, adjust the pixel value of the data-enhanced image at the pasting position of the promotional image template to the first pixel value, and adjust the pixel value at the remaining position of the promotional image template to the second pixel value, to obtain a second training product image.

[0072] As an optional embodiment, in the second aspect of the present invention, the image background segmentation result of each first training product image in the first category of training product images is annotated based on the segmentation result map corresponding to each first training product image;

[0073] For each first training product image of the first category of training product images, a segmentation result image corresponding to the first training product image is generated by:

[0074] Inputting the original image corresponding to the first training product image into a predetermined image segmentation network to obtain three original feature maps of different sizes corresponding to the original image;

[0075] Inputting the three original feature maps into three different convolutional layers in the segmentation branch of the image segmentation network respectively to obtain an output feature map of each convolutional layer;

[0076] Determining a target size of an output feature map obtained by passing the original feature map of the largest size among the three original feature maps through the corresponding convolution layer, and upsampling the output feature maps obtained by passing the two original feature maps of non-largest size through the corresponding convolution layer so that the size of the output feature maps obtained by passing the two original feature maps of non-largest size through the corresponding convolution layer is equal to the target size;

[0077] The three output feature maps of the same size are spliced ​​to obtain a spliced ​​feature map, which is then input into the feature fusion convolution layer to obtain the target feature map after feature fusion.

[0078] Normalizing the original pixel value corresponding to each pixel point in the target feature map to obtain the target pixel value corresponding to each pixel point in the target feature map;

[0079] For each pixel point in the target feature map, a target pixel value corresponding to the pixel point is compared with a reference pixel value to obtain a comparison result, and the target pixel value corresponding to the pixel point is mapped to a set pixel value according to the comparison result;

[0080] A segmentation result map corresponding to the training product image is generated according to the set pixel values ​​corresponding to all pixel points in the target feature map.

[0081] A third aspect of the present invention discloses another commodity identification device based on image segmentation, the device comprising:

[0082] a memory storing executable program code;

[0083] a processor coupled to the memory;

[0084] The processor calls the executable program code stored in the memory to execute the commodity recognition method based on image segmentation disclosed in the first aspect of the present invention.

[0085] A fourth aspect of the present invention discloses a computer storage medium storing computer instructions. When the computer instructions are called, they are used to execute the commodity identification method based on image segmentation disclosed in the first aspect of the present invention.

[0086] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0087] In an embodiment of the present invention, when it is detected that there is a product image to be identified and a product identification operation needs to be performed, the product image to be identified is input into a predetermined product image main body segmentation model to obtain a target image corresponding to the product to be identified in the product image to be identified, and the correlation between the target image and the background of the product image to be identified is lower than a preset correlation threshold; the target image is input into a pre-constructed image feature extraction model to obtain a target feature vector corresponding to the target image; based on the target feature vector and each existing feature vector in the product image feature library, a target existing feature vector that matches the target feature vector is determined, and based on the image feature-product identification correspondence corresponding to the product image feature library, the product identification corresponding to the target existing feature vector is determined as the product identification result corresponding to the product image to be identified. It can be seen that the present invention can perform image segmentation on the product image to be identified through the constructed detection and segmentation network of the product image main area to obtain the target image of the product, extract the feature vector of the target image, and screen out the target existing feature vector that matches the feature vector from the product image feature library, and use the product identification of the target existing feature vector as the product recognition result of the product image to be identified. This can not only ensure the recognition speed of the product image, but also effectively reduce the interference of the image background in the product image to be identified on the product recognition result, thereby helping to improve the accuracy and reliability of the determined product recognition result to improve the precision of product recognition, and is conducive to improving the determination efficiency of the product recognition result. BRIEF DESCRIPTION OF THE DRAWINGS

[0088] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0089] Figure 1 This is a flow chart of a commodity identification method based on image segmentation disclosed in an embodiment of the present invention;

[0090] Figure 2 This is a flow chart of another commodity identification method based on image segmentation disclosed in an embodiment of the present invention;

[0091] Figure 3 This is a schematic structural diagram of a commodity identification device based on image segmentation disclosed in an embodiment of the present invention;

[0092] Figure 4 2 is a schematic structural diagram of another commodity identification device based on image segmentation disclosed in an embodiment of the present invention;

[0093] Figure 5This is a structural diagram of another commodity identification device based on image segmentation disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0094] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0095] The terms "first," "second," and so on, in the description and claims of the present invention and the accompanying drawings are used to distinguish between different items, not to describe a specific order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product, or end comprising a series of steps or elements is not limited to the listed steps or elements but may optionally include steps or elements not listed therein, or may optionally include other steps or elements inherent to such process, method, product, or end.

[0096] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present invention. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute a separate or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0097] The present invention discloses a commodity recognition method and device based on image segmentation, which can perform image segmentation on the commodity image to be identified through a constructed commodity image main area detection and segmentation network to obtain a target image of the commodity, extract the feature vector of the target image, and screen out the target existing feature vector that matches the feature vector from the commodity image feature library, and use the commodity identification of the target existing feature vector as the commodity recognition result of the commodity image to be identified. This method can not only ensure the recognition speed of the commodity image, but also effectively reduce the interference of the image background in the commodity image to be identified on the commodity recognition result, thereby facilitating the improvement of the accuracy and reliability of the determined commodity recognition result to improve the precision of commodity recognition, and facilitating the improvement of the efficiency of the determination of the commodity recognition result. The following are detailed descriptions.

[0098] Example 1

[0099] See also Figure 1 , Figure 1This is a flow chart of a commodity identification method based on image segmentation disclosed in an embodiment of the present invention. Figure 1 The described method can be applied to a commodity identification device based on image segmentation, wherein the device may include a server, wherein the server includes a local server or a cloud server, which is not limited in the embodiment of the present invention. Figure 1 As shown, the commodity recognition method based on image segmentation includes the following operations:

[0100] 101. When it is detected that there is a product image to be identified and a product identification operation needs to be performed, the product image to be identified is input into a predetermined product image subject segmentation model to obtain a target image corresponding to the product to be identified in the product image to be identified.

[0101] In the embodiment of the present invention, optionally, the correlation between the target image and the background of the product image to be identified is lower than a preset correlation threshold.

[0102] 102. Input the target image into a pre-built image feature extraction model to obtain a target feature vector corresponding to the target image.

[0103] In an embodiment of the present invention, optionally, the image feature extraction model can be an open source ImageNet pre-trained model. For example, the ImageNet pre-trained model can be ResNet18vd, etc.; the image feature extraction model can also be a segmentation model after adjusting the product image main body segmentation model, which is not limited in the embodiment of the present invention.

[0104] Further optionally, the specific operation of adjusting the product image main body segmentation model to obtain the adjusted segmentation model is, for example, taking out the feature extraction part of the product image main body segmentation model, re-adding the fully connected layer at the end, adjusting the input image size of the product image main body segmentation model to be the same as the predetermined fixed size of the product image (for example: 224×224 pixel values), and fine-tuning it on the product image classification task to obtain the adjusted segmentation model as the image feature extraction model.

[0105] 103. Determine a target existing feature vector that matches the target feature vector based on the target feature vector and each existing feature vector in the product image feature library.

[0106] In the embodiment of the present invention, the product image feature library may optionally include one or more existing feature vectors, which is not limited in the embodiment of the present invention. Optionally, all existing feature vectors in the product image feature library may include the target existing feature vector, which is not limited in the embodiment of the present invention.

[0107] 104. Determine the product identification corresponding to the target existing feature vector based on the image feature-product identification correspondence in the product image feature library as the product identification result corresponding to the product image to be identified.

[0108] In the embodiment of the present invention, the image feature-product identification correspondence relationship may optionally be included in the product image feature library or may be outside the product image feature library, and the embodiment of the present invention does not limit this. Optionally, the image feature-product identification correspondence relationship may, for example, be a pre-set binding relationship between the image feature and the corresponding product identification, and the embodiment of the present invention does not limit this.

[0109] It can be seen that the product recognition method based on image segmentation described in the embodiment of the present invention can obtain the target image of the product by performing image segmentation on the product image to be identified through the detection and segmentation network of the main area of ​​the product image constructed, extract the feature vector of the target image, and screen out the target existing feature vector that matches the feature vector from the product image feature library, and use the product identification of the target existing feature vector as the product recognition result of the product image to be identified. This can not only ensure the recognition speed of the product image, but also effectively reduce the interference of the image background in the product image to be identified on the product recognition result, thereby helping to improve the accuracy and reliability of the determined product recognition result to improve the precision of product recognition, and is conducive to improving the determination efficiency of the product recognition result.

[0110] In an optional embodiment, before determining a target existing feature vector that matches the target feature vector based on the target feature vector and each existing feature vector in the product image feature library, the method may further include the following operations:

[0111] A dimensionality reduction operation is performed on the target feature vector to update the target feature vector.

[0112] In the above optional embodiment, further optionally, performing a dimensionality reduction operation on the target feature vector to update the target feature vector may include:

[0113] A dimensionality reduction operation is performed on the target feature vector according to a predetermined vector dimensionality reduction model to update the target feature vector.

[0114] Optionally, the vector dimensionality reduction model may be a covariance matrix or other vector dimensionality reduction device capable of achieving vector dimensionality reduction, which is not limited in the present embodiment. Further, optionally, the covariance matrix is ​​obtained by uniformly reducing the dimensionality of all product image features in the product image feature library using a PCA dimensionality reduction method, which is not limited in the present embodiment.

[0115] In the above optional embodiment, further optionally, before performing the dimensionality reduction operation on the target feature vector to update the target feature vector, the method may further include the following operations:

[0116] Determine the first dimension information of the target feature vector and obtain the second dimension information corresponding to all existing feature vectors in the product image feature library;

[0117] Determine whether the first dimension information matches the second dimension information. When it is determined that the first dimension information does not match the second dimension information, trigger the execution of the above-mentioned operation of performing a dimensionality reduction operation on the target feature vector to update the target feature vector; when it is determined that the first dimension information matches the second dimension information, trigger the execution of the above-mentioned operation of determining a target existing feature vector that matches the target feature vector based on the target feature vector and each existing feature vector in the product image feature library.

[0118] In the above optional embodiment, further optionally, performing a dimensionality reduction operation on the target feature vector according to a predetermined vector dimensionality reduction model to update the target feature vector may include:

[0119] A dimensionality reduction operation is performed on the target feature vector according to the first dimensional information, the second dimensional information and a predetermined vector dimensionality reduction model to update the target feature vector.

[0120] It can be seen that this optional embodiment can reduce the dimension of the feature vector to realize the updating function of the feature vector, can cope with the situation where the dimension between the target feature vector and the existing feature vector is different, which is conducive to improving the efficiency of determining the subsequent target existing feature vector and improving the effectiveness of the determined target existing feature vector, thereby helping to improve the efficiency and accuracy of determining the product recognition result, and can also expand the intelligent function of the product recognition device based on image segmentation, improve the user experience, and enhance the user stickiness of the device; and, it can also perform the feature vector dimension reduction operation through a predetermined vector dimension reduction model, which is conducive to improving the efficiency and convenience of dimension reduction of the feature vector, and when the vector dimension reduction model is a covariance matrix, it is conducive to improving the effectiveness and accuracy of the feature vector after dimension reduction; Furthermore, it is also possible to determine whether the dimension of the target feature vector matches the dimension of the existing feature vector. If not, the subsequent operation of updating the target feature vector is performed, which is conducive to improving the integrity and comprehensiveness of the method of updating the target feature vector, and thus is conducive to improving the rationality and effectiveness of the operation of updating the target feature vector, as well as improving the effectiveness of the updated target feature vector, so as to reduce the execution of unnecessary operations and reduce unnecessary waste of resources; and it is also possible to update the target feature vector in combination with the first dimension information and the second dimension information, which is conducive to improving the rationality of the operation of updating the target feature vector, and thus is conducive to improving the effectiveness and accuracy of the updated target feature vector, thereby to a certain extent being able to improve the accuracy and determination efficiency of the subsequently determined product identification results.

[0121] In yet another optional embodiment, the above-mentioned determining a target existing feature vector that matches the target feature vector based on the target feature vector and each existing feature vector in the product image feature library may include:

[0122] Calculate the cosine similarity between the target feature vector and each existing feature vector in the product feature database;

[0123] It is determined whether there is at least one target cosine similarity greater than or equal to a preset cosine similarity threshold among all the cosine similarities. If the determination result is yes, the similar existing feature vectors corresponding to all the target cosine similarities are determined as target existing feature vectors that match the target feature vector.

[0124] In this optional embodiment, further optionally, the target existing feature vector that matches the target feature vector can be determined by calculating the difference between the target feature vector and each existing feature vector. When the difference is less than or equal to a pre-set difference threshold, the operation of determining similar existing feature vectors corresponding to all target cosine similarities as target existing feature vectors that match the target feature vector is performed; when the difference is greater than the pre-set difference threshold, the operation of updating the image feature-product identification correspondence set corresponding to the product image feature library is performed. This embodiment of the present invention does not limit this.

[0125] In the above optional embodiment, further optionally, the method may further include the following operations:

[0126] When it is determined that there is no target cosine similarity greater than or equal to the similarity threshold among all cosine similarities, the identification information of the product to be identified in the product image to be identified is obtained, and an information binding operation is performed on the target feature vector and the identification information of the product to be identified in the product image to be identified to obtain the image feature-product identification correspondence corresponding to the product to be identified in the product image to be identified, so as to update the image feature-product identification correspondence set corresponding to the product image feature library; the image feature-product identification correspondence set includes one or more image feature-product identification correspondence sets.

[0127] Optionally, to obtain the identification information of the commodity to be identified in the commodity image to be identified, the identification information of the commodity to be identified in the commodity image to be identified may be manually determined and entered into the backend system, which is not limited in the embodiment of the present invention.

[0128] Optionally, an information binding operation is performed on the target feature vector and the identification information of the product to be identified in the product image to be identified. The binding operation of the identification information and the target feature vector can be completed through manual operation, or the server can bind the obtained identification information and the target feature vector after receiving the corresponding trigger instruction. The embodiment of the present invention does not limit this.

[0129] It can be seen that this optional embodiment can determine the target existing feature vector that matches the target feature vector by calculating the cosine similarity between the target feature vector and the existing feature vector, which is conducive to improving the rationality and feasibility of the method for determining the target existing feature vector, and thus is conducive to improving the accuracy and reliability of the determined target existing feature vector, thereby helping to improve the accuracy of the subsequently determined product identification results; and, it can also provide a corresponding function of updating the image feature-product identification correspondence corresponding to the product image feature library for the case where there is no target cosine similarity greater than or equal to the similarity threshold among all cosine similarities, which is conducive to improving the feasibility and completeness of the method for determining the target existing feature vector, and thus is conducive to improving the comprehensiveness and feasibility of the product identification method based on image segmentation, and to a certain extent can improve the efficiency of determining the target existing feature vector. In addition, it can also expand the intelligent function of the product identification device based on image segmentation, improve the user experience, and enhance the user stickiness of the device.

[0130] In yet another optional embodiment, the product identification corresponding to the target existing feature vector is determined based on the image feature-product identification correspondence corresponding to the product image feature library as the product identification result corresponding to the product image to be identified, which may include:

[0131] Calculate the number of all similar existing feature vectors, and determine the product identification corresponding to each similar existing feature vector based on the image feature-product identification correspondence relationship corresponding to the product image feature library;

[0132] According to the quantity and commodity identifications corresponding to all similar existing feature vectors, the commodity identification corresponding to the target existing feature vector is determined as the commodity recognition result corresponding to the commodity image to be recognized.

[0133] In this optional embodiment, the product identifier may include a product name identifier and / or a product category identifier, which is not limited in this embodiment of the present invention. Further, each product identifier may correspond to one or more similar existing feature vectors, which is not limited in this embodiment of the present invention.

[0134] It can be seen that this optional embodiment can determine the product identification result of the product image to be identified based on the number of all similar existing feature vectors, the image feature-product identification correspondence and the product identification of the similar existing feature vectors, and combines more influencing factors to determine the product identification result, which is conducive to improving the rationality and comprehensiveness of the method for determining the product identification result, and thus is conducive to improving the accuracy of the determined product identification result.

[0135] In yet another optional embodiment, determining the product identification corresponding to the target existing feature vector based on the quantity and product identifications corresponding to all similar existing feature vectors as the product identification result corresponding to the product image to be identified may include:

[0136] When the number is 1, the product identification corresponding to the similar existing feature vector is determined as the product recognition result corresponding to the product image to be recognized;

[0137] When the number is greater than 1, the product identification corresponding to the target similar existing feature vector is determined as the product recognition result corresponding to the product image to be recognized; or

[0138] When the number is greater than 1 and less than a preset number threshold, the product identification corresponding to the target similar existing feature vector is determined as the product recognition result corresponding to the product image to be recognized; when the number is greater than or equal to the preset number threshold, the product recognition result corresponding to the product image to be recognized is determined based on the first product identification corresponding to the target similar existing feature vector and the second product identification corresponding to each remaining similar existing feature vector;

[0139] The target similar existing feature vector is the similar existing feature vector with the largest cosine similarity to the target feature vector among all similar existing feature vectors, and the remaining similar existing feature vector is the similar existing feature vector of all similar existing feature vectors except the target similar existing feature vector.

[0140] It can be seen that this optional embodiment can provide corresponding methods for determining product identification results for various situations such as the number is 1, the number is greater than 1, the number is greater than 1 and less than the corresponding threshold, and the number is greater than the corresponding threshold. This is conducive to enriching the diversity of methods for determining product identification results, and is conducive to improving the flexibility and pertinence of methods for determining product identification results, and thus is conducive to improving the accuracy of the determined product identification results, and to a certain extent, can improve the efficiency of determining product identification results.

[0141] In yet another optional embodiment, determining the product recognition result corresponding to the product image to be recognized based on the first product identification corresponding to the target similar existing feature vector and the second product identification corresponding to each remaining similar existing feature vector may include:

[0142] Determine whether there is a product identifier that is identical to the first product identifier among all second product identifiers;

[0143] When it is determined that there is a product identification that is the same as the first product identification among all the second product identifications, determining the product identification corresponding to the target similar existing feature vector as the product recognition result corresponding to the product image to be recognized;

[0144] When it is determined that there is no product identification identical to the first product identification among all the second product identifications, the auxiliary factor corresponding to the product image to be identified is determined, and based on the auxiliary factor, a target product identification whose correlation with the auxiliary factor is greater than or equal to a preset correlation threshold is selected from the first product identification and all the second product identifications, and the target product identification is determined as the product identification result corresponding to the product image to be identified.

[0145] In this optional embodiment, there may be one or more target product identifiers whose correlation with the auxiliary factor is greater than or equal to a preset correlation threshold, which is not limited in this embodiment of the present invention.

[0146] Optionally, the auxiliary factor may include at least one sub-auxiliary factor, and further, may include a first sub-auxiliary factor and / or a second sub-auxiliary factor. The first sub-auxiliary factor may be a background pattern factor and / or a background color factor in the product image to be identified, and the second sub-auxiliary factor may be a background text factor in the product image to be identified. This embodiment of the present invention does not limit this.

[0147] It can be seen that this optional embodiment can provide a corresponding method for determining the product identification results with more detailed and specific operating steps for the case where the quantity is greater than or equal to the preset quantity threshold, which is conducive to improving the feasibility and rationality of the method for determining the product identification results, and thus is conducive to improving the accuracy and reliability of the determined product identification results, and to a certain extent, can improve the efficiency of determining the product identification results.

[0148] In the above optional embodiment, further optionally, selecting, based on the auxiliary factor, a target product identification from the first product identification and all second product identifications, the target product identification having a correlation with the auxiliary factor greater than or equal to a preset correlation threshold, and determining the target product identification as the product recognition result corresponding to the product image to be recognized may include:

[0149] Determining a first auxiliary feature vector that matches the first auxiliary sub-factor in the product image to be identified, and analyzing the first auxiliary feature vector and each similar existing feature vector to obtain a first auxiliary correlation degree between the first auxiliary feature vector and each similar existing feature vector;

[0150] Determining a second auxiliary feature vector that matches the second auxiliary sub-factor in the product image to be identified, and analyzing the second auxiliary feature vector and each similar existing feature vector to obtain a second auxiliary correlation degree between the second auxiliary feature vector and each similar existing feature vector;

[0151] For each similar existing feature vector, the auxiliary correlation degree corresponding to the similar existing feature vector is calculated according to the corresponding first auxiliary correlation degree, the corresponding second auxiliary correlation degree and the corresponding weight of the set auxiliary factor;

[0152] The maximum auxiliary correlation degree is determined from the auxiliary correlation degrees corresponding to all similar existing feature vectors, and the product identification corresponding to the similar existing feature vector corresponding to the maximum auxiliary correlation degree is used as the target product identification whose correlation degree with the auxiliary factor is greater than or equal to a preset correlation threshold.

[0153] It can be seen that this optional embodiment can combine auxiliary factors and calculate corresponding auxiliary correlation degrees to determine the product recognition results of the product image to be identified, and can combine more influencing factors to analyze and determine the product recognition results, which is conducive to improving the accuracy and reliability of the determined product recognition results, and is conducive to improving the rationality and feasibility of the product recognition method based on image segmentation, and thus is conducive to improving the accuracy of product recognition.

[0154] Example 2

[0155] See also Figure 2 , Figure 2 This is a flow chart of another commodity identification method based on image segmentation disclosed in an embodiment of the present invention. Figure 2 The described method can be applied to a commodity identification device based on image segmentation, wherein the device may include a server, wherein the server includes a local server or a cloud server, which is not limited in the embodiment of the present invention. Figure 2 As shown, the commodity recognition method based on image segmentation includes the following operations:

[0156] 201. Train the image segmentation model based on a predetermined training sample data set to obtain a product image main body segmentation model.

[0157] In an embodiment of the present invention, optionally, the training sample dataset includes several training product images, each training product image is a product image with the image background segmented, and all the training product images include first-category training product images, or all the training product images include first-category training product images and second-category training product images; wherein, the image background segmentation results of all first training product images in the first category of training product images are manually labeled, and all second training product images in the second category of training product images are generated based on the first training product images in the first category of training product images.

[0158] Further, optionally, all the second training product images in the second category of training product images are generated by the server based on the first training product images in the first category of training product images, which is not limited in this embodiment of the present invention.

[0159] 202. When it is detected that there is a product image to be identified and a product identification operation needs to be performed, the product image to be identified is input into a predetermined product image subject segmentation model to obtain a target image corresponding to the product to be identified in the product image to be identified.

[0160] 203. Input the target image into a pre-built image feature extraction model to obtain a target feature vector corresponding to the target image.

[0161] 204. Determine a target existing feature vector that matches the target feature vector based on the target feature vector and each existing feature vector in the product image feature library.

[0162] 205. Determine the product identification corresponding to the target existing feature vector based on the image feature-product identification correspondence in the product image feature library as the product identification result corresponding to the product image to be identified.

[0163] In the embodiment of the present invention, for other descriptions of steps 202 to 205, please refer to the other detailed descriptions of steps 101 to 104 in the first embodiment, which will not be repeated in the embodiment of the present invention.

[0164] It can be seen that the implementation of the product recognition method based on image segmentation described in the embodiment of the present invention can obtain a target product image by performing image segmentation on the product image to be identified through the constructed product image main area detection and segmentation network, extract the feature vector of the target image, and screen the target existing feature vector that matches the feature vector from the product image feature library, and use the product identification of the target existing feature vector as the product recognition result of the product image to be identified. This not only ensures the recognition speed of the product image, but also effectively reduces the interference of the image background in the product image to be identified on the product recognition result, thereby facilitating the improvement of the accuracy and reliability of the determined product recognition result, thereby improving the precision of product recognition, and facilitating the improvement of the efficiency of determining the product recognition result. In addition, before inputting the product image to be identified into the product image main body segmentation model, a segmentation model training operation can be performed to obtain a product image main body segmentation model, thereby improving the integrity and comprehensiveness of the product recognition method based on image segmentation, thereby improving the rationality of the product recognition method based on image segmentation, thereby facilitating the improvement of the accuracy and reliability of the determined product recognition result, thereby improving the effectiveness of the determined product recognition result.

[0165] In the above embodiment, further optionally, the training of the image segmentation model based on the predetermined training sample data set to obtain the product image main body segmentation model may include:

[0166] Based on the determined optimization loss function corresponding to the segmentation branch, the target object loss parameter, the coordinate regression loss parameter, and the predetermined training sample data set, a weighted parallel optimization operation is performed on the image segmentation model to obtain the corresponding segmentation loss result; and the accuracy of the validation set corresponding to the training sample data set is determined;

[0167] When the segmentation loss result is used to indicate that the first change amplitude of the loss value is less than or equal to the preset first change amplitude threshold, and the accuracy is used to indicate that the second change amplitude corresponding to the accuracy is less than or equal to the preset second change amplitude threshold, the image segmentation model corresponding to the accuracy greater than or equal to the preset accuracy threshold in the verification set is determined as the main segmentation model of the product image.

[0168] In this optional embodiment, the optimization loss function may be a Focal loss function, which is not limited in the embodiment of the present invention. Optionally, the target object loss parameter may be a binary cross entropy parameter, and the coordinate regression loss parameter may be a CIOU parameter, which is not limited in the embodiment of the present invention.

[0169] It can be seen that this optional embodiment can provide a way to train an image segmentation model, and train the image segmentation model based on a matching training sample data set, which is conducive to improving the effectiveness and feasibility of the trained image segmentation model, and thus is conducive to improving the accuracy and reliability of the image segmentation results subsequently obtained through the image segmentation model, and to a certain extent can improve the efficiency of determining the image segmentation results.

[0170] In an optional embodiment, each second training product image in the second category of training product images is generated in the following manner:

[0171] For any first training product image in the first category of training product images, crop the product main area image in the first training product image according to the annotation result of the first training product image; perform data augmentation on the product main area image to obtain a data-enhanced image, and randomly paste the data-enhanced image onto different promotional image templates, adjust the pixel value of the data-enhanced image at the pasting position of the promotional image template to the first pixel value, and adjust the pixel value at the remaining position of the promotional image template to the second pixel value, to obtain a second training product image.

[0172] In this optional embodiment, the data enhancement operation may optionally include but is not limited to one or more of a size scaling operation, a brightness adjustment operation, a contrast adjustment operation, a horizontal flip operation, a random angle rotation operation, etc., and is not limited in this embodiment of the present invention.

[0173] It can be seen that this optional embodiment can determine the second training product image in the second category of training product images by performing image processing operations such as data enhancement and image pasting on the product main area image, which is conducive to improving the feasibility and rationality of the second training product image generation method, and thus is conducive to improving the generation efficiency of the second training product image, and to a certain extent can improve the effectiveness and reliability of the second training product image, thereby helping to improve the efficiency and accuracy of product recognition based on image segmentation.

[0174] In another optional embodiment, optionally, the image background segmentation result of each first training product image in the first category of training product images is annotated based on a segmentation result map corresponding to each first training product image.

[0175] Further optionally, for each first training product image of the first category of training product images, the segmentation result image corresponding to the first training product image is generated by:

[0176] Inputting the original image corresponding to the first training product image into a predetermined image segmentation network to obtain three original feature maps of different sizes corresponding to the original image;

[0177] The three original feature maps are respectively input into three different convolutional layers in the segmentation branch of the image segmentation network to obtain the output feature map of each convolutional layer;

[0178] Determine the target size of the output feature map obtained by passing the corresponding convolution layer through the original feature map of the largest size among the three original feature maps, and upsample the output feature maps obtained by passing the corresponding convolution layer through the two original feature maps of non-largest size so that the size of the output feature maps obtained by passing the corresponding convolution layer through the two original feature maps of non-largest size is equal to the target size;

[0179] The three output feature maps of the same size are spliced ​​to obtain a spliced ​​feature map, which is then input into the feature fusion convolution layer to obtain the target feature map after feature fusion.

[0180] Normalize the original pixel value corresponding to each pixel in the target feature map to obtain the target pixel value corresponding to each pixel in the target feature map;

[0181] For each pixel in the target feature map, the target pixel value corresponding to the pixel is compared with the reference pixel value to obtain a comparison result, and the target pixel value corresponding to the pixel is mapped to the set pixel value according to the comparison result;

[0182] According to the set pixel values ​​corresponding to all pixels in the target feature map, a segmentation result map corresponding to the training product image is generated.

[0183] In this optional embodiment, optionally, the number of input channels of the three different convolutional layers in the segmentation branch is equal to the number of channels of the corresponding original feature map, and the number of output channels of the three different convolutional layers in the segmentation branch is also equal to the number of channels of the corresponding original feature map, which is not limited in this embodiment of the present invention. Further, for example, the number of channels of the original feature map, the number of input channels of the convolutional layer, and the number of output channels of the convolutional layer can be set to 256, that is, the three different convolutional layers in the segmentation branch can be represented as 1×1×256 convolutions, which is not limited in this embodiment of the present invention.

[0184] Optionally, the output feature maps obtained after the two original feature maps of non-maximum size pass through the corresponding convolution layer are upsampled. For example, the output feature map obtained after the original feature map of minimum size passes through the corresponding convolution layer is upsampled 4 times by the corresponding upsampling layer to expand the size of the original feature map of minimum size, and the output feature map obtained after the original feature map of non-maximum size and non-minimum size passes through the corresponding convolution layer is upsampled 2 times by the corresponding upsampling layer to expand the size of the original feature map of non-maximum size and non-minimum size. This embodiment of the present invention does not limit this.

[0185] Optionally, the image segmentation network can be the open-source ultra-lightweight YOLOv5 network, which is not limited in this embodiment of the present invention. Furthermore, optionally, the original image corresponding to the first training product image can be input into the FPN module of the open-source ultra-lightweight YOLOv5 network to obtain three original feature maps of different sizes corresponding to the original image, which is not limited in this embodiment of the present invention.

[0186] Further optionally, the three original feature maps can be input into the detection branch in the image segmentation network to obtain the coordinate values ​​of the main target of the product corresponding to the three original feature maps, and the subsequent segmentation branch related operations can be triggered based on the coordinate values. This is not limited in the embodiment of the present invention.

[0187] Optionally, the above-mentioned operation of splicing three output feature maps of the same size to obtain a spliced ​​feature map can be performed in the channel, which is not limited in the embodiment of the present invention.

[0188] Optionally, for example, the feature fusion convolution layer can be a 3×3×256 convolution, and the number of channels corresponding to the target feature map after feature fusion is still 256, which is not limited in this embodiment of the present invention.

[0189] Optionally, the above-mentioned operation of normalizing the original pixel value corresponding to each pixel point in the target feature map to obtain the target pixel value corresponding to each pixel point in the target feature map can be implemented by passing the target feature map through a sigmoid activation layer, which is not limited in the embodiment of the present invention.

[0190] Optionally, the value range corresponding to the pixel value can be set to between 0 and 1, which is not limited in the embodiment of the present invention. Further optionally, the target pixel value corresponding to the pixel point is mapped to the set pixel value based on the comparison result. For example, when the target pixel value is less than 0.5, the corresponding set pixel value is 0, and when the target pixel value is greater than 0.5, the corresponding set pixel value is 1, which is not limited in the embodiment of the present invention.

[0191] Further optionally, after inputting the spliced ​​feature map into the feature fusion convolution layer to obtain the target feature map after feature fusion, and before normalizing the original pixel value corresponding to each pixel point in the target feature map to obtain the target pixel value corresponding to each pixel point in the target feature map, the method may further include the following operations:

[0192] The target feature map after feature fusion is passed through a 1×1×256 convolution layer to obtain a target feature map with the number of channels reduced to 1; and the target feature map with the number of channels reduced to 1 is passed through an 8-fold upsampling layer to obtain a target feature map with the same size as the original image, triggering the above-mentioned normalization of the original pixel value corresponding to each pixel point in the target feature map to obtain the target pixel value corresponding to each pixel point in the target feature map.

[0193] It can be seen that this optional embodiment can provide a method for generating a segmentation result map corresponding to the first training product image, which is conducive to improving the feasibility and rationality of the segmentation result map generation method, and thus is conducive to improving the generation efficiency of the segmentation result map, and to a certain extent can improve the effectiveness and reliability of the segmentation result map corresponding to the first training product image, thereby helping to improve the efficiency and accuracy of product recognition based on image segmentation.

[0194] In yet another optional embodiment, the product image feature library is constructed in the following manner:

[0195] Acquire a product promotion image set, where the product promotion image set includes at least one product promotion image;

[0196] For each product promotion image in the product promotion image set, the product promotion image is input into the product image subject segmentation model to obtain a subject target detection frame corresponding to the product in the product promotion image, and a rectangular area corresponding to the subject product in the product promotion image is cropped according to the subject target detection frame to obtain a rectangular cropped image corresponding to the product in the product promotion image; a condition is set according to the binary segmentation result, and the pixel value corresponding to the background area in the rectangular cropped image is adjusted to a first pixel value, while the pixel value corresponding to the product area in the rectangular cropped image remains unchanged to obtain a target product image corresponding to the product promotion image, and the corresponding size of the target product image is scaled to a predetermined size setting value to obtain a scaled target product image; the correlation degree of the background corresponding to the target product image is lower than a preset correlation degree threshold; the scaled target product image is input into the image feature extraction model to obtain a target image feature corresponding to the product in the target product image as a retrieval feature of the product; the retrieval feature of the product is bound to the identification information of the product to obtain a corresponding relationship between the image feature and the product identification of the product;

[0197] A product image feature library is constructed based on the target image features corresponding to all product promotion images included in the product promotion image set and the image feature-product identification correspondence relationship corresponding to all product promotion images included in the product promotion image set; all existing feature vectors in the product image feature library include the target image features corresponding to the product promotion images included in the product promotion image set.

[0198] Optionally, the size setting value may be 224×224 pixels, or other pixel values, which is not limited in the embodiment of the present invention.

[0199] It can be seen that this optional embodiment can provide a method for constructing a product image feature library, which is conducive to improving the feasibility and rationality of the method for constructing the product image feature library, and further conducive to improving the effectiveness of the constructed product image feature library, thereby helping to improve the efficiency of subsequent determination of the target product identification from the product image feature library and improving the accuracy of the determined target product identification.

[0200] Example 3

[0201] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of a commodity identification device based on image segmentation disclosed in an embodiment of the present invention. Figure 3 The described device may include a server, wherein the server includes a local server or a cloud server, which is not limited in the embodiment of the present invention. Figure 3 As shown, the commodity recognition device based on image segmentation may include:

[0202] The image segmentation module 301 is used to input the product image to be identified into a predetermined product image subject segmentation model when it is detected that there is a product image to be identified and a product identification operation needs to be performed, to obtain a target image corresponding to the product to be identified in the product image to be identified, and the correlation between the target image and the background of the product image to be identified is lower than a preset correlation threshold.

[0203] The feature vector extraction module 302 is used to input the target image into a pre-built image feature extraction model to obtain a target feature vector corresponding to the target image.

[0204] The feature vector determination module 303 is configured to determine a target existing feature vector that matches the target feature vector based on the target feature vector and each existing feature vector in the product image feature library.

[0205] The recognition result determination module 304 is used to determine the commodity identification corresponding to the target existing feature vector according to the image feature-commodity identification correspondence corresponding to the commodity image feature library as the commodity recognition result corresponding to the commodity image to be recognized.

[0206] It can be seen that implementation Figure 3 The described product recognition device based on image segmentation can obtain the target image of the product by performing image segmentation on the product image to be identified through the constructed detection and segmentation network of the main area of ​​the product image, extract the feature vector of the target image, and screen out the target existing feature vector that matches the feature vector from the product image feature library, and use the product identification of the target existing feature vector as the product recognition result of the product image to be identified. It can not only ensure the recognition speed of the product image, but also effectively reduce the interference of the image background in the product image to be identified on the product recognition result, thereby helping to improve the accuracy and reliability of the determined product recognition result to improve the precision of product recognition, and is conducive to improving the determination efficiency of the product recognition result.

[0207] In an optional embodiment, if Figure 4 As shown, the device may also include:

[0208] The feature vector updating module 305 is used to perform a dimensionality reduction operation on the target feature vector to update the target feature vector before the feature vector determining module 303 determines a target existing feature vector that matches the target feature vector based on the target feature vector and each existing feature vector in the product image feature library.

[0209] It can be seen that implementation Figure 4The described device has the function of reducing the dimension of the feature vector to realize the update of the feature vector. It can cope with the situation where the dimension of the target feature vector is different from the existing feature vector, which is beneficial to improving the efficiency of determining the subsequent target existing feature vector and improving the effectiveness of the determined target existing feature vector, thereby helping to improve the efficiency and accuracy of determining the product identification results, and can also expand the intelligent function of the device, improve the user experience, and enhance the user stickiness of the device.

[0210] In another optional embodiment, as Figure 4 As shown, the device may also include:

[0211] The information determination module 306 is used to determine the first dimension information of the target feature vector and obtain the second dimension information corresponding to all existing feature vectors in the product image feature library before the feature vector updating module 305 performs a dimensionality reduction operation on the target feature vector to update the target feature vector.

[0212] The judgment module 307 is used to judge whether the first dimension information matches the second dimension information. When the judgment result is no, the feature vector updating module 305 is triggered to perform the above-mentioned operation of performing a dimensionality reduction operation on the target feature vector to update the target feature vector; when the judgment result is yes, the feature vector determination module 303 is triggered to perform the above-mentioned operation of determining the target existing feature vector that matches the target feature vector based on the target feature vector and each existing feature vector in the product image feature library.

[0213] It can be seen that implementation Figure 4 The described device can also determine whether the dimension of the target feature vector matches the dimension of the existing feature vector. If not, it will perform subsequent operations to update the target feature vector, which is conducive to improving the integrity and comprehensiveness of the method of updating the target feature vector, and thus is conducive to improving the rationality and effectiveness of the operation of updating the target feature vector, as well as improving the effectiveness of the updated target feature vector, so as to reduce the execution of unnecessary operations and reduce unnecessary waste of resources.

[0214] In another optional embodiment, the feature vector determining module 303 determines a target existing feature vector that matches the target feature vector based on the target feature vector and each existing feature vector in the product image feature library in the following manner:

[0215] Calculate the cosine similarity between the target feature vector and each existing feature vector in the product feature database;

[0216] It is determined whether there is at least one target cosine similarity greater than or equal to a preset cosine similarity threshold among all the cosine similarities. If the determination result is yes, the similar existing feature vectors corresponding to all the target cosine similarities are determined as target existing feature vectors that match the target feature vector.

[0217] It can be seen that implementation Figure 4 The described device can also determine the target existing feature vector that matches the target feature vector by calculating the cosine similarity between the target feature vector and the existing feature vector, which is conducive to improving the rationality and feasibility of the method of determining the target existing feature vector, and further conducive to improving the accuracy and reliability of the determined target existing feature vector, thereby helping to improve the accuracy of the subsequently determined product identification results.

[0218] In another optional embodiment, the recognition result determination module 304 determines the product identification corresponding to the target existing feature vector based on the image feature-product identification correspondence corresponding to the product image feature library, and uses the method of determining the product identification corresponding to the product image to be identified as the product recognition result specifically includes:

[0219] Calculate the number of all similar existing feature vectors, and determine the product identification corresponding to each similar existing feature vector based on the image feature-product identification correspondence relationship corresponding to the product image feature library;

[0220] According to the quantity and commodity identifications corresponding to all similar existing feature vectors, the commodity identification corresponding to the target existing feature vector is determined as the commodity recognition result corresponding to the commodity image to be recognized.

[0221] It can be seen that implementation Figure 4 The described device can also determine the product identification result of the product image to be identified based on the number of all similar existing feature vectors, the image feature-product identification correspondence and the product identification of the similar existing feature vectors. It combines more influencing factors to determine the product identification result, which is conducive to improving the rationality and comprehensiveness of the method for determining the product identification result, and thus helps to improve the accuracy of the determined product identification result.

[0222] In another optional embodiment, the recognition result determination module 304 determines the product identification corresponding to the target existing feature vector based on the quantity and product identifications corresponding to all similar existing feature vectors, and uses the product identification as the product recognition result corresponding to the product image to be identified, specifically including:

[0223] When the number is 1, the product identification corresponding to the similar existing feature vector is determined as the product recognition result corresponding to the product image to be recognized;

[0224] When the number is greater than 1, the product identification corresponding to the target similar existing feature vector is determined as the product recognition result corresponding to the product image to be recognized; or

[0225] When the number is greater than 1 and less than a preset number threshold, the product identification corresponding to the target similar existing feature vector is determined as the product recognition result corresponding to the product image to be recognized; when the number is greater than or equal to the preset number threshold, the product recognition result corresponding to the product image to be recognized is determined based on the first product identification corresponding to the target similar existing feature vector and the second product identification corresponding to each remaining similar existing feature vector;

[0226] The target similar existing feature vector is the similar existing feature vector with the largest cosine similarity to the target feature vector among all similar existing feature vectors, and the remaining similar existing feature vector is the similar existing feature vector of all similar existing feature vectors except the target similar existing feature vector.

[0227] It can be seen that implementation Figure 4 The described device can also provide corresponding product identification result determination functions for various situations such as the number is 1, the number is greater than 1, the number is greater than 1 and less than the corresponding threshold, and the number is greater than the corresponding threshold, which is conducive to enriching the diversity of product identification result determination methods, and is conducive to improving the flexibility and pertinence of product identification result determination methods, thereby helping to improve the accuracy of the determined product identification results, and to a certain extent, can improve the efficiency of determining product identification results.

[0228] In another optional embodiment, the recognition result determination module 304 determines the product recognition result corresponding to the product image to be recognized based on the first product identifier corresponding to the target similar existing feature vector and the second product identifier corresponding to each remaining similar existing feature vector, specifically by:

[0229] Determine whether there is a product identifier that is identical to the first product identifier among all second product identifiers;

[0230] When it is determined that there is a product identification that is the same as the first product identification among all the second product identifications, determining the product identification corresponding to the target similar existing feature vector as the product recognition result corresponding to the product image to be recognized;

[0231] When it is determined that there is no product identification identical to the first product identification among all the second product identifications, the auxiliary factor corresponding to the product image to be identified is determined, and based on the auxiliary factor, a target product identification whose correlation with the auxiliary factor is greater than or equal to a preset correlation threshold is selected from the first product identification and all the second product identifications, and the target product identification is determined as the product identification result corresponding to the product image to be identified.

[0232] It can be seen that implementation Figure 4The described device can also provide a corresponding method for determining the product identification results with more detailed and specific operating steps for the case where the quantity is greater than or equal to a preset quantity threshold, which is conducive to improving the feasibility and rationality of the method for determining the product identification results, and thus is conducive to improving the accuracy and reliability of the determined product identification results, and to a certain extent, can improve the efficiency of determining the product identification results.

[0233] In another optional embodiment, Figure 4 As shown, the device may also include:

[0234] The model training module 308 is configured to train the image segmentation model based on a predetermined training sample dataset to obtain a product image main segmentation model before the image segmentation module 301 inputs the product image to be identified into the product image main segmentation model to obtain a target image of the product in the product image to be identified;

[0235] The training sample dataset includes a plurality of training product images, each training product image is a product image with the image background segmented out, and all the training product images include first-category training product images, or all the training product images include first-category training product images and second-category training product images; wherein the image background segmentation results of all first training product images in the first-category training product images are manually labeled, and all second training product images in the second-category training product images are generated based on the first training product images in the first-category training product images.

[0236] It can be seen that implementation Figure 4 The described device can also perform a segmentation model training operation to obtain a product image main body segmentation model before inputting the product image to be identified into the product image main body segmentation model, providing a function of training the product image main body segmentation model, which is conducive to improving the integrity and comprehensiveness of the product identification method based on image segmentation, and thus is conducive to improving the rationality of the product identification method based on image segmentation, thereby helping to improve the accuracy and reliability of the determined product identification results to improve the effectiveness of the determined product identification results.

[0237] In yet another optional embodiment, each second training product image in the second category of training product images is generated in the following manner:

[0238] For any first training product image in the first category of training product images, crop the product main area image in the first training product image according to the annotation result of the first training product image; perform data augmentation on the product main area image to obtain a data-enhanced image, and randomly paste the data-enhanced image onto different promotional image templates, adjust the pixel value of the data-enhanced image at the pasting position of the promotional image template to the first pixel value, and adjust the pixel value at the remaining position of the promotional image template to the second pixel value, to obtain a second training product image.

[0239] It can be seen that implementation Figure 4 The described device can also determine the second training product image in the second category of training product images by performing image processing operations such as data enhancement and image pasting on the product main area image, which is conducive to improving the feasibility and rationality of the second training product image generation method, and thus is conducive to improving the generation efficiency of the second training product image, and to a certain extent can improve the effectiveness and reliability of the second training product image, thereby helping to improve the efficiency and accuracy of product recognition based on image segmentation.

[0240] In yet another optional embodiment, the image background segmentation result of each first training product image in the first category of training product images is annotated based on the segmentation result map corresponding to each first training product image;

[0241] For each first training product image of the first category of training product images, a segmentation result image corresponding to the first training product image is generated by:

[0242] Inputting the original image corresponding to the first training product image into a predetermined image segmentation network to obtain three original feature maps of different sizes corresponding to the original image;

[0243] The three original feature maps are respectively input into three different convolutional layers in the segmentation branch of the image segmentation network to obtain the output feature map of each convolutional layer;

[0244] Determine the target size of the output feature map obtained by passing the corresponding convolution layer through the original feature map of the largest size among the three original feature maps, and upsample the output feature maps obtained by passing the corresponding convolution layer through the two original feature maps of non-largest size so that the size of the output feature maps obtained by passing the corresponding convolution layer through the two original feature maps of non-largest size is equal to the target size;

[0245] The three output feature maps of the same size are spliced ​​to obtain a spliced ​​feature map, which is then input into the feature fusion convolution layer to obtain the target feature map after feature fusion.

[0246] Normalize the original pixel value corresponding to each pixel in the target feature map to obtain the target pixel value corresponding to each pixel in the target feature map;

[0247] For each pixel in the target feature map, the target pixel value corresponding to the pixel is compared with the reference pixel value to obtain a comparison result, and the target pixel value corresponding to the pixel is mapped to the set pixel value according to the comparison result;

[0248] According to the set pixel values ​​corresponding to all pixels in the target feature map, a segmentation result map corresponding to the training product image is generated.

[0249] It can be seen that implementation Figure 4 The described device can also provide a method for generating a segmentation result map corresponding to the first training product image, and provides a function for generating a segmentation result map, which is conducive to improving the feasibility and rationality of the segmentation result map generation method, and thus is conducive to improving the generation efficiency of the segmentation result map, and to a certain extent can improve the effectiveness and reliability of the segmentation result map corresponding to the first training product image, thereby helping to improve the efficiency and accuracy of product recognition based on image segmentation.

[0250] Example 4

[0251] See also Figure 5 , Figure 5 This is a structural diagram of another commodity identification device based on image segmentation disclosed in an embodiment of the present invention. Figure 3 The described device may include a server, wherein the server includes a local server or a cloud server, which is not limited in the embodiment of the present invention. Figure 5 As shown, the device may include:

[0252] A memory 401 storing executable program code;

[0253] a processor 402 coupled to the memory 401;

[0254] Furthermore, it may also include an input interface 403 and an output interface 404 coupled to the processor 402;

[0255] The processor 402 calls the executable program code stored in the memory 401 to execute the steps of the commodity identification method based on image segmentation described in the first or second embodiment.

[0256] Example 5

[0257] An embodiment of the present invention discloses a computer-readable storage medium storing a computer program for electronic data exchange, wherein the computer program enables a computer to execute the steps of the commodity identification method based on image segmentation described in the first or second embodiment.

[0258] Example 6

[0259] An embodiment of the present invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute the steps of the product identification method based on image segmentation described in Example 1 or Example 2.

[0260] The device embodiments described above are merely illustrative, wherein the modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, i.e., they may be located in one place or distributed across multiple network modules. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Those skilled in the art can understand and implement the present invention without inventive effort.

[0261] Through the detailed description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus the necessary general hardware platform, or of course, by means of hardware. Based on this understanding, the above technical solution, in essence, or the portion that contributes to the prior art, can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, including a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.

[0262] Finally, it should be noted that the method and device for commodity identification based on image segmentation disclosed in the embodiments of the present invention are only preferred embodiments of the present invention, and are only used to illustrate the technical solutions of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A commodity recognition method based on image segmentation, characterized in that: The method comprises: When a product image to be identified is detected and a product identification operation needs to be performed, the product image to be identified is input into a predetermined product image subject segmentation model to obtain a target image corresponding to the product to be identified in the product image to be identified, and the correlation between the target image and the background of the product image to be identified is lower than a preset correlation threshold; Inputting the target image into a pre-built image feature extraction model to obtain a target feature vector corresponding to the target image; Determining a target existing feature vector that matches the target feature vector based on the target feature vector and each existing feature vector in the product image feature library, and determining the product identification corresponding to the target existing feature vector based on the image feature-product identification correspondence in the product image feature library as the product identification result corresponding to the product image to be identified; The step of determining the commodity identification corresponding to the target existing feature vector based on the image feature-commodity identification correspondence relationship corresponding to the commodity image feature library as the commodity identification result corresponding to the commodity image to be identified includes: When the number of all the target existing feature vectors is greater than or equal to a preset number threshold, determining whether there is a product identifier that is the same as the first product identifier corresponding to the target similar existing feature vector among the second product identifiers corresponding to all the remaining similar existing feature vectors; When it is determined that there is no product identifier identical to the first product identifier among all the second product identifiers, an auxiliary factor corresponding to the product image to be identified is determined, and based on the auxiliary factor, a target product identifier whose correlation with the auxiliary factor is greater than or equal to a preset correlation threshold is selected from the first product identifier and all the second product identifiers, and the target product identifier is determined as the product identification result corresponding to the product image to be identified.

2. The commodity recognition method based on image segmentation according to claim 1, characterized in that: Before determining a target existing feature vector that matches the target feature vector based on the target feature vector and each existing feature vector in the product image feature library, the method further includes: performing a dimensionality reduction operation on the target feature vector to update the target feature vector; Furthermore, before performing a dimensionality reduction operation on the target feature vector to update the target feature vector, the method further includes: Determine the first dimension information of the target feature vector, and obtain the second dimension information corresponding to all existing feature vectors in the product image feature library; Determine whether the first dimensional information matches the second dimensional information. When it is determined that the first dimensional information does not match the second dimensional information, trigger the execution of the operation of performing a dimensionality reduction operation on the target feature vector to update the target feature vector; when it is determined that the first dimensional information matches the second dimensional information, trigger the execution of the operation of determining a target existing feature vector that matches the target feature vector based on the target feature vector and each existing feature vector in the product image feature library.

3. The commodity recognition method based on image segmentation according to claim 2, characterized in that: The step of determining a target existing feature vector that matches the target feature vector based on the target feature vector and each existing feature vector in the product image feature library includes: Calculating the cosine similarity between the target feature vector and each existing feature vector in the product feature database; It is determined whether there is at least one target cosine similarity greater than or equal to a preset cosine similarity threshold among all the cosine similarities. If yes, the similar existing feature vectors corresponding to all the target cosine similarities are determined as target existing feature vectors that match the target feature vector.

4. The commodity recognition method based on image segmentation according to claim 3, characterized in that: The step of determining the commodity identification corresponding to the target existing feature vector based on the image feature-commodity identification correspondence corresponding to the commodity image feature library as the commodity identification result corresponding to the commodity image to be identified further includes: Calculating the number of all the similar existing feature vectors, and determining the product identification corresponding to each of the similar existing feature vectors based on the image feature-product identification correspondence relationship corresponding to the product image feature library; Determine, based on the quantity and the commodity identifiers corresponding to all the similar existing feature vectors, the commodity identifier corresponding to the target existing feature vector as the commodity recognition result corresponding to the commodity image to be recognized; The step of determining the commodity identification corresponding to the target existing feature vector based on the quantity and the commodity identifications corresponding to all the similar existing feature vectors as the commodity identification result corresponding to the commodity image to be identified further includes: When the number is 1, determining the commodity identification corresponding to the similar existing feature vector as the commodity recognition result corresponding to the commodity image to be recognized; When the number is greater than 1 and less than a preset number threshold, determining the commodity identifier corresponding to the target similar existing feature vector as the commodity recognition result corresponding to the commodity image to be recognized; The target similar existing feature vector is the similar existing feature vector having the largest cosine similarity with the target feature vector among all the similar existing feature vectors, and the remaining similar existing feature vectors are the similar existing feature vectors of all the similar existing feature vectors except the target similar existing feature vector.

5. The commodity recognition method based on image segmentation according to claim 4, characterized in that: The method further comprises: When it is determined that there is a product identification identical to the first product identification among all the second product identifications, the product identification corresponding to the target similar existing feature vector is determined as the product recognition result corresponding to the product image to be recognized.

6. The commodity recognition method based on image segmentation according to claim 5, characterized in that: Before inputting the commodity image to be identified into the commodity image subject segmentation model to obtain the target image of the commodity in the commodity image to be identified, the method further includes: The image segmentation model is trained based on a predetermined training sample data set to obtain a product image main body segmentation model; The training sample dataset includes a plurality of training product images, each of which is a product image with its image background segmented, and all of the training product images include first-category training product images, or all of the training product images include first-category training product images and second-category training product images; wherein the image background segmentation results of all first-category training product images in the first-category training product images are manually annotated, and all of the second-category training product images in the second-category training product images are generated based on the first-category training product images; Furthermore, each second training product image in the second type of training product images is specifically generated by: For any first training product image in the first category of training product images, crop the product main area image in the first training product image according to the annotation result of the first training product image; perform data augmentation operation on the product main area image to obtain a data-enhanced image, and randomly paste the data-enhanced image onto different promotional image templates, adjust the pixel value of the data-enhanced image at the pasting position of the promotional image template to the first pixel value, and adjust the pixel value at the remaining position of the promotional image template to the second pixel value, to obtain a second training product image.

7. The commodity recognition method based on image segmentation according to claim 6, characterized in that: The image background segmentation result of each first training product image in the first category of training product images is annotated based on the segmentation result map corresponding to each first training product image; For each first training product image of the first category of training product images, a segmentation result image corresponding to the first training product image is generated by: Inputting the original image corresponding to the first training product image into a predetermined image segmentation network to obtain three original feature maps of different sizes corresponding to the original image; Inputting the three original feature maps into three different convolutional layers in the segmentation branch of the image segmentation network respectively to obtain an output feature map of each convolutional layer; Determining a target size of an output feature map obtained by passing the original feature map of the largest size among the three original feature maps through the corresponding convolution layer, and upsampling the output feature maps obtained by passing the two original feature maps of non-largest size through the corresponding convolution layer so that the size of the output feature maps obtained by passing the two original feature maps of non-largest size through the corresponding convolution layer is equal to the target size; The three output feature maps of the same size are spliced ​​to obtain a spliced ​​feature map, which is then input into the feature fusion convolution layer to obtain the target feature map after feature fusion. Normalizing the original pixel value corresponding to each pixel point in the target feature map to obtain the target pixel value corresponding to each pixel point in the target feature map; For each pixel point in the target feature map, a target pixel value corresponding to the pixel point is compared with a reference pixel value to obtain a comparison result, and the target pixel value corresponding to the pixel point is mapped to a set pixel value according to the comparison result; A segmentation result map corresponding to the training product image is generated according to the set pixel values ​​corresponding to all pixel points in the target feature map.

8. A commodity recognition device based on image segmentation, characterized in that: The device comprises: an image segmentation module configured to, upon detecting the presence of a commodity image requiring commodity recognition, input the commodity image into a predetermined commodity image subject segmentation model to obtain a target image corresponding to the commodity in the commodity image, wherein the correlation between the target image and the background of the commodity image is less than a preset correlation threshold; A feature vector extraction module is used to input the target image into a pre-built image feature extraction model to obtain a target feature vector corresponding to the target image; a feature vector determination module, configured to determine a target existing feature vector that matches the target feature vector based on the target feature vector and each existing feature vector in the product image feature library; a recognition result determination module, configured to determine the commodity identification corresponding to the target existing feature vector based on the image feature-commodity identification correspondence corresponding to the commodity image feature library, as the commodity recognition result corresponding to the commodity image to be identified; Furthermore, the recognition result determination module determines the product identification corresponding to the target existing feature vector based on the image feature-product identification correspondence corresponding to the product image feature library as the product recognition result corresponding to the product image to be identified, specifically including: When the number of all the target existing feature vectors is greater than or equal to a preset number threshold, determining whether there is a product identifier that is the same as the first product identifier corresponding to the target similar existing feature vector among the second product identifiers corresponding to all the remaining similar existing feature vectors; When it is determined that there is no product identifier identical to the first product identifier among all the second product identifiers, an auxiliary factor corresponding to the product image to be identified is determined, and based on the auxiliary factor, a target product identifier whose correlation with the auxiliary factor is greater than or equal to a preset correlation threshold is selected from the first product identifier and all the second product identifiers, and the target product identifier is determined as the product identification result corresponding to the product image to be identified.

9. A commodity recognition device based on image segmentation, characterized in that: The device comprises: a memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the commodity recognition method based on image segmentation according to any one of claims 1 to 7.

10. A computer storage medium, characterized in that The computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the commodity recognition method based on image segmentation according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Image-based commodity settlement method and device, medium and electronic equipment

    CN111222382A

  • Commodity category identification method and device and electronic equipment

    CN111382635A