A user clothing recommendation method and system based on autoencoder and memory network

By adopting a combination method of GRU network and autoencoder in the user dressing recommendation system, the shortcomings of the RNN model in gradient vanishing and information memory are solved, and the accuracy and comprehensiveness of dressing recommendations are improved.

CN114943035BActive Publication Date: 2025-04-08QINGDAO WINDAKA TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210652440.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-08
Publication Date
2025-04-08
Estimated Expiration
2042-06-08

AI Technical Summary

Technical Problem

The existing RNN-based user dressing recommendation methods are prone to gradient disappearance or explosion problems during training, and it is difficult to effectively remember information in long sequences. Especially in objects with sparse feature distribution, the prediction accuracy is low.

Method used

The GRU network is used as the prediction model and the user's clothing recommendation is combined with the autoencoder. The autoencoder compresses the high-dimensional sparse eigenvector into low-dimensional dense vectors through the encoding layer and the decoding layer, which improves the prediction accuracy as input to the GRU model.

Benefits of technology

It effectively avoids the problem of gradient disappearance or explosion, and can selectively memorize and analyze the information in long sequences, improving the accuracy and comprehensiveness of clothing recommendations, especially when clothing features are sparse.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114943035B_ABST
    Figure CN114943035B_ABST
Patent Text Reader

Abstract

The present invention proposes a user clothing recommendation method based on an autoencoder and a memory network, which is characterized by comprising: obtaining a high-dimensional feature vector of clothing in a user's historical clothing record; inputting the high-dimensional feature vector of the clothing into the autoencoder for training until the data output by the autoencoder after decoding and encoding tends to be the same as the input high-dimensional feature vector, thereby obtaining a trained autoencoder; using the low-dimensional feature vector output by the trained autoencoder after decoding as a training set for training a GRU prediction model, thereby obtaining a trained GRU prediction model; inputting the high-dimensional feature vector sequence of the historical clothing record of the user to be predicted into the trained autoencoder-GRU prediction model, thereby making clothing recommendations for the user. The present invention adopts a GRU network as a prediction model, and can establish a prediction model for the temporal relationship implicit in the user's clothing, thereby making clothing recommendations for the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of clothing recommendation, and in particular to a user clothing recommendation method and system based on an autoencoder and a memory network. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] In the recommendation algorithm, the method based on user history trajectory is one of the main branches. The recommendation method based on user history trajectory analyzes the user's historical behavior (such as what the user has purchased and where he has been, etc.) to deduce the user's possible future behavior, and the prediction accuracy of this method often depends on the specific design of the prediction model.

[0004] Previous recommendation methods assume that items or users are individuals with fixed attributes, but in real life, users' preferences are not static in the future, so it is necessary to establish a time series model to complete dynamic recommendation tasks. Generally speaking, the construction of time series models is usually based on RNN. According to the specific prediction task requirements, RNN can be supervised with sequences of any length as input or output. After training, RNN recommends items or sequences that may appear in the future based on the given sequence. However, the original RNN model has many disadvantages: First, the RNN model optimizes parameters in the form of back propagation during training, but in the back propagation optimization process of the multi-layer network, the RNN model is easy to cause gradient vanishing or gradient explosion problems due to the addition or multiplication of the gradient calculation functions between the layers. In addition, if the learning sequence length of the RNN is too long, the model will not be able to remember all the information contained in the long sequence. In the process of solving long-term dependency problems, it is necessary to remember and analyze the older information in the input sequence to output a more comprehensive and accurate prediction result. In addition, RNN models are generally used for text prediction. For items with sparse feature distribution, the performance of RNN is poor and it is unable to accurately discover the implicit temporal associations between items in the item sequence. Summary of the invention

[0005] In order to overcome the shortcomings of the above-mentioned prior art, the present invention provides a user clothing recommendation method and system based on autoencoder and memory network, which adopts GRU network as the prediction model and combines autoencoder to recommend user clothing. It can accurately discover the implicit temporal relationship from the user's clothing sequence and output more comprehensive and accurate clothing recommendation results for the user.

[0006] To achieve the above objectives, one or more embodiments of the present invention provide the following technical solutions:

[0007] A user clothing recommendation method based on autoencoder and memory network, comprising:

[0008] Obtain high-dimensional feature vectors of clothing in the user's historical clothing records;

[0009] Inputting the high-dimensional feature vector of the clothing into an autoencoder for training until the data output by the autoencoder after decoding and encoding tends to be the same as the input high-dimensional feature vector, thereby obtaining a trained autoencoder;

