Image classification method, apparatus and device, and computer readable medium

By establishing target category and non-target category image datasets, using preset models to extract and filter high-frequency attributes, and establishing classification attribute groups, the problem of low image classification accuracy is solved and efficient image classification is achieved.

CN120375027APending Publication Date: 2025-07-25JINGDONG CITY BEIJING DIGITS TECH CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410099093.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-24
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

In the prior art, the accuracy of image classification is low, especially in the case of diversification of images on video platforms. The existing methods require a large amount of data to train models, resulting in a long time and high cost.

Method used

Data sets are created based on target categories and non-target categories images, image attributes are extracted using preset models, key-value pairs are established, high-frequency attributes are filtered, and classification attribute groups are established based on high-frequency attribute groups, which are used to filter target category images.

Benefits of technology

It improves the accuracy of image classification, reduces the time and cost of training models, and simplifies the image classification process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120375027A_ABST
    Figure CN120375027A_ABST
Patent Text Reader

Abstract

The invention discloses an image classification method, device and equipment and a computer readable medium, and relates to the technical field of computers. A specific embodiment of the method comprises the following steps: establishing an image data set based on a target category image and a non-target category image; extracting attributes of images in the image data set by adopting a preset model, establishing key value pairs of names of the images and the attributes of the images, and screening out a plurality of high-frequency attributes from the key value pairs according to the occurrence frequency of the attributes; and selecting a classification attribute group of the images in the image data set according to a primary attribute group, a target category and a non-target category established by the high-frequency attributes, and screening attributes of the plurality of images based on the classification attribute group to determine the images belonging to the target category. According to the embodiment, the accuracy of image classification can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular, to a method, apparatus, device, and computer-readable medium for classifying images. Background Art

[0002] With the development of Internet technology, various video platforms are more and more widely used. Everyone can become a creator of videos and images. By uploading video works and image works on the video platform, the video works and image works are shared.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art: Since videos and images are diverse, there is a technical problem of low accuracy in image classification. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a method, apparatus, device, and computer-readable medium for classifying images, which can improve the accuracy of image classification.

[0005] To achieve the above object, according to one aspect of the embodiments of the present invention, a method for classifying images is provided, including:

[0006] Establishing an image data set based on target category images and non-target category images;

[0007] Extracting the attributes of the images in the image data set by using a preset model, establishing a key-value pair between the name of the image and the attributes of the image, and screening out a plurality of high-frequency attributes according to the frequency of attribute occurrence in the key-value pair;

[0008] Selecting a classification attribute group of the images in the image data set according to the primary selection attribute group established based on the high-frequency attributes, the target category, and the non-target category, so as to screen the attributes of a plurality of images based on the classification attribute group to determine the images belonging to the target category.

[0009] The step of extracting the attributes of the images in the image data set by using a preset model, establishing a key-value pair between the name of the image and the attributes of the image, and screening out a plurality of high-frequency attributes according to the frequency of attribute occurrence in the key-value pair includes:

[0010] Extracting the attributes of the target category images in the image data set by using a preset model, and establishing a target category image key-value pair between the name of the target category image and the attributes of the target category image;

[0011] Extracting the attributes of the non-target category images in the image data set by using a preset model, and establishing a non-target category image key-value pair between the name of the non-target category image and the attributes of the non-target category image;

[0012] Filter out multiple high-frequency attributes of the target-class images from the target-class image key-value pairs, and filter out multiple high-frequency attributes of the non-target-class images from the non-target-class image key-value pairs.

[0013] The number of the target-class images is less than or equal to the number of the non-target-class images.

[0014] The method of selecting the classification attribute group of the images in the image dataset according to the primary selection attribute group established based on the high-frequency attributes, the target class, and the non-target class includes:

[0015] Establish a primary selection attribute group according to the high-frequency attributes and logical relationships;

[0016] Determine the image parameters of the images in the image dataset based on the primary selection attribute group and the class to which the images in the image dataset belong, where the class to which the images belong includes the target class and the non-target class;

[0017] Select the classification attribute group of the images in the image dataset based on the image parameters.

[0018] The method of selecting the classification attribute group of the images in the image dataset based on the image parameters includes:

[0019] Select the classification attribute group of the images in the image dataset according to the weights of the high-frequency attributes and the image parameters.

