Image detection methods, devices, electronic equipment and storage media
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-17
- Publication Date
- 2026-08-14
AI Technical Summary
[0004]上述对图像质量检测时,因模型数量过多存在响应时间较长的问题;且将商品图像传输至云服务端进行分析的方式,存在数据传输链路长,响应时间易受传输带宽和网络延迟等因素的影响
[0019] The image detection scheme provided in this embodiment of the invention first acquires the image to be detected and a tag feature set, the tag feature set including product category tag features and quality category tag features; then, it acquires the image features to be detected based on a feature extraction model; finally, it performs similarity comparisons between the image features to be detected and the product category tag features and the quality category tag features, respectively, to obtain the detection result of the image to be detected. The scheme provided in this embodiment deploys the feature extraction model at the edge, processing the image to be detected at the edge, and obtaining the detection result of the image to be detected by comparing the image features to be detected with the product category tag features and the quality category tag features, respectively. This solves the problems of a large number of models and long data transmission links caused by deploying the analysis model in the cloud in traditional schemes, achieving the beneficial effects of improving response speed and reducing cloud server resource costs.
Smart Images

Figure CN116433936B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to computer technology, and more particularly to an image detection method, apparatus, electronic device and storage medium. Background Technology
[0002] Before selling goods on an e-commerce platform, product images need to be uploaded to the platform for visual display to guide users in making a purchase. Before displaying product images, they must be inspected to prevent substandard images from being uploaded to the platform and negatively impacting the user experience.
[0003] The existing solution for image detection involves uploading a product image to a cloud server, where multiple detection models are used to detect the input product image from multiple dimensions to obtain a corresponding quality score for each dimension; furthermore, the obtained multiple quality scores are fused to obtain a total quality score for the product image; finally, the detection result of the product image is determined based on the total quality score.
[0004] The above-mentioned image quality detection suffers from long response times due to the large number of models; and the method of transmitting product images to the cloud server for analysis has long data transmission links, and the response time is easily affected by factors such as transmission bandwidth and network latency. Summary of the Invention
[0005] This invention provides an image detection method, apparatus, electronic device, and storage medium, which can improve existing image detection schemes and increase detection efficiency.
[0006] In a first aspect, embodiments of the present invention provide an image detection method, comprising:
[0007] Obtain the image to be detected and a tag feature set, wherein the tag feature set includes product category tag features and quality category tag features;
[0008] The detection image features are obtained based on the feature extraction model, which is obtained by training the product category label features, the first image features corresponding to the product category label features, the quality category label features, and the second image features corresponding to the quality category label features.
[0009] The similarity comparison between the features of the image to be tested and the features of the product category label and the features of the quality category label is performed to obtain the detection result of the image to be tested.
[0010] In a second aspect, embodiments of the present invention provide an image detection apparatus, the apparatus comprising:
[0011] The first acquisition module is used to acquire the image to be detected and a label feature set, wherein the label feature set includes commodity category label features and quality category label features;
[0012] The second acquisition module is used to acquire the image features to be detected of the image to be detected based on a feature extraction model. The feature extraction model is obtained by training the product category label features, the first image features corresponding to the product category label features, the quality category label features, and the second image features corresponding to the quality category label features.
[0013] The comparison module is used to perform similarity comparison between the features of the image to be tested and the product category label features and the quality category label features, respectively, to obtain the detection result of the image to be detected.
[0014] Thirdly, embodiments of the present invention also provide an electronic device, the electronic device comprising:
[0015] At least one processor; and
[0016] A memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the image detection method according to any embodiment of the present invention.
[0018] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer instructions that are used to cause a processor to execute and implement the image detection method described in any embodiment of the present invention.
[0019] The image detection scheme provided in this embodiment of the invention first acquires the image to be detected and a tag feature set, the tag feature set including product category tag features and quality category tag features; then, it acquires the image features to be detected based on a feature extraction model; finally, it performs similarity comparisons between the image features to be detected and the product category tag features and the quality category tag features, respectively, to obtain the detection result of the image to be detected. The scheme provided in this embodiment deploys the feature extraction model at the edge, processing the image to be detected at the edge, and obtaining the detection result of the image to be detected by comparing the image features to be detected with the product category tag features and the quality category tag features, respectively. This solves the problems of a large number of models and long data transmission links caused by deploying the analysis model in the cloud in traditional schemes, achieving the beneficial effects of improving response speed and reducing cloud server resource costs.
[0020] It should be understood that the description in this section is not intended to identify key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the embodiments of the present invention will become readily apparent from the following description. Attached Figure Description
[0021] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a schematic flowchart of an image detection method provided in an embodiment of the present invention;
[0023] Figure 2 This is another schematic flowchart of the image detection method provided in this embodiment of the invention;
[0024] Figure 3 This is a schematic diagram of the image detection device provided in an embodiment of the present invention;
[0025] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0026] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0027] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.
[0028] Figure 1 This is a schematic flowchart of an image detection method provided in an embodiment of the present invention. This embodiment is applicable to the detection of captured images at the edge. The method can be executed by an image detection device, which can be implemented in hardware and / or software. The device can be configured in an edge device with shooting function.
[0029] refer to Figure 1 The method may specifically include the following steps:
[0030] S110. Obtain the image to be detected and the label feature set.
[0031] In e-commerce, sellers need to upload product images via applications so that buyers can browse them, facilitating product sales and display. However, due to factors such as the shooting equipment and environment, uploaded product images may not meet specifications. Therefore, to ensure that sellers' images are clear and complete, quality checks are required before uploading them to the e-commerce platform. The images to be checked are those taken by users using edge devices and intended for upload to the e-commerce platform.
[0032] The quality inspection solution provided in this embodiment of the invention is deployed on edge devices. The advantage of doing so is that after the seller user uses the device to collect product images, the computing function of the local edge device can be directly called to perform quality inspection on the currently captured product images, thereby determining whether the currently captured product images meet the platform requirements. While making efficient use of edge computing resources, images that do not meet the requirements can be directly filtered out during the image acquisition process, reducing the bandwidth cost of transmitting image data and the cost of cloud servers, and improving response speed.
[0033] Among them, edge devices are devices that integrate camera acquisition functions. For example, they can be industrial cameras, smartphones, and smart tablets, etc. The specific type of edge device is not limited here.
[0034] The aforementioned tag feature set includes product tag features and quality tag features.
[0035] Product category tag features are the name features of all product categories sold on the e-commerce platform. For example, the names of current product categories may include: shoes, clothing, watches, jewelry, and bags, etc.; product category tags are corresponding tags assigned to each product category name. These tags can be represented using a combination of numbers, letters, and / or symbols; alternatively, they can be obtained by directly encoding the product category name using a natural language model. The specific method for setting each product category tag is not limited here. Further feature extraction is performed on the product category tags to obtain product category tag features.
[0036] The quality category label feature is the name feature corresponding to the quality type determined from the shooting quality angle of the captured product image. For example, the current quality type name may include: image acceptable and / or image unacceptable, etc.; the quality category label is the corresponding label determined for each quality type name. The method for determining the quality category label and quality category label feature is the same as the method for determining the product category label and product category label feature described above, and will not be repeated here.
[0037] For each e-commerce platform, the corresponding tag feature set remains unchanged as long as the business domain or product type remains the same. Therefore, the determined tag feature set can be pre-stored in the storage unit of the edge device for direct use in subsequent steps.
[0038] S120. Obtain the features of the image to be detected based on the feature extraction model.
[0039] The aforementioned feature extraction model was obtained by training on product category label features, the first image features corresponding to the product category label features, the quality category label features, and the second image features corresponding to the quality category label features.
[0040] In a detailed explanation, the product category label features and quality category label features can be understood as label features of text information in the product image. The current text information can be information about the language and text structure of the text name; the first image feature and the second image feature can be understood as features about the image data in the product image. The current image data can be data such as outline, shadow, and brightness extracted from the product image.
[0041] The feature extraction model provided in this embodiment is based on a multimodal approach (integrating or fusing two or more recognition technologies). It simultaneously extracts features from both the input text information and image data. The model is trained by associative learning to establish the matching relationships between text information and image data pairs. Therefore, during model application, when the image to be detected is input into the feature extraction model, the model outputs the features of the image. Further, in subsequent steps, the edge device can match the corresponding tags from product category tag features and quality category tag features based on the features of the image.
[0042] In this embodiment, by training a feature extraction model on product category label features and first image features, the edge device can determine the target product type of the image to be detected (e.g., whether the target product type is shoes or clothes) based on the features of the image to be tested during the application phase. At the same time, by training a feature extraction model on quality category label features and second image features, the edge device can determine the quality type of the image to be detected (e.g., whether the image quality is qualified or unqualified) based on the features of the image to be tested during the application phase.
[0043] S130. Compare the similarity of the features of the image to be tested with the features of the commodity category label and the features of the quality category label, respectively, to obtain the detection results of the image to be detected.
[0044] The aforementioned product category label features may include multiple features, such as product category label features corresponding to all product categories sold on the e-commerce platform; the quality category label features may include at least one feature, such as image quality being qualified, and / or image quality being unqualified, etc.
[0045] In the process of comparing the similarity of the image features to be tested with the product category label features and the quality category label features, the similarity comparison can be performed first between the image features to be tested and the product category label features, and then between the image features to be tested and the quality category label features; alternatively, the similarity comparison can be performed first between the image features to be tested and the quality category label features, and then between the image features to be tested and the product category label features; or the operation of comparing the image features to be tested with both product category label features and quality category label features can be performed simultaneously. The specific order of the similarity comparisons is not restricted here.
[0046] During the similarity comparison process, the features of the image to be tested can be compared sequentially with multiple product category label features. Thus, the product category label corresponding to the product category label feature with the highest similarity comparison result can be taken as the target product label to which the image feature belongs.
[0047] When there is only one quality category label feature, the similarity comparison of the image features to be tested is performed using the quality category label feature as an example. If the image features to be tested meet the "image qualified" feature, the similarity comparison result is 1; otherwise, it is 0. When there are multiple quality category label features, the image features to be tested are compared with multiple quality category label features sequentially. The quality category label corresponding to the quality category label feature with the highest similarity comparison result value is taken as the target quality label of the image features to be tested. The specific method of similarity comparison between the image features to be tested and the quality category label features is not limited here.
[0048] When performing similarity comparisons, algorithms such as Pearson similarity algorithm, vector space cosine similarity algorithm, or Euclidean distance algorithm can be used. The specific similarity comparison algorithm is not restricted here.
[0049] After comparing the features of the image to be tested with the product category label features and the quality category label features respectively, the detection result of the image to be detected can be determined based on the similarity comparison result. The output format of the current detection result is "Is product xx qualified?", etc. The image detection scheme provided in this embodiment can simultaneously output the product type and image quality type of the image to be detected, simplifying the implementation process.
[0050] The image detection method provided in this embodiment of the invention first acquires the image to be detected and a tag feature set, the tag feature set including product category tag features and quality category tag features; then, it acquires the image features to be detected based on a feature extraction model; finally, it performs similarity comparisons between the image features to be detected and the product category tag features and quality category tag features respectively to obtain the detection result of the image to be detected. The scheme provided in this embodiment deploys the feature extraction model at the edge, processing the image to be detected at the edge, and obtaining the detection result of the image to be detected by comparing the image features to be detected with the product category tag features and quality category tag features respectively. This solves the problems of a large number of models and long data transmission links caused by deploying the analysis model in the cloud in traditional schemes, achieving the beneficial effects of improving response speed and reducing cloud server resource costs.
[0051] Figure 2 This is another schematic flowchart of the image detection method provided in this embodiment of the invention. The relationship between this embodiment and the above embodiments further refines the corresponding features of the above embodiments. Figure 2 As shown, the method may include the following steps:
[0052] S210. Obtain the image to be detected.
[0053] S220. Obtain the product category label corresponding to the product type and the quality category label corresponding to the image quality type.
[0054] Product tags can be tags for all types of products sold on the e-commerce platform, such as tags related to shoes, clothes, watches, jewelry, and bags; quality tags can be tags for whether the captured images meet the platform's requirements; for example, tags related to "image quality is acceptable" and / or "image quality is unacceptable".
[0055] The requirement for acceptable image quality is that the image is clear and of acceptable quality, and can fully display the main appearance of the product. However, it cannot be guaranteed that every shot will meet the requirements, so the product images need to be inspected in subsequent steps.
[0056] Optionally, when the quality category label includes unqualified image quality, it may further include unqualified imaging (such as images that are too dark, overexposed, or blurry) and unqualified content (such as target occlusion and shape changes).
[0057] S221. Based on a preset language algorithm, feature extraction is performed on product category tags and quality category tags respectively to obtain product category tag features and quality category tag features.
[0058] In this step, product category tags and quality category tags are input into a preset language algorithm. The algorithm outputs product category tag features and quality category tag features. To facilitate similarity comparison in subsequent processes, the feature lengths of the extracted product category tag features and quality category tag features should be consistent. In e-commerce, when there are N product categories, N product category tag features can be extracted.
[0059] When there are three quality category labels, such as "image quality is acceptable," "imaging quality is unacceptable," and "content quality is unacceptable," then three quality category label features can be extracted. The specific number of quality category label features depends on the developer's classification of image quality.
[0060] The aforementioned preset language algorithm can be a bidirectional encoder representation from transformers (BERT), embedded language algorithms (ELMO), or long short-term memory networks (LSTM), etc. The specific preset language algorithm is not limited here.
[0061] S230. Obtain the features of the image to be detected based on the feature extraction model.
[0062] The feature extraction model is obtained by training on product category label features, the first image features corresponding to the product category label features, the quality category label features, and the second image features corresponding to the quality category label features.
[0063] One implementation method involves training a feature extraction model as follows: determining an objective function based on product category label features and quality category label features; training the model parameters of a preset model based on first image features and second image features; and completing the model parameter training when the objective function reaches the convergence condition, thereby obtaining the feature extraction model.
[0064] First, for each product type included in the e-commerce platform, collect product category image sets corresponding to each product category tag (including but not limited to shoes, clothing, watches, etc.). Then, for all product types on the e-commerce platform, collect quality category image sets corresponding to each quality category tag, such as those meeting quality standards (qualified), imaging standards (unqualified), and content standards (unqualified). Further, obtain image data corresponding to each image in the aforementioned product category and quality category image sets to extract first image features based on the product category image set and second image features based on the quality category image set. Then, perform association training between the product category tags and the first image features and the second image features corresponding to the quality category tags. During training, for all product images participating in the training, when the product category and quality category corresponding to the current product image can be determined, and the loss is minimized, the current preset model can be considered optimized, and the feature extraction model is obtained.
[0065] In particular, considering the limited computing power of edge devices, the above-mentioned preset model can be implemented by a lightweight network model.
[0066] The first image feature mentioned above includes the image features corresponding to each product category image set. Accordingly, the first image feature can be obtained in the following way: for each product category image set corresponding to each product category label, feature extraction is performed on the product category image set corresponding to each product category to obtain the first image feature composed of the image features corresponding to each product category.
[0067] The aforementioned second image features include image features corresponding to each quality class image set. Accordingly, the second image features can be obtained as follows: obtain the product image set corresponding to each quality class label, the product image set including the product images corresponding to each product class label feature; perform feature learning on the product images in each quality class label to obtain the second image features.
[0068] Each quality category label corresponds to a set of product images, and each set of product images contains product images corresponding to the features of each product category label. For example, the image quality qualified label includes photos of clothes, shoes, hats, etc. that are of qualified quality; the image quality unqualified label includes photos of clothes, shoes, hats, etc. that are of unqualified quality. Furthermore, by performing feature learning on the product images in each category label, the second image features corresponding to each quality category image set are obtained.
[0069] It should be noted that the image features to be tested, the first image features, and the second image features mentioned in this embodiment can be understood as corresponding feature vectors, namely the image feature vector to be tested, the first image feature vector, and the second image feature vector. The process of extracting feature vectors can be implemented based on convolutional neural networks. Convolutional neural networks can scale each image to a fixed image scale, and finally, after multi-layer convolutional network calculations, output the corresponding feature vector of a specific length.
[0070] The feature extraction model training method provided in this invention is based on a multimodal training approach, simultaneously learning for multiple product categories and quality categories. It achieves quality detection for multiple product category images in an end-to-end manner. A single model can realize the capabilities of existing multi-model or multi-head model image detection solutions, avoiding the data coupling difficulties and long inference times associated with training multiple models simultaneously. Considering the computational inference characteristics at the edge, a lightweight backbone network is selected, achieving a reduction in computational consumption.
[0071] S240. Based on a preset comparison algorithm, the features of the image to be tested are compared with at least one product category label feature and at least two quality category label features to obtain the product category label comparison value and the quality category label comparison value.
[0072] Product-related label features include at least one; quality-related label features include at least two.
[0073] By sequentially comparing the features of the image under test with multiple product category label features, a similarity comparison algorithm can obtain multiple comparison values for product category labels. Similarly, by comparing the features of the image under test with at least two quality category label features, a similarity comparison algorithm can obtain at least two comparison values for quality category labels. The higher the similarity, the higher the corresponding comparison value for either the product category label or the quality category label.
[0074] The aforementioned preset comparison algorithm can be Pearson similarity algorithm, vector space cosine similarity algorithm, or Euclidean distance algorithm, etc. The specific preset comparison algorithm is not limited here.
[0075] S241. The values that meet the preset conditions in the comparison values of the product category label and the comparison values of the quality category label are determined as the target product category label and the target quality category label corresponding to the image to be detected, respectively.
[0076] Among the multiple comparison values for product category labels and at least two comparison values for quality category labels obtained, the comparison values for product category labels and quality category labels are sorted separately. The highest value satisfies the preset conditions. The product category label corresponding to the highest comparison value for product category labels is determined as the target product category label of the image to be detected; the quality category label corresponding to the highest comparison value for quality category labels is determined as the target quality category label of the image to be detected.
[0077] S242. Obtain the detection results of the image to be detected based on the target product category label and the target quality category label.
[0078] The detection result of the image to be detected is obtained by obtaining the target product category label and the target quality category label, which is whether the product is qualified. The image detection scheme provided in this embodiment can simultaneously output the image to be detected in two dimensions: product type and image quality type, simplifying the implementation process.
[0079] S250. Determine whether the target quality label is an image qualification label.
[0080] The target quality label can be either an image pass label or an image fail label. If the target quality label is an image pass label, execute S260; otherwise, execute S270 to S271.
[0081] S260. Send the image data of the image to be detected to the cloud server so that the cloud server can perform distributed storage of the image data.
[0082] Once the edge device determines that the image quality of the image to be detected meets the requirements, it can send the image data of the detected image to the cloud server. The cloud server can then determine the product type of the current image to be detected based on the image data, and perform distributed storage according to the product type for the next step of displaying the product on the e-commerce platform.
[0083] S270. Determine the target sub-label corresponding to the image to be detected.
[0084] The target sub-labels include imaging failure labels and / or content failure labels.
[0085] S271. Feedback the corresponding prompt information to the user equipment based on the target sub-label.
[0086] If the target sub-label is an imaging defect label, the message sent to the user's device could be: "Image imaging defect (too dark, overexposed, or blurry, etc.). Please move the product to a bright / dimly lit area and retake the photo." If the target sub-label is a content defect label, the message sent to the user's device could be: "Image content defect label (target obstruction, shape change, etc.). Please move the product to a clean background or foreground and retake the photo." The specific content of the corresponding message is not limited here.
[0087] The image detection method provided in this embodiment can quickly and cost-effectively detect product images on edge devices, reducing the impact of unqualified images on subsequent product display, and also reducing the transmission cost of invalid data and the inference cost of cloud servers. Compared with the existing solution that requires multiple models to extract features, this solution only uses one model, with fewer models and a faster response speed.
[0088] Figure 3 This is a schematic diagram of an image detection apparatus provided in an embodiment of the present invention. This apparatus is suitable for executing the image detection method provided in the embodiment of the present invention. Figure 3 As shown, the device may specifically include: a first acquisition module 310, a second acquisition module 320, and a comparison module 330, wherein:
[0089] The first acquisition module 310 is used to acquire the image to be detected and a tag feature set, wherein the tag feature set includes commodity tag features and quality tag features;
[0090] The second acquisition module 320 is used to acquire the image features to be detected of the image to be detected based on a feature extraction model. The feature extraction model is obtained by training the product category label features, the first image features corresponding to the product category label features, the quality category label features, and the second image features corresponding to the quality category label features.
[0091] The comparison module 330 is used to perform similarity comparison between the features of the image to be tested and the features of the commodity category label and the features of the quality category label, respectively, to obtain the detection result of the image to be detected.
[0092] The image detection device provided in this embodiment of the invention first acquires the image to be detected and a tag feature set, the tag feature set including product category tag features and quality category tag features; then, it acquires the image features to be detected based on a feature extraction model; finally, it performs similarity comparisons between the image features to be detected and the product category tag features and the quality category tag features, respectively, to obtain the detection result of the image to be detected. The solution provided in this embodiment deploys the feature extraction model at the edge, processing the image to be detected at the edge, and obtaining the detection result of the image to be detected by comparing the image features to be detected with the product category tag features and the quality category tag features, respectively. This solves the problems of a large number of models and long data transmission links caused by deploying the analysis model in the cloud in traditional solutions, achieving the beneficial effects of improving response speed and reducing cloud server resource costs.
[0093] In one embodiment, the first acquisition module includes a label acquisition unit and a label feature acquisition unit, wherein:
[0094] The tag acquisition unit is used to acquire product category tags corresponding to product types and quality category tags corresponding to image quality types.
[0095] The tag feature acquisition unit is used to extract features from the product category tag and the quality category tag based on a preset language algorithm, and obtain the product category tag features and the quality category tag features.
[0096] In one embodiment, the device further includes: a training module;
[0097] The training module is used to determine an objective function based on the product category label features and the quality category label features; to train the model parameters of the preset model based on the first image features and the second image features; and to complete the training of the model parameters when the objective function reaches the convergence condition, thereby obtaining the feature extraction model.
[0098] In one embodiment, the second acquisition module 320 is further configured to acquire a set of product images corresponding to each quality category label, the set of product images including product images corresponding to each product category label feature; and to perform feature learning on the product images in each quality category label to obtain the second image features.
[0099] In one embodiment, the product category label feature includes at least one; the quality category label feature includes at least two; the comparison module 330 includes: a similarity comparison unit, a target label determination unit, and a detection result acquisition unit, wherein:
[0100] The similarity comparison unit is used to perform similarity comparisons between the features of the image to be tested and at least one of the product category label features and at least two of the quality category label features based on a preset comparison algorithm, so as to obtain the product category label comparison value and the quality category label comparison value.
[0101] The target label determination unit is used to determine the values that meet preset conditions in the comparison values of the product category label and the comparison values of the quality category label as the target product category label and the target quality label corresponding to the image to be detected, respectively.
[0102] The detection result acquisition unit is used to obtain the detection result of the image to be detected based on the target product category label and the target quality category label.
[0103] In one embodiment, when the target quality label is an image qualification label, the device further includes a sending module, wherein:
[0104] The sending module is used to send the image data of the image to be detected to the cloud server so that the cloud server can perform distributed storage of the image data.
[0105] In one embodiment, when the target quality label is an image defective label, the device further includes: a sub-label determination module and an information feedback module, wherein:
[0106] The sub-label determination module is used to determine the target sub-label corresponding to the image to be detected; the target sub-label includes an imaging failure label and / or a content failure label;
[0107] The information feedback module is used to provide corresponding prompt information to the user device based on the target sub-tag.
[0108] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional modules is merely an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the functional modules described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0109] This invention also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the image detection method according to any embodiment of this invention.
[0110] This invention also provides a computer-readable medium storing computer instructions that, when executed by a processor, implement the image detection method described in any embodiment of this invention.
[0111] The following is for reference. Figure 4 It shows a schematic diagram of the structure of a computer system 500 suitable for implementing an electronic device according to embodiments of the present invention. Figure 4 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
[0112] like Figure 4 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 502 or programs loaded from storage section 508 into random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the system 500. The CPU 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0113] The following components are connected to I / O interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to I / O interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 510 as needed so that computer programs read from it can be installed into storage section 508 as needed.
[0114] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by central processing unit (CPU) 501, it performs the functions defined above in the system of this invention.
[0115] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0116] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0117] The modules and / or units described in the embodiments of the present invention can be implemented in software or hardware. The described modules and / or units can also be housed in a processor; for example, a processor can be described as including a first acquisition module, a second acquisition module, and a comparison module. The names of these modules do not necessarily limit the functionality of the module itself.
[0118] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs that, when executed by the device, cause the device to include: acquiring an image to be detected and a set of label features, the set of label features including product category label features and quality category label features; acquiring test image features of the image to be detected based on a feature extraction model, the feature extraction model being obtained by training the product category label features, a first image feature corresponding to the product category label features, the quality category label features, and a second image feature corresponding to the quality category label features; and performing similarity comparisons between the test image features and the product category label features and the quality category label features, respectively, to obtain a detection result for the image to be detected.
[0119] According to the technical solution of this invention, a feature extraction model is deployed at the edge, and the image to be detected is processed at the edge. The detection result of the image to be detected is obtained by comparing the features of the image to be detected with the product category label features and the quality category label features, respectively. This solves the problems of a large number of models and long data transmission links caused by deploying the analysis model in the cloud in traditional solutions, achieving the beneficial effects of improving response speed and reducing cloud server resource costs.
[0120] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. An image detection method, characterized in that, include: Obtain the image to be detected and a tag feature set, wherein the tag feature set includes product category tag features and quality category tag features; The feature extraction model is used to obtain the image features of the image to be detected. The feature extraction model is obtained by training the product category label features, the first image features corresponding to the product category label features, the quality category label features, and the second image features corresponding to the quality category label features. The feature extraction model is deployed at the edge. The similarity of the image features to be tested with the product category label features and the quality category label features is compared to obtain the detection result of the image to be tested; The process of obtaining the product category label features and the quality category label features includes: Retrieve the product category label corresponding to the product type and the quality category label corresponding to the image quality type; Based on a preset language algorithm, features are extracted from the product category label and the quality category label respectively to obtain the product category label features and the quality category label features.
2. The method according to claim 1, characterized in that, The feature extraction model is obtained by training the product category label features, the first image features corresponding to the product category label features, the quality category label features, and the second image features corresponding to the quality category label features, including: The objective function is determined based on the product category label features and the quality category label features; The model parameters of the preset model are trained based on the first image features and the second image features. When the objective function reaches the convergence condition, the training of the model parameters is completed, and the feature extraction model is obtained.
3. The method according to claim 2, characterized in that, The second image feature is obtained in the following way: Obtain the product image set corresponding to each quality category label, wherein the product image set includes product images corresponding to each product category label feature; Feature learning is performed on the product image in each of the quality category labels to obtain the second image features.
4. The method according to claim 1, characterized in that, The product category label feature includes at least one; the quality category label feature includes at least two. The step of comparing the features of the image to be tested with the product category label features and the quality category label features respectively to obtain the detection result of the image to be detected includes: Based on a preset comparison algorithm, the features of the image to be tested are compared with at least one product category label feature and at least two quality category label features to obtain product category label comparison values and quality label comparison values. The target product category label and the target quality label corresponding to the image to be detected are determined by the values that meet the preset conditions in the comparison values of the product category label and the comparison values of the quality category label, respectively. The detection result of the image to be detected is obtained based on the target product category label and the target quality category label.
5. The method according to claim 4, characterized in that, When the target quality category label is an image qualified label, the method further includes: The image data of the image to be detected is sent to the cloud server so that the cloud server can perform distributed storage of the image data.
6. The method according to claim 4, characterized in that, When the target quality label is an image defective label, the method further includes: Determine the target sub-label corresponding to the image to be detected; the target sub-label includes an imaging defect label and / or a content defect label; The corresponding prompt information is fed back to the user device based on the target sub-tag.
7. An image detection device, characterized in that, include: The first acquisition module is used to acquire the image to be detected and a label feature set, wherein the label feature set includes commodity category label features and quality category label features; The second acquisition module is used to acquire the image features to be detected of the image to be detected based on a feature extraction model. The feature extraction model is obtained by training the product category label features, the first image features corresponding to the product category label features, the quality category label features, and the second image features corresponding to the quality category label features. The feature extraction model is deployed at the edge. The comparison module is used to compare the features of the image to be tested with the product category label features and the quality category label features respectively, and obtain the detection result of the image to be detected; The first acquisition module includes: a label acquisition unit and a label feature acquisition unit; The tag acquisition unit is used to acquire product category tags corresponding to product types and quality category tags corresponding to image quality types. The tag feature acquisition unit is used to extract features from the product category tag and the quality category tag based on a preset language algorithm, and obtain the product category tag features and the quality category tag features.
8. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the image detection method according to any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the image detection method as described in any one of claims 1-6.
Citation Information
Patent Citations
Method and device for detecting image quality
CN105357411A
Method and apparatus for identifying display scene, device and storage medium
US20220301286A1