A commodity classification method based on adaptive polynomial basis
By using an adaptive multinomial basis spectral neural network, the problem of insufficient performance in product classification in existing technologies is solved, and more efficient product classification results are achieved.
Patent Information
- Application Number
- CN202310904160.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-21
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2043-07-21
AI Technical Summary
Existing graph neural network models are insufficient in performance when processing product networks, especially those with dissimilar graph structures, making it difficult to effectively classify products.
A spectral neural network with adaptive multinomial basis is used to construct a commodity transaction graph structure, encode commodity features using a pre-trained Chinese BERT model, transform and classify commodity features using an adaptive multinomial filter, and optimize model parameters by combining the cross-entropy loss function.
It improves classification performance on non-matching product networks, achieving more efficient product classification results.
Smart Images

Figure CN116756655B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of e-commerce network, and particularly relates to a commodity classification method based on adaptive polynomial basis. BACKGROUND
[0002] With the advent of the big data era, the amount of data is growing rapidly, and the types of data are more diverse, including both sequential data such as images and texts, and graph data such as social networks and biological protein molecules. Graph data is usually represented as a binary tuple containing a set of nodes and edges, where nodes represent objects of interest and edges represent the association between objects. For example, a social network can be composed of users (nodes) and their interaction relationships (edges), and a protein network can be composed of molecules (nodes) and their chemical bonds (edges). Considering the topological association between nodes, a neural network can be called a graph neural network. Currently, graph neural networks have achieved excellent performance in tasks such as graph node classification and graph classification. In practical applications, graph neural networks are widely used in biological molecule property prediction, social network data mining, fraud identification, and recommendation system design, and can also be found in real modeling of physical and chemical systems.
[0003] From the perspective of graph structure data, commodities constitute nodes, and they are connected by the "commonly purchased" relationship to form a commodity network. Running a graph neural network on the commodity network can obtain vectors of commodity nodes, which can be further used for commodity classification for multiple purposes. For example, e-commerce platforms can classify commodities according to their popularity to provide ideas for subsequent product selection, or classify whether commodities are suitable for specific groups of people as a part of commodity recommendation.
[0004] It is worth noting that the commodity network built by the above-mentioned simultaneous purchase relationship may not meet the general graph neural network basis: the same matching assumption. The same matching assumption means that two nodes connected by an edge on a graph network tend to have the same label. For example, still considering the classification target of predicting the popularity of commodities, assuming that a user purchases a popular hot-selling product A and a less popular product B for a one-time transaction, a transaction behavior establishes an edge between product A and product B, but obviously, product A and product B should not belong to the same classification label, which does not meet the "same matching assumption".
[0005] Considering that the commodity network tends to be non-homophilic, spectral graph neural networks are more suitable for use in commodity classification scenarios. Spectral graph neural networks decompose the graph structure to obtain graph signals of different base frequencies. The higher the frequency of the signal, the faster the changes between nodes. By emphasizing high-frequency signals, spectral graph neural networks can often achieve much higher performance than general graph neural networks on non-homophilic graphs. Therefore, how to design spectral graph neural networks for the above scenarios is a problem worth considering.
[0006] The prior art is based on a generalized PageRank graph neural network. This model belongs to the polynomial filter of the spectral graph neural network, which is easy to calculate. The following describes a specific scheme for commodity classification using the generalized PageRank graph neural network.
[0007] For a constructed commodity transaction graph structure G, each commodity node has a vector to describe the characteristics of the commodity itself, and all node characteristics are collectively denoted as matrix X. First, the generalized PageRank graph neural network performs feature transformation on the commodity's own characteristics X. This process is completed using a fully connected neural network; then K times of graph propagation is performed on the transformed features using the generalized PageRank technique, and the results of multiple graph propagations are weighted together. This process can be expressed as where P represents the normalized adjacency matrix, and w represents the learnable coefficient. The key to this step is to learn an effective coefficient w. After graph propagation on the features, the vector representation Y of each commodity node can be obtained, and finally the probability score of each category can be calculated using Y to obtain the predicted score of the commodity in each category.
[0008] The core step of this technology In fact, a monomial basis is used to fit the ideal filter. This polynomial basis is unstable in function fitting.
[0009] The second prior art is a polynomial filter based on a Jacobi graph convolutional neural network (JacobiConv). When used for commodity classification, its process is similar to that of the first technology, but the core convolution step becomes where g k represents the k-th order Jacobi basis. Compared with the first technology, the second technology changes the monomial basis to the Jacobi basis. The Jacobi basis is a family of orthogonal polynomial bases, and its specific form is determined by two parameters between [0, 1].
[0010] The work firstly proves that the polynomial basis which makes the convergence speed of the polynomial filter optimal is the standard orthogonal polynomial basis on a certain measure, but they think that the measure is not available in finite time and on a large graph, so they compromise to choose the appropriate orthogonal polynomial basis from the Jacobian polynomial sequence by hyperparameter selection. As a compromise, firstly, the range of measure functions that the Jacobian basis can cover is narrow and is most likely to not cover the measure of the target optimal polynomial basis; secondly, the Jacobian basis is not a standard orthogonal basis. Therefore, this compromise is far from the original intention of optimizing the polynomial filter model by using the optimal polynomial basis. SUMMARY
[0011] To this end, the present application firstly proposes a commodity classification method based on an adaptive polynomial basis,
[0012] S1, for any commodity and transaction record data, a graph structure G is constructed using transaction information, the nodes of the graph structure are different commodities, and the edges between the nodes represent that two different commodities are purchased or sold at the same time;
[0013] S2, for each commodity node, the commodity name, commodity description, formula, manufacturer and note five text information are spliced together, and a D=768-dimensional vector is obtained through a Chinese pre-trained Bert model encoder as the initial feature of the commodity. Let the number of commodities be N, and the total commodity feature vector be F initial , which has the shape of N rows and D columns;
[0014] S3, the edge weight of the graph structure G is symmetrically normalized, and the normalized adjacency matrix is denoted as
[0015] S4, the F initial is transformed to obtain a new commodity feature matrix F, which has the shape of N rows and d columns; d is the commodity feature dimension after transformation. Specifically, the feature transformation here is a single-layer perception machine, denoted as F = σ (F initial W0+b0), where σ represents a linear rectification function (Linear rectification function, ReLU), W0 is a D row d column matrix, b0 is a 1 row d column row vector, and W0 and b0 are learnable variables to be updated in S10;
[0016] S5, a zero matrix Q with the same shape as F is prepared to carry the filtered and transformed commodity features;
[0017] S6, take out each column in F, i.e. the feature of the product in one channel, and record it as f; meanwhile, take out the corresponding column in Q, record it as q, and use it to carry the feature of the product in this channel after filtering; for each column in F, execute steps MS1-MS10. The behavior of MS1-MS10 can be briefly described as: based on the feature f before filtering, update the feature q after filtering step by step, and write the updated feature q back to the corresponding column in Q. Note that MS1-MS10 contain learnable variables, i.e. weighting coefficients;
[0018] S7, perform feature transformation on the filtered features Q in all dimensions to obtain The shape is N rows and C columns, where C is the number of product categories; specifically, the feature transformation here is a single-layer perception machine, recorded as Where σ is ReLU (same as S4), W1 is a matrix of d rows and C columns, b1 is a row vector of shape 1 row and C column, and W1 and b1 are learnable variables that will be updated in S10;
[0019] S8, perform SoftMax operation on to obtain the predicted score of each product in the C product categories;
[0020] S9, use the softened cross-entropy loss function to measure the loss value of the predicted score and the true category according to the known correct category of the product. Specifically, the cross-entropy loss function is recorded as Where represents the probability score of the model that the ith product belongs to the cth predicted category, the number of products is N, and p ic A soft standard is adopted, and the value criterion is: if the true category of the ith product is c, it is 0.8, otherwise it is
[0021] S10, backpropagate the loss value to obtain the gradient of each learnable variable in S4, S6 and S7 after this round of training;
[0022] S11, update the learnable variables in S4, S6 and S7 using gradient descent method;
[0023] S12, return to S4 and continue training based on the updated learnable parameters. In this process, for the products with labels, the loss between the predicted score and the true category is constantly reduced. When the loss no longer decreases, the training is completed.
[0024] S13, use the trained model for products with unknown categories, and record the prediction result as a product classification table.
[0025] Where MS1-10 are specifically:
[0026] MS1, let the order of the polynomial be K (in practice, K is often chosen to be 10 or 20), and initialize the learnable coefficient vector α = [α0, α1, ..., α2]. K The following calculates the K+1 basic commodity features related to the current dimension commodity features / signals, which are all components of the filtered commodity features;
[0027] MS2 initializes the (1)th basic commodity feature as a vector of all zeros, denoted as...
[0028] MS3, by normalizing the product feature f before filtering, obtains the 0th base product feature, denoted as p0←f / |f|;
[0029] MS4 updates the filtered product feature q. Add the 0th base product feature to z with weight α0, denoted as q←q+α0p0;
[0030] MS5, design variable i=0, records the features that have been calculated and weighted to the i-th base commodity feature;
[0031] MS6, begin calculating the feature p of the (f+1)th base commodity. i+1 The calculated p i exist A graph propagation is performed once, which can be expressed mathematically as follows:
[0032] MS7, in the previous step p i+1 Remove the components with the i-th and i-1-th basic product characteristics from the list;
[0033] MS8, for p in the previous step i+1 Normalization is performed on the middle, and the result is denoted as p. i+1 ←p i+1 / |p i+1 |;Formally obtained the feature p of the (i+1)th basic commodity. i+1 ;
[0034] MS9, utilizing the newly obtained basic commodity feature p i+1 Update the filtered product features q. Add α to q. i+1 p i+1 , denoted as q←q+α i+1 p i+1 ;
[0035] MS10, increment the counter variable by 1, denoted as i←i+1; if i>K, the program stops; otherwise, return to step MS6, continue to calculate the base product features and update the filtered product features q.
[0036] The technical effects to be achieved by this invention are as follows:
[0037] The present solution can efficiently compute a polynomial basis with theoretically optimal convergence property. The concept of optimal polynomial basis has been proposed in prior art II, but it was considered to be intractable to solve within affordable time cost, and thus has not been effectively utilized before. In the present solution, the complexity is only K times of graph propagation per training, which is no different from the filter model with a fixed polynomial basis. This property can improve the performance of the filter model on the non-uniform commodity classification network. BRIEF DESCRIPTION OF DRAWINGS
[0038] Figure 1 Commodity classification method architecture based on adaptive polynomial basis DETAILED DESCRIPTION
[0039] The following is a preferred embodiment of the present application and further describes the technical solutions of the present application in conjunction with the drawings, but the present application is not limited to this embodiment.
[0040] The present application proposes a commodity classification method based on adaptive polynomial basis.
[0041] Through S1-S13, the classification of commodities is realized. The data possessed before the algorithm starts are: commodity information, commodity transaction records, and known categories of some commodities (used for training, manually annotated by product personnel); the expected output is a commodity classification table.
[0042] The specific implementation of each step is as follows:
[0043] S1, for any commodity and transaction record data, a graph structure G is constructed using transaction information, the nodes of the graph structure are different commodities, and the edges between the nodes represent that two different commodities are purchased or sold at the same time;
[0044] S2, for each commodity node, the five pieces of text information of commodity name, commodity description, formula, manufacturer, and note are spliced together, and then encoded by a Chinese pre-trained Bert model encoder to obtain a D=768-dimensional vector as the initial feature of the commodity. Let the number of commodities be N, and the total commodity feature vector be F initial , which has a shape of N rows and D columns;
[0045] S3, the edge weight of the graph structure G is symmetrically normalized, and the normalized adjacency matrix is denoted as
[0046] S4, F initial is transformed to obtain a new commodity feature matrix F, which has a shape of N rows and d columns; d is the commodity feature dimension after transformation. Specifically, the feature transformation here is a single-layer perception machine, denoted as F = σ (F initialW0+b0), where σ denotes a linear rectification function (ReLU), W0is a D-by-d matrix, b0is a 1-by-d row vector, and both W0and b0are learnable variables to be updated in S10;
[0047] S5, prepare a zero matrix Q of the same shape as F, which is used to carry the filtered transformed product features;
[0048] S6, take out each column in F, i.e., the product features in each channel, and record it as f; at the same time, take out the corresponding column in Q, and record it as q, which is used to carry the product features in this channel after filtering; for each column taken out from F, perform steps MS1-MS10. The behavior of MS1-MS10 can be briefly described as: based on the product features f before filtering, gradually update the product features q after filtering, and write the updated product features q back to the corresponding column of Q. Note that the learnable variable, i.e., the weighting coefficient, is involved in steps MS1-MS10;
[0049] S7, perform feature transformation on the filtered product features Q in all dimensions to obtain The shape is N-by-C, where C is the number of product categories; specifically, the feature transformation here is a single-layer perception machine, denoted as where σ is ReLU (same as S4), W1is a d-by-C matrix, b1is a 1-by-C row vector, and both W1and b1are learnable variables to be updated in S10;
[0050] S8, perform SoftMax operation on to obtain the prediction scores of each product in the C product categories;
[0051] S9, use the softened cross-entropy loss function to measure the loss value of the prediction score and the true belonging category according to the known correct category of the product. Specifically, the cross-entropy loss function is denoted as where represents the probability score of the model that the ith product belongs to the cth predicted category, the number of products is N, and p ic A kind of softening standard is adopted, and its value criterion is: if the true category of the ith product is c, it is 0.8, otherwise it is
[0052] S10, perform gradient backpropagation on the loss value to obtain the gradients of the learnable variables in S4, S6 and S7 after this round of training;
[0053] S11, update the learnable variables in S4, S6 and S7 using gradient descent method;
[0054] S12, return to S4, continue training based on the updated learnable parameters. In this process, for the labeled goods, the loss between the predicted score and the real class is constantly reduced. When the loss no longer decreases, the training ends.
[0055] S13, use the trained model for goods of unknown classes, and record the prediction results as a goods classification table.
[0056] Among them, MS1-10 are specifically:
[0057] MS1, set the polynomial order K (in actual application, K is often selected as 10 or 20), initialize the learnable coefficient vector α = [α0, α1, …, αK-1]; Next, calculate K+1 base goods features related to the current dimension goods features / signals, which are all components of the filtered goods features; K
[0058] MS2, initialize the first base goods feature as a zero vector, denoted as
[0059] MS3, by normalizing the pre-filtered goods feature f, get the 0th base goods feature, denoted as p0←f / |f|;
[0060] MS4, update the filtered goods feature q. Add the 0th base goods feature to z with α0 as the weight, denoted as q←q+α0p0;
[0061] MS5, design a number variable i = 0, record the i-th base goods feature that has been calculated and weighted;
[0062] MS6, start calculating the i+1th base goods feature p i+1 . Perform one graph propagation on the i , which can be mathematically expressed as
[0063] MS7, remove the i-th and i-1th base goods features from the p i+1 in the last step;
[0064] MS8, normalize the p i+1 in the last step to get, denoted as p i+1 ←p i+1 / |p i+1 |; formally get the i+1th base goods feature p i+1 ;
[0065] MS9, update the filtered goods feature q using the newly obtained base goods feature p i+1 . Add αi+1 p i+1 , written as q <- q + a i+1 p i+1 ;
[0066] MS10, increment the counter variable, written as i <- i + 1; if i > K, the program stops; otherwise, return to step MS6 to continue calculating the base item features and updating the filtered item features q.
Claims
1. A product classification method based on adaptive polynomial basis, characterized in that: The product classification is achieved through steps S1-S13, specifically as follows: S1. For any commodity and transaction record data, construct a graph structure G using the transaction information. The nodes of this graph structure are different commodities, and the edges between the nodes indicate that two different commodities are bought or sold at the same time. S2, for each product node, concatenate the five text information items: product name, product description, recipe, manufacturer, and remarks. After passing through the pre-trained BERT model encoder (for Chinese characters), obtain a D=768-dimensional vector, which serves as the initial feature describing the product. Let N be the number of products and F be the total product feature vector. initial Its shape is N rows and D columns; S3, perform symmetric normalization on the edge weights of the graph structure G, and the normalized adjacency matrix is denoted as... S4, for F initial Perform feature transformation to obtain a new product feature matrix F, which has an N-row, d-column shape; d is the dimension of the product features after transformation. S5. Prepare a zero matrix Q with the same shape as F to carry the filtered product features. S6, sequentially extract each column of F, i.e. the product features of one channel, denoted as f; at the same time, extract the corresponding column of Q, denoted as q, to carry the product features of this channel after filtering; for each column extracted from F, based on the product features f before filtering, gradually update the product features q after filtering, and write the updated product features q back to the corresponding column of Q; S7, perform feature transformation again on the filtered product features Q across all dimensions, to obtain... Its shape is N rows and C columns, where C is the number of product categories; S8, for Perform a SoftMax operation to obtain the predicted scores for each product across a total of C product categories; S9 uses the softened cross-entropy loss function to measure the loss value between the predicted score and the true category of the product based on the known correct category of the product. S10, perform gradient backpropagation on the loss value to obtain the gradients of each learnable variable in S4, S6 and S7 after this round of training. S11, use gradient descent to update the learnable variables in S4, S6, and S7; S12, return to S4, and continue training based on the updated learnable parameters; S13, apply the trained model to products of unknown categories, and record the prediction results as a product classification table.
2. The product classification method based on adaptive polynomial basis as described in claim 1, characterized in that: The specific method for progressively updating the filtered product features q based on the unfiltered product features f, and writing the updated product features q back to the corresponding column of Q, is as follows: MS1, Let the order of the polynomial be K, and initialize the learnable coefficient vector α = [α0, α1, ..., α2]. K The following calculates the K+1 basic commodity features related to the current dimension commodity features / signals, which are all components of the filtered commodity features; MS2 initializes the (1)th basic commodity feature as a vector of all zeros, denoted as... MS3, by normalizing the product feature f before filtering, obtains the 0th base product feature, denoted as p0←f / |f|; MS4 updates the filtered product feature q and adds the 0th base product feature to z with weight α0, denoted as q←q+a0p0; MS5, design variable i=0, records the features that have been calculated and weighted to the i-th base commodity feature; MS6, begin calculating the feature p of the (i+1)th base commodity. i+1, The calculated p i exist A graph propagation is performed once, which can be expressed mathematically as follows: MS7, in the previous step p i+1 Remove the components with the i-th and i-1-th basic product characteristics from the list; MS8, for p in the previous step i+1 Normalization is performed on the middle, and the result is denoted as p. i+1 ←p i+1 / |p i+1 |;Formally obtained the feature p of the (i+1)th basic commodity. i+1 ; MS9, utilizing the newly obtained basic commodity feature p i+1 Update the filtered product feature q by adding α to q. i+1 p i+1 , denoted as q←q+α i+1 P i+1 ; MS10 increments the counter variable by 1, denoted as i←i+1; if i>K, the program stops. Otherwise, return to step MS6 to continue calculating the base product features and updating the filtered product features q.
Citation Information
Patent Citations
Intelligent commodity tax classification coding method and system based on neural network
CN110175235A
Commodity information classification method based on deep feature fusion model
CN110674305A