[0020] Before establishing the image dataset based on the target-class images and the non-target-class images, it further includes:

[0021] Identify the target-class images and the non-target-class images according to the original attributes of the images.

[0022] The method of extracting the attributes of the images in the image dataset by using a preset model includes:

[0023] Extract the attributes of the images in the image dataset by using a preset model within the range of the original attributes of the images in the image dataset.

[0024] The multiple images are the images uploaded to the server.

[0025] According to the second aspect of the embodiments of the present invention, there is provided an apparatus for classifying images, including:

[0026] A building module, configured to build an image dataset based on target-class images and non-target-class images;

[0027] A screening module, configured to extract the attributes of the images in the image dataset by using a preset model, establish key-value pairs between the names of the images and the attributes of the images, and screen out multiple high-frequency attributes according to the frequency of attribute occurrences in the key-value pairs;

[0028] A classification module, configured to select a classification attribute group of the images in the image dataset according to the primary selection attribute group, target category, and non-target category established based on the high-frequency attributes, so as to screen the attributes of multiple images based on the classification attribute group to determine the images belonging to the target category.

[0029] According to the third aspect of the embodiments of the present invention, there is provided an electronic device for classifying images, including:

[0030] One or more processors;

[0031] A storage device, configured to store one or more programs,

[0032] When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described above.

[0033] According to the fourth aspect of the embodiments of the present invention, there is provided a computer-readable medium, on which a computer program is stored, and when the program is executed by a processor, the method as described above is implemented.

[0034] One of the embodiments of the above invention has the following advantages or beneficial effects: An image dataset is established based on target category images and non-target category images; the attributes of the images in the image dataset are extracted by using a preset model, key-value pairs between the names of the images and the attributes of the images are established, and multiple high-frequency attributes are screened out according to the frequency of attribute occurrences in the key-value pairs; according to the attribute group, target category, and non-target category established based on the high-frequency attributes, a classification attribute group of the images in the image dataset is selected, so as to screen the attributes of multiple images based on the classification attribute group to determine the images belonging to the target category. Since the classification attribute group can be directly screened out by using the target category images and non-target category images, and then the images belonging to the target category can be screened out, the accuracy of image classification can be improved.

[0035] The further effects of the above non-conventional optional methods will be described in combination with specific embodiments below. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The drawings are used to better understand the present invention and do not constitute an improper limitation to the present invention. Among them:

[0037] Figure 1 is a main flowchart of the method for classifying images according to the embodiments of the present invention;

[0038] Figure 2 It is a schematic flowchart of extracting image attributes and screening high-frequency attributes according to an embodiment of the present invention;

[0039] Figure 3 It is to statistically count the occurrence frequency of attributes by using a histogram according to an embodiment of the present invention;

[0040] Figure 4 It is a schematic flowchart of selecting a classification attribute group of images in an image dataset according to an embodiment of the present invention;

[0041] Figure 5 It is a main structural schematic diagram of a device for classifying images according to an embodiment of the present invention;

[0042] Figure 6 It is an exemplary system architecture diagram to which an embodiment of the present invention can be applied;

[0043] Figure 7 It is a structural schematic diagram of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. Detailed implementation manners

[0044] The following makes an explanation of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted below.

[0045] Currently, a model for classifying images is mostly trained. Specifically, algorithm experts communicate with business personnel about business requirements and convert them into solutions that can be implemented by algorithms. A large amount of data is collected, and classification algorithms such as the resnet network of CNN and detection algorithms such as the YOLO series network are used. Then, the corresponding model needs to be trained, and this process requires algorithm experts to operate throughout, with high personnel costs and long training cycles.

[0046] In summary, when using a neural network to train a model for classifying images, since the model needs to be trained to classify images, there is a technical problem of a long time for classifying images.

[0047] To solve the technical problem of a long time for classifying images, the technical solutions in the following embodiments of the present invention can be adopted.

[0048] See Figure 1 , Figure 1 It is a main flowchart of a method for classifying images according to an embodiment of the present invention. By extracting the attributes and categories of images, a classification attribute group of images is selected to classify the images. As Figure 1As shown in 100, it specifically includes the following steps:

[0049] S101. Establish an image data set based on target category images and non-target category images.