[0010] The low-dimensional feature vector output by the trained autoencoder after decoding is used as a training set to train the GRU prediction model, thereby obtaining a trained GRU prediction model;

[0011] The high-dimensional feature vector sequence of the historical clothing records of the user to be predicted is input into the trained autoencoder-GRU prediction model to make clothing recommendations for the user.

[0012] Furthermore, the clothing parts are divided into multiple sets according to the user's historical dressing records. The clothing in each set is represented by different vectors according to different features and is sorted in chronological order.

[0013] Furthermore, the autoencoder consists of an encoding layer and a decoding layer.

[0014] Furthermore, a sliding window is used to select a dressing sequence consisting of high-dimensional feature vectors of clothing items that are continuous in chronological order, and the sequence is input into the GRU prediction model for iterative training.

[0015] Furthermore, the trained autoencoder-GRU prediction model forms an end-to-end network structure with the autoencoder and the GRU prediction model, the encoding layer of the autoencoder is connected to the input layer of the GRU prediction model, and the output layer of the GRU prediction model is connected to the decoding layer of the autoencoder.

[0016] Furthermore, it also includes using the clothing index to make clothing recommendations for the predicted user.

[0017] Furthermore, the clothing high-dimensional feature vector output by the trained autoencoder-GRU prediction model is compared with the clothing information in the clothing database of the user to be predicted for similarity, so as to recommend clothing combinations for the user to be predicted.

[0018] The present invention also provides a user clothing recommendation system based on an autoencoder and a memory network, comprising:

[0019] A data acquisition module is configured to: acquire a high-dimensional feature vector of clothing in a user's historical clothing record;

[0020] A first model training module is configured to: input the high-dimensional feature vector of the clothing into an autoencoder for training until the data output by the autoencoder after decoding and encoding tends to be the same as the input high-dimensional feature vector, thereby obtaining a trained autoencoder;

[0021] The second model training module is configured to: use the low-dimensional feature vector output by the trained autoencoder after decoding as a training set to train the GRU prediction model, thereby obtaining a trained GRU prediction model;

[0022] The prediction module is configured to: input the high-dimensional feature vector of the historical clothing record of the user to be predicted into the trained autoencoder-GRU prediction model to make clothing recommendations for the user.

[0023] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-mentioned method for recommending clothing to a user based on an autoencoder and a memory network.

[0024] The present invention also provides a processing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the above-mentioned method for recommending clothing to a user based on an autoencoder and a memory network are implemented.

[0025] One or more of the above technical solutions have the following beneficial effects:

[0026] 1. The present invention adopts the GRU network as the prediction model. The structure of GRU is simpler than the original RNN, and can effectively avoid the problem of gradient disappearance or explosion. The GRU network can selectively memorize and analyze the information in long sequences, and can output more comprehensive and accurate clothing recommendation results for users.

[0027] 2. In the present invention, due to the wide variety of clothing features and types, the clothing vectors formed are very sparse and cannot be directly used for GRU model training. The GRU model is supervised by using the encoded and compressed data of the autoencoder as input or output, which improves the prediction accuracy of the GRU prediction model. The AG-PNN model proposed in the present invention can still analyze clothing sequences with time series relationships when clothing features are relatively sparse, thereby further predicting the clothing that users may visit in the future, and its prediction accuracy is high.

[0028] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0030] Figure 1 This is an overall flow chart of user clothing recommendation proposed in Embodiment 1 of the present invention;

[0031] Figure 2 This is a network structure diagram of the AG-PNN model proposed in Example 1 of the present invention. DETAILED DESCRIPTION

[0032] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0033] It should be noted that the terms used herein are for describing specific embodiments only and are not intended to be limiting of exemplary embodiments according to the present invention.

[0034] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.

[0035] GRU is a variant of LSTM. LSTM introduces a gate mechanism based on the original RNN. It can selectively retain old information or add new information in each step of information propagation. After proper training, LSTM can transmit key information along a longer sequence and use this as a benchmark to predict items that may appear in the sequence in the future. Compared with the original RNN, LSTM can effectively solve the problem of long-term dependence. For application scenarios that require analysis of long sequences, LSTM shows good performance. In addition, in order to speed up the training speed of the model, GRU is simplified on the basis of the original LSTM structure. The gate mechanism of LSTM contains three gate functions: input gate, forget gate and output gate. The input gate determines how much new information is added to the propagation process, and the forget gate determines how much old information is forgotten during the propagation process. Finally, the output gate integrates the new information with the old information and determines which part of the integrated information is propagated to the next network layer. GRU only uses two gates to control the information propagation process, namely the update gate and the reset gate. The reset gate determines how much old information and new information are written into the current candidate information, and the update gate determines the propagation ratio of the old information to the current candidate information. In summary, GRU uses two gate functions to retain the necessary data features in the analysis process. Compared with LSTM, its structure is simpler and there are fewer parameters to be optimized, so its training speed is higher than LSTM.

