A data classification method and system based on deep learning

Through deep learning methods, the color and texture features of product images are obtained and fused into feature indexes, which solves the problem of low image data classification efficiency and accuracy in the existing technology and achieves efficient product image classification.

CN118658012BActive Publication Date: 2024-10-22SHANDONG CENTURY SAIFU INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411139124.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2024-10-22
Estimated Expiration
2044-08-20

AI Technical Summary

Technical Problem

Existing image data classification methods consume a lot of time and manpower in supervised learning, and unsupervised learning has insufficient fitting capabilities and low accuracy.

Method used

A data classification method based on deep learning is used to obtain the block characteristics of product images in different color spaces, calculate the degree of color shift, brightness balance and texture complexity, fuse them into feature indexes, and use deep neural networks for classification.

Benefits of technology

It improves the classification accuracy and efficiency of product images, fully considers the different factors of merchants and users when shooting, and saves manpower and training time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118658012B_ABST
    Figure CN118658012B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing technology, and specifically to a data classification method and system based on deep learning, including: dividing product images into blocks, obtaining the degree of color shift, brightness balance, and texture complexity, fusing and obtaining characteristic indexes of product images, and classifying product images using the characteristic indexes of product images. The present invention takes into account the color breadth differences, brightness differences, and product flatness differences between the merchant's product images and the user's product images, and fully considers the different factors of merchants and users when photographing products. All product images are classified through deep learning, the characteristics of the data itself are analyzed, and the classification accuracy and efficiency of product images are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image data processing, and in particular to a data classification method and system based on deep learning. Background Art

[0002] With the development of computer-related industries, application systems in various fields have developed rapidly, and the scale of data generated by industry applications in operation has increased exponentially. These data contain information of market value or strategic value. The most common data types include image data. The classic application scenarios of image data include e-commerce systems, which contain a large amount of image data. To effectively use image data, it is necessary to classify the image data first.

[0003] Currently, the commonly used data classification method for image data is to use deep learning to automatically classify images by learning the features of images. However, if the idea of ​​supervised learning is adopted, it will consume a lot of time and manpower, while the use of unsupervised learning will lead to too long training time, insufficient fitting ability and low accuracy. Summary of the invention

[0004] The present invention provides a data classification method and system based on deep learning to solve the existing problems.

[0005] A data classification method and system based on deep learning of the present invention adopts the following technical solutions:

[0006] An embodiment of the present invention provides a data classification method based on deep learning, the method comprising the following steps:

[0007] Obtain several product images of any product, as well as type I product images, type II product images, and type III product images in RGB color space, HSV color space, and grayscale space respectively;

[0008] Divide any type I product image and type II product image into blocks respectively to obtain a number of first target blocks of the type I product image and a number of second target blocks of the type II product image; obtain the color shift degree of the first target block by combining the values ​​of all color components of all pixels in any first target block; obtain the brightness balance degree of the type II product image according to the brightness difference between all second target blocks in any type II product image and the type II product image;

[0009] Divide any type III commodity image into blocks to obtain a number of third target blocks; obtain the overall directionality of the third target block according to the gradient information of all pixel points of any third target block; obtain a number of texture blocks of any type III commodity image by screening the overall directionality, screen the color skewness of all texture blocks and then merge them to obtain the texture complexity of the type III commodity image;

[0010] The color shift degree, brightness balance degree, and texture complexity of all blocks of any product image are merged to obtain the characteristic index of the product image;

[0011] The product images are classified using their feature indexes.

[0012] Furthermore, the method of integrating the values ​​of all color components of all pixels in any first target block to obtain the color shift degree of the first target block includes the following specific methods:

[0013] Obtaining the values ​​of all color components of all pixels of any first target block;

[0014] Obtaining the degree of skewness of any color component in any first target block;

[0015] The degree of skewness of each color component in the first target block is added together to obtain the degree of color skewness of the first target block.

[0016] Furthermore, the specific method for obtaining the degree of skewness of any color component in any first target block is:

[0017] The skewness of any color component in any first target block is calculated, and the skewness is directly proportional to the degree of skewness of the color component in the first target block.

[0018] Furthermore, the brightness balance degree of the type II commodity image is obtained according to the brightness difference between all the second target blocks in any type II commodity image and the type II commodity image, including the specific method of:

[0019] The average value of the V channel values ​​of all pixels of any Type II commodity image is recorded as the average brightness of the Type II commodity image; the average value of the V channel values ​​of all pixels in any second target block is recorded as the average brightness of the second target block; the average brightness of any second target block in any Type II commodity image is subtracted from the average brightness of the Type II commodity image, and the absolute value is taken to obtain the brightness difference between the second target block and the Type II commodity image to which it belongs; the brightness differences of all second target blocks of any Type II commodity image and the Type II commodity image to which it belongs are summed, and the inverse is taken to obtain the brightness balance degree of the Type II commodity image.