[0050] In an embodiment of the present invention, in order to classify images, it needs to be realized based on the attributes of the images. For images, they can be divided into target category images and non-target category images. Target category images belong to the image categories to be recognized. Non-target category images belong to the image categories that do not need to be recognized. As an example, target category images include red chairs; non-target category images include: yellow chairs and black tables.

[0051] In an embodiment of the present invention, target category images and non-target category images are identified according to the original attributes of the images. The original attributes of the images are the initial attributes of the images and are the initial features characterizing the images themselves from different angles. As an example, the original attributes of the images include multiple attributes. For example: from the perspective of color, the original attributes of the images include: orange; from the perspective of shape, the original features include: ball; from the perspective of use, the original features include: food.

[0052] As another example, the original attribute of image 1: yellow fruit; the original attribute of image 2: red flower. Based on the original attributes of the images, image 1 is used as the target category image and image 2 is used as the non-target category image.

[0053] It should be noted that the purpose of adopting the embodiment of the present invention is to screen out classification attribute groups for target category images and non-target category images. Furthermore, images belonging to the target category are screened out with the classification attribute groups.

[0054] In an embodiment of the present invention, an image data set is established based on target category images and non-target category images. The image data set includes not only target category images but also non-target category images.

[0055] In order to improve the accuracy of classifying images, an image data set is established based on target category images and non-target category images, and the number of target category images is less than or less than or equal to the number of non-target category images. As an example, the ratio of the number of target category images to the number of non-target category images is between 1:10 and 1:1. The number of target category images is generally not less than 1000. Among them, non-target images include random images and images that are not significantly different from target category images.

[0056] The types of non-target category images and the proportion of the types of non-target category images are the same as in real life. As an example, the target category image is a white flower; the non-target category images include non-white flowers, such as: red flowers, green flowers, yellow flowers, purple flowers, and black flowers. Except for white flowers, the proportion of other colored flowers is the same as that in nature. From the ratio of the number of target category images to the number of non-target category images, it can be seen that white flowers account for the largest proportion relative to other colored flowers.

[0057] As another example, the target category image is a red apple, and the number of red apple images is 1100; the non-target category images include green apples, yellow apples, green bananas, yellow bananas, orange oranges, orange tangerines, green watermelons, green honeydews, red grapes, green grapes, purple grapes, red cherries, yellow cherries, red strawberries, and white strawberries. The total number of non-target category images is 10000.

[0058] It should be noted that the ratio of the number of images of the image categories included in the non-target category images to the total number of all non-target category images is the same as the quantity ratio in real life. As an example, the ratio of green apples to the total number of all non-target category images is 3%, and in real life, the ratio of green apples to fruits other than red apples is 3%. In this way, the number of red apple images is relatively large compared to the number of other non-target category images.

[0059] S102. Use a preset model to extract the attributes of the images in the image dataset, establish a key-value pair of the name of the image and the attributes of the image, and screen out multiple high-frequency attributes according to the frequency of attribute occurrence in the key-value pair.

[0060] In an embodiment of the present invention, a preset model can be used to extract the attributes of the images in the image dataset. For each image in the image data, establish a key-value pair of the name of the image and the attributes of the image, and screen out multiple high-frequency attributes according to the frequency of attribute occurrence in the key-value pair.

[0061] See Figure 2 That is, 200, Figure 2 is a schematic flow chart of extracting image attributes and screening high-frequency attributes according to an embodiment of the present invention. Specifically, it includes the following steps:

[0062] S201. Use a preset model to extract the attributes of the target category images in the image dataset, and establish a target category image key-value pair between the name of the target category image and the attributes of the target category image.

[0063] In an embodiment of the present invention, a preset model can be used to extract the attributes of an image. Among them, the preset model is a deep learning model. The deep learning model is a model that has been trained, and the deep learning model can directly extract the attributes of an image. As an example, the model is a model including a Transformer structure. Transformer is a neural network architecture. As another example, the model includes a recurrent neural network (RNN) model and a convolutional neural network (CNN) model.

[0064] Use a preset model to extract the attributes of the target category images in the image dataset. Among them, the attributes of the target category images can include multiple ones. Such as: vegetables; green; green leaves; thornless.

[0065] For each target category image, establish a target category image key-value pair of the name of the target category image and the attributes of the target category image. Such as: the name of the target category image is the key; the attributes of the target category image are the value of the key-value.

