Shopping basket recommendation method and system based on data enhancement and representation alignment

By introducing an autoencoder into the shopping basket recommendation system for data augmentation and comparison learning, the cold start and data sparse problems in the existing technology are solved, the accuracy and diversity of recommendations are improved, and a better user experience is provided.

CN118797163BActive Publication Date: 2025-03-21SOUTH CHINA AGRICULTURAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410937718.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2025-03-21
Estimated Expiration
2044-07-12

AI Technical Summary

Technical Problem

The existing shopping basket recommendation technology is not effective when dealing with cold start and data sparse problems, and traditional comparison learning methods may destroy the original characteristics, resulting in poor recommendation results.

Method used

Using a data augmentation method based on the autoencoder, two types of shopping basket enhancements are generated through the noise-reducing autoencoder and the variational autoencoder, and a comparison learning is constructed to optimize the shopping basket embedding characterization.

Benefits of technology

It improves the accuracy and diversity of shopping basket recommendations, enhances the robustness and effectiveness of the recommendation system, and provides a better user shopping experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118797163B_ABST
    Figure CN118797163B_ABST
Patent Text Reader

Abstract

The present invention discloses a shopping basket recommendation method and system based on data enhancement and representation alignment, including: inputting shopping basket data embedding representation into a denoising autoencoder and a variational autoencoder for data enhancement to obtain two more robust shopping basket embedding representations, completing alignment of the two reconstructed shopping basket representations based on a decoder of the autoencoder, and forming three groups of positive sample pairs with the original shopping basket embedding representations, extracting items irrelevant to the user's shopping basket based on a preset number K, and forming 3*K groups of negative samples with the three groups of shopping basket embedding representations, and maximizing the similarity of positive sample pairs and minimizing the similarity of negative sample pairs through contrastive learning to complete model training. The present invention uses an autoencoder to perform data enhancement on the embedding representation of the shopping basket, and then constructs contrastive learning to optimize the embedding representation of the shopping basket, thereby improving the effect of the next shopping basket recommendation task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of personalized recommendation technology, and more specifically, to a shopping basket recommendation method and system based on data enhancement and representation alignment. Background Art

[0002] In the modern field of big data and artificial intelligence, contrastive learning has become a key method to improve model performance and alleviate data sparsity. Contrastive learning mainly includes data enhancement and construction of contrast loss, and reconstruction is an effective method of data enhancement.

[0003] In the existing next shopping basket recommendation task technology, the traditional contrastive learning method is to achieve data enhancement by introducing random noise or performing element-level masking in the embedding of items or shopping baskets. However, such data enhancement methods may destroy the embedding representation of important features in the original entity, making it difficult to achieve a better contrastive learning effect. In addition, most traditional recommendation methods are based on collaborative filtering, content filtering and other methods, which face huge challenges in dealing with cold start, data sparsity and other problems, and ignore the deeper connection and internal structure between data, resulting in poor recommendation results.

[0004] Therefore, the present invention proposes a shopping basket enhancement method based on autoencoders, realizes two sets of data enhancement through two different autoencoders, constitutes three sets of positive sample pairs with the original shopping basket embedding, constructs contrast loss and then optimizes the shopping basket embedding representation to improve the accuracy and diversity of the next shopping basket recommendation, and bring users a better shopping experience. Summary of the invention

[0005] In order to solve the above technical problems, the present invention proposes a shopping basket recommendation method and system based on data enhancement and representation alignment, the purpose of which is to complete data enhancement through an autoencoder, and then construct contrastive learning to optimize the shopping basket embedding representation, thereby improving the effect of the next shopping basket recommendation.

[0006] A first aspect of the present invention provides a shopping basket recommendation method based on data enhancement and representation alignment, comprising:

[0007] Acquire user shopping basket sequence data, preprocess the user shopping basket sequence data, and generate item embedding representation and shopping basket embedding representation;

[0008] Construct a denoising autoencoder and a variational autoencoder to generate shopping basket enhancements of the two autoencoders, obtain the reconstructed shopping basket embedding representation, and align the two reconstructed shopping basket embedding representations;