[0020] Furthermore, the overall directionality of any third target block is obtained according to the gradient information of all pixels of the third target block, including the specific method of:

[0021] Acquire a plurality of discrete angles and corresponding numbers of significant pixels of any third target block, and construct a discrete angle-significant pixel number coordinate system of the third target block, wherein the discrete angle-significant pixel number coordinate system includes a plurality of data points, each data point corresponding to a discrete angle and a corresponding number of significant pixels;

[0022] Using the least squares method, several data points in the discrete angle-significant pixel number coordinate system are fitted into a discrete angle-significant pixel number curve, and the curve between any adjacent minimum values ​​in the discrete angle-significant pixel number curve is recorded as a wave, and the maximum value of each wave is recorded as a peak, so as to obtain several waves and corresponding peaks of the discrete angle-significant pixel number curve;

[0023] The method for obtaining the directionality of any third target block is:

[0024]

[0025] in, Indicates the directionality of any third target block; Indicates the number of peaks of the discrete angle-significant pixel number curve of any third target block; Indicates the first The number of discrete angles of a wave; Indicates the first The first wave Discrete angles, Indicates the first The discrete angle corresponding to the peak of each wave; Indicates the first The first wave The number of significant pixels corresponding to discrete angles, Represents the normalization function.

[0026] Furthermore, the specific method of obtaining a plurality of discrete angles and corresponding numbers of significant pixels of any third target block and forming a discrete angle-significant pixel number coordinate system of the third target block is:

[0027] The Sobel operator is used to calculate each block of all Type III product images to obtain the horizontal and vertical changes at each pixel point of each Type III product image;

[0028] Record any pixel point in the third target block as the target pixel point;

[0029] Calculate the average of the horizontal direction change and the vertical direction change at the target pixel point as the modulus of the gradient vector at the target pixel point;

[0030] Compare the vertical change and horizontal change at the target pixel point, use the inverse function of the tangent function, and then add , obtain the direction of the gradient vector at the target pixel;

[0031] Obtain the direction and modulus of the gradient vector at all pixel points in the third target block, discretize the direction of the gradient vector at all pixel points in the third target block using the equal width method to obtain a number of discrete angles, obtain the pixel points included in each discrete angle and the modulus of the gradient vector at the corresponding pixel points; obtain the number of pixel points whose modulus of the gradient vector at the pixel points included in each discrete angle is greater than the preset fifth parameter, and record it as the number of significant pixel points corresponding to each discrete angle;

[0032] by A discrete angle-significant pixel number coordinate system is established with θ as the coordinate origin, the discrete angle as the positive direction of the horizontal axis, and the number of significant pixels corresponding to each discrete angle as the positive direction of the vertical axis.

[0033] Furthermore, the method of obtaining a plurality of texture blocks of any type III commodity image by overall directional screening, screening the color skewness of all texture blocks and then fusing them to obtain the texture complexity of the type III commodity image includes the following specific methods:

[0034] Recording the third target block whose overall directionality is greater than the preset sixth parameter as a texture block;

[0035] Obtain all the peaks of the discrete angle-significant pixel number curve of any texture block, calculate the skewness of the significant pixel points corresponding to the discrete angle of any color component corresponding to any peak, and record it as the skewness of the discrete angle corresponding to any peak of any color component; add the skewness of the discrete angle corresponding to any peak of all color components, and record it as the color skewness of the discrete angle corresponding to any peak; add the color skewness of the discrete angle corresponding to all peaks to obtain the color skewness of the texture block; the color skewness of the texture block is in direct proportion to the color skewness degree of the texture block;

[0036] The directionality of all texture blocks in any type III commodity image whose color skewness is greater than the preset seventh parameter is added together to obtain the texture complexity of the type III commodity image.

[0037] Furthermore, the color shift degree, brightness balance degree, and texture complexity of all blocks of any product image are merged to obtain the characteristic index of the product image, including the specific method of:

[0038] For any product image, the color skew degree of all the first target blocks corresponding to the type I product image is added to obtain the color skew degree of the product image. The color skew degree of the product image is proportional to the characteristic index of the product image; the brightness balance degree of the product image corresponding to the type II product image is inversely proportional to the characteristic index of the product image; the texture complexity of the product image corresponding to the type III image is inversely proportional to the characteristic index of the product image.