[0036] Embodiment 1

[0037] like Figure 1-2 As shown, this embodiment discloses a user clothing recommendation method based on an autoencoder and a memory network, comprising:

[0038] S1: Obtain the high-dimensional feature vector of clothing in the user's historical clothing records;

[0039] S2: inputting the high-dimensional feature vector of the clothing into the autoencoder for training, until the data output by the autoencoder after decoding and encoding tends to be the same as the input high-dimensional feature vector, thereby obtaining a trained autoencoder;

[0040] S3: Using the low-dimensional feature vector output by the trained autoencoder after decoding as a training set to train the GRU prediction model, thereby obtaining a trained GRU prediction model;

[0041] S4: Input the high-dimensional feature vector of the historical clothing record of the user to be predicted into the trained autoencoder-GRU prediction model to make clothing recommendations for the user.

[0042] In step S1, the application scenario of the user clothing recommendation of the present invention is related to the community service type application, and the clothing habits of community users can be analyzed.

[0043] Specifically, the dressing habits of community users can be obtained through smart wardrobes. When users take clothes out of the smart wardrobe, the built-in camera in the smart wardrobe will identify the clothes and compare them with the clothes in the database to obtain the clothes that the user may wear next and generate a record of the clothes taken out.

[0044] Collect users' historical dressing records and clothing data from the community database, and train the model based on the above data.

[0045] Due to the wide variety of clothing, the user's historical clothing record data is divided into multiple sets H according to the corresponding parts of the clothing (such as tops, pants, shoes, hats, etc.) i ={h ij |j∈[1,m]}, where h ij represents the dressing record of user i in part j, and m represents the number of preset parts. ij In , the clothes are sorted according to the time they are taken out, and the specific clothing information is represented in the form of a vector, which is represented as follows:

[0046]

[0047]

[0048] Among them, L ij Indicates hij The total length of the vector, that is, the total number of records; Indicates h ij The dressing record of user i at corresponding part j at the tth moment in time is represented by K j One-hot vector c k Connection obtained; c k The kth feature corresponding to part j, K j Indicates the total number of features of part j. Each single heat vector corresponds to a feature of clothing information, and the features representing clothing information can be the color of the clothing, the part of the clothing, the thickness of the clothing, the brand of the clothing, etc.

[0049] Through the above processing, each piece of clothing is converted into an item vector, and the clothing in the user's historical clothing record is represented in the form of a vector, forming a high-dimensional sparse feature vector of the clothing in the user's historical clothing record.

[0050] Similarly, the clothes in the smart wardrobe database are represented in the form of vectors.

[0051] In step S2, due to the wide variety of features and types of clothing, the item vectors of clothing formed have high sparsity. If they are directly converted into corresponding item vectors and used in the training process of the prediction model, the prediction accuracy of the prediction model will deteriorate, and the specific features of the clothing worn by the target user cannot be accurately determined. Therefore, an autoencoder is used to process the high-dimensional sparse feature vectors of clothing.

[0052] The purpose of training the autoencoder in the present invention is to find a method for compressing or decompressing data so that high-dimensional sparse data can be compressed into low-dimensional dense data in a characteristic manner, and low-dimensional dense data can be restored to high-dimensional sparse data in a corresponding decompression manner.

[0053] In this embodiment, the autoencoder includes an encoding layer and a decoding layer. The encoding layer converts the high-dimensional sparse feature vector of the clothing into low-dimensional dense data, and the decoding layer restores the low-dimensional dense data output by the encoding layer to a high-dimensional sparse feature vector.

[0054] The high-dimensional sparse feature vector of the user's historical clothing obtained in step S1 is used as input and output, and multiple autoencoders are trained according to the corresponding parts. The training process of the autoencoder is an unsupervised process. In each iterative optimization process, the difference between the input and the actual output of the autoencoder is the optimization target. When the difference between the input and output of the autoencoder is very small, the encoding layer and decoding layer of the autoencoder are trained. Through the trained encoding layer and decoding layer of the autoencoder, the high-dimensional sparse feature vector corresponding to the clothing is converted into a low-dimensional dense feature vector.