[0009] Obtain shopping basket embedding representation, reconstructed shopping basket embedding representation of denoising autoencoder and variational autoencoder to construct positive sample pairs, randomly select items irrelevant to the user and three shopping basket embedding representations to form negative sample pairs, and use the positive sample pairs and negative sample pairs to perform comparative learning of the autoencoder;

[0010] Three groups of shopping basket embedding representation sequences are generated based on the user's original shopping basket embedding representation and the reconstructed shopping basket embedding representation of the two autoencoders. Sequence encoding is performed on each of them, and the user preference representation vector is mapped to the probability space using a multilayer perceptron to obtain the probability of each item in the user's next shopping basket.

[0011] In this solution, all users, items and shopping basket data are numbered, and items and shopping baskets with interactive associations are screened according to users, and user shopping basket sequence data is obtained and training data, test data and verification data are generated according to the preset data format;

[0012] For all items in any shopping basket, an item embedding representation is constructed, and the item embedding representations of all items are average-pooled to obtain the shopping basket embedding representation.

[0013] In this solution, a denoising autoencoder is constructed to generate a shopping basket enhancement of the denoising autoencoder, specifically:

[0014] Obtain a shopping basket embedding representation of a given shopping basket, construct a Gaussian noise of the same size as the shopping basket embedding representation, add the Gaussian noise to the shopping basket embedding representation, and introduce a hyperparameter to adjust the Gaussian noise intensity;

[0015] The shopping basket embedding representation with noise is input into the encoder consisting of three fully connected layers. The encoder compresses the shopping basket embedding representation layer by layer and extracts key features. After three compressions, a low-dimensional shopping basket key feature vector is finally obtained.

[0016] The shopping basket key feature vector is decoded through the decoder structure of the denoising autoencoder, restored to its original size, and the shopping basket embedding representation is reconstructed to perform shopping basket enhancement based on the denoising autoencoder.

[0017] In this scheme, a variational autoencoder is constructed to generate a shopping basket enhancement of the variational autoencoder, specifically:

[0018] Obtaining a shopping basket embedding representation of a given shopping basket, and compressing the shopping basket embedding representation through a fully connected layer to perform feature extraction;

[0019] Generate a latent space distribution by fitting the mean and log-variance of the latent space from the compressed shopping basket embedding representation using two different fully connected layers;

[0020] A random noise is sampled from the standard Gaussian distribution, the element-wise product is calculated with the standard deviation of the latent space and added to the mean of the latent space to obtain the Gaussian sampling result of the latent space. The decoder structure is used for decoding, the shopping basket embedding representation is reconstructed, and the shopping basket enhancement based on the variational autoencoder is performed.

[0021] In this solution, the two shopping basket enhancements are characterized and aligned, specifically:

[0022] Calculate the mean square error between the shopping basket embedding representation and the shopping basket enhancement based on the denoising autoencoder, and align the reconstructed shopping basket embedding representation by minimizing the mean square error;

[0023] The mean squared error between the shopping basket embedding representation and the shopping basket enhancement based on the variational autoencoder is calculated, and the alignment of the reconstructed shopping basket embedding representation is performed by minimizing the mean squared error and minimizing the KL divergence between the latent space distribution and the standard Gaussian distribution.

[0024] In this scheme, the contrastive learning of the autoencoder is carried out, specifically:

[0025] Get the basket embedding representation for a given basket Reconstructing shopping basket embedding representation with denoising autoencoder Reconstructed shopping basket embedding representation using variational autoencoders Construct three sets of positive sample pairs

[0026] Randomly select negative samples that have no interaction with the user based on a preset number K The three embedding representations of the given shopping basket constitute negative sample pairs k=1,2,...,K, Embedding representation for non-interaction samples;

[0027] The cosine similarity is used to calculate the similarity between different sample pairs. The contrast loss is obtained by maximizing the similarity between positive sample pairs and minimizing the similarity between negative sample pairs. The contrast loss is used to guide the contrast training of the denoising autoencoder and the variational autoencoder.

