Female shirt recommendation method based on random forest algorithm

By applying the random forest algorithm and Relief algorithm in the clothing recommendation system, a detailed classification model for women's shirt style is constructed, which solves the problem of inaccurate recommendation results for women's shirts in the existing system, and achieves a more accurate recommendation effect.

CN119539913APending Publication Date: 2025-02-28嘉兴南湖学院
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411675044.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The existing clothing recommendation system lacks detailed processing when recommending women's shirts, resulting in inaccurate recommendation results.

Method used

The women's shirt recommendation method based on the random forest algorithm is adopted. By performing feature analysis and classification of women's shirts, a style classification model is constructed, and feature extraction is used to calculate similarity through decision-making leaf nodes for recommendation.

Benefits of technology

The meticulous feature processing of women's shirts is achieved, the accuracy of recommendation results is improved, and the accuracy of recommendation lists is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119539913A_ABST
    Figure CN119539913A_ABST
Patent Text Reader

Abstract

The invention discloses a woman shirt recommendation method based on a random forest algorithm, and the method comprises the steps: 1, carrying out the feature analysis of woman shirts, summarizing the related features and styles, carrying out the classification, sequentially carrying out the feature introduction, carrying out the assignment through statistical variables, and preparing for the construction of a subsequent model; 2, firstly, collecting a female shirt style label sample on a platform, and performing assignment on the basis of feature quantification in the step 1; and step 3, connecting the model constructed in the step 2 to a user side for application, realizing recommendation of the user's female shirts, then pushing recommendation result evaluation to the user side, and receiving evaluation data after the user side completes the evaluation. According to the woman shirt recommendation method based on the random forest algorithm, through setting of the first step, the second step and the third step, the woman shirt can be recommended after feature analysis is carried out on the woman shirt, so that compared with a mode in the prior art, the recommendation accuracy is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a clothing recommendation method, and more particularly to a women's shirt recommendation method based on a random forest algorithm. Background Art

[0002] In the current information age, people are faced with a massive amount of information input, and it is easy to miss some key information. Some businesses recommend clothing customization to users by casting a wide net, hoping to let more users understand the benefits of clothing customization and guide users who actually need this service to enjoy the advantages brought by customization. However, there are some problems with this promotion method. The recommendation method of casting a wide net lacks pertinence and does not take into account the actual consumption of users, resulting in some potential users who need clothing customization services still not understanding or being exposed to this service.

[0003] To solve this problem, merchants can adopt more accurate recommendation strategies and tailor push content for users based on personalized recommendation algorithms and user behavior data. By analyzing users' browsing history, purchase preferences and needs, merchants can better understand users and recommend customized services that meet their interests and needs. This personalized recommendation can not only improve user experience, but also increase users' understanding and acceptance of clothing customization services.

[0004] Therefore, there is an invention patent with patent number CN118445490A in the prior art, and its name is personalized clothing design recommendation system and method based on AI and big data. It discloses the setting of clothing design data acquisition module, clothing design data processing module, clothing design data fusion module and clothing design data analysis module, and obtains the user's clothing browsing and purchase data, as well as the feature data of the clothing to be recommended, and uses feature vectors and classifiers to determine whether to recommend the clothing, thereby providing users with customized clothing recommendation services. However, women's shirts have a variety of detailed styles, and the above-mentioned clothing design data analysis module does not process the features of women's shirts one by one in detail. If the existing recommendation system is used, it is easy for the recommendation results of women's shirts to be inaccurate. Summary of the invention

[0005] In view of the deficiencies in the prior art, the object of the present invention is to provide a women's shirt recommendation method based on a random forest algorithm, which is used to recommend women's shirts in a targeted manner.

[0006] To achieve the above object, the present invention provides the following technical solution: a method for recommending women's shirts based on a random forest algorithm, characterized in that it includes:

[0007] Step 1: Analyze the characteristics of women's shirts, summarize the relevant characteristics and styles, and then classify them. Finally, three major feature modules and three types of style labels are obtained. Then, the characteristics are introduced in turn and assigned with the help of statistical variables to prepare for the subsequent model construction;

[0008] Step 2: First, collect samples of women's shirt style labels on the platform, assign values ​​based on the feature quantification in step 1, extract features using the Relief algorithm, complete style classification with the help of random forest, calculate similarity using decision tree leaf nodes, and complete model construction;

[0009] Step three, connect the model built in step two to the user end for application, implement the recommendation of women's shirts for users, and then push the evaluation of recommendation results to the user end. After the user end completes the evaluation, the evaluation data is received, and the satisfaction rate of the recommendation results is calculated based on the evaluation data. The user's recommendation preference is counted, and finally, the consumer's evaluation of the model is collected.