[0055] In step S3, GRU is used to perform time series modeling on the user's dressing record. Although the training speed of GRU is faster than LSTM, its prediction accuracy is not necessarily higher than LSTM. Therefore, in order to improve the prediction accuracy of GRU, the low-dimensional dense feature vector output by the encoding layer of the trained autoencoder is used as a training set to train the GRU prediction model, which can improve the accuracy of the GRU prediction model and enable the GRU prediction model to predict the detailed features of items that will appear in the sequence in the future.

[0056] The low-dimensional dense feature vectors output by the encoding layer of the trained autoencoder are sorted in the chronological order of user records and input into the GRU prediction model in sequence for model training.

[0057] A user dressing sequence of a certain length As the input of the GRU prediction model corresponding to part j, the clothing information that follows As the output of the GRU prediction model, the GRU prediction model is trained.

[0058] Specifically, the input length L of the user's dressing sequence p is 5, and the dressing information to be predicted is 1. In each iteration, a sliding window of length 6 is used to select 6 consecutive dressing records to train the prediction model. The dressing information corresponding to the first 5 records is the input of the GRU prediction model, and the dressing information corresponding to the 6th record is the output of the GRU prediction model for training.

[0059] Among them, according to the different parts of the clothes corresponding to different parts, the dressing sequences corresponding to different parts are input into the corresponding GRU prediction model in parallel for training according to different parts. The trained GRU model can predict the target user's future clothing information according to the dressing records of various parts of the human body, such as the dressing conditions of tops, pants, shoes and other parts.

[0060] In the step S4, based on the trained autoencoder obtained in step S2 and the trained GRU prediction model obtained in step S3, the trained autoencoder and the GRU prediction model are integrated to form an end-to-end network, which is the AG-PNN (Prediction Neural Network based on AutoEncoder and GRU) model proposed in the present invention.

[0061] The encoding layer of the trained autoencoder is connected to the input layer of the GRU prediction model, and the high-dimensional sparse feature vector sequence of the historical clothing records of the user to be predicted is compressed into a low-dimensional dense vector sequence and input into the GRU model for calculation. The output of the GRU prediction model is also the compressed low-dimensional dense vector of the clothing; the output layer of the GRU prediction model is connected to the decoding layer of the autoencoder, and the output of the GRU prediction model is restored, and the output is a decompressed high-dimensional sparse vector.

[0062] Then, the high-dimensional sparse vector output by the AG-PNN model is compared with the high-dimensional sparse vectors of other clothes in the database in terms of cosine similarity. The clothing with the highest cosine similarity is the clothing recommended by the user to be predicted.

[0063] The trained AG-PNN model is deployed in the smart wardrobe APP to provide clothing recommendations for users.

[0064] In this embodiment, clothing recommendations are also made to the predicted user using the clothing index.

[0065] For users who have not left any dressing records or have relatively few dressing records, the AG-PNN model cannot accurately predict the dressing combinations that the predicted user has a higher preference tendency. Therefore, the dressing index is introduced to judge the dressing situation of the predicted user.

[0066] The clothing index refers to the thickness of clothing required to keep a person's body surface temperature constant or to keep the human body in a comfortable state, and is generally expressed in levels. Each clothing index level corresponds to a type of clothing, and the above clothing types can intuitively reflect the thickness of clothing, such as thinner clothing such as T-shirts or shorts, and thicker clothing such as sweaters and down jackets.

[0067] The clothing index is mainly obtained through weather APIs. Specifically, the clothing index can be estimated through Tencent Weather API.

[0068] Introduce the clothing index into the smart wardrobe APP to recommend suitable clothing for the predicted user.

[0069] Embodiment 2

[0070] This embodiment provides a user clothing recommendation system based on an autoencoder and a memory network, including:

[0071] A data acquisition module is configured to: acquire a high-dimensional feature vector of clothing in a user's historical clothing record;

[0072] A first model training module is configured to: input the high-dimensional feature vector of the clothing into an autoencoder for training until the data output by the autoencoder after decoding and encoding tends to be the same as the input high-dimensional feature vector, thereby obtaining a trained autoencoder;

[0073] The second model training module is configured to: use the low-dimensional feature vector output by the trained autoencoder after decoding as a training set to train the GRU prediction model, thereby obtaining a trained GRU prediction model;

[0074] The prediction module is configured to: input the high-dimensional feature vector of the historical clothing record of the user to be predicted into the trained autoencoder-GRU prediction model to make clothing recommendations for the user.

[0075] Embodiment 3

[0076] The purpose of this embodiment is to provide a computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the steps of the above method are implemented when the processor executes the program.

[0077] Embodiment 4

[0078] The purpose of this embodiment is to provide a computer-readable storage medium.