[0028] In this scheme, the user's original shopping basket embedding representation and the reconstructed shopping basket embedding representation of two autoencoders are obtained to generate three groups of shopping basket embedding representation sequences. The three groups of shopping basket embedding representation sequences are sequence-encoded using a gated recurrent unit to obtain three groups of user preference representation vectors.

[0029] In this scheme, based on the three sets of preference representation vectors of users, two sets of two-layer multi-layer perceptrons are used to map the user's preference representation vectors to the probability space, and the probability of each item appearing in the user's next shopping cart is obtained;

[0030] After obtaining the probability of all items in the data set appearing in the user's next shopping cart, maximize the probability of actually appearing in the user's next shopping cart and calculate the prediction loss For training, the prediction loss is expressed as:

[0031]

[0032] where i p Indicates that it appears in the next shopping cart b T+1 Items in i n Indicates that it does not appear in the next shopping cart b T+1 Items in Indicates i p The corresponding predicted probability is Indicates i n The corresponding predicted probability.

[0033] A second aspect of the present invention provides a shopping basket recommendation system based on data enhancement and representation alignment, the system comprising: a shopping basket input module, a shopping basket representation generation module, a shopping basket enhancement module, a contrastive learning module, a shopping basket sequence encoding module and an item prediction module;

[0034] The shopping basket input module performs data preprocessing on the shopping basket and items purchased by the user to generate a preset data format;

[0035] The shopping basket representation generation module generates a shopping basket embedding representation and an item embedding representation for calculation of the forward propagation of the shopping basket enhancement module;

[0036] The shopping basket enhancement module utilizes a denoising autoencoder and a variational autoencoder to perform data enhancement on the shopping basket embedding representation and align the reconstructed representation to generate a reconstructed shopping basket embedding representation.

[0037] The contrastive learning module constructs three groups of positive samples by combining the reconstructed shopping basket embedding representations generated by the two groups of autoencoders with the original shopping basket embedding representations, randomly extracts items irrelevant to the user based on a preset number K and the three groups of shopping basket embedding data to form 3*K groups of negative samples, maximizes the similarity between positive sample pairs, and minimizes the similarity between negative sample pairs;

[0038] The shopping basket sequence encoding module performs sequence encoding on three groups of shopping basket embedding representations through a gated recurrent unit to obtain an embedding representation that can represent user preferences;

[0039] The item prediction module maps the user preference representation vector to the probability space through a multi-layer perceptron, predicts the probability of the item in the user's next shopping cart, and selects a preset number of items for output based on probability sorting.

[0040] Compared with the prior art, the present invention has the following beneficial effects:

[0041] (1) The present invention enhances the data of the shopping basket embedding representation by introducing two autoencoders. The denoising autoencoder introduces noise and extracts features through the encoder and reconstructs the embedded representation through the decoder to generate a more robust embedded representation; the other variational autoencoder does not compress the original representation first and then restore the improved data, but extracts the mean and logarithmic variance from the embedded representation, constructs a Gaussian distribution, and performs sampling. The decoder reconstructs new data containing the representation information based on the sampling. The two data enhancement methods ensure the effectiveness of generating the shopping basket.

[0042] (2) The present invention constructs contrastive learning to optimize the shopping basket embedding representation. The present invention uses two basket embeddings enhanced by the autoencoder and the original basket embedding as three groups of positive samples, and randomly takes out items irrelevant to the user based on a preset number K and the three groups of shopping basket embedding data to form 3*K groups of negative samples, maximizes the similarity between positive sample pairs, and minimizes the similarity between negative sample pairs to construct contrastive learning. And the quality of the basket embedding representation is improved by contrastive loss, further improving the effect of the next shopping basket recommendation. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments or exemplary embodiments of the present invention, the drawings required for use in the embodiments or exemplary descriptions 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 according to the drawings without paying creative work.

[0044] Figure 1 A flowchart of a shopping basket recommendation method based on data enhancement and representation alignment is shown;