[0010] As a further improvement of the present invention, the specific steps of performing feature analysis on the women's shirt in step 1 are as follows:

[0011] Step 1: Conduct an online survey on women's shirts from various e-commerce brands to obtain relevant features of women's shirts, build feature factor quantification and feature system, and provide a sample basis for random forest style recommendation;

[0012] Step 1 and 2, filter the information on the relevant features and styles of the women's shirts obtained in step 1, and obtain the relevant features and styles of the women's shirts. Specifically, the structural features of 8 types of women's shirts are finally obtained: length, collar type, sleeve length, pattern, version, placket, decoration and sleeve type. Among them, "length, collar type, sleeve length, version, placket and sleeve type" can be classified into styles, recorded as A1, and "pattern, decoration" are recorded as A2 and A3 respectively, these 3 modules;

[0013] Step 13, mark the structural features of the 8 types of women's shirts obtained in step 12, and divide the specific locations of the feature values ​​into two categories, namely, unordered variables and ordered variables. Among them, for the features whose content classification shows regularity and the results are relatively qualitative, ordered variables are adopted, and integers between [-2,2] are marked. For the features with more and richer content classifications, binomial classification of unordered variables is adopted, marked "0" or "1" to represent "yes" and "no". Some features adopt multinomial variables of unordered variables, marked "-1", "0" and "1" to represent variables.

[0014] As a further improvement of the present invention, the specific steps of feature extraction by the Relief algorithm in step 2 are as follows:

[0015] Step 21: first, all feature weight sets W are preset to 0;

[0016] Step 22: The feature optimization training set is divided into a training set and a test set according to a ratio of 1:4. A female shirt sample X is randomly selected from the training set L, X∈L;

[0017] Step 2 and 3: Select r samples Hi, i = (1, 2, ..., r) similar to the women's shirt sample X in the same style;

[0018] Step 24: select r samples Mi similar to the women's shirt sample X in different styles, i = (1, 2, ..., r);

[0019] Step 25: Use the following formula to calculate the feature weight W(ei)

[0020]

[0021] Among them, the weight W(e i ) represents feature e i The importance of diff(e i ,X i ,H j) and diff(e i ,X i ,M j (D)) measure the shirt samples X and H respectively j and M j (D) In ​​feature e i The difference in the number of similar samples, r is the number of similar samples, h is the number of sampling; Z x represents the style of women's shirt to which sample X belongs, D is the total number of categories different from X; P(D) and P(Z xi) are the probabilities of class D and X respectively; M j (D) is the sample in class D that is closest to the jth sample in X;

[0022] Step 26, perform h iterations of calculation;

[0023] Step 27: Determine the importance weight of each feature.

[0024] As a further improvement of the present invention, the specific method of completing style classification with the help of random forest in step 2 is: first, classify the 180 women's shirt sample data sets, and this step uses the random forest algorithm; count the number of same paths between samples to calculate the similarity, and sort the samples that meet the requirements according to the similarity to form a recommendation list with a similarity greater than 7.

[0025] As a further improvement of the present invention, the specific method of classifying the 180 women's shirt sample data set in step 2 is as follows: the initial N women's shirt samples are extracted k times with replacement through the bagging algorithm to form k training sets T, and k decision trees F are trained based on them, and each decision tree randomly selects n features (n<m) from the m features for training. Finally, the classification result of each tree is determined by the mode to obtain the overall classification result;

[0026] The selection of decision tree node features is calculated in the following way, see the following formula:

[0027] Gini(T)=1-∑P i 2

[0028] Among them, Pi represents the proportion of samples of the i-th category in the node data set. The smaller the Gini coefficient, the more accurate the classification. Therefore, the attribute corresponding to the smallest Gini coefficient is finally taken.

[0029] As a further improvement of the present invention, the specific method of calculating the similarity in step 2 is: first, a decision tree is generated by a random forest algorithm, and then classification is performed using the structural characteristics of the tree. Each node of the decision tree has its corresponding characteristics, and the initial sample is divided according to the characteristic judgment of each leaf node, and finally classification is achieved. The specific calculation formula is as follows:

[0030]

[0031] Where: S is the sample similarity, T is the training sample, V is the test sample, u refers to the u-th decision tree, X is the state function, L is the node number vector, the women's shirt test set and the training set samples are similar at the same nodes, and the more times they are at the same nodes, the higher the similarity.

[0032] As a further improvement of the present invention, the step three also includes a model verification step, which is as follows: first, the smart terminals corresponding to 20 female consumers are selected, and samples are sent to the smart terminals for users to select their favorite women's shirt product images from the samples. After the user completes the selection, the model constructed in step two assigns features to the women's shirt product image selected by the user, and screens other samples similar to this product image. If the similarity value is greater than 70%, they are considered similar and recommended. A recommendation list is generated from the recommended results. Consumers use the smart terminals to provide feedback on their satisfaction with the recommendation list, and the satisfaction is scored from 1 to 5 to determine the credibility of the model. Finally, the consumer's evaluation of the model is collected.