[0039] Furthermore, the method of classifying the commodity images by using the characteristic index of the commodity images includes the following specific methods:

[0040] The feature index of the product image is used as a label, and the product image is subjected to a cross entropy loss function and a stochastic gradient descent algorithm to train a deep neural network, so that the cross entropy loss function converges to obtain a trained deep neural network. The trained deep neural network is used to obtain the feature index of a new product image, and the product image whose feature index is greater than or equal to a preset first hyperparameter is recorded as the merchant's product image, and the product image whose feature index is less than the preset first hyperparameter is recorded as the user's product image.

[0041] An embodiment of the present invention provides a data classification system based on deep learning, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any one of the steps of the data classification method based on deep learning when executing the computer program.

[0042] The beneficial effect of the technical solution of the present invention is: considering the color breadth difference, brightness difference, and product flatness difference of the product image of the merchant and the product image of the user, respectively obtaining the color deviation degree, brightness balance degree, and texture complexity of the product image, and then comprehensively obtaining the characteristic index of the product image, fully considering the different factors of the merchant and the user when shooting the product. Then, according to the characteristic index of the product image, all product images are classified through deep learning, the characteristics of the data itself are analyzed, and the classification accuracy and efficiency of the product image are greatly improved. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0044] Figure 1 This is a flowchart of the steps of a data classification method based on deep learning of the present invention.

[0045] Figure 2 A schematic diagram of a discrete angle-significant pixel number coordinate system and curve of a data classification method based on deep learning of the present invention. DETAILED DESCRIPTION

[0046] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of a data classification method and system based on deep learning proposed by the present invention, its specific implementation method, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0047] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0048] The following is a detailed description of a data classification method and system based on deep learning provided by the present invention in conjunction with the accompanying drawings.

[0049] See also Figure 1 , which shows a flowchart of a data classification method based on deep learning provided by an embodiment of the present invention, the method comprising the following steps:

[0050] Step S001: obtaining a plurality of product images of any product, as well as type I product images, type II product images, and type III product images in RGB color space, HSV color space, and grayscale space, respectively.

[0051] It should be noted that due to the rapid development of the Internet and e-commerce platforms, consumers often first choose to search for the same product on major e-commerce platforms, whether they see a product they like in real life or in advertisements. However, the search results are often promotional pictures that have been carefully taken and edited by the merchants, and the evaluation pictures of other consumers who have purchased the same product are mostly hidden. This can easily mislead consumers and prevent them from getting the real product pictures taken by other consumers, so we first need to collect different images of the same product provided by buyers and sellers.

[0052] It should be noted that this embodiment uses clothing products.

[0053] Specifically, in order to implement a data classification method based on deep learning proposed in this embodiment, it is first necessary to collect a commodity image of a commodity. The specific process is as follows:

[0054] Use crawler tools to obtain several product images of a product on e-commerce platforms and social platforms, and record the product images in RGB color space as Type I product images; convert all Type I product images into several product images in HSV color space, which are recorded as Type II product images; and grayscale all Type I product images, and record the resulting images as Type III product images.

[0055] It should be noted that each product image has a unique corresponding type I product image, type II product image, and type III product image.

[0056] So far, a commodity image of a commodity is obtained through the above method.

[0057] Step S002: Divide any type I product image and type II product image into blocks respectively to obtain a plurality of first target blocks of the type I product image and a plurality of second target blocks of the type II product image; obtain the color shift degree of the first target block by combining the values ​​of all color components of all pixels in any first target block; obtain the brightness balance degree of the type II product image according to the difference between the V channel values ​​of all pixels in each second target block and the V channel values ​​of all pixels of the type II product image to which the second target block belongs.

[0058] It should be noted that when merchants shoot promotional pictures or advertising images for clothing, they will use models with suitable figures, use professional cameras to shoot high-resolution images under appropriate fill-light conditions, and may also use photo editing software to enhance the images. However, most images taken by consumers have different light environments, and are often in low-light environments, which will cause deviations in the overall color of the image. Therefore, it is possible to determine whether a product image is from a seller or a buyer by the color richness and brightness of the product image.

[0059] Specifically, in step 2.1, any type I product image and type II product image are divided into blocks respectively to obtain a plurality of first target blocks of the type I product image and a plurality of second target blocks of the type II product image.

[0060] For all Type I product images, The size of the blocks is divided into several first target blocks; all type II product images are divided into The size of the target blocks is divided into blocks to obtain a plurality of second target blocks.

[0061] Said and The first parameter and the second parameter are preset respectively.