[0045] Figure 2 A flowchart of a shopping basket recommendation method based on data enhancement and representation alignment is shown;

[0046] Figure 3 A flowchart of constructing a denoising autoencoder according to an embodiment of the present invention is shown;

[0047] Figure 4 A flow chart of constructing a variational autoencoder according to an embodiment of the present invention is shown;

[0048] Figure 5 The architecture diagram of the shopping basket recommendation system based on data augmentation and representation alignment is shown. DETAILED DESCRIPTION

[0049] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0050] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0051] Figure 1 , 2 A flowchart of a shopping basket recommendation method based on data augmentation and representation alignment is shown.

[0052] like Figure 1 As shown, the present invention provides a shopping basket recommendation method based on data enhancement and representation alignment, comprising:

[0053] S102, obtaining user shopping basket sequence data, preprocessing the user shopping basket sequence data, and generating item embedding representation and shopping basket embedding representation;

[0054] S104, constructing a denoising autoencoder and a variational autoencoder to generate shopping basket enhancements of the two autoencoders, obtaining a reconstructed shopping basket embedding representation, and aligning the two reconstructed shopping basket embedding representations;

[0055] S106, obtaining a shopping basket embedding representation, a reconstructed shopping basket embedding representation of a denoising autoencoder and a variational autoencoder to construct a positive sample pair, randomly selecting items irrelevant to the user and three shopping basket embedding representations to construct a negative sample pair, and using the positive sample pair and the negative sample pair to perform comparative learning of the autoencoder;

[0056] S108, generating three groups of shopping basket embedding representation sequences based on the user's original shopping basket embedding representation and the reconstructed shopping basket embedding representation of the two autoencoders, performing sequence encoding on each of them, and using a multi-layer perceptron to map the user preference representation vector to a probability space, and obtaining the probability of each item in the user's next shopping basket.

[0057] It should be noted that all users, items and shopping basket data are numbered, and multiple rows of data are formed according to the items and shopping baskets that are interactively related to each other, and the user shopping basket sequence data is obtained and training data, test data and verification data are generated according to the preset data format; for any shopping basket b t Build item embedding representations for all items in , and average pool the item embedding representations of all items to get the shopping basket embedding representation where |b t|For shopping basket t The number of items in For project i j is a learnable embedding representation of , and H is the latent dimension of the item.

[0058] Figure 3 A flow chart of constructing a denoising autoencoder according to an embodiment of the present invention is shown.

[0059] According to an embodiment of the present invention, a denoising autoencoder is constructed to generate a shopping basket enhancement of the denoising autoencoder, specifically:

[0060] S302, obtaining a shopping basket embedding representation of a given shopping basket, constructing Gaussian noise of the same size as the shopping basket embedding representation, adding the Gaussian noise to the shopping basket embedding representation, and introducing a hyperparameter to adjust the Gaussian noise intensity;

[0061] Given a shopping basket b t Embedded representation of Construct a Gaussian noise of the same size as the shopping basket representation N(0,1) represents a standard Gaussian distribution with a mean of 0 and a variance of 1. In order to prevent the original embedded representation information from being excessively destroyed, a hyperparameter is introduced. To adjust the Gaussian noise intensity,

[0062] S304, the shopping basket embedding representation with noise is input into an encoder consisting of three fully connected layers. The encoder compresses the shopping basket embedding representation layer by layer and extracts key features. After three compressions, a low-dimensional shopping basket key feature vector is finally obtained.

[0063]

[0064]

[0065] in, is the weight matrix used to compress the shopping basket embedding representation, is the bias vector, H1, H2, H3 are the dimensions of different fully connected layers, φ(·) is the activation function, preferably the ReLU function, The embedded representation of the shopping basket after adding noise, are the key feature vectors generated by the encoder after the first, second, and third compressions, respectively;

[0066] S306, decoding the shopping basket key feature vector through the decoder structure of the denoising autoencoder, restoring it to its original size, reconstructing the shopping basket embedding representation, and performing shopping basket enhancement based on the denoising autoencoder