[0033] As a further improvement of the present invention, the specific steps of marking the structural features in step 1-3 are as follows:

[0034] The length, version, and sleeve length of the style features are uniformly marked with [-1, 1]. The sleeve type, placket, collar type, pattern, and decoration of the women's shirt are unordered variables. Among them, the sleeve type is mainly divided into regular sleeves, raglan sleeves, and lantern sleeves. The placket is mainly divided into visible placket, hidden placket, and soft placket. The collar type can be mainly divided into standard collar, round collar, long pointed collar, stand-up collar and other collar types. The pattern is mainly divided into solid color, stripes, and geometry. The decoration is divided into splicing, asymmetry, and pleats.

[0035] As a further improvement of the present invention, step three also includes an evaluation result analysis step, specifically: analyzing the scores of 20 users. If the satisfaction scores of 15 users are greater than 4, the satisfaction scores of the remaining five users are greater than 3.5, and 10% of the users are not satisfied, it is judged that the model's prediction of user preferences is relatively accurate, otherwise it is judged that the prediction is inaccurate.

[0036] The beneficial effects of the present invention are:

[0037] The characteristic elements of women's shirts are quantified

[0038] The present invention completes the quantification and feature extraction of women's shirt feature elements, and the results are as follows: through the preliminary search of relevant literature, the feature types of women's shirts are divided into three modules: style, pattern and decoration. The styles of women's shirts are sweet, casual and business. The modules are further divided into 8 feature elements, and the meaning of the features and the standards for feature quantification are explained. The length, sleeve length and other modules in the style module are defined with the help of standard mannequins, and style diagrams are drawn as references. With the help of the Relief algorithm, the sample feature importance score calculation is completed, and the leaf node calculation formula is used to obtain the optimal number of decision trees, which improves the accuracy of the classification results and finally completes the quantification of feature elements.

[0039] (2) Build a women’s shirt recommendation model

[0040] The study constructed a women's shirt recommendation model and achieved the following results: With the help of the selected women's shirt feature elements and the help of the random forest algorithm, the women's shirt samples were classified and trained, a decision tree was constructed, and the leaf nodes were used to complete the classification of features with an accuracy rate of 81.2%, completing the classification of the women's shirt model. The path of the samples in the decision tree was analyzed, the similarity between the samples was predicted, and the samples with a similarity greater than 70% were recommended to obtain a recommendation list. The model completed the recommendation of women's shirts and achieved good results.

[0041] In summary, the women's shirt recommendation model of the random forest algorithm can recommend clothing of similar styles to users, and the recommendation results are relatively accurate, which plays a certain reference role in the field of recommendation system construction. Compared with the methods in the existing technology, it fully realizes the detailed processing of the features of women's shirts one by one, and it is not easy to have inaccurate recommendation results for women's shirts. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A schematic diagram of the process of forming a recommendation list;

[0043] Figure 2 Schematic diagram of sample familiarity calculation;

[0044] Figure 3 a is a schematic diagram of the score of the style module feature, b is a schematic diagram of the score of the pattern module feature, and c is a schematic diagram of the score of the decoration module feature;

[0045] Figure 4 It is the heat map of correlation between features;

[0046] Figure 5 It is a heat map of the similarity between samples;

[0047] Figure 6 Schematic diagram for selecting samples with similarity >= 7 for recommendation;

[0048] Figure 7 A schematic diagram of the predicted path and the actual path direction;

[0049] Figure 8 This is a schematic diagram of a recommended example;

[0050] Fig. 9 This is a diagram showing an example of user satisfaction. DETAILED DESCRIPTION

[0051] The present invention will be further described below in detail with reference to the embodiments shown in the accompanying drawings.

[0052] Reference Figures 1 to 4 As shown, a method for recommending women's shirts based on a random forest algorithm in this embodiment is characterized by comprising:

[0053] Step 1: Analyze the characteristics of women's shirts, summarize the relevant characteristics and styles, and then classify them. Finally, three major feature modules and three types of style labels are obtained. Then, the characteristics are introduced in turn and assigned with the help of statistical variables to prepare for the subsequent model construction;

[0054] Step 2: First, collect samples of women's shirt style labels on the platform, assign values ​​based on the feature quantification in step 1, extract features using the Relief algorithm, complete style classification with the help of random forest, calculate similarity using decision tree leaf nodes, and complete model construction;