[0062] It should be noted that the smaller the block size, the better the feature expression, but it will affect the calculation speed. The larger the block size, the worse the feature expression, and the faster the calculation speed.

[0063] It should be noted that based on experience and They are 16 and 16 respectively, which can be adjusted according to actual conditions and are not specifically limited in this embodiment.

[0064] Step 2.2, combining the values ​​of all color components of all pixels in any first target block to obtain the color shift degree of the first target block.

[0065] First, the values ​​of all color components of all pixels of any first target block are obtained.

[0066] It should be noted that the type I product image is a product image in the RGB color space, so any pixel point of the target block has three color components.

[0067] Secondly, according to the skewness of any color component in any first target block, the skewness of the color component in the first target block is obtained.

[0068] The skewness of any color component in any first target block is directly proportional to the skewness of the color component in the first target block.

[0069] It should be noted that the degree of skewness of any color component in the first target block represents the distribution range of the color component. The greater the degree of skewness of the color component in the first target block, that is, the greater the difference between the values ​​of the color component of all pixels in the first target block and the average value of the color component in the first target block, the wider the value range of the color component, and thus the larger the distribution range of the color component.

[0070] It should be noted that the third-order central moment of the numerical value of the color component defines the skewness of the color component, which is an existing algorithm, and thus will not be described in detail in this embodiment.

[0071] Finally, the degree of skewness of each color component in the first target block is added to obtain the degree of color skewness of the first target block.

[0072] Step 2.3, obtaining the brightness balance degree of the type II product image according to the brightness difference between all the second target blocks in any type II product image and the type II product image.

[0073] It should be noted that the images obtained by the camera are all in RGB color space, and the RGB model cannot intuitively obtain indicators such as saturation and brightness. Therefore, to analyze the brightness of the product, the product image in the HSV color space, that is, the type II product image, should be used.

[0074] It should be noted that to obtain the brightness balance of the product image, it is necessary to compare the brightness differences of different areas in the Type II product image corresponding to the product image, that is, the differences in the V channel values. If the brightness of each block is similar to the overall brightness of the Type II product image, then the brightness balance of the Type II product image will be greater.

[0075] Specifically, the average value of the V channel values ​​of all pixels of any Type II commodity image is recorded as the average brightness of the Type II commodity image; the average value of the V channel values ​​of all pixels in any second target block is recorded as the average brightness of the second target block; the average brightness of any second target block in any Type II commodity image is subtracted from the average brightness of the Type II commodity image, and the absolute value is taken to obtain the brightness difference between the second target block and the Type II commodity image to which it belongs; the brightness differences of all second target blocks of any Type II commodity image and the Type II commodity image to which it belongs are summed, and the inverse is taken to obtain the brightness balance degree of the Type II commodity image.

[0076] It should be noted that the V channel value of any pixel point represents the brightness of the pixel point, so the average brightness of the second target block can be obtained by the average of the V channel values ​​of all pixels in the second target block, and the average brightness of any Type II product image can be obtained by the average of the V channel values ​​of all pixels of the Type II product image.

[0077] So far, the color skew degree of any first target block of any type I commodity image and the brightness balance degree of the type II commodity image are obtained through the above method.

[0078] Step S003: Divide any type III commodity image into blocks to obtain a number of third target blocks; obtain the overall directionality of the third target block according to the gradient information of all pixel points of any third target block; obtain a number of texture blocks of any type III commodity image through overall directionality screening, screen the color skewness of all texture blocks and then merge them to obtain the texture complexity of the type III commodity image.

[0079] It should be noted that, at the same time, the product also has texture features. The surface of the clothes itself will have pattern textures. The surface patterns of the same clothes photographed by users and merchants are the same. The difference between the two is that the images taken by merchants, whether worn by models or displayed in the air, are all flat. In the images taken by users, the clothes often have folds, wrinkles, etc. In this case, more textures will appear in the image. And the folds and wrinkles on the surface of the clothes have obvious directions and are concentrated.

[0080] It should be noted that the direction of the texture can be determined by the direction of the grayscale gradient in the grayscale image of the product image, that is, the type III product image, and the obviousness of the texture can be determined according to the concentration of the gradient.

[0081] Specifically, in step 3.1, any type III product image is divided into blocks to obtain a plurality of third target blocks.

[0082] For any type III product image, The image is divided into blocks of the size of , and a plurality of third target blocks of any type III product image are obtained.

[0083] Said and The third parameter and the fourth parameter are preset respectively.

[0084] It should be noted that based on experience and They are 15 and 15 respectively, which can be adjusted according to actual conditions and are not specifically limited in this embodiment.