[0067]

[0068] in is the weight matrix used to restore the shopping basket embedding representation, is the bias vector, is the reconstructed shopping basket embedding representation restored by the decoder.

[0069] Figure 4 A flow chart of constructing a variational autoencoder according to an embodiment of the present invention is shown.

[0070] According to an embodiment of the present invention, a variational autoencoder is constructed to generate a shopping basket enhancement of the variational autoencoder, specifically:

[0071] S402, obtaining a shopping basket embedding representation of a given shopping basket The shopping basket embedding representation is compressed by the fully connected layer to extract features. It is expressed as:

[0072] S404, using two different fully connected layers to fit the mean and log variance of the latent space from the compressed shopping basket embedding representation to generate a latent space distribution;

[0073] Mean of the latent space from the compressed shopping basket representation through two different fully connected layers and log variance Get the distribution of latent space

[0074]

[0075] It should be noted that here we are not directly fitting the variance of the latent space, but fitting the logarithmic variance lnσ 2 , because the use of logarithmic variance can ensure that the variance is always positive, it is more stable numerically, and the variance range can be controlled, which helps the model to better learn and adjust the size of the variance. In addition, the use of logarithmic variance helps the gradient propagation to be more stable.

[0076] S406, sampling a random noise from a standard Gaussian distribution, calculating the element-wise product with the standard deviation of the latent space and adding the mean of the latent space to obtain the Gaussian sampling result of the latent space, decoding using the decoder structure, reconstructing the shopping basket embedding representation, and performing shopping basket enhancement based on the variational autoencoder;

[0077] Use the reparameterization technique, that is, Gaussian sampling of the obtained latent space; first sample a random noise from a standard Gaussian distribution Calculate the element-wise product with the standard deviation of the latent space and add the mean of the latent space to get the Gaussian sampling result

[0078]

[0079] in is the weight matrix of the compressed shopping basket embedding representation, is the weight matrix used to generate the mean vector, is the weight matrix used to generate the variance vector, is the bias vector, φ(·) is the activation function, N(0,1) is the standard Gaussian distribution with mean 0 and variance 1, and ⊙ is the element-wise product;

[0080] Similar to the denoising autoencoder structure, the decoder of the variational autoencoder is composed of two layers of fully connected networks. The decoder converts the sample points in the low-dimensional latent space into Restore to original size layer by layer Reconstruct the embedded representation of the shopping basket and realize shopping basket enhancement based on denoising autoencoder Generate a new shopping basket embedding representation:

[0081]

[0082] in is the weight matrix used to restore the shopping basket embedding representation, is the bias vector and φ(·) is the activation function.

[0083] It should be noted that the two shopping basket enhancements are characterized and aligned as follows:

[0084] Calculate the mean square error between the shopping basket embedding representation and the shopping basket enhancement based on the denoising autoencoder, and align the reconstructed shopping basket embedding representation by minimizing the mean square error to ensure the reconstruction ability of the denoising autoencoder and the effectiveness of the generated shopping basket enhancement, and the reconstruction loss of the denoising autoencoder for:

[0085]

[0086] Where T is user u n The number of shopping baskets with historical interactions, is the embedding dimension of the shopping basket representation, and ‖·‖1 is the L1 norm.

[0087] The mean square error between the shopping basket embedding representation and the shopping basket enhancement based on the variational autoencoder is calculated. The alignment of the reconstructed shopping basket embedding representation is performed by minimizing the mean square error and minimizing the KL divergence between the latent space distribution and the standard Gaussian distribution, so that the distribution of the latent space is closer to the standard Gaussian distribution. The alignment of the embedded representation further refines the key information in the shopping basket embedding and removes noise and irrelevant information. Reconstruction loss of variational autoencoder and KL divergence loss for:

[0088]

[0089] Where T is user u n The number of shopping baskets with historical interactions, is the embedding dimension of the shopping basket representation, and ‖·‖1 is the L1 norm.