[0055] Step 3, connect the model constructed in step 2 to the user end for application, realize the recommendation of women's shirts for users, and then push the evaluation of recommendation results to the user end. After the user end completes the evaluation, the evaluation data is received, and the satisfaction rate of the recommendation results is calculated based on the evaluation data, and the recommendation preference of the user is counted. Finally, the evaluation of the model by consumers is collected. In the process of using the recommendation method of this embodiment, it is only necessary to load the execution program corresponding to the method into the server, and execute steps 1 to 3 in sequence through the communication between the server and the user terminal and the external Internet. After executing step 1, the feature analysis of women's shirts can be effectively completed, and then classification is performed. After executing step 2, style classification can be completed with the help of random forest, and then the model construction is completed. Finally, step 3 is executed to recommend women's shirts to the user terminal using the model constructed in step 2, and the recommendation of women's shirts is completed at one time. In the above process, since step 1 first performs feature analysis of women's shirts, and then completes the construction of the model based on the analyzed features, the model mainly realizes recommendation through the features of women's shirts. Therefore, compared with the method in the prior art, the recommendation result is more accurate and reliable.

[0056] As an improved specific implementation method, the specific steps of performing feature analysis on the women's shirt in step 1 are as follows:

[0057] Step 1: Conduct an online survey on women's shirts from various e-commerce brands to obtain relevant features of women's shirts, build feature factor quantification and feature system, and provide a sample basis for random forest style recommendation;

[0058] Step 1 and 2, filter the information on the relevant features and styles of the women's shirts obtained in step 1, and obtain the relevant features and styles of the women's shirts. Specifically, the structural features of 8 types of women's shirts are finally obtained: length, collar type, sleeve length, pattern, version, placket, decoration and sleeve type. Among them, "length, collar type, sleeve length, version, placket and sleeve type" can be classified into styles, recorded as A1, and "pattern, decoration" are recorded as A2 and A3 respectively, these 3 modules;

[0059] Step 13, mark the structural features of the 8 types of women's shirts obtained in step 12, and divide the specific locations of the feature values ​​into two categories, namely, unordered variables and ordered variables. Among them, for the features whose content classification shows regularity and the results are relatively qualitative, ordered variables are adopted, and integers between [-2,2] are marked. For the features with more and richer content classifications, binomial classification of unordered variables is adopted, and "0" or "1" is marked to represent "yes" and "no". Some features adopt multinomial variables of unordered variables, and "-1", "0" and "1" are marked to represent variables. Through the setting of the above steps, the analysis of the characteristics contained in the women's shirts can be fully and effectively realized, and finally quantified, so that the computer can effectively identify the characteristics of the women's shirts, and recommend women's shirts containing these characteristics based on these characteristics.

[0060] As a specific implementation of the improvement, the specific steps of feature extraction by the Relief algorithm in step 2 are as follows:

[0061] Step 21: first, all feature weight sets W are preset to 0;

[0062] Step 22: The feature optimization training set is divided into a training set and a test set according to a ratio of 1:4. A female shirt sample X is randomly selected from the training set L, X∈L;

[0063] Step 2 and 3: Select r samples Hi, i = (1, 2, ..., r) similar to the women's shirt sample X in the same style;

[0064] Step 24: select r samples Mi similar to the women's shirt sample X in different styles, i = (1, 2, ..., r);

[0065] Step 25: Use the following formula to calculate the feature weight W(ei)

[0066]

[0067] Among them, the weight W(e i ) represents feature e i The importance of diff(e i ,X i ,H j) and diff(e i ,X i ,M j (D)) measure the shirt samples X and H respectively j and M j (D) In ​​feature e i The difference in the number of similar samples, r is the number of similar samples, h is the number of sampling; Z x represents the style of women's shirt to which sample X belongs, D is the total number of categories different from X; P(D) and P(Zxi) are the probabilities of class D and X respectively; M j (D) is the sample in class D that is closest to the jth sample in X;

[0068] Step 26, perform h iterations of calculation;

[0069] Step 27, determine the importance weight of each feature. Women's shirt samples have diverse characteristics, so their features are relatively complicated, and any feature of style, pattern and decoration will affect the classification of women's shirt style. Therefore, all 12 extracted features are used, but there are differences in importance among the features. Therefore, the study uses the Relief-F algorithm to extract features to determine the importance weight of each feature. The Relief-F algorithm calculates the feature importance of all selected feature modules, calculates the feature weight of each part through the existing sample data, compares and screens the parts with lower weights, and optimizes the features.

[0070] The Relief-F algorithm uses the features of women's shirts to distinguish similar styles, thereby measuring the characteristic weight. Randomly select sample X from the women's shirt sample set L, then select similar sample A from the same category, and select similar sample B from different categories. In a certain feature E, if the similarity of XA is higher than that of XB, then the feature E is considered to be a valid feature with a higher weight. On the contrary, if the similarity of XA is lower than that of XB, it means that the feature does not distinguish much from the style and is an invalid feature. Therefore, through the settings of the above steps 21 to 27, the appearance feature extraction of women's shirts can be effectively realized.