[0085] Step 3.2: Obtain the overall directionality of any third target block based on the gradient information of all pixels of the third target block.

[0086] First, the Sobel operator is used to calculate each block of all Type III product images to obtain the horizontal and vertical changes at each pixel point of each Type III product image.

[0087] It should be noted that the Sobel operator is an existing edge detection algorithm, and thus is not described in detail in this embodiment.

[0088] Secondly, the horizontal direction variation and the vertical direction variation of any block of any type III commodity image are fused to obtain the gradient direction and magnitude of the gradient vector at each pixel point in any block of the type III commodity image.

[0089] Record any pixel point in the third target block as the target pixel point;

[0090] As an embodiment, the method for obtaining the modulus of the gradient vector at the target pixel point is:

[0091]

[0092] in, Represents the modulus of the gradient vector at the target pixel; Indicates the horizontal change at the target pixel. Indicates the vertical change at the target pixel.

[0093] As an embodiment, a method for obtaining the direction of the gradient vector at the target pixel point is:

[0094]

[0095] in, Indicates the direction of the gradient vector at the target pixel; Indicates the horizontal change at the target pixel. Indicates the vertical change at the target pixel; Represents the inverse function of the tangent function.

[0096] Then, the discrete angle-significant pixel number coordinate system is obtained.

[0097] Obtain the direction and modulus of the gradient vector at all pixel points in the third target block, discretize the direction of the gradient vector at all pixel points in the third target block using the equal-width method to obtain several discrete angles, obtain the pixels included in each discrete angle and the modulus of the gradient vector at the corresponding pixel points; obtain the number of pixels whose modulus of the gradient vector at the pixel points included in each discrete angle is greater than the preset fifth parameter, and record it as the number of significant pixels corresponding to each discrete angle.

[0098] by A discrete angle-significant pixel number coordinate system is established with θ as the coordinate origin, the discrete angle as the positive direction of the horizontal axis, and the number of significant pixels corresponding to each discrete angle as the positive direction of the vertical axis.

[0099] It should be noted that the fifth parameter is preset to 30 based on experience, and can be adjusted according to actual conditions, and is not specifically limited in this embodiment.

[0100] Finally, the overall directionality of the third target block is obtained according to the data change of the discrete angle-significant pixel number coordinate system data of the third target block.

[0101] Using the least squares method, several data points in the discrete angle-significant pixel number coordinate system are fitted into a discrete angle-significant pixel number curve, and the curve between any adjacent minimum values ​​in the discrete angle-significant pixel number curve is recorded as a wave, and the maximum value of each wave is recorded as a peak, so as to obtain several waves and corresponding peaks of the discrete angle-significant pixel number curve.

[0102] It should be noted that there are several peaks in the discrete angle-significant pixel number curve, and correspondingly there are several waves. The waveform and peak of each wave reflect the overall characteristics of the discrete angle-significant pixel number curve. The texture of the commodity image has obvious directionality. Therefore, the number of significant pixels corresponding to each discrete angle is different, and for the texture direction, the number of significant pixels corresponding to the corresponding discrete angle should have more prominent characteristics, and the difference is large from the number of significant pixels corresponding to the adjacent discrete angles. That is, the number of significant pixels corresponding to the discrete angle corresponding to the texture direction is the peak, and the more prominent and sharp the peak, the higher the sharpness of the peak of the directional gradient histogram, and the clearer the overall directionality of the third target block.

[0103] Therefore, the sharpness of the peak of the discrete angle-significant pixel number curve of the third target block can be obtained by the difference in the number of corresponding significant pixels of each wave at each discrete angle in the discrete angle-significant pixel number coordinate system of the third target block.

[0104] The schematic diagram of the discrete angle-significant pixel number coordinate system and curve is as follows Figure 2 shown.

[0105] As an embodiment, a method for obtaining the directionality of any third target block is:

[0106]

[0107] in, Indicates the directionality of any third target block; Indicates the number of peaks of the discrete angle-significant pixel number curve of any third target block; Indicates the first The number of discrete angles of a wave; Indicates the first The first wave Discrete angles, Indicates the first The discrete angle corresponding to the peak of each wave; Indicates the first The first wave The number of significant pixels corresponding to discrete angles, Represents the normalization function.

[0108] It should be noted that if the difference between the values ​​on both sides of a peak and the peak value is larger, it means that the peak is narrower, the peak is sharper, and the directionality is stronger. This means that for the peak , calculate the sum of the squares of the differences between all discrete angles in the wave and the discrete angle corresponding to the peak, and then multiply it by That is, the number of significant pixels corresponding to the discrete angle. The larger it is, the greater the difference between the values ​​on both sides of a peak in the discrete angle-significant pixel number curve and the peak, which means the steeper the wave is, that is, the more gradient vectors in the third target block have similar directions, the stronger the directionality of the pixel distribution in the third target block, that is, the more obvious the texture is.