[0090] It should be noted that the comparative learning of the autoencoder is specifically as follows:

[0091] Get the basket embedding representation for a given basket Reconstructing shopping basket embedding representation with denoising autoencoder Reconstructed shopping basket embedding representation using variational autoencoders Construct three sets of positive sample pairs

[0092] Randomly select negative samples that have no interaction with the user based on a preset number K The three embedding representations of the given shopping basket constitute 3*K groups of negative sample pairs k=1,2,...,K, For the embedding representation of non-interaction samples, the preferred K=5, 5 item embeddings irrelevant to the shopping cart and 3 groups of shopping cart embeddings are extracted to form 15 groups of negative samples, and 5 negative samples are user u n All shopping baskets share the same value. Use cosine similarity to calculate the similarity between different sample pairs, by maximizing the similarity between positive sample pairs cl p , minimize the similarity cl between negative sample pairs n , and get the contrast loss The contrast loss is used to guide the contrast training of the denoising autoencoder and the variational autoencoder. The parameters of the denoising autoencoder, the variational autoencoder and the contrast learning module are continuously updated through the back propagation algorithm and the gradient descent optimizer, so that the model can learn effective shopping basket representations and recommendation rules. It is expressed as: τ is the time constant;

[0093]

[0094] It should be noted that the original shopping basket embedding representation of the user and the reconstructed shopping basket embedding representation of the two autoencoders are obtained to generate three sets of shopping basket embedding representation sequences. Use the gated recurrent unit to perform sequence encoding on the three sets of shopping basket embedding representation sequences respectively, and generate the embedding representation h representing the user preferences in the three sets of sequences t , Specifically:

[0095]

[0096]

[0097] Finally, we get three sets of preference representation vectors h of the user: T ,

[0098] It should be noted that based on the three sets of user preference representation vectors, the user's preference representation vectors are mapped to the probability space through two sets of two-layer multi-layer perceptrons to obtain the probability of each item appearing in the user's next shopping cart, where the preference representation vector h T The calculation is:

[0099] y1=MLP1(h T )

[0100] y2=MLP2(h T )

[0101] y=y1+y2

[0102] Where y1, y2, and y are all high-dimensional vectors of the total size of items in the data set |I|

[0103] After obtaining the probability of all items in the data set appearing in the user's next shopping cart, maximize the probability of actually appearing in the user's next shopping cart and calculate the prediction loss For training, the prediction loss is expressed as:

[0104]

[0105] where i p Indicates that it appears in the next shopping cart b T+1 Items in (positive samples), i n Indicates that it does not appear in the next shopping cart b T+1 Items in (negative samples), Indicates i p The corresponding predicted probability is Indicates i n The corresponding predicted probability.

[0106] During the training phase, the three sets of preference embedding representations are passed through the predictor and generate corresponding probability prediction vectors y, y d ,y v , then sum and calculate the prediction loss During the test phase, only the original shopping basket representation sequence is used for context encoding to generate a user preference representation vector, and then the corresponding prediction probability vector y is generated. The top-n n items with the highest prediction probability are taken to test the accuracy of the recommendation model.

[0107] Figure 5 A block diagram of a shopping basket recommendation system based on data augmentation and representation alignment is shown.

[0108] The second aspect of the present invention provides a shopping basket recommendation system based on data enhancement and representation alignment, the system comprising: a shopping basket input module 51, a shopping basket representation generation module 52, a shopping basket enhancement module 53, a comparative learning module 54, a shopping basket sequence encoding module 55 and an item prediction module 56;

[0109] The shopping basket input module 51 performs data preprocessing on the shopping basket and items purchased by the user to generate a preset data format;

[0110] The shopping basket representation generation module 52 generates a shopping basket embedding representation and an item embedding representation for calculation of the forward propagation of the shopping basket enhancement module;

[0111] The shopping basket enhancement module 53 utilizes the denoising autoencoder and the variational autoencoder to perform data enhancement on the shopping basket embedding representation and align the reconstructed representation to generate a reconstructed shopping basket embedding representation.