[0079] A computer-readable storage medium stores a computer program, which executes the steps of the above method when executed by a processor.

[0080] The steps involved in the apparatuses of the above embodiments 2, 3 and 4 correspond to the method embodiment 1, and the specific implementation methods can refer to the relevant description part of embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood to include any medium that can store, encode or carry an instruction set for execution by a processor and enable the processor to execute any method in the present invention.

[0081] Those skilled in the art should understand that the modules or steps of the present invention described above can be implemented by a general-purpose computer device, or alternatively, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. The present invention is not limited to any specific combination of hardware and software.

[0082] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.

Claims

1. A user clothing recommendation method based on autoencoder and memory network, characterized in that: include: Obtaining a high-dimensional feature vector of clothing in the user's historical clothing record, wherein the specific method of obtaining the high-dimensional feature vector is: dividing the clothing into multiple sets according to the corresponding parts of the clothing according to the user's historical clothing record, and the clothing in each set is represented by different vectors according to different features, and the clothing in the set is sorted in chronological order; Inputting the high-dimensional feature vector of the clothing into an autoencoder for training until the data output by the autoencoder after decoding and encoding tends to be the same as the input high-dimensional feature vector, and training a corresponding number of autoencoders according to the number of the multiple sets; The low-dimensional feature vector output by the trained autoencoder after encoding is used as a training set to train the GRU prediction model, and the trained GRU prediction model is obtained. The training GRU prediction model is: using a sliding window to select a dressing sequence consisting of low-dimensional feature vectors of clothing that are continuous in time order, and inputting them into the GRU prediction model for iterative training; Input the high-dimensional feature vector sequence of the historical clothing records of the user to be predicted into the trained autoencoder-GRU prediction model to make clothing recommendations for the user; The trained autoencoder-GRU prediction model forms an end-to-end network structure with the autoencoder and the GRU prediction model, wherein the encoding layer of the autoencoder is connected to the input layer of the GRU prediction model, and the output layer of the GRU prediction model is connected to the decoding layer of the autoencoder.

2. The user clothing recommendation method based on autoencoder and memory network as claimed in claim 1, characterized in that: The autoencoder consists of an encoding layer and a decoding layer.

3. The user clothing recommendation method based on autoencoder and memory network as claimed in claim 1, characterized in that: It also includes using the clothing index to make clothing recommendations for the predicted users.

4. The user clothing recommendation method based on autoencoder and memory network as claimed in claim 1, characterized in that: The high-dimensional clothing feature vector output by the trained autoencoder-GRU prediction model is compared with the clothing information in the clothing database of the user to be predicted, and clothing combinations are recommended for the user to be predicted.

5. A user clothing recommendation system based on autoencoder and memory network, characterized in that: include: The data acquisition module is configured to: acquire high-dimensional feature vectors of clothing in the user's historical clothing records, wherein the specific method of acquiring the high-dimensional feature vectors is: according to the user's historical clothing records, the clothing is divided into multiple sets according to the corresponding parts of the clothing, and the clothing in each set is represented by different vectors according to different features, and the clothing in the set is sorted in chronological order; A first model training module is configured to: input the high-dimensional feature vector of the clothing into an autoencoder for training, until the data output by the autoencoder after decoding and encoding tends to be the same as the input high-dimensional feature vector, to obtain a trained autoencoder, and train a corresponding number of autoencoders according to the number of the multiple sets; The second model training module is configured to: use the low-dimensional feature vector output by the trained autoencoder after encoding as a training set to train the GRU prediction model, and obtain a trained GRU prediction model, wherein the training GRU prediction model is: using a sliding window to select a dressing sequence consisting of low-dimensional feature vectors of clothing that are continuous in time order, and inputting them into the GRU prediction model for iterative training; A prediction module is configured to: input the high-dimensional feature vector of the historical clothing record of the user to be predicted into the trained autoencoder-GRU prediction model to make clothing recommendations for the user; The trained autoencoder-GRU prediction model forms an end-to-end network structure with the autoencoder and the GRU prediction model, wherein the encoding layer of the autoencoder is connected to the input layer of the GRU prediction model, and the output layer of the GRU prediction model is connected to the decoding layer of the autoencoder.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps in a user clothing recommendation method based on an autoencoder and a memory network as described in any one of claims 1 to 4 are implemented.

7. A processing device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the user clothing recommendation method based on autoencoder and memory network as described in any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Intelligent terminal clothing recommendation method and system

    CN107644093A

  • Tropical cyclone trajectory prediction method based on auto-encoder and GRU neural network

    CN111242351A