[0071] As an improved specific implementation method, the specific method of completing style classification with the help of random forest in step 2 is: first, classify the 180 women's shirt sample data sets, this step uses the random forest algorithm; count the number of same paths between samples to calculate the similarity, and sort the samples that meet the requirements by similarity to form a recommendation list with a similarity greater than 7. Through the above method, a recommendation list can be formed simply and effectively.

[0072] As an improved specific implementation, the specific method of classifying the 180 women's shirt sample data set in step 2 is: the initial N women's shirt samples are extracted k times with replacement through the bagging algorithm to form k training sets T, and k decision trees F are trained based on them. Each decision tree randomly selects n features (n<m) from m features for training. Finally, the classification result of each tree is determined by the mode to obtain the overall classification result;

[0073] The selection of decision tree node features is calculated in the following way, see the following formula:

[0074] Gini(T)=1-∑P i 2

[0075] Among them, Pi represents the proportion of the i-th type of samples in the node data set. The smaller the Gini coefficient, the more accurate the classification. Therefore, the attribute corresponding to the smallest Gini coefficient is finally taken. Through the above method, the style of women's shirts can be effectively classified.

[0076] As an improved specific implementation method, the specific method of calculating the similarity in step 2 is: first generate a decision tree through a random forest algorithm, and then use the structural characteristics of the tree for classification. Each node of the decision tree has its corresponding characteristics. The initial sample is divided according to the characteristic judgment of each leaf node, and finally classification is achieved. The specific calculation formula is as follows:

[0077]

[0078] Where: S is the sample similarity, T is the training sample, V is the test sample, u refers to the u-th decision tree, X is the indicator function, L is the node number vector, the women's shirt test set and the training set samples are similar in the same nodes, the more the same nodes, the higher the similarity. Through the above method, classification can be achieved simply and effectively.

[0079] As a specific implementation method of the improvement, the step three also includes a model verification step, which is as follows: first, the smart terminals corresponding to 20 female consumers are selected, and samples are sent to the smart terminals for users to select their favorite women's shirt product images from the samples. After the user completes the selection, the model constructed in step two assigns features to the women's shirt product images selected by the user, and screens other samples similar to this product image. If the similarity value is greater than 70%, it is considered similar and recommended. The recommended results generate a recommendation list. Consumers use the smart terminals to feedback their satisfaction with the recommendation list, and the satisfaction is scored from 1 to 5 to determine the credibility of the model. Finally, the consumer's evaluation of the model is collected. Through the setting of the above steps, the model can be pre-used by 20 female consumers, and then the accuracy of the model recommendation can be judged based on the feedback results of the 20 female consumers, thereby verifying the model recommendation results and further improving the experience of subsequent use of the model.

[0080] As an improved specific implementation method, the specific steps of marking the structural features in step 1-3 are as follows:

[0081] The length, pattern, and sleeve length of the style features are uniformly marked with [-1, 1]. For the sleeve type, placket, collar type, pattern, and decoration of the women's shirt, unordered variables are used. Among them, the sleeve type is mainly divided into regular sleeves, raglan sleeves, and lantern sleeves. The placket is mainly divided into visible placket, hidden placket, and soft placket. The collar type can be mainly divided into standard collar, round collar, long pointed collar, stand-up collar and other collar types. The pattern is mainly divided into solid color, stripes, and geometry. The decoration is divided into splicing, asymmetry, and pleats. Through the above steps, the style features can be marked one by one through digital variables, so that the computer system can better identify the style features.

[0082] As a specific implementation method of the improvement, the step three also includes an evaluation result analysis step, specifically: analyzing the scores of 20 users, if 15 users have a satisfaction score greater than 4, the remaining five users have a satisfaction score greater than 3.5, and 10% of the users are not satisfied, it is judged that the model's prediction of user preferences is relatively accurate, otherwise it is judged that the prediction is inaccurate. Through the above-mentioned setting, it is possible to effectively verify whether the model recommendation is accurate. In this embodiment, after determining to obtain the analysis result, a selection window is popped up for users with a satisfaction score less than 3.5 points, and "Please select the dissatisfied area" is highlighted on the side of the window, and then in the selection In the selection window, different color blocks are used to display the pattern of a women's shirt composed of clothing length, collar type, sleeve length, pattern, version, placket, decoration and sleeve type partitions. At the same time, a click detection code is set in the background corresponding to the color blocks of clothing length, collar type, sleeve length, pattern, version, placket, decoration and sleeve type. After the user clicks on one of the color blocks, the detection code feeds back the color block clicked by the user to the user end, and then transmits it to the platform through the user end. The above method can be used to realize that the system understands which feature recommendation the user is not satisfied with, so that the dissatisfied data can be collected and integrated into a training set, so that when the recommendation is not passed, the model can be accurately adjusted to increase the completion rate of model training. Specifically, this embodiment provides the following examples:

[0083] The experiment collected 180 women's shirt samples, and the sample labels were divided into three categories. Each category had 60 women's shirt samples, and each sample had only one style label. In the women's shirt sample set, the first 144 samples were used to generate the training set, and the last 36 samples were used to generate the test set.

[0084] The study uses the Relief-F algorithm to extract features, and calculates the 12 features according to the three modules of style, pattern, and decoration. Figure 3abc, (a) represents the style module features, SA to SF represent clothing length, sleeve length, sleeve type, placket, collar type, and version, respectively. Sleeve type has the greatest impact on the style of women's shirts, while placket has the least impact. (b) is the pattern module feature, including solid color, plaid, and geometry. Solid color has the greatest impact, geometry is in the middle, and plaid has the least impact. (c) is the decoration module feature, including splicing, asymmetry, and pleats. Splicing has the greatest impact, asymmetry is in the middle, and pleats have the least impact. The feature variables are sorted from high to low according to feature importance, namely sleeve type, collar type, solid color, sleeve length, version, splicing, pleats, clothing length, placket, geometry, asymmetry, and plaid. Therefore, in the subsequent model construction, the features with higher ranking are given higher weights and distributed in the main nodes of the decision tree, that is, the nodes closest to the root node, while the features with lower ranking are given lower weights and distributed in the nodes farther away.

[0085] The heat map of the sample features of women's shirts is as follows Figure 4 As shown, independence is analyzed by Pearson correlation coefficient, blue represents low correlation and red represents high correlation. The figure shows that the correlation between the features of women's shirts is low, indicating that the features are independent.

[0086] Then, parameter design is performed. The number of decision trees k has an important influence on the classification accuracy. When the number of decision trees k is too low, the model has too low classification accuracy for women's shirt samples. When the number of decision trees k is too large, the model operation time and cost will be greatly increased. Therefore, in order to find the most suitable k value, the study keeps other variables unchanged and only changes the number of decision trees k, such as Figure 5 When k=25, the classification accuracy of the model is the highest, reaching 81.2%. Therefore, considering all factors, the number of decision trees k in the study is set to 25.

[0087] Then, the classification is performed and a random forest model is built. The 180 samples are randomly classified into 36 test samples and 144 training samples in a ratio of 2:8, and 25 decision trees are generated. The features of the women's shirt and the three types of style elements are input, and the decision tree is used to classify them. The number of votes for different style elements is counted to determine the final style of the sample. A decision tree is a tree structure. Each non-leaf node represents a feature. The node represents a value, and each leaf node represents a category. Starting from the root node, each feature to be classified is extracted and a decision is made until the classification category of the leaf node is obtained as the output result. With the help of each leaf node of the sample, the style of the sample is predicted and the path is inferred. The higher the overlap between the two samples, the higher the similarity of the samples. The similarity between the test sample and the training sample is shown in Table 5-1 below.

[0088] Table 5-1 Partial similarity

[0089]

[0090] The experiment obtained similarity results of 144 test samples and 36 training samples, a total of 5184 groups. The heat map of the similarity between samples is as follows: Figure 5 As shown in , the similarity between samples ranges from 0 to 15. Samples with similarity S greater than or equal to 7 are recorded. For the input target sample, based on the judgment that its style is of the same category, samples with similarity ≥ 7 are selected for recommendation. The result is shown in Figure 6 shown.

[0091] Figure 7 The red path is the predicted path, and the green path is the actual path. It can be seen that the predicted path fits the actual path.

[0092] The user selects the most favorite sample from the training samples. By judging the similarity, samples with a similarity value of more than 7 will be selected from the training set for recommendation, thus generating a recommendation list. Figure 8 As shown in the figure, the user selected the women's shirt samples with serial numbers 174 and 151, and finally recommended similar samples with serial numbers 159 and 121. Finally, the model was verified. Since this model is ultimately intended to serve users, the study decided to conduct a user survey to verify the recommendation model. The study measured the credibility of the model by the accuracy of the recommendation. Then 20 female consumers were selected, and the consumers met the following conditions: 1. Between the ages of 20 and 35. 2. Have the experience of purchasing women's shirts or have the idea of ​​purchasing them. 3. Usually prefer online shopping or are willing to shop online.