[0112] The contrastive learning module 54 constructs three groups of positive samples by combining the reconstructed shopping basket embedding representations generated by the two groups of autoencoders with the original shopping basket embedding representations, randomly extracts items irrelevant to the user based on a preset number K and the three groups of shopping basket embedding data to form 3*K groups of negative samples, maximizes the similarity between the positive sample pairs, and minimizes the similarity between the negative sample pairs;

[0113] The shopping basket sequence encoding module 55 performs sequence encoding on the three groups of shopping basket embedding representations through a gated recurrent unit to obtain an embedding representation that can represent the user's preference;

[0114] The item prediction module 56 maps the user preference representation vector to the probability space through a multi-layer perceptron, predicts the probability of the item in the user's next shopping cart, and selects a preset number of items for output based on probability sorting.

[0115] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0116] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0117] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0118] Those skilled in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, and other media that can store program codes.

[0119] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

[0120] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A shopping basket recommendation method based on data enhancement and representation alignment, characterized in that: The following steps are involved: Acquire user shopping basket sequence data, preprocess the user shopping basket sequence data, and generate item embedding representation and shopping basket embedding representation; Construct a denoising autoencoder and a variational autoencoder to generate shopping basket enhancements of the two autoencoders, obtain the reconstructed shopping basket embedding representation, and align the two reconstructed shopping basket embedding representations; Obtain shopping basket embedding representation, reconstructed shopping basket embedding representation of denoising autoencoder and variational autoencoder to construct positive sample pairs, randomly select items irrelevant to the user and three shopping basket embedding representations to form negative sample pairs, and use the positive sample pairs and negative sample pairs to perform comparative learning of the autoencoder; Three sets of shopping basket embedding representation sequences are generated based on the user's original shopping basket embedding representation and the reconstructed shopping basket embedding representation of the two autoencoders. Sequence encoding is performed on each of them. The user preference representation vector is mapped to the probability space using a multi-layer perceptron to obtain the probability of each item in the user's next shopping basket. Construct a denoising autoencoder and generate a shopping basket enhancement for the denoising autoencoder, specifically: Obtain a shopping basket embedding representation of a given shopping basket, construct a Gaussian noise of the same size as the shopping basket embedding representation, add the Gaussian noise to the shopping basket embedding representation, and introduce a hyperparameter to adjust the Gaussian noise intensity; The shopping basket embedding representation with noise is input into the encoder consisting of three fully connected layers. The encoder compresses the shopping basket embedding representation layer by layer and extracts key features. After three compressions, a low-dimensional shopping basket key feature vector is finally obtained. The shopping basket key feature vector is decoded by the decoder structure of the denoising autoencoder to restore it to its original size, the shopping basket embedding representation is reconstructed, and the shopping basket enhancement is performed based on the denoising autoencoder; Construct a variational autoencoder and generate a shopping basket enhancement for the variational autoencoder, specifically: Obtaining a shopping basket embedding representation of a given shopping basket, and compressing the shopping basket embedding representation through a fully connected layer to perform feature extraction; Generate a latent space distribution by fitting the mean and log-variance of the latent space from the compressed shopping basket embedding representation using two different fully connected layers; Sample a random noise from the standard Gaussian distribution, calculate the element-wise product with the standard deviation of the latent space and add the mean of the latent space to obtain the Gaussian sampling result of the latent space, decode it using the decoder structure, reconstruct the shopping basket embedding representation, and perform shopping basket enhancement based on the variational autoencoder; The two shopping basket enhancements are characterized and aligned, specifically: Calculate the mean square error between the shopping basket embedding representation and the shopping basket enhancement based on the denoising autoencoder, and align the reconstructed shopping basket embedding representation by minimizing the mean square error; The mean squared error between the shopping basket embedding representation and the shopping basket enhancement based on the variational autoencoder is calculated, and the alignment of the reconstructed shopping basket embedding representation is performed by minimizing the mean squared error and minimizing the KL divergence between the latent space distribution and the standard Gaussian distribution.