[0109] Step 3.3, obtain several texture blocks of any type III commodity image through overall directionality screening, screen the color skewness of all texture blocks and then merge them to obtain the texture complexity of the type III commodity image.

[0110] It should be noted that the characteristics of clothing images can be further analyzed: the texture of the clothing surface is not only due to folds and wrinkles, but also very likely to be patterns and designs that exist on the clothing surface itself. Therefore, it is necessary to screen several blocks of any type III product image. Specifically, because patterns and designs have color changes along the texture direction, and the color consistency of folds and wrinkles is likely to be high, screening can be performed based on the directionality of the blocks.

[0111] First, the blocks whose directionality of the third target blocks is greater than the preset sixth parameter are recorded as texture blocks;

[0112] It should be noted that the sixth parameter is preset to 0.5 based on experience and can be adjusted according to actual conditions, and is not specifically limited in this embodiment.

[0113] Secondly, the color skewness of any texture block is obtained.

[0114] Specifically, all the peaks of the discrete angle-significant pixel number curve of any texture block are obtained, and the skewness of the significant pixel points corresponding to the discrete angle corresponding to any color component at any peak is calculated, which is recorded as the skewness of the discrete angle corresponding to any color component at any peak; the skewness of the discrete angles corresponding to all color components at any peak is added, which is recorded as the color skewness of the discrete angle corresponding to any peak; the color skewness of the discrete angles corresponding to all peaks is added to obtain the color skewness of the texture block; the color skewness of the texture block is directly proportional to the degree of color skewness of the texture block.

[0115] Finally, the directionality of all texture blocks in any type III commodity image whose color skewness is greater than the preset seventh parameter is added to obtain the texture complexity of the type III commodity image.

[0116] It should be noted that the seventh parameter is preset to 0.5 based on experience and can be adjusted according to actual conditions, and is not specifically limited in this embodiment.

[0117] So far, the texture complexity of any type III commodity image is obtained through the above method.

[0118] Step S004: The color shift degree, brightness balance degree, and texture complexity of all blocks of any product image are merged to obtain a characteristic index of the product image.

[0119] It should be noted that the feature index of a product image is used to describe whether the product image comes from a merchant or a user. The greater the possibility that the product image comes from a merchant, the greater the feature index of the product image.

[0120] It should be noted that, for any product image, the color skewness of all blocks in the corresponding Type I product image, the brightness balance of the corresponding Type II product image, and the texture complexity of the corresponding Type III product image together reflect the characteristics of the product image. The color skewness of all blocks in the corresponding Type I product image reflects the color richness of the product image, and the color of the image taken by the merchant is richer; the brightness balance of the corresponding Type II product image reflects the lighting balance of the product image, and the lighting of the image taken by the merchant is relatively more balanced; the texture complexity of the corresponding Type III product image reflects the degree of texture such as wrinkles and folds in the product image, and the image taken by the merchant has relatively less texture.

[0121] Therefore, for any product image, the characteristic index of the product image can be obtained by fusing the color skewness of all blocks in the corresponding type I product image, the brightness balance of the corresponding type II product image, and the texture complexity of the corresponding type III product image.

[0122] As an embodiment, a method for obtaining a feature index of any product image is as follows:

[0123]

[0124] in, Indicates Feature index of product images; Indicates The first one in the I-type product image corresponding to the product image The color skewness of each block, Indicates The number of blocks in the I-type product image corresponding to the product image; Indicates The brightness balance degree of the type II product images corresponding to the product images; Indicates The texture complexity of type III product images corresponding to product images.

[0125] It should be noted that Indicates The color skewness of all blocks in the I-type product image corresponding to the product image is added up to show the The overall color skewness of a product image.

[0126] So far, the feature index of any product image is obtained through the above method.

[0127] Step S005: classify the commodity images using their characteristic indexes.

[0128] Specifically, any product image is taken as a sample, the feature index of the product image is taken as the label of the corresponding sample, and a set formed by several labeled samples is taken as a data set for training a deep neural network. The data set is used to train the deep neural network according to a cross entropy loss function and a stochastic gradient descent algorithm to make it converge to obtain a trained deep neural network. The trained deep neural network is used to obtain the feature index of a new product image. The product image whose feature index is greater than or equal to a preset first hyperparameter is recorded as the merchant's product image, and the product image whose feature index is less than the preset first hyperparameter is recorded as the user's product image.