[0066] In an embodiment of the present invention, a preset model is used to extract the attributes of the target category images in the image dataset, where the preset model includes a coarse-grained model and a fine-grained model. Compared with the attributes extracted by the fine-grained model, the attributes extracted by the coarse-grained model have the characteristic of a larger range.

[0067] Use the coarse-grained model and the fine-grained model to extract the attributes of the target category images in the image dataset. Attributes in different ranges can be extracted. As an example, for the same image, the attributes extracted by the coarse-grained model include: food; transportation; stationery. The attributes extracted by the fine-grained model include: vegetables; bicycle; pen.

[0068] S202. Use a preset model to extract the attributes of the non-target category images in the image dataset, and establish a non-target category image key-value pair between the name of the non-target category image and the attributes of the non-target category image.

[0069] For non-target category images, use a preset model to extract the attributes of the non-target category images in the image dataset. Furthermore, establish a non-target category image key-value pair of the name of the non-target category image and the attributes of the non-target category image. Such as: the name of the non-target category image is the key; the attributes of the non-target category image are the value of the key-value.

[0070] S203. Screen out multiple target category image high-frequency attributes according to the frequency of attribute occurrence in the target category image key-value pair, and screen out multiple non-target category image high-frequency attributes according to the frequency of attribute occurrence in the non-target category image key-value pair.

[0071] To accurately characterize an image, high-frequency attributes can be screened out. High-frequency attributes are those with high usage frequencies.

[0072] Specifically, multiple high-frequency attributes of target-category images are screened out according to the attribute occurrence frequencies in target-category image key-value pairs, and multiple high-frequency attributes of non-target-category images are screened out according to the attribute occurrence frequencies in non-target-category image key-value pairs. As an example, the top N attributes with high occurrence frequencies are used as high-frequency attributes.

[0073] In one embodiment of the present invention, a histogram or text pair can be used to count the frequencies of attributes.

[0074] See Figure 3 i.e., 300, Figure 3 is the occurrence frequency of attributes counted by using a histogram according to an embodiment of the present invention. Among them, the occurrence frequency of attribute 1 is 5 times; the occurrence frequency of attribute 2 is 10 times; the occurrence frequency of attribute 3 is 3 times. Where N is 2, then attribute 1 and attribute 2 are used as high-frequency attributes.

[0075] In one embodiment of the present invention, in order to improve the accuracy of extracting image attributes, within the original attribute range of images in the image dataset, a preset model can be used to extract the attributes of images in the image dataset.

[0076] As an example, the original attributes of images in the image dataset include green. The attributes extracted from the images in the image dataset by using the preset model include: red; vegetable; round. Since the attribute red is not within the range of the original attribute green, based on the attributes of the image: red; vegetable; round, the output of the image is adjusted to include: vegetable; round.

[0077] The original attributes of an image can characterize the essential features of the image. Within the original attribute range determined by the original attributes, the accuracy of the attributes extracted by using the preset model is higher.

[0078] S103. Based on the primary attribute group established according to the high-frequency attributes, the target category and the non-target category, select the classification attribute group of images in the image dataset to screen the attributes of multiple images based on the classification attribute group to determine the images belonging to the target category.

[0079] High-frequency attributes are those with relatively high usage frequencies in extracting image attributes. As an example, attributes with usage frequencies greater than the high-frequency threshold are used as high-frequency data. The classification attribute group of images in the image dataset can be selected based on the primary attribute group established according to the high-frequency attributes, the target category and the non-target category.

[0080] As an example, high-frequency attributes include high-frequency attributes of target-category images and high-frequency attributes of non-target-category images. This is to expand the selection range of the classification attribute group and improve the accuracy of image attributes.

[0081] See Figure 4 i.e., 400, Figure 4 It is a schematic flowchart of selecting a classification attribute group of images in an image dataset according to an embodiment of the present invention. Specifically, it includes the following steps:

[0082] S401. Establish a preliminary selection attribute group according to high-frequency attributes and logical relationships.

[0083] In an embodiment of the present invention, the logical relationships include and, or, and not. A preliminary selection attribute group is established according to high-frequency attributes and logical relationships.

