A hypergraph-based clothing compatibility prediction method
By introducing hypergraph and simple graph-enhanced network models into clothing matching, combined with the attention mechanism, the problem of difficulty in expressing the complex relationships of clothing sets in the existing technology is solved, and high-accuracy clothing compatibility prediction and matching suggestions are achieved.
Patent Information
- Application Number
- CN202210296195.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-24
- Publication Date
- 2024-09-20
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technology is difficult to effectively represent and predict the complex relationships between multiple clothing items in a clothing set, resulting in complex clothing matching tasks and difficulty in achieving reasonable compatibility predictions.
A hypergraph-based clothing compatibility prediction method is adopted, by constructing a hypergraph and converting it into a simple graph-enhanced network model, combining a convolutional neural network, a multi-layer perceptron network and an attention mechanism, and iteratively updating the graph node representation to calculate the suit compatibility score.
It significantly improves the accuracy of clothing fill-in-the-blank tasks and the accuracy of clothing compatibility prediction. It can effectively represent and predict the relationship between clothing items in a suit, and improves the compatibility prediction ability of clothing matching.
Smart Images

Figure CN114581155B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer vision, and in particular aims at predicting compatibility in clothing matching based on neural networks. Background Art
[0002] In recent years, with the rapid development of the Internet and the increasing maturity of the logistics industry, online shopping has become increasingly important to modern consumers, greatly promoting the development of the fashion industry. According to statistics, the global online fashion market was worth $533 billion in 2018 and is expected to increase to $825 billion by 2022. As a daily consumer product, consumers have a relatively large demand for clothing, with high consumption frequency and density. In 2018, clothing accounted for 65% of the market share, followed by footwear (25%) and bags and accessories (10%). In addition, there are some fashion community websites that allow customers to create their own style using clothing images on the website. However, not everyone is a natural fashion designer. It is difficult for many people to choose and match suitable clothes from a large number of clothing items, and they are even tired of it. Therefore, it is of great significance to establish a reasonable and effective clothing matching model through the analysis of massive clothing items and suits.
[0003] Clothing matching is a complex task that depends on subjective concepts of style, context, and trends - all of which can vary from person to person and evolve over time. This task is fundamental to a variety of industry applications, such as personalized fashion design, clothing combination, clothing item recommendation, and fashion trend forecasting. The key to clothing matching is to measure the matching degree of multiple clothing items in an outfit.
[0004] The key to solving the problem of suit compatibility prediction lies in how to reasonably represent the suit as a whole. However, previous research results mainly used three clothing representation methods: pair representation, sequence representation and graph representation. Their representation methods all have certain defects. For example, pair representation cannot reflect the complex relationship between multiple clothing items; sequence representation itself is unreasonable because the relationship between clothing items in a suit is not ordered; and graph representation models the suit as a graph, but when constructing the relationship, it essentially constructs the relationship between pairs. Therefore, the current research results have not found a reasonable representation method that can well represent the relationship between suits and clothing items. It is urgent to propose a new idea to better reflect the dense and complex relationship between multiple items in a set of clothing. Summary of the invention
[0005] In view of the above problems, the present invention provides a clothing compatibility prediction method based on a hypergraph. The present invention introduces a hypergraph to well reflect the complex relationship between suits and clothing items, while converting hyperedges into simple graphs to enhance the coupling ability of the model, and using the attention mechanism to enhance the prediction ability of the model.
[0006] In order to solve the above technical problems, the present invention proposes a clothing compatibility prediction method based on a hypergraph, comprising the following steps:
[0007] Step 1: Preprocess the data set: First, construct a hypergraph from the existing data set to represent the suits and clothing items in the existing data set, and use graph segmentation technology to divide the data set into training set, validation set, and test set; then use convolutional neural network to extract the visual features contained in the clothing item images in the data set, and then use one-hot encoding to encode the titles of the clothing items to obtain their text features;
[0008] Step 2, training the network model: map the visual features and text features corresponding to the clothing items in the training set to a common style space as the initialization state of the hypergraph node through a multi-layer perceptron network (MLP); after obtaining the initialization state of the hypergraph node, randomly select a hyperedge in the hypergraph, perform inner product on the hypergraph nodes in the hyperedge, obtain the two hypergraph nodes with the largest difference as key nodes, and use the hypergraph nodes other than the key nodes in the hyperedge as intermediary nodes, and then connect the intermediary nodes to the key nodes to obtain a simple graph enhancement network model; after obtaining the simple graph enhancement network model, iteratively update the graph node representation in the simple graph structure using a message propagation mechanism, and obtain the final representation of the graph node through a gated loop (Gated Recurrent Units); then use the final representation of the graph node to calculate the compatibility score of the suit through an attention mechanism, and input the compatibility score of the suit into the loss function. When the loss function reaches a stable value and remains unchanged, the training of the simple graph enhancement network model is completed;
[0009] Step 3: Test the network model: Input the validation set and the test set into the trained simple graph augmented network model, use the clothing filling-in-the-blank task and clothing compatibility prediction task to test the performance of the simple graph augmented network model, and obtain the tested network model;
[0010] Step 4: Use the tested network model to predict the overall compatibility of the package.
[0011] Furthermore, the hypergraph-based clothing compatibility prediction method of the present invention comprises:
[0012] Step 1 includes: 1-1) Using a convolutional neural network to extract the visual features of clothing items, first input the pictures of clothing items into the convolutional neural network GoogleNet Inception-V3 model, and then output the visual features of each clothing item through a linear layer; 1-2) Using the titles of clothing items in the dataset to create a vocabulary, filter out invalid words, and use one-hot encoding to obtain the text features of each clothing item. The invalid words are words with less than three characters.
[0013] The hypergraph is composed of hypernodes and hyperedges. The hypernodes represent clothing items of different categories, and the hyperedges represent suits composed of multiple different clothing items.
[0014] Furthermore, in step 2, the process of obtaining the initialization state of the node is: the visual features and text features of the clothing items corresponding to each hypergraph node are filled into the hypergraph node as input, and then the visual features and text features obtained in step 1 are mapped to a common style space as the initialization state of the hypergraph node through a multi-layer perceptron network (MLP).
[0015] The process of iteratively updating the node representation of the model using the message propagation mechanism is: using the message propagation mechanism to propagate the state information of each key node and intermediate node to the adjacent graph nodes, and at the same time each key node and intermediate node receives the state information from the adjacent graph nodes for node interaction; each key node and intermediate node iteratively updates its own state information by aggregating the information of adjacent graph nodes.
[0016] Furthermore, in step three, the clothing filling-in-the-blank task refers to given a set of clothing items, a blank and a set of candidate sets, and then finding the clothing that is most compatible with the given clothing items from the candidate set to fill the blanks, and finding the suit with the highest compatibility score with the given clothing items from the candidate set; the clothing compatibility prediction task refers to generating a compatibility score for a given set of clothing, and the score of the compatibility score represents the overall compatibility degree of the clothing.
[0017] The test for the clothing compatibility prediction task includes the following steps:
[0018] 3-1) Input the final representation of the nodes corresponding to different clothing items into the attention mechanism model, simulate the importance of different clothing items to the suit through the attention mechanism, and obtain the state representation of the importance of each item corresponding to the graph node to the suit;
[0019] 3-2) Input the final representation of the nodes corresponding to different clothing items into the attention mechanism model, simulate the compatibility scores of different clothing items in the suit through the attention mechanism, and obtain the state representation of the compatibility score of each clothing item corresponding to the graph node in the suit;
[0020] 3-3) Multiply the state representation of each graph node obtained in steps 3-1) and 3-2) and then add them together to obtain the compatibility score of the entire set; if the compatibility score is higher than 0.5 and lower than 1, the set is considered compatible; if the compatibility score is higher than 0 and lower than 0.5, the set is considered incompatible.
[0021] Compared with the prior art, the present invention has the following beneficial effects:
[0022] The experiments and comparative experiments of the hypergraph-based clothing compatibility prediction method in the present invention are trained by a Quadro M4000 graphics processor. The model effect is illustrated by two tasks: clothing fill-in-the-blank task and compatibility prediction task. The experimental results show that, under the same data set, the hypergraph-based clothing compatibility prediction method improves the accuracy of clothing fill-in-the-blank task by more than 3% compared with the latest model (node graph neural network NGNN), and reaches an accuracy of up to 98% in the compatibility prediction task. This shows that the hypergraph-based clothing compatibility prediction method designed in the present invention can well represent the relationship between clothing items in a suit, and can well predict the compatibility of the suit as a whole. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 This is a hypergraph-based clothing compatibility prediction framework diagram of the present invention;
[0024] Figure 2 A schematic diagram of a hypergraph constructed based on a data set according to the present invention;
[0025] Figure 3 It is a schematic diagram of converting a hypergraph into a simple graph according to the present invention. DETAILED DESCRIPTION
[0026] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. The described specific embodiments are only used to explain the present invention and are not intended to limit the present invention.
[0027] The invention proposes a design concept of a hypergraph-based clothing compatibility prediction method, such as Figure 1 As shown in the figure, since the hypergraph can well reflect the complex relationship between the suit and the clothing items, the hypergraph is constructed through the data in the dataset. After the hypergraph is constructed, the hypergraph is converted into a traditional graph to form a simple graph enhanced network model for information propagation, and the attention mechanism is used to enhance the prediction ability of the model to obtain the final suit compatibility score.
[0028] The present invention is based on the hypergraph clothing compatibility prediction method, such as Figure 1 As shown, the following steps are included:
[0029] Step 1: Preprocess the data set.
[0030] 1-1) First, a hypergraph is constructed through the existing data set to represent the suits and clothing items in the existing data set. The hypergraph is composed of hypernodes and hyperedges. The hypernodes represent clothing items of different categories, such as Figure 1 As shown in the figure, there are many categories such as coats, shirts, shorts, accessories, sandals, dresses, handbags, high heels, etc.; the hyperedge represents a set of multiple different clothing items; at the same time, the data set is divided into training set, validation set and test set using graph segmentation technology. Figure 2 As shown, the hypernodes in the hypergraph represent different types of clothing items, such as coats, shirts, shorts, accessories, sandals, dresses, handbags, high heels, etc.; and the hyperedges represent the relationship between multiple different types of items (that is, they together form a complete suit).
[0031] 1-2) Use convolutional neural networks to extract visual features of clothing items. First, input the pictures of clothing items into the convolutional neural network GoogleNet Inception-V3 model, and then output the visual features of each clothing item through a linear layer;
[0032] 1-3) Create a vocabulary using the titles of clothing items in the dataset. Since there is no unified standard for titles, there may be many meaningless words, such as 'a', 'an', 'de', etc. Therefore, it is necessary to filter out words with less than three characters to ensure the validity of the vocabulary. After filtering out invalid words, use one-hot encoding to obtain the text features of each clothing item.
[0033] Step 2: Train the network model.
[0034] 2-1) The visual features and text features corresponding to the clothing items in the training set are mapped to a common style space as the initialization state of the hypergraph node through a multi-layer perceptron network (MLP). That is, for each hypergraph node, the visual features and text features of the corresponding clothing item are filled into the node as input, and then the visual features and text features obtained in step 1 are mapped to a common style space as the initialization state of the node through a multi-layer perceptron network (MLP).
[0035] 2-2) In order to better reflect the relationship between clothing items in a suit, after obtaining the initial state of the hypergraph node, a hyperedge in the hypergraph is randomly selected, such as Figure 3As shown in the figure, the hyperedge composed of category nodes such as coats, dresses, handbags, high heels and accessories, the inner product of the hypergraph nodes is performed, and the two hypergraph nodes with the greatest difference are obtained as key nodes to represent the entire hyperedge. At the same time, in order to make full use of all the node information in the hyperedge, only using two key nodes to represent the hyperedge may cause some important information to be lost. Therefore, in order to make full use of all the hypergraph node information, the hypergraph nodes other than the key nodes in the hyperedge are used as media nodes, and are connected to the key nodes respectively to obtain a simple graph enhancement network model, as shown in the figure. Figure 3 shown.
[0036] 2-3) After obtaining the simple graph enhancement network model, the message propagation mechanism is used to iteratively update the graph node representation in the simple graph structure. That is, each node in the simple graph aggregates the node information of the surrounding neighbors using the message propagation mechanism in the graph convolutional network to iteratively update its own node information, and receives status information from adjacent nodes for node interaction; each node iteratively updates its own status information by aggregating the node information of the surrounding neighbors.
[0037] 2-4) After the representation of each node has undergone multiple layers of message propagation, the final representation of the graph node is obtained through the gated recurrent units. Then, the compatibility score of the set is calculated using the final representation of the graph node through the attention mechanism, and the compatibility score of the set is input into the loss function. When the loss function reaches a stable value and remains unchanged, the training of the simple graph enhancement network model is completed.
[0038] Step 3: Test the network model.
[0039] The validation set and the test set are input into the trained simple graph augmented network model, and the performance of the simple graph augmented network model is tested using the clothing filling-in-the-blank task and clothing compatibility prediction task. The clothing filling-in-the-blank task refers to given a set of clothing items, a blank, and a set of candidate sets, and then finding the most compatible clothing with the given clothing items from the candidate set to fill the blank, and finding the suit with the highest compatibility score with the given clothing items from the candidate set; the clothing compatibility prediction task refers to generating a compatibility score for a given set of clothing, and the score of the compatibility score represents the overall compatibility of the clothing. After the test, the performance indicators of each experimental task are recorded as the final experimental results.
[0040] The compatibility score of the set is calculated through the attention mechanism, including:
[0041] 3-1) Input the final representation of the nodes corresponding to different clothing items into the attention mechanism model, simulate the importance of different clothing items to the suit through the attention mechanism, and obtain the state representation of the importance of each item corresponding to the graph node to the suit;
[0042] 3-2) Input the final representation of the nodes corresponding to different clothing items into the attention mechanism model, simulate the compatibility scores of different clothing items in the suit through the attention mechanism, and obtain the state representation of the compatibility score of each clothing item corresponding to the graph node in the suit;
[0043] 3-3) Multiply the state representation of each graph node obtained in steps 3-1) and 3-2) and then add them together to obtain the compatibility score of the entire set; if the compatibility score is higher than 0.5 and lower than 1, the set is considered compatible; if the compatibility score is higher than 0 and lower than 0.5, the set is considered incompatible.
[0044] Step 4: Use the tested network model to predict the overall compatibility of the package.
[0045] Example:
[0046] This example first constructs a fashion hypergraph based on the Polyvore dataset, where each hyperedge represents a set of different fashion items, and randomly selects a hyperedge in the hypergraph to calculate the compatibility of clothing. Different from the way of expanding the hypergraph by connected components, in order to make the fashion items in the set that have a greater impact on clothing compatibility gain more attention, this chapter calculates the similarity between different nodes in the hyperedge, takes the two nodes with the smallest similarity as key nodes to represent the entire hyperedge, and connects the remaining nodes to the key nodes to form a new graph structure. At the same time, the message propagation mechanism in the graph neural network is used to aggregate the effective information in the graph structure into the state representation of the key nodes to enhance compatibility modeling; finally, the attention mechanism is introduced to model the importance of different items to clothing compatibility, and the final compatibility score is generated to predict clothing compatibility.
[0047] The experiment of this embodiment (using the simple graph-enhanced network model in the prediction method of the present invention) and the comparative experiment (using the NGNN model) are both trained by a graphics processor configured as a Quadro M4000. The model effect is illustrated by two tasks: clothing filling-in-the-blank task (selecting a clothing item that matches the existing clothing to form a compatible suit) and clothing compatibility prediction (scoring the compatibility of a given suit and predicting whether the suit is compatible). The experimental results show that under the same data set, the model proposed by the present invention achieves an accuracy of up to 77% and 98% in the clothing filling-in-the-blank task and the clothing compatibility prediction task, respectively, which is more than 3% higher than the comparative experiment in the clothing filling-in-the-blank task. This shows that the simple graph-enhanced network model designed in the clothing compatibility prediction method based on the hypergraph of the present invention can well represent the relationship between clothing items in the suit, and can well predict the compatibility of the suit as a whole.
[0048] Although the present invention has been described above in conjunction with the accompanying drawings, the present invention is not limited to the above-mentioned specific embodiments, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can make many modifications without departing from the purpose of the present invention, all of which are within the protection of the present invention.
Claims
1. A clothing compatibility prediction method based on hypergraph, characterized in that: The following steps are involved: Step 1: Preprocess the data set: First, construct a hypergraph from the existing data set to represent the suits and clothing items in the existing data set, and use graph segmentation technology to divide the data set into training set, validation set, and test set; then use convolutional neural network to extract the visual features contained in the clothing item images in the data set, and then use one-hot encoding to encode the titles of the clothing items to obtain their text features; Step 2: Training the network model: Map the visual features and text features corresponding to the clothing items in the training set to a common style space as the initialization state of the hypergraph node through a multi-layer perceptron network (MLP); after obtaining the initialization state of the hypergraph node, randomly select a hyperedge in the hypergraph, perform inner product on the hypergraph nodes in the hyperedge, obtain the two hypergraph nodes with the largest difference as key nodes, and use the hypergraph nodes in the hyperedge other than the key nodes as intermediary nodes, and then connect the intermediary nodes to the key nodes to obtain a simple graph enhancement network model; After the simple graph enhancement network model is obtained, the graph node representation in the simple graph structure is iteratively updated by using a message propagation mechanism, and the final representation of the graph node is obtained by using a gated recurrent unit; then, the compatibility score of the set is calculated by using the final representation of the graph node through an attention mechanism, and the compatibility score of the set is input into a loss function. When the loss function reaches a stable value and remains unchanged, the training of the simple graph enhancement network model is completed; Step 3: Test the network model: Input the validation set and the test set into the trained simple graph augmented network model, use the clothing filling-in-the-blank task and clothing compatibility prediction task to test the performance of the simple graph augmented network model, and obtain the tested network model; Step 4: Use the tested network model to predict the overall compatibility of the package.
2. The hypergraph-based clothing compatibility prediction method according to claim 1, characterized in that: Step one includes the following steps: 1-1) Use convolutional neural networks to extract visual features of clothing items. First, input the pictures of clothing items into the convolutional neural network GoogleNet Inception-V3 model, and then output the visual features of each clothing item through a linear layer; 1-2) Create a vocabulary using the titles of the clothing items in the dataset, filter out invalid words, and use one-hot encoding to obtain the text features of each clothing item.
3. The hypergraph-based clothing compatibility prediction method according to claim 2, characterized in that: In step 1, the invalid word refers to a word with less than three characters.
4. The hypergraph-based clothing compatibility prediction method according to claim 1, characterized in that: In step 1, the hypergraph is composed of hypernodes and hyperedges, the hypernodes represent clothing items of different categories, and the hyperedges represent suits composed of multiple different clothing items.
5. The hypergraph-based clothing compatibility prediction method according to claim 4, characterized in that: In step 2, the process of obtaining the initialization state of the node is: the visual features and text features of the clothing items corresponding to each hypergraph node are filled into the hypergraph node as input, and then the visual features and text features obtained in step 1 are mapped to a common style space as the initialization state of the hypergraph node through a multi-layer perceptron network (MLP).
6. The hypergraph-based clothing compatibility prediction method according to claim 5, characterized in that: In step 2, the process of iteratively updating the node representation of the model using the message propagation mechanism is: using the message propagation mechanism to propagate the state information of each key node and intermediate node to the adjacent graph nodes, and at the same time each key node and intermediate node receives the state information from the adjacent graph nodes for node interaction; each key node and intermediate node iteratively updates its own state information by aggregating the information of adjacent graph nodes.
7. The hypergraph-based clothing compatibility prediction method according to claim 1, characterized in that: In step three, the clothing filling-in-the-blank task refers to given a set of clothing items, a blank and a set of candidate sets, and then finding the clothing that is most compatible with the given clothing items from the candidate set to fill the blanks, and finding the suit with the highest compatibility score with the given clothing items from the candidate set; the clothing compatibility prediction task refers to generating a compatibility score for a given set of clothing, and the score of the compatibility score represents the overall compatibility degree of the clothing.
8. The hypergraph-based clothing compatibility prediction method according to claim 7, characterized in that: In step 3, the test for the clothing compatibility prediction task includes the following steps: 3-1) Input the final representation of the nodes corresponding to different clothing items into the attention mechanism model, simulate the importance of different clothing items to the suit through the attention mechanism, and obtain the state representation of the importance of each item corresponding to the graph node to the suit; 3-2) Input the final representation of the nodes corresponding to different clothing items into the attention mechanism model, simulate the compatibility scores of different clothing items in the suit through the attention mechanism, and obtain the state representation of the compatibility score of each clothing item corresponding to the graph node in the suit; 3-3) Multiply the state representation of each graph node obtained in steps 3-1) and 3-2) and then add them together to obtain the compatibility score of the entire set; if the compatibility score is higher than 0.5 and lower than 1, the set is considered compatible; if the compatibility score is higher than 0 and lower than 0.5, the set is considered incompatible.