[0129] It should be noted that the first hyperparameter is preset to 0.5 based on experience and can be adjusted according to actual conditions, and is not specifically limited in this embodiment.

[0130] It should be noted that the task in this embodiment is a binary classification, and the ultimate goal is to classify product images into two types, users and merchants. Therefore, in conventional supervised learning, it is necessary to manually add clear "hard labels" of users or merchants to all images in the data set. In this embodiment, the characteristic index of the product image is used to reflect the possibility that the image belongs to a merchant or a user. Using the characteristic index of the product image as a classification label is not like the original supervised learning that clearly tells the neural network which category a certain data belongs to, but uses the size of the characteristic index of the product image as a "soft label" of the possibility of belonging to a certain category. Compared with traditional supervised learning, this saves a lot of manpower. At the same time, compared with traditional unsupervised learning, due to the accurate extraction of image data features, it greatly improves the accuracy and training time.

[0131] Through the above steps, data classification based on deep learning is completed.

[0132] An embodiment of the present invention provides a deep learning-based data classification system, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any one of the steps of the deep learning-based data classification method when executing the computer program.

[0133] This embodiment considers the color breadth difference, brightness difference, and product flatness difference between the merchant's product images and the user's product images, and obtains the color deviation degree, brightness balance degree, and texture complexity of the product images respectively, and then comprehensively obtains the characteristic index of the product images, fully considering the different factors of the merchant and the user when taking pictures of the products. Then, according to the characteristic index of the product image, all product images are classified through deep learning, and the characteristics of the data itself are analyzed, which greatly improves the classification accuracy and efficiency of the product images.

[0134] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A data classification method based on deep learning, characterized in that: The method comprises the following steps: Obtain several product images of any product, as well as type I product images, type II product images, and type III product images in RGB color space, HSV color space, and grayscale space respectively; Divide any type I product image and type II product image into blocks respectively to obtain a number of first target blocks of the type I product image and a number of second target blocks of the type II product image; obtain the color shift degree of the first target block by combining the values ​​of all color components of all pixels in any first target block; obtain the brightness balance degree of the type II product image according to the brightness difference between all second target blocks in any type II product image and the type II product image; Divide any type III commodity image into blocks to obtain a number of third target blocks; obtain the overall directionality of the third target block according to the gradient information of all pixel points of any third target block; obtain a number of texture blocks of any type III commodity image by screening the overall directionality, screen the color skewness of all texture blocks and then merge them to obtain the texture complexity of the type III commodity image; The color shift degree, brightness balance degree, and texture complexity of all blocks of any product image are merged to obtain the characteristic index of the product image; The product images are classified using their feature indexes.

2. According to claim 1, a data classification method based on deep learning is characterized in that: The method of synthesizing the values ​​of all color components of all pixels in any first target block to obtain the color shift degree of the first target block includes: Obtaining the values ​​of all color components of all pixels of any first target block; Obtaining the degree of skewness of any color component in any first target block; The degree of skewness of each color component in the first target block is added to obtain the degree of color skewness of the first target block.

3. According to claim 2, a data classification method based on deep learning is characterized in that: The specific method for obtaining the degree of skewness of any color component in any first target block is: The skewness of any color component in any first target block is calculated, and the skewness is directly proportional to the degree of skewness of the color component in the first target block.

4. According to the data classification method based on deep learning in claim 1, it is characterized in that: The step of obtaining the brightness balance degree of the type II commodity image according to the brightness difference between all the second target blocks in any type II commodity image and the type II commodity image includes the following specific methods: The average value of the V channel values ​​of all pixels of any Type II commodity image is recorded as the average brightness of the Type II commodity image; the average value of the V channel values ​​of all pixels in any second target block is recorded as the average brightness of the second target block; the average brightness of any second target block in any Type II commodity image is subtracted from the average brightness of the Type II commodity image, and the absolute value is taken to obtain the brightness difference between the second target block and the Type II commodity image to which it belongs; the brightness differences of all second target blocks of any Type II commodity image and the Type II commodity image to which it belongs are summed, and the inverse is taken to obtain the brightness balance degree of the Type II commodity image.