2. A shopping basket recommendation method based on data enhancement and representation alignment according to claim 1, characterized in that: Number all users, items and shopping basket data, filter items and shopping baskets that have interactive associations according to users, obtain user shopping basket sequence data and generate training data, test data and verification data according to the preset data format; For all items in any shopping basket, an item embedding representation is constructed, and the item embedding representations of all items are average-pooled to obtain the shopping basket embedding representation.

3. The shopping basket recommendation method based on data enhancement and representation alignment according to claim 1, characterized in that: Perform contrastive learning of the autoencoder, specifically: Get the basket embedding representation for a given basket , Reconstructed Shopping Basket Embedding Representation of Denoising Autoencoder Reconstructed shopping basket embedding representation using variational autoencoders Construct three sets of positive sample pairs , , ; Based on preset quantity Randomly select negative samples that have no interaction with the user , and the three embedding representations of the given shopping basket constitute negative sample pairs , , , , Embedding representation for non-interaction samples; The cosine similarity is used to calculate the similarity between different sample pairs. The contrast loss is obtained by maximizing the similarity between positive sample pairs and minimizing the similarity between negative sample pairs. The contrast loss is used to guide the contrast training of the denoising autoencoder and the variational autoencoder.

4. The shopping basket recommendation method based on data enhancement and representation alignment according to claim 1, characterized in that: The user's original shopping basket embedding representation and the reconstructed shopping basket embedding representation of two autoencoders are obtained to generate three groups of shopping basket embedding representation sequences. The three groups of shopping basket embedding representation sequences are sequence-encoded using gated recurrent units to obtain three groups of user preference representation vectors.

5. The shopping basket recommendation method based on data enhancement and representation alignment according to claim 1, characterized in that: Based on the user's three sets of preference representation vectors, the user's preference representation vectors are mapped to the probability space through two sets of two-layer multi-layer perceptrons to obtain the probability of each item appearing in the user's next shopping cart; After obtaining the probability of all items in the data set appearing in the user's next shopping cart, maximize the probability of actually appearing in the user's next shopping cart and construct the prediction loss For training, the prediction loss is expressed as: , in Indicates that it appears in the next shopping cart Items in Indicates that it does not appear in the next shopping cart Items in express The corresponding predicted probability is express The corresponding predicted probability.

6. A shopping basket recommendation system based on data enhancement and representation alignment, characterized in that: Implementing a shopping basket recommendation method based on data enhancement and representation alignment as described in any one of claims 1 to 5, the system comprises: a shopping basket input module, a shopping basket representation generation module, a shopping basket enhancement module, a contrastive learning module, a shopping basket sequence encoding module and an item prediction module; The shopping basket input module performs data preprocessing on the shopping basket and items purchased by the user to generate a preset data format; The shopping basket representation generation module generates a shopping basket embedding representation and an item embedding representation for calculation of the forward propagation of the shopping basket enhancement module; The shopping basket enhancement module uses a denoising autoencoder and a variational autoencoder to enhance the data of the shopping basket embedding representation and align the reconstructed representation to generate a reconstructed shopping basket embedding representation; The contrastive learning module constructs three groups of positive samples by combining the reconstructed shopping basket embedding representations generated by the two groups of autoencoders with the original shopping basket embedding representations, randomly extracts items irrelevant to the user based on a preset number K and the three groups of shopping basket embedding data to form 3*K groups of negative samples, maximizes the similarity between positive sample pairs, and minimizes the similarity between negative sample pairs; The shopping basket sequence encoding module performs sequence encoding on three groups of shopping basket embedding representations through a gated recurrent unit to obtain an embedding representation that can represent user preferences; The item prediction module maps the user preference representation vector to the probability space through a multi-layer perceptron, predicts the probability of the item in the user's next shopping cart, and selects a preset number of items for output based on probability sorting.

Citation Information

Patent Citations

  • Shopping basket recommendation method based on deep learning

    CN113837834A

  • Model processing method, device and equipment

    CN116662998A