[0084] As an example, the high-frequency attributes include red; round; fruit. The preliminary selection attribute group includes: "red" and "round" and "fruit".

[0085] S402. Determine the image parameters of the images in the image dataset based on the preliminary selection attribute group and the categories to which the images in the image dataset belong. The categories include target categories and non-target categories.

[0086] For the images in the image dataset, due to the large number of logical relationships, the number of preliminary selection attribute groups is large. The category of the image determined based on the preliminary selection attribute group is the preliminary selection category. The preliminary selection attribute group is used to predict the category of the image.

[0087] Specifically, the preliminary selection attribute group is input into a preset logic model to determine the preliminary selection category corresponding to the preliminary selection attribute group. As an example, the preset logic model includes a classifier.

[0088] The category of the images in the image dataset belongs to: target category. If the preliminary selection category is the same as the category of the image, that is, the predicted category of the image is the same as the actual category of the image, the TP count is incremented by one; if the preliminary selection category is different from the category of the image, that is, the predicted category of the image is different from the actual category of the image, the FN count is incremented by one. Among them, the actual positive sample is predicted as a positive sample (True Positive, TP), the classifier prediction result is a positive sample, and the actual is also a positive sample, that is, the number of correctly identified positive samples. The actual positive sample is predicted as a negative sample (False Negative, FN), the classifier prediction result is a negative sample, and the actual is a positive sample, that is, the number of missed positive samples.

[0089] The category of the images in the image dataset belongs to: non-target category. If the preliminary selection category is different from the category of the image, that is, the predicted category of the image is different from the actual category of the image, the TN count is incremented by one; if the preliminary selection category is different from the category of the image, that is, the predicted category of the image is different from the actual category of the image, the FP count is incremented by one.

[0090] Among them, the actual negative samples predicted as positive samples (False Positive, FP) refer to the number of negative samples that are misreported, where the classifier's prediction result is positive but the actual sample is negative. The actual negative samples predicted as negative samples (True Negative, TN) refer to the number of negative samples that are correctly identified, where the classifier's prediction result is negative and the actual sample is negative.

[0091] In an embodiment of the present invention, the image parameters of the images in the image dataset include TP, FP, TN, and FN.

[0092] S403. Select the classification attribute group of the images in the image dataset based on the image parameters.

[0093] Based on the image parameters, the corresponding recall rate and precision rate can be calculated. Among them, recall rate = TP / (TP + FN), and precision rate = TP / (TP + FP).

[0094] For each primary selected attribute group, the recall rate and precision rate are determined based on the image parameters. Then, select the classification attribute group of the images in the image dataset.

[0095] As an example, arrange the primary selected attribute groups according to the recall rate or precision rate, and then select the classification attribute group of the images in the image dataset. For example: for a business that focuses on recall, arrange the primary selected attribute groups in descending order of the recall rate, and take the primary selected attribute group corresponding to the lowest recall rate as the classification attribute group.

[0096] Another example: for a business that focuses on accuracy, arrange the primary selected attribute groups in descending order of the precision rate, and take the primary selected attribute group corresponding to the highest precision rate as the classification attribute group.

[0097] In an embodiment of the present invention, select the classification attribute group of the images in the image dataset according to the weights of the high-frequency attributes and the image parameters.

[0098] Specifically, after determining the image parameters, arrange the primary selected attribute groups according to the recall rate or precision rate, and then adjust the sorting of the primary selected attribute groups according to the weights of the high-frequency attributes, and then select the classification attribute group of the images in the image dataset.

[0099] As an example, arrange the primary selected attribute groups in descending order of the recall rate, and adjust the sorting of the primary selected attribute groups based on the product of the weights of the high-frequency attributes in the primary selected attribute groups and the recall rate. Then, take the last sorted primary selected attribute group as the classification attribute group.

[0100] As another example, arrange the primary selected attribute groups in descending order of the precision rate, and adjust the sorting of the primary selected attribute groups based on the product of the weights of the high-frequency attributes in the primary selected attribute groups and the recall rate. Then, take the first sorted primary selected attribute group as the classification attribute group.

[0101] It should be noted that the weights of high-frequency attributes can be preset. As an example, the weight of high-frequency attribute 1 is 50%, the weight of high-frequency attribute 2 is 10%, and the weight of high-frequency attribute 3 is 40%.