[0093] First, the user selects a favorite women's shirt product image from the sample; then the model will screen other samples similar to this product based on the feature assignment. If the similarity value is greater than 70%, it is considered similar and recommended. The recommended results are generated into a recommendation list, and consumers are surveyed on their satisfaction with the recommendation list. The satisfaction is scored from 1 to 5 to determine the credibility of the model. Finally, consumers' evaluation of the model is collected, mainly targeting the main consumer group of women's shirts who often shop online and have certain clothing knowledge, to increase the effectiveness of the evaluation.

[0094] For specific cases, see Fig. 9, taking users 1 and 2 as examples, user 1 selected five favorite samples, with serial numbers of 74, 92, 107, 73, and 87. After similarity analysis, the model recommended four similar samples for him, which were 105, 85, 126, and 83. For this recommendation, the user satisfaction score was 4.5. User 2 selected five favorite samples, with serial numbers of 75, 83, 86, 90, and 81. After similarity analysis, the model recommended four similar samples for him, which were 107, 97, 111, and 82. For this recommendation, the user satisfaction score was 4.8. User 3 selected five favorite samples, with serial numbers of 105, 94, 76, 80, and 103. After similarity analysis, the model recommended five similar samples for him, which were 109, 118, 74, 75, and 107. For this recommendation, the user satisfaction score was 5. User 4 selected five favorite samples, which were numbered 30, 23, 3, 27, and 16. After similarity analysis, the model recommended two similar samples to him, which were 41 and 56. The user satisfaction score for this recommendation was 4.5.

[0095] The results were analyzed and the satisfaction of the 20 female consumers with the recommendation system was counted. Each feature was scored from 1 to 5, and the average score was finally calculated. Among them, 15 users scored more than 4, and the remaining five users scored more than 3.5. 10% of the users were not very satisfied, indicating that the system's prediction of user preferences was relatively accurate and satisfied most users.

[0096] Table 5-2 User satisfaction example

[0097]

[0098] In summary, the women's shirt recommendation method based on the random forest algorithm of this embodiment can effectively realize the feature analysis of women's shirts and then classify them through the settings of steps one to three, and build a model based on the analyzed features. Thereafter, the constructed model is preliminarily applied, and then the user's recommendation number is counted, and finally, the consumer's evaluation of the model is collected to complete the gradual adjustment of the model.

[0099] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A method for recommending women's shirts based on a random forest algorithm, characterized in that: include: Step 1: Analyze the characteristics of women's shirts, summarize the relevant characteristics and styles, and then classify them. Finally, three major feature modules and three types of style labels are obtained. Then, the characteristics are introduced in turn and assigned with the help of statistical variables to prepare for the subsequent model construction; Step 2: First, collect samples of women's shirt style labels on the platform, assign values ​​based on the feature quantification in step 1, extract features using the Relief algorithm, complete style classification with the help of random forest, calculate similarity using decision tree leaf nodes, and complete model construction; Step three, connect the model built in step two to the user end for application, implement the recommendation of women's shirts for users, and then push the evaluation of recommendation results to the user end. After the user end completes the evaluation, the evaluation data is received, and the satisfaction rate of the recommendation results is calculated based on the evaluation data. The user's recommendation preference is counted, and finally, the consumer's evaluation of the model is collected.

2. The method for recommending women's shirts based on random forest algorithm according to claim 1, characterized in that: The specific steps of performing feature analysis on the women's shirt in step 1 are as follows: Step 1: Conduct an online survey on women's shirts from various e-commerce brands to obtain relevant features of women's shirts, build feature factor quantification and feature system, and provide a sample basis for random forest style recommendation; Step 1 and 2, filter the information on the relevant features and styles of the women's shirts obtained in step 1, and obtain the relevant features and styles of the women's shirts. Specifically, the structural features of 8 types of women's shirts are finally obtained: length, collar type, sleeve length, pattern, version, placket, decoration and sleeve type. Among them, "length, collar type, sleeve length, version, placket and sleeve type" can be classified into styles, recorded as A1, and "pattern, decoration" are recorded as A2 and A3 respectively, these 3 modules; Step 13, mark the structural features of the 8 types of women's shirts obtained in step 12, and divide the specific locations of the feature values ​​into two categories, namely, unordered variables and ordered variables. Among them, for the features whose content classification shows regularity and the results are relatively qualitative, ordered variables are adopted, and integers between [-2,2] are marked. For the features with more and richer content classifications, binomial classification of unordered variables is adopted, marked "0" or "1" to represent "yes" and "no". Some features adopt multinomial variables of unordered variables, marked "-1", "0", "1" to represent variables.

3. The method for recommending women's shirts based on random forest algorithm according to claim 2, characterized in that: The specific steps of feature extraction by the Relief algorithm in step 2 are as follows: Step 21: first, all feature weight sets W are preset to 0; Step 22: The feature optimization training set is divided into a training set and a test set according to a ratio of 1:

4. A female shirt sample X is randomly selected from the training set L, X∈L; Step 2 and 3: Select r samples Hi, i = (1, 2, ..., r) similar to the women's shirt sample X in the same style; Step 24: select r samples Mi similar to the women's shirt sample X in different styles, i = (1, 2, ..., r); Step 25: Use the following formula to calculate the feature weight W(ei) Among them, the weight W(e i ) represents feature e i The importance of diff(e i ,X i ,H j) and diff(e i ,X i ,M j (D)) measure the shirt samples X and H respectively j and M j (D) In ​​feature e i The difference in the number of similar samples, r is the number of similar samples, h is the number of sampling; Z x represents the style of women's shirt to which sample X belongs, D is the total number of categories different from X; P(D) and P(Z xi) are the probabilities of class D and X respectively; M j (D) is the sample in class D that is closest to the jth sample in X; Step 26, perform h iterations of calculation; Step 27: Determine the importance weight of each feature.

4. The method for recommending women's shirts based on random forest algorithm according to claim 3, characterized in that: The specific method of completing the style classification with the help of random forest in step 2 is: first, classify the 180 women's shirt sample data sets, which uses the random forest algorithm; count the number of same paths between samples to calculate the similarity, and sort the samples that meet the requirements by similarity to form a recommendation list with a similarity greater than 7.

5. The method for recommending women's shirts based on random forest algorithm according to claim 4, characterized in that: The specific method of classifying the 180 women's shirt sample data set in step 2 is as follows: the initial N women's shirt samples are extracted k times with replacement through the bagging algorithm to form k training sets T, and k decision trees F are trained based on them. Each decision tree randomly selects n features (n<m) from m features for training. Finally, the classification result of each tree is determined by the mode to obtain the overall classification result; The selection of decision tree node features is calculated in the following way, see the following formula: Gini(T)=1-∑P i 2 Among them, Pi represents the proportion of samples of the i-th category in the node data set. The smaller the Gini coefficient, the more accurate the classification. Therefore, the attribute corresponding to the smallest Gini coefficient is finally taken.

6. The method for recommending women's shirts based on random forest algorithm according to claim 5, characterized in that: The specific method of calculating the similarity in step 2 is: first, a decision tree is generated by a random forest algorithm, and then the structural characteristics of the tree are used for classification. Each node of the decision tree has its corresponding characteristics. The initial sample is divided according to the characteristic judgment of each leaf node, and finally the classification is realized. The specific calculation formula is as follows: Where: S is the sample similarity, T is the training sample, V is the test sample, u refers to the u-th decision tree, X is the state function, L is the node number vector, the women's shirt test set and the training set samples are similar at the same nodes, and the more times they are at the same nodes, the higher the similarity.

7. The method for recommending women's shirts based on random forest algorithm according to claim 6, characterized in that: The step three also includes a model verification step, which is as follows: first, the smart terminals corresponding to 20 female consumers are selected, and samples are sent to the smart terminals for users to select their favorite women's shirt product images from the samples. After the user completes the selection, the model constructed in step two assigns features to the women's shirt product image selected by the user, and screens other samples similar to this product image. If the similarity value is greater than 70%, they are considered similar and recommended. A recommendation list is generated from the recommended results. Consumers use the smart terminals to provide feedback on their satisfaction with the recommendation list, and the satisfaction is scored from 1 to 5 to determine the credibility of the model. Finally, consumers' evaluation of the model is collected.

8. The method for recommending women's shirts based on random forest algorithm according to claim 7, characterized in that: The specific steps of marking the structural features in step 1-3 are as follows: The length, version, and sleeve length of the style features are uniformly marked with [-1, 1]. The sleeve type, placket, collar type, pattern, and decoration of the women's shirt are unordered variables. Among them, the sleeve type is mainly divided into regular sleeves, raglan sleeves, and lantern sleeves. The placket is mainly divided into visible placket, hidden placket, and soft placket. The collar type can be mainly divided into standard collar, round collar, long pointed collar, stand-up collar and other collar types. The pattern is mainly divided into solid color, stripes, and geometry. The decoration is divided into splicing, asymmetry, and pleats.

9. The method for recommending women's shirts based on random forest algorithm according to claim 8, characterized in that: The step three also includes an evaluation result analysis step, specifically: analyzing the scores of 20 users. If 15 users have a satisfaction score greater than 4, and the remaining five users have a satisfaction score greater than 3.5, and 10% of the users are not satisfied, it is judged that the model's prediction of user preferences is relatively accurate, otherwise it is judged that the prediction is inaccurate.

Citation Information

Patent Citations

  • Personalized costume design recommendation system and method based on AI and big data

    CN118445490A