5. The data classification method based on deep learning according to claim 1, characterized in that: The method of obtaining the overall directionality of the third target block according to the gradient information of all pixels of any third target block includes: Acquire a plurality of discrete angles and corresponding numbers of significant pixels of any third target block, and construct a discrete angle-significant pixel number coordinate system of the third target block, wherein the discrete angle-significant pixel number coordinate system includes a plurality of data points, each data point corresponding to a discrete angle and a corresponding number of significant pixels; Using the least squares method, several data points in the discrete angle-significant pixel number coordinate system are fitted into a discrete angle-significant pixel number curve, and the curve between any adjacent minimum values ​​in the discrete angle-significant pixel number curve is recorded as a wave, and the maximum value of each wave is recorded as a peak, so as to obtain several waves and corresponding peaks of the discrete angle-significant pixel number curve; The method for obtaining the directionality of any third target block is: in, Indicates the directionality of any third target block; Indicates the number of peaks of the discrete angle-significant pixel number curve of any third target block; Indicates the first The number of discrete angles of a wave; Indicates the first The first wave Discrete angles, Indicates the first The discrete angle corresponding to the peak of each wave; Indicates the first The first wave The number of significant pixels corresponding to discrete angles, Represents the normalization function.

6. The data classification method based on deep learning according to claim 5, characterized in that: The specific method of obtaining a plurality of discrete angles and corresponding numbers of significant pixels of any third target block and forming a discrete angle-significant pixel number coordinate system of the third target block is: The Sobel operator is used to calculate each block of all Type III product images to obtain the horizontal and vertical changes at each pixel point of each Type III product image; Record any pixel point in the third target block as the target pixel point; Calculate the average of the horizontal direction change and the vertical direction change at the target pixel point as the modulus of the gradient vector at the target pixel point; Compare the vertical change and horizontal change at the target pixel point, and use the inverse function of the tangent function to compare the value. , obtain the direction of the gradient vector at the target pixel; Obtain the direction and modulus of the gradient vector at all pixel points in the third target block, discretize the direction of the gradient vector at all pixel points in the third target block using the equal width method to obtain a number of discrete angles, and obtain the pixel points included in each discrete angle and the modulus of the gradient vector at the corresponding pixel point; Obtain the number of pixels whose magnitude of the gradient vector at the pixel points included in each discrete angle is greater than the preset fifth parameter, and record it as the number of significant pixel points corresponding to each discrete angle; by A discrete angle-significant pixel number coordinate system is established with θ as the coordinate origin, the discrete angle as the positive direction of the horizontal axis, and the number of significant pixels corresponding to each discrete angle as the positive direction of the vertical axis.

7. The data classification method based on deep learning according to claim 5, characterized in that: The method of obtaining a plurality of texture blocks of any type III commodity image by overall directional screening, screening the color skewness of all texture blocks and then fusing them to obtain the texture complexity of the type III commodity image includes the following specific methods: Recording the third target block whose overall directionality is greater than the preset sixth parameter as a texture block; Obtain all the peaks of the discrete angle-significant pixel number curve of any texture block, calculate the skewness of the significant pixel corresponding to the discrete angle of any color component corresponding to any peak, and record it as the skewness of the discrete angle corresponding to any color component at any peak; Add the skewness of all color components at discrete angles corresponding to any wave crest, and record it as the color skewness of the discrete angle corresponding to any wave crest; add the color skewness of the discrete angles corresponding to all wave crests to obtain the color skewness of the texture block; the color skewness of the texture block is in direct proportion to the degree of color skewness of the texture block; The directionality of all texture blocks in any type III commodity image whose color skewness is greater than the preset seventh parameter is added together to obtain the texture complexity of the type III commodity image.

8. The data classification method based on deep learning according to claim 1, characterized in that: The color shift degree, brightness balance degree, and texture complexity of all blocks of any product image are merged to obtain the characteristic index of the product image, including the specific method of: For any product image, the color skew degree of all the first target blocks corresponding to the type I product image is added to obtain the color skew degree of the product image. The color skew degree of the product image is proportional to the characteristic index of the product image; the brightness balance degree of the product image corresponding to the type II product image is inversely proportional to the characteristic index of the product image; the texture complexity of the product image corresponding to the type III image is inversely proportional to the characteristic index of the product image.

9. The data classification method based on deep learning according to claim 1, characterized in that: The specific method of classifying the commodity images by using the characteristic index of the commodity images is as follows: The feature index of the product image is used as a label, and the product image is subjected to a cross entropy loss function and a stochastic gradient descent algorithm to train a deep neural network, so that the cross entropy loss function converges to obtain a trained deep neural network. The trained deep neural network is used to obtain the feature index of a new product image, and the product image whose feature index is greater than or equal to a preset first hyperparameter is recorded as the merchant's product image, and the product image whose feature index is less than the preset first hyperparameter is recorded as the user's product image.

10. A data classification system based on deep learning, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Commodity classification method for fusion attention graph

    CN108229430A

  • Waste textile classification method based on image processing

    CN115082741A