[0102] After determining the classification attribute group of the images, the attributes of multiple images can be filtered based on the classification attribute group to determine the images belonging to the target category. Among them, the attributes of multiple images are extracted by the model in S102. If the attributes of the image are the same as the attributes in the classification attribute group, then the image belongs to the image of the target category.

[0103] As an example, if the attributes of the image are the same as some of the attributes in the classification attribute group, it is determined that the image belongs to the image of the target category. As another example, in order to improve the classification accuracy, if the attributes of the image are the same as all the attributes in the classification attribute group, then the image belongs to the image of the target category.

[0104] In an embodiment of the present invention, the multiple images are images uploaded to the server. The multiple images are images to be classified.

[0105] As an example, a user uploads a product image to the server to evaluate the product. After classifying the product image uploaded by the user using the classification attribute group, if it is determined that the product image uploaded by the user does not belong to the target category, the user will be allowed to upload the product image to the server. If it is determined that the product image uploaded by the user belongs to the target category, the user will be prohibited from uploading the product image to the server.

[0106] As another example, a merchant uploads a product image to the server to publish the product. After classifying the product image uploaded by the merchant using the classification attribute group, if it is determined that the product image uploaded by the merchant does not belong to the target category, the merchant will be allowed to upload the product image to the server. If it is determined that the product image uploaded by the merchant belongs to the target category, the merchant will be prohibited from uploading the product image to the server.

[0107] In the above embodiments of the present invention, an image dataset is established based on the target category images and non-target category images; the attributes of the images in the image dataset are extracted by a preset model, and a key-value pair of the name of the image and the attributes of the image is established, and multiple high-frequency attributes are filtered out according to the frequency of attribute occurrence in the key-value pair; according to the attribute group established by the high-frequency attributes, the target category and the non-target category, the classification attribute group of the images in the image dataset is selected to filter the attributes of multiple images based on the classification attribute group to determine the images belonging to the target category. By using the target category images and non-target category images, the classification attribute group can be filtered out, and then the images belonging to the target category can be filtered out, thus improving the accuracy of image classification.

[0108] It is convenient for different users to utilize the attributes of images to accurately determine the classification attribute groups, so as to classify images using the attributes in the classification attribute groups and screen out the images belonging to the target category. There is no need for users to learn professional knowledge and train models.

[0109] See Figure 5 , Figure 5 FIG. 7 is a schematic diagram of the main structure of the image classification device according to an embodiment of the present invention. The image classification device can implement the method for classifying images, such as Figure 5 As shown in FIG. 500, the image classification device specifically includes:

[0110] A building module 501, configured to build an image data set based on target category images and non-target category images;

[0111] A screening module 502, configured to extract the attributes of the images in the image data set by using a preset model, establish key-value pairs between the names of the images and the attributes of the images, and screen out a plurality of high-frequency attributes according to the frequency of attribute occurrence in the key-value pairs;

[0112] A classification module 503, configured to select a classification attribute group of the images in the image data set according to the primary selection attribute group established based on the high-frequency attributes, the target category, and the non-target category, so as to screen the attributes of a plurality of images based on the classification attribute group to determine the images belonging to the target category.

[0113] In an embodiment of the present invention, the screening module 502 is specifically configured to extract the attributes of the target category images in the image data set by using a preset model, and establish target category image key-value pairs between the names of the target category images and the attributes of the target category images;

[0114] Extract the attributes of the non-target category images in the image data set by using a preset model, and establish non-target category image key-value pairs between the names of the non-target category images and the attributes of the non-target category images;

[0115] Screen out a plurality of high-frequency attributes of the target category images according to the frequency of attribute occurrence in the target category image key-value pairs, and screen out a plurality of high-frequency attributes of the non-target category images according to the frequency of attribute occurrence in the non-target category image key-value pairs.

[0116] In an embodiment of the present invention, the number of the target category images is less than or equal to the number of the non-target category images.

[0117] In an embodiment of the present invention, the classification module 503 is specifically configured to establish a primary selection attribute group according to the high-frequency attributes and logical relationships;

[0118] Determine the image parameters of the images in the image dataset based on the initially selected attribute group and the category to which the images in the image dataset belong, where the category includes the target category and the non-target category;

[0119] Based on the image parameters, select the classification attribute group of the images in the image dataset.

[0120] In an embodiment of the present invention, the classification module 503 is further configured to select the classification attribute group of the images in the image dataset according to the weight of the high-frequency attribute and the image parameters.

[0121] In an embodiment of the present invention, the establishment module 501 is further configured to identify the target category images and the non-target category images according to the original attributes of the images.

[0122] In an embodiment of the present invention, the screening module 502 is specifically configured to extract the attributes of the images in the image dataset by using a preset model within the range of the original attributes of the images in the image dataset.

[0123] Figure 6 An exemplary system architecture 600 to which the method for classifying images or the apparatus for classifying images according to the embodiments of the present invention can be applied is shown.

[0124] As Figure 6 shown, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 is used to provide a medium for communication links between the terminal devices 601, 602, 603 and the server 605. The network 604 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.

[0125] Users can use the terminal devices 601, 602, 603 to interact with the server 605 through the network 604 to receive or send messages, etc. Various communication client applications may be installed on the terminal devices 601, 602, 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0126] The terminal devices 601, 602, 603 may be various electronic devices with a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop computers, and desktop computers, etc.

[0127] The server 605 may be a server that provides various services. For example, it may be a back-end management server (merely an example) that supports shopping websites browsed by users using the terminal devices 601, 602, and 603. The back-end management server may analyze and process data such as product information query requests received, and feedback the processing results (such as target push information, product information - merely examples) to the terminal devices.

[0128] It should be noted that the method for classifying images provided by the embodiments of the present invention is generally executed by the server 605. Correspondingly, the device for classifying images is generally disposed in the server 605.

[0129] It should be understood that Figure 6 the numbers of terminal devices, networks, and servers in

[0130] are merely illustrative. According to actual needs, there may be any number of terminal devices, networks, and servers. Figure 7 is a schematic diagram of a computer system 700 of a terminal device suitable for implementing the embodiments of the present invention. Figure 7 The terminal device shown is merely an example and should not impose any limitations on the functions and usage scope of the embodiments of the present invention.

[0131] As Figure 7 shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to the programs stored in the read-only memory (ROM) 702 or the programs loaded from the storage section 708 into the random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, ROM 702, and RAM 703 are connected to each other via a bus 704. The input / output (I / O) interface 705 is also connected to the bus 704.

[0132] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and speakers; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. The drive 710 is also connected to the I / O interface 705 as required. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as required, so that the computer program read from it can be installed into the storage section 708 as required.

[0133] In particular, according to the embodiments disclosed in the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present invention include a computer program product that includes a computer program carried on a computer-readable medium, and the computer program contains program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are performed.

[0134] It should be noted that the computer-readable medium shown in the present invention can be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The 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 of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, the computer-readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, apparatus, or device. In the present invention, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries the computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination of the above.

[0135] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a portion of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, as well as combinations of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0136] The modules described in the embodiments of the present invention can be implemented in software or in hardware. The described modules can also be provided in a processor. For example, it can be described as: a processor includes a building module, a screening module, and a classification module. Among them, the names of these modules do not constitute a limitation on the module itself in some cases. For example, the building module can also be described as "used to build an image data set based on target category images and non-target category images".

[0137] As another aspect, the present invention also provides a computer-readable medium, which can be included in the device described in the above embodiments; or can exist separately without being assembled into the device. The above computer-readable medium carries one or more programs. When the one or more programs are executed by the device, the device includes:

[0138] Build an image data set based on target category images and non-target category images;

[0139] Extract the attributes of the images in the image data set using a preset model, establish key-value pairs between the names of the images and the attributes of the images, and screen out multiple high-frequency attributes according to the frequency of attribute occurrences in the key-value pairs;

[0140] Based on the primary attribute group established according to the high-frequency attributes, the target category and the non-target category, select the classification attribute group of the images in the image data set to screen the attributes of multiple images based on the classification attribute group to determine the images belonging to the target category.

[0141] According to the technical solution of the embodiment of the present invention, an image dataset is established based on target category images and non-target category images; a preset model is used to extract the attributes of the images in the image dataset, and key-value pairs of the names of the images and the attributes of the images are established, and multiple high-frequency attributes are screened out according to the frequency of attribute occurrences in the key-value pairs; according to the attribute groups established based on the high-frequency attributes, the target category and the non-target category, the classification attribute groups of the images in the image dataset are selected to screen the attributes of multiple images based on the classification attribute groups to determine the images belonging to the target category. Since the classification attribute groups can be screened out by using the target category images and the non-target category images, and then the images belonging to the target category can be screened out, the accuracy of image classification can be improved.

[0142] The above specific embodiments do not constitute a limitation to the protection scope of the present 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 principle of the present invention shall be included within the protection scope of the present invention. It should be noted that in the technical solutions of the present disclosure, the acquisition, storage and application of the user's personal information involved all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.

Claims

1. A method for classifying images, characterized in that, Including: Establish an image dataset based on target-class images and non-target-class images; Use a preset model to extract the attributes of the images in the image dataset, establish key-value pairs between the names of the images and the attributes of the images, and screen out multiple high-frequency attributes according to the frequency of attribute occurrences in the key-value pairs; According to the primary attribute group established based on the high-frequency attributes, the target class and the non-target class, select the classification attribute group of the images in the image dataset, so as to screen the attributes of multiple images based on the classification attribute group to determine the images belonging to the target class.

2. The method for classifying an image according to claim 1, characterized in that, The step of using a preset model to extract the attributes of the images in the image dataset, establishing key-value pairs between the names of the images and the attributes of the images, and screening out multiple high-frequency attributes according to the frequency of attribute occurrences in the key-value pairs includes: Use a preset model to extract the attributes of the target-class images in the image dataset, and establish target-class image key-value pairs between the names of the target-class images and the attributes of the target-class images; Use a preset model to extract the attributes of the non-target-class images in the image dataset, and establish non-target-class image key-value pairs between the names of the non-target-class images and the attributes of the non-target-class images; Screen out multiple high-frequency target-class image attributes according to the frequency of attribute occurrences in the target-class image key-value pairs, and screen out multiple high-frequency non-target-class image attributes according to the frequency of attribute occurrences in the non-target-class image key-value pairs.

3. The method for classifying images according to claim 2, characterized in that, The number of the target-class images is less than or equal to the number of the non-target-class images.

4. A method for classifying images according to claim 1, characterized in that, The step of selecting the classification attribute group of the images in the image dataset according to the primary attribute group established based on the high-frequency attributes, the target class and the non-target class includes: Establish a primary attribute group according to the high-frequency attributes and logical relationships; Determine the image parameters of the images in the image dataset based on the primary attribute group and the categories to which the images in the image dataset belong, where the categories include the target class and the non-target class; Based on the image parameters, select the classification attribute group of the images in the image dataset.

5. The method for classifying an image according to claim 4, characterized in that, The step of selecting the classification attribute group of the images in the image dataset based on the image parameters includes: Select the classification attribute group of the images in the image dataset according to the weights of the high-frequency attributes and the image parameters.

6. The method for classifying an image according to claim 1, characterized in that, Before establishing the image dataset based on the target-class images and the non-target-class images, it further includes: Identify the target-class images and the non-target-class images according to the original attributes of the images.

7. A method for classifying an image according to claim 1, characterized in that, The step of using a preset model to extract the attributes of the images in the image dataset includes: Within the range of the original attributes of the images in the image dataset, use a preset model to extract the attributes of the images in the image dataset.

8. A method for classifying an image according to claim 1, 2 or 4, characterized in that The multiple images are images uploaded to the server.

9. An apparatus for classifying images, characterized in that, Including: A building module for establishing an image dataset based on target-class images and non-target-class images; A screening module for using a preset model to extract the attributes of the images in the image dataset, establishing key-value pairs between the names of the images and the attributes of the images, and screening out multiple high-frequency attributes according to the frequency of attribute occurrences in the key-value pairs; A classification module, configured to select a classification attribute group of images in the image dataset according to a preliminary selection attribute group established based on the high-frequency attributes, a target category, and a non-target category, so as to screen the attributes of multiple images based on the classification attribute group to determine images belonging to the target category.

10. An electronic device for classifying images, characterized in that, Comprising: One or more processors; A storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-8.

11. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, the method according to any one of claims 1-8 is implemented.

Citation Information

Cited By

  • Method and device for determining target image set, electronic equipment and storage medium

    CN121095950A