Second-hand car recommendation method based on deep learning and clustering

By using deep learning and clustering methods, and leveraging the Transformer model and K-Means clustering to generate diverse recommendation lists, this approach addresses the issues of insufficient user interest modeling and data sparsity in used car recommendation systems, achieving accurate modeling of user interests and effective recommendation of new vehicles.

CN120873282APending Publication Date: 2025-10-31SUZHOU ZHEYUAN INFORMATION TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510965936.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-14
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

In existing used car recommendation systems, traditional RNN/LSTM models struggle to capture the long-term dynamic evolution of user interests, collaborative filtering suffers from reduced recommendation quality when user behavior sequences are sparse, and rule-based filtering strategies lead to semantic confusion in the recommendation list, making it difficult to effectively integrate new vehicles into the recommendation system.

Method used

We employ a deep learning and clustering approach, generating user interest representations through the Transformer model, generating vehicle semantic clusters using K-Means clustering, and combining user interests and vehicle features to generate a diverse recommendation list. We also trigger a cold-start strategy for meta-learning when a new user or vehicle is detected.

Benefits of technology

It achieves accurate modeling of user interests, ensures the structured diversity of the recommendation list in terms of vehicle type and brand, improves the relevance of recommendations for new users and new vehicles, and solves the problems of insufficient model modeling and failure in data sparsity scenarios in existing technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120873282A_ABST
    Figure CN120873282A_ABST
Patent Text Reader

Abstract

The invention discloses a second-hand car recommendation method based on deep learning and clustering, and belongs to the field of second-hand car recommendation, and the method comprises the steps: obtaining a user behavior sequence and vehicle feature data; standardizing the user behavior sequence to generate a time sequence interaction vector with a fixed length; inputting the time sequence interaction vector into a Transform model, and generating user interest representation through a multi-head attention mechanism and position coding; performing K-Means clustering on the vehicle feature data embedding to generate a vehicle semantic cluster; generating a diversity recommendation list in combination with the user interest representation and the vehicle semantic cluster; when a new user or a new vehicle is detected, a meta-learned cold start strategy is triggered. According to the invention, the problem of insufficient RNN / LSTM long-term dependence modeling in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of used car recommendation technology, and particularly relates to a used car recommendation method based on deep learning and clustering. Background Technology

[0002] Current used car recommendation systems primarily employ collaborative filtering and content-based filtering techniques. Collaborative filtering generates recommendations by analyzing the similarity of users' historical behavior, including user-based collaborative filtering (identifying similar user groups) and item-based collaborative filtering (identifying associations between similar vehicles). Content-based filtering relies on matching vehicle attribute features to extract features such as price, brand, and vehicle age to construct user profiles. Some improvements introduce matrix factorization to alleviate data sparsity issues or use RNN or LSTM models to capture short-term temporal dependencies in user behavior. To address the issue of recommendation diversity, existing technologies either add a rule-based filtering layer after ranking or employ a weighted hybrid strategy to balance the exposure of popular and less popular items.

[0003] Existing technologies have three main drawbacks: First, traditional RNN / LSTM models struggle to capture the long-term dynamic evolution of user interests and lack the ability to model leaps in interest shifts within browsing sequences. Second, collaborative filtering significantly degrades recommendation quality when user behavior sequences are sparse, and new vehicles cannot be effectively integrated into the recommendation system due to a lack of interaction records. Finally, rule-based filtering strategies disrupt recommendation relevance, and weighted hybrid strategies lead to semantic confusion in recommendation lists, failing to achieve structured diversity in vehicle type, brand, and price range while maintaining accuracy. Summary of the Invention

[0004] To address the aforementioned technical problems, this invention proposes a used car recommendation method based on deep learning and clustering, thereby resolving the issues present in the existing technologies.

[0005] To achieve the above objectives, in a first aspect, the present invention provides a used car recommendation method based on deep learning and clustering, comprising:

[0006] Acquire user behavior sequences and vehicle characteristic data;

[0007] The user behavior sequence is standardized to generate a fixed-length temporal interaction vector;

[0008] The temporal interaction vector is input into the Transformer model, and user interest representations are generated through multi-head attention mechanism and positional encoding.

[0009] K-Means clustering is performed on the embedded vehicle feature data to generate vehicle semantic clusters;

[0010] By combining the user interest representations and the vehicle semantic clusters shown, a diverse recommendation list is generated;

[0011] When a new user or vehicle is detected, the meta-learning cold start strategy is triggered.

[0012] Preferably, the standardization process for user behavior sequences includes:

[0013] To detect outliers in interaction intensity, Winsorization is used for boundary constraints.

[0014] Missing values ​​are filled using the user-internal mean or nearest neighbor collaborative filling.

[0015] Preferably, generating a fixed-length temporal interaction vector includes:

[0016] The sequence length is standardized to N=4;

[0017] Zero-padding is applied to sequences that are too short.

[0018] For very long sequences, retain the most recent N interactions.

[0019] Preferably, the Transformer model processing includes:

[0020] The vehicle ID is embedded and added to the trigonometric function position code;

[0021] Temporal weights are calculated using a multi-head attention mechanism.

[0022] Preferably, the K-Means clustering includes:

[0023] The K-Means++ algorithm is used to initialize the cluster centers;

[0024] Weighted Euclidean distance based on feature importance;

[0025] The optimal number of clusters K is determined by the elbow method and the silhouette coefficient.

[0026] Preferably, the process of generating a diversity recommendation list includes:

[0027] Calculate the predicted interaction intensity of the user with the vehicle;

[0028] Calculate the affinity between the user and each vehicle semantic cluster;

[0029] Vehicles are selected from the highest affinity cluster with probability α, and from other clusters with probability 1-α.

[0030] Preferably, the probability α is dynamically adjusted based on the user interest distribution.

[0031] Preferably, the cold start for new users includes:

[0032] Extract initial user interaction data;

[0033] The model parameters are updated through meta-learning.

[0034] Preferably, a cold start for a new vehicle includes:

[0035] Calculate its similarity to vehicles in its cluster;

[0036] Add exploration factors to increase exposure.

[0037] In a second aspect, the present invention also discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect.

[0038] Compared with the prior art, the present invention has the following advantages and technical effects:

[0039] This invention provides a used car recommendation method based on deep learning and clustering, comprising: first, acquiring user behavior sequences and vehicle feature data; second, standardizing the user behavior sequences to generate fixed-length temporal interaction vectors; third, inputting the temporal interaction vectors into a Transformer model to generate user interest representations through multi-head attention and positional encoding; next, performing K-Means clustering on the vehicle feature data embeddings to generate vehicle semantic clusters; further, combining the user interest representations and the vehicle semantic clusters to generate a diverse recommendation list; and finally, triggering a meta-learning cold-start strategy when a new user or vehicle is detected.

[0040] This invention processes user behavior sequences and vehicle feature embeddings, directly achieving joint optimization of user-vehicle cross-modal features, overcoming the limitation of separating behavior and content data in traditional recommendation systems. This invention standardizes user behavior sequences to a fixed length, directly reducing the computational complexity of the Transformer model and solving the resource consumption problem of existing sequence models when processing variable-length data.

[0041] This invention processes user behavior sequences using a Transformer model, directly achieving accurate modeling of the dynamic evolution of user interests and solving the problem of insufficient modeling that RNN / LSTM rely on in existing technologies. This invention employs semantic clusters generated through optimized clustering, directly ensuring the structured diversity of the recommendation list in terms of vehicle type and brand dimensions, avoiding the recommendation chaos caused by rule filtering in existing technologies.

[0042] This invention uses a meta-learning cold start strategy to directly improve the relevance of the first recommendation for new users and the rationality of the exposure of new vehicles, overcoming the failure of collaborative filtering in data-sparse scenarios. Attached Figure Description

[0043] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0044] Figure 1 This is a flowchart of a used car recommendation method based on deep learning and clustering according to an embodiment of the present invention;

[0045] Figure 2 This is a schematic diagram of data preprocessing according to an embodiment of the present invention. Detailed Implementation

[0046] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0047] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0048] Example 1

[0049] like Figure 1 As shown, this embodiment provides a used car recommendation method based on deep learning and clustering, including:

[0050] S1. Obtain user behavior sequences and vehicle feature data;

[0051] Specifically, this embodiment constructs a vocabulary for vehicle IDs and user IDs, and creates user interaction sequences in chronological order. All user interactions are first sorted by their interaction timestamps, and then divided into subsequences for model training. To facilitate subsequent computation, this embodiment converts the vehicle ID list and interaction strengths to a fixed length, while retaining the location set of subsequence information. These sequences are further divided into subsequences to create a structured input format that encapsulates the user's fixed-length interaction history, thereby preparing data for the Transformer model. After processing, input is generated for each individual user in a sequence format, including user ID, vehicle ID, sequence interaction strength, the target (label) that the model is trying to predict—which will be the target vehicle ID—and the interaction strength of the last item in the sequence, the sequence interaction between the user and the vehicle, as shown in Table 1.

[0052] Table 1

[0053]

[0054] S2. Standardize the user behavior sequence to generate a fixed-length temporal interaction vector;

[0055] To enhance the input data, this embodiment integrates additional attributes into the final dataset, including vehicle types in the sequence and user interaction characteristics (such as click frequency, browsing duration, and query patterns). The final dataset then undergoes a series of cleansing procedures, including removing duplicates, handling missing values, and processing outliers, before being finalized for analysis. Furthermore, some data must be converted from categorical to numerical format to ensure compatibility with the Transformer model and k-means clustering in the embedding layers. User behavior features are encoded from categorical to numerical format through a decomposition process. Features such as interaction frequency and dwell time are normalized using MinMaxScaler, a method that scales the data to a specified range. This enhances model performance by ensuring that numerical features are at similar scales. Vehicle types are expanded into binary features, each representing the presence of a specific type, thus enriching the dataset with explicit type information.

[0056] This embodiment uses data preprocessing methods to ensure optimal data quality and model compatibility. For example... Figure 2 As shown, the data processing methods specifically include:

[0057] 1. Missing value handling mechanism: Implement a conditional weighted imputation algorithm based on similarity clustering for missing user feature values ​​(such as age, occupation).

[0058]

[0059] Where S represents a subset of users with similar behavioral patterns, w i This refers to the user similarity weighting coefficient.

[0060] To address missing vehicle attributes, a hierarchical imputation strategy is employed, prioritizing the use of statistical center metrics for vehicles of the same brand and type. Missing values ​​in interaction time series are handled using linear interpolation. Where t a and t b These represent the known interaction timestamps before and after the missing time point, respectively.

[0061] 2. Outlier Detection and Robustnessing: Implementing the Modified Median Absolute Deviation (MAD) method for robust outlier detection:

[0062]

[0063] Where, MAD(X) = median(|X) i -median(X)|) is the absolute deviation of the median, providing a more robust measure of dispersion against outliers.

[0064] For anomalous interaction strength values ​​|Z|>3.5, the Winsorization boundary constraint technique is applied to map extreme values ​​to the acceptable ranges of Q1-1.5×IQR and Q3+1.5×IQR.

[0065] 3. Differentiation strategies for duplicate samples:

[0066] For repeated, homogeneous interactions between the same user and the same vehicle within a short time window (≤30 seconds), the last record is retained to prevent redundant interaction behavior.

[0067] For repeated interactions of heterogeneous intensity, apply a time-decay weighted aggregation function:

[0068]

[0069] Where λ = 0.01 is the time decay coefficient, and T is the latest interaction timestamp, thus achieving adaptive reinforcement of recent interactions.

[0070] 4. Sequence structuring and feature engineering:

[0071] (1) Formal construction of interaction sequences: Implement a sliding window-based serialization algorithm with a window size of N=4 and a step size of 1 to ensure the temporal continuity of sequence coverage. Construct an interaction sequence set for each user u. Each sequence element N vehicle entities that represent continuous user interactions.

[0072] (2) Multidimensional feature extraction and enhancement:

[0073] Temporal interval features: Calculate and quantize the temporal gradient Δt of adjacent interactions in the sequence. i =t i+1 -t i It captures the temporal dynamics of user behavior.

[0074] Interaction depth features: via d i =t i,end -t i,start Quantify the allocation of user attention to different vehicles.

[0075] Interaction pattern encoding: Map different types of behaviors (clicks, favorites, inquiries, etc.) to an intensity spectrum of [0.2, 0.5, 0.8] to construct a behavior semantic vector space.

[0076] Through this series of refined processing and transformation steps, the original heterogeneous and unstructured interactive data is normalized into high-quality sequence representations, providing a structured and information-dense training data stream for subsequent deep learning models, effectively supporting the learning efficiency and prediction accuracy of the models.

[0077] S3. Input the temporal interaction vector into the Transformer model, and generate user interest representations through multi-head attention mechanism and positional encoding;

[0078] Specifically, the Transformer model is implemented using a multi-head attention layer and location embeddings, which excel at understanding complex user browsing patterns. The multi-head attention mechanism allows the model to focus on different parts of a user's vehicle history to provide a comprehensive understanding of their preferences. Location embeddings provide the model with an understanding of the order in which vehicles are browsed, which is crucial for predicting future interests. Subsequently, this embodiment inputs an embedding layer of user behavior sequences, implemented using the Transformer architecture. This is then combined with user statistics to predict interaction strength using a multilayer perceptron (MLP). In the third step, after training the Transformer model, this embodiment integrates the output predicted interaction strengths into K-means clustering to generate a Top-N recommendation system for the target user.

[0079] User behavior analysis forms the core computational foundation of the recommender system in this study. This embodiment designs a hierarchical feature representation and dynamic interest modeling architecture to accurately capture users' preference features at different time scales.

[0080] The Transformer model is a deep learning architecture specifically designed for processing sequential data, effectively capturing the impact of user dynamics on their recent activities. This embodiment analyzes the Transformer layer structure in depth, which enhances the model's ability to capture long-range dependencies and implicit connections in vehicle sequences, thereby generating more accurate and personalized recommendations. The Transformer layer mainly consists of a multi-head attention mechanism and a position feedforward neural network (FFN).

[0081] Multi-head attention mechanisms enable models to focus on different aspects of the input sequence (such as long-term and short-term dependencies) in different ways when predicting the interaction strength of target vehicles. This mechanism processes information in parallel through attention computation, allowing the model to jointly focus on information from different representation subspaces at different locations, providing a more comprehensive and in-depth understanding of the input sequence. Subsequently, the outputs of the different attention heads are concatenated and linearly transformed into the final representation. In this implementation, the multi-head attention operation embeds vectors... As input, query (Q), key (K), and value (V) matrices are generated through three independent linear mapping layers:

[0082]

[0083] in The projection matrix is ​​learnable, which enhances the expressive power of the model. W is a matrix containing all vehicle embeddings; W0 is a learnable weight matrix used to form the final representation of the vehicle at position i; h represents the number of attention heads.

[0084] Within the Transformer layers, point-based feedforward networks (FFNs) provide the necessary adaptability for the model, offering the essential nonlinear transformation capabilities to understand complex vehicle interaction relationships within sequences. These networks contain hidden layers and nonlinear activation functions, enabling the model to learn complex patterns in vehicle ID sequences. Each FFN consists of two fully connected layers, employing dropout and layer normalization techniques to optimize the model training process, effectively preventing overfitting, and using the LeakyReLU activation function to accelerate convergence. These processes are applied independently and consistently at each location during training. The overall output of the Transformer layers between multi-head attention and the stacked FFNs, i.e., the candidate vehicle representation incorporating user behavior sequence features, is defined as follows:

[0085]

[0086] F i =FFN(N i )

[0087] T i =LayerNormalization(N i +Dropout(LeakyReLU(F i W 1 +b 1 W 2 +b 2 ))

[0088] in These represent the learnable weight matrix and bias parameters, respectively.

[0089] In the final prediction stage, this embodiment embeds user behavior features into layer u. i With Transformer output and target item T i The features are concatenated to form a joint representation vector, which is then transformed through a multilayer perceptron (MLP) network. The output layer uses a fully connected layer to compute the predicted interaction strength of the next target vehicle. This layer performs a linear transformation on all flattened and connected features, as expressed below:

[0090] x i,j =Concat(T i ,u j )

[0091]

[0092] in Let W represent the predicted interaction strength between user j and vehicle i, and let (·) represent the weight matrix of the output layer. i,j The dot product of B and σ is the output layer bias vector, and σ is the sigmoid activation function, which maps the output to a suitable range of interaction strengths.

[0093] This embodiment determines the following optimal parameter configurations for the Transformer model:

[0094] Transformer layer number: L=2. This configuration ensures that the model can capture sufficiently complex sequence patterns while avoiding the risk of overfitting.

[0095] Number of attention heads: h=8, allowing the model to learn sequence features from 8 different perspectives, enhancing representational capabilities;

[0096] Sequence length: N = 4, determined based on the typical length and information capacity of a user's browsing history;

[0097] FFN internal dimensions: The number of hidden units in the FFN layer is 256, providing sufficient non-linear transformation capabilities;

[0098] MLP hidden layer configuration: A two-layer structure [128, 128] is adopted to balance model complexity and expressive power;

[0099] Dropout rate: 0.2, the optimal setting to prevent overfitting;

[0100] Batch size: 128, striking a balance between training efficiency and memory requirements;

[0101] Optimizer selection: Adam optimizer, initial learning rate 0.001.

[0102] These parameters are determined using a strategy combining grid search and random search on the validation set. The core principle of parameter selection is to achieve the optimal balance between model complexity, training efficiency, and predictive performance.

[0103] User behavior computational feature extraction specifically includes:

[0104] 1. Interaction mode feature representation:

[0105] Time distribution characteristics: Constructing the time allocation vector T for users in different vehicle categories u =[t1,t2,...,t k Attention distribution is generated through normalization transformation:

[0106]

[0107] Sequence transition features: Introducing the first-order Markov transition matrix P to model the browsing transition probability of a user in the vehicle attribute space:

[0108]

[0109] Where N i→j This indicates the frequency of observations where a user switches from attribute i to attribute j.

[0110] 2. Timing representation of interaction frequency:

[0111] Time decay weighted: Introducing an exponential decay function to calculate time-aware interaction frequency.

[0112]

[0113] Where T u,i This represents the set of all interaction times between user u and vehicle type i. Let I be the time decay weighting function. t The interaction strength.

[0114] Periodic pattern characteristics: Constructing a periodic representation of user intraday behavior to characterize the distribution of activity over time segments:

[0115]

[0116] in This represents the total number of interactions by user u during time period h.

[0117] A hierarchical modeling framework for user interests, specifically including:

[0118] 1. Dual-timescale interest representation:

[0119] Short-term interest encoding: Capturing immediate preferences using attention-weighted representations of the most recent N=4 interaction sequences.

[0120]

[0121] Where α i To derive the importance weights from the Transformer multi-head attention mechanism, The vehicle embedding vector.

[0122] Long-term interest representation: Construct a long-term interest storage mechanism based on an external memory network, and activate relevant memory units through attentional selection:

[0123]

[0124] Where M = [M1, M2, ..., M M [ ] represents the user interest memory matrix, β jThis is the memory access weight calculated based on the current context.

[0125] 2. Adaptive Interest Fusion Mechanism:

[0126] Achieving a parameterized gating update mechanism to dynamically integrate short-term and long-term interest representations:

[0127] g t =σ(W g ·[I short ;I long ]+b g )

[0128] I t =g t ⊙I short +(1-g t )⊙I long

[0129] Where g t The gating vector is used to control the ratio of short-term to long-term interests. ⊙ represents the Hadamard product (element-wise multiplication) operation.

[0130] This embodiment utilizes a multi-level behavioral representation and dynamic interest modeling framework to effectively capture the temporal evolution characteristics and contextual relevance of user interests, providing an accurate user representation foundation for subsequent personalized recommendations.

[0131] S4. Perform K-Means clustering on the embedded vehicle feature data to generate vehicle semantic clusters;

[0132] Specifically, K-means clustering is a popular method in cluster analysis that aims to divide a set of objects into K clusters such that the sum of squared distances between an object and the mean of its assigned cluster is minimized. This embodiment aims not only to develop a recommendation algorithm based on personalized results from historical preferences but also to dynamically adjust the diversity of the recommendation list according to user interests. To achieve this, this embodiment utilizes the K-means method for personalized diversity, which automatically segments vehicles into different groups based on user preferences (target next vehicle) according to certain predefined categories (vehicle embeddings related to vehicle type). When creating the recommendation list, this embodiment investigates these clusters to ensure diverse Top-N vehicle suggestions as the user interacts with the system. Similarly, for new vehicles with little or no interaction, clustering helps identify and recommend unseen vehicles to the target user based on similarity scores with other vehicles. K-means clustering helps diversify the selected Top N by ensuring that the recommendations include vehicles from different clusters. Therefore, the method of this embodiment helps provide users with diverse recommendations, ensuring that these recommendations are not limited to a specific type or vehicle category.

[0133] The K-Means clustering algorithm plays a crucial role in the recommendation framework of this embodiment, especially in ensuring recommendation diversity. The following optimization strategies are employed:

[0134] Adaptive Determination of Optimal Cluster Number: This embodiment employs the Elbow Method to determine the optimal cluster number K. This method identifies the best split point by calculating the sum of squares within each cluster (WCSS) for different K values.

[0135]

[0136] Where C i Let μ represent the i-th cluster. i Let K be the centroid of the cluster. By analyzing the curve of WCSS as a function of K, the optimal K value is selected at the inflection point of the curve.

[0137] To further improve the clustering results, this embodiment implements a series of optimizations to the standard K-Means algorithm:

[0138] 1. Efficient initialization strategy:

[0139] The specific steps for implementing the K-Means++ initialization method to replace traditional random initialization are as follows:

[0140] (1) Randomly select the initial centroid c1;

[0141] (2) Calculate the distance D(x) from each data point to the nearest centroid;

[0142] (3) Choose a new centroid such that the probability of point x being chosen as the new centroid is related to D(x). 2 Proportional;

[0143] (4) Iterate through steps (2)-(3) until K initial centroids are selected.

[0144] This method ensures that the initial centroids are uniformly and relatively dispersed, which significantly accelerates the clustering convergence speed and improves the final clustering quality.

[0145] 2. Feature Importance Weighting:

[0146] Adaptive weight adjustments are implemented for different feature dimensions to highlight key vehicle attributes:

[0147]

[0148] Where w d The weight coefficients representing feature dimension d are determined through feature importance evaluation:

[0149]

[0150] IGd The information gain value of feature d is calculated using the decision tree feature evaluation algorithm.

[0151] 3. Multi-index cluster number verification:

[0152] In conjunction with the elbow method, this embodiment introduces the silhouette coefficient as a complementary evaluation metric:

[0153]

[0154] Where a(i) represents the average distance between data point i and other points in the same cluster, and b(i) represents the average distance between point i and all points in the nearest neighbor cluster.

[0155] The final K value was determined by taking the median of the indicated intervals of both the elbow method and the profile coefficient, thus improving the robustness of cluster number selection.

[0156] 4. Hierarchical clustering architecture:

[0157] For large-scale datasets, a two-level clustering framework is designed:

[0158] (1) First-level clustering: Mini-Batch K-Means is applied to perform coarse-grained partitioning of the global vehicle space;

[0159] (2) Secondary clustering: fine clustering is performed within each coarse-grained cluster.

[0160] This hierarchical strategy significantly improves computational efficiency, especially when dealing with datasets of millions of vehicles.

[0161] 5. Feature Selection and Preprocessing: Clustering input features include:

[0162] Vehicle embedding vectors (semantic representations extracted from the Transformer model);

[0163] Vehicle type characteristics (converted via one-hot encoding);

[0164] Price range indicator (continuous characteristics after discretization);

[0165] All features underwent standardization preprocessing to eliminate the influence of dimensions:

[0166]

[0167] Where μ represents the feature mean and σ represents the standard deviation, ensuring that different features are of equal importance in the clustering process.

[0168] 6. Clustering Algorithm Execution Flow: The K-Means algorithm is executed using an iterative optimization method.

[0169] Initialize K centroids based on the K-Means++ strategy;

[0170] Each vehicle data point is assigned to the cluster to which the nearest centroid belongs;

[0171] Recalculate the centroid positions of each cluster;

[0172] Repeat the above allocation and update process until the centroid position converges or the preset maximum number of iterations is reached.

[0173] 7. Application of Clustering Results in Recommendation: During the recommendation generation stage, clustering information is used to enhance recommendation diversity.

[0174] Calculate the affinity between the user and each cluster based on historical interaction patterns;

[0175] Prioritize recommended candidates from clusters with high user affinity;

[0176] Ensuring diversity in the recommendation list through balanced sampling across clusters;

[0177] This mechanism effectively alleviates the "over-specialization" problem common in recommendation systems, ensuring that users have access to a wider range of vehicle options while maintaining recommendation relevance.

[0178] In this embodiment, the choice of embedding dimension has a significant impact on model performance. Based on the system analysis in the experimental study section, this embodiment determines that the optimal value range for the embedding dimension d is 20 to 50. Experiments show that as the embedding dimension increases from 20 to 50, the model performance exhibits a stable upward trend. This indicates that a higher-dimensional embedding space can more effectively capture the complex relationship structure between the user and the vehicle.

[0179] In practical implementation, the determination of the embedding dimension takes into account the following key factors: dataset size and sparsity characteristics, computational resource constraints, and the balance between expected model complexity and performance.

[0180] For location encoding, this embodiment uses the same dimension setting as the embedding dimension, which facilitates direct combination with vehicle ID embedding. Location encoding follows the sine and cosine functions proposed in the original Transformer architecture:

[0181] PE (pos,2i) =sin(pos / 10000) 2i / d )

[0182] PE (pos,2i+1) =cos(pos / 10000) 2i / d )

[0183] Where pos represents the position index in the sequence and i represents the dimension index. This encoding method enables the model to accurately distinguish elements at different positions in the sequence, effectively capturing the temporal relationships of user interactions.

[0184] Position encoding addresses the critical issue of missing sequence information in Transformer models. Since the self-attention mechanism itself cannot perceive the positional information of elements, the introduction of position encoding enables the model to distinguish vehicles at different locations and their temporal dependencies. The position encoding implementation in this embodiment is based on the following theoretical foundation:

[0185] 1. Encoding Matrix Construction: For a user-vehicle interaction sequence of length N=4, this embodiment constructs a location encoding matrix.

[0186]

[0187] 2. Principles for choosing trigonometric functions: The selection of sine and cosine functions is based on their unique mathematical properties:

[0188] Uniqueness: A unique encoding vector is generated for each position;

[0189] Continuity: Encoding vectors at similar positions have geometric similarity;

[0190] Boundedness: The encoded value is strictly limited to the range [-1, 1] to ensure numerical stability;

[0191] Frequency diversity: through 10000 2i / d By parameterizing the wavelengths in different dimensions, multi-scale location dependencies can be captured.

[0192] 3. Calculation Mechanism: For any position pos and dimension i, the position code is calculated as follows:

[0193] Even-numbered dimensions:

[0194] Odd-numbered dimensions:

[0195] Of which 10,000 2i / d It is a scaling factor that increases exponentially with dimension, ensuring that different dimensions can capture dependencies at different scales.

[0196] 4. Location Encoding and Embedding Fusion: For the vehicle embedding vector at the pos-th position in the sequence The enhanced embedding is represented as:

[0197]

[0198] This addition operation preserves the original embedded semantic information while injecting precise location information.

[0199] 5. Relative Position Representation: The properties of trigonometric functions enable them to naturally express relative positional relationships:

[0200] sin(α+β)=sin(α)cos(β)+cos(α)sin(β)

[0201] cos(α+β)=cos(α)cos(β)-sin(α)sin(β)

[0202] This allows the model to learn the relative relationships between positions through linear projection, rather than focusing solely on absolute positions.

[0203] Compared to learnable positional embedding schemes, this trigonometric function-based positional encoding exhibits stronger generalization capabilities, especially for unseen sequence lengths. This characteristic is significant for handling variable-length user interaction histories, enabling models to more accurately understand the temporal evolution of user interests.

[0204] S5. Combine the user interest representation and the shown vehicle semantic clusters to generate a diverse recommendation list;

[0205] Specifically, this embodiment divides the feature space into two key parts: user behavior features and vehicle sequence embeddings. User behavior features include multi-dimensional information such as user ID, browsing pattern, click frequency, and interaction duration. Each type of input feature is transformed into a dense feature vector through a dedicated embedding layer. Specifically, this embodiment constructs an embedding matrix. Discrete integer indices are mapped to dense vectors of fixed dimensions, where u represents the vocabulary size (i.e., the total number of unique class elements) and d is the embedding dimension. These low-dimensional dense vectors effectively reduce the dimensionality of the input features while capturing the latent relationships between class features, providing high-quality input for multilayer perceptrons (MLPs).

[0206] Vehicle features primarily include vehicle IDs and vehicle type information within the sequence. First, the vehicle IDs in the sequence are converted into dense feature vectors through an embedding layer, while the vehicle type features are converted into feature vectors through multi-hot encoding. This embodiment generates an embedding representation for each vehicle ID (including the target vehicle) in the behavior sequence, which is crucial for the Transformer model to understand the temporal dynamics of the sequence. Furthermore, this embodiment introduces a learnable positional encoding matrix to enhance the input sequence representation, effectively addressing the inherent problem of missing positional information in the Transformer architecture. For each vehicle in the sequence, this embodiment combines vehicle ID embedding with positional encoding to construct an embedding matrix. This matrix represents the embedding vector of the i-th vehicle in the user u behavior sequence after adding the location vector. In the processing flow, the vehicle embedding sequence is first fed into the Transformer layer, and then its output is concatenated with the user feature representation to form a joint representation.

[0207] After the model is trained, this embodiment applies the K-Means clustering algorithm to spatially partition the vehicle embedding vectors, organizing the vehicles into semantically related clusters based on the learned latent features. This clustering mechanism effectively enhances the structured understanding capability of the recommendation system by identifying semantically similar vehicles.

[0208] The recommendation generation process consists of two key steps: First, the system calculates the predicted interaction strength between the target user and candidate vehicles; then, based on these predictions and clustering information, a final recommendation list is constructed. Clustering information plays a dual role in the recommendation refinement process: on the one hand, it ensures the diversity of results; on the other hand, it allows the system to make accurate recommendations based on the user's specific interest areas. The integration of K-Means clustering with the recommendation framework in this embodiment is as follows:

[0209] After the training phase, the system extracts embedding representations for each vehicle from the neural network model. These embedding vectors capture the latent semantic features of the vehicles. The clustering process comprises the following three core steps:

[0210] (1) Determine the optimal number of clusters K using domain knowledge and data-driven methods (such as the elbow method);

[0211] (2) The enhanced K-Means algorithm is used to divide the vehicle embedding space;

[0212] (3) Assign the nearest cluster identifier to each vehicle. In the recommendation generation stage, the system first predicts the potential interest of users in vehicles that have not been interacted with, then uses clustering information to achieve a balance between diversity and relevance in the recommendation list, and finally selects the vehicles with the highest interaction intensity and that meet the diversity constraints to form the final recommendation set.

[0213] To achieve the optimal balance between recommendation accuracy and diversity, this embodiment proposes the following diversity-aware recommendation algorithm:

[0214] Algorithm 1: Diversity-Aware Recommendation Generation

[0215] Input: User u, predicted interaction strength matrix P, vehicle clustering result C, number of recommendations N, diversity factor α;

[0216] Output: Recommendation list Rec

[0217] 1. Initialize the recommendation list Rec = []

[0218] 2. Sort the un-interacted vehicles for user u based on the predicted interaction intensity P to form the candidate set Candidates

[0219] 3. Calculate the affinity vector Affinity of user u for each cluster

[0220] 4. Sort the clusters in descending order of affinity to obtain the cluster priority list Clusters

[0221] 5. When |Rec| < N:

[0222] 5.1 Select the vehicle with the highest rank from the cluster with the highest priority with probability α

[0223] 5.2 Select the vehicle with the highest rank from the clusters that have not yet appeared in Rec with probability (1 - α)

[0224] 5.3 Add the selected vehicle to Rec

[0225] 5.4 Remove the vehicle from Candidates

[0226] 6. Return Rec

[0227] In this algorithm, the diversity factor α controls the precise trade-off between the accuracy and diversity of the recommendation system. A higher value of α makes the system tend to select the vehicle with the highest predicted interaction intensity; a lower value of α prompts the system to select representative vehicles from different clusters, enhancing the diversity of the recommendation results. The empirical study of this embodiment shows that setting α = 0.7 can achieve the best balance between the accuracy and diversity goals

[0228] S6. When a new user or a new vehicle is detected, trigger the cold start strategy of meta-learning

[0229] The cold start problem is one of the main challenges faced by recommendation systems. This embodiment designs a special processing strategy for new users and new vehicles to ensure that the system can still provide high-quality recommendations in the case of data sparsity

[0230] New user processing strategy:

[0231] 1. Content-based initial recommendation:

[0232] For the first-time visiting user, this embodiment collects their basic attribute information (such as age, gender, region) and initial query conditions

[0233] Use a rule-based matching algorithm to generate an initial recommendation set:

[0234]

[0235] where P u is the user attribute vector is the vehicle feature vector, sim() is the cosine similarity function, and θ is the matching threshold.

[0236] 2. Rapid Feature Learning:

[0237] Employing the "Few-shot Learning" technique, preference features are quickly extracted from the user's initial few interactions:

[0238]

[0239] in It is the initial set of user interactions, and the Encoder is a pre-trained user interest encoder.

[0240] By incorporating a meta-learning framework, the model can quickly adapt to a limited number of interactions:

[0241]

[0242] Where θ meta These are meta-model parameters. It is a small amount of user-supported data set.

[0243] 3. Social cold start:

[0244] Collaborative recommendations using user social network information or demographic similarity:

[0245]

[0246] Where S u w is a set of users similar to user u. s It is the similarity weight, R s It is a recommendation list of similar users s.

[0247] New vehicle handling strategy:

[0248] 1. Feature mapping and similarity calculation:

[0249] Feature extraction is performed on the new vehicle, and it is then mapped to the existing vehicle embedding space:

[0250]

[0251] Where F embed It is a pre-trained vehicle feature embedding function. It is the feature vector of the new vehicle.

[0252] Calculate the similarity matrix between the new vehicle and existing vehicles:

[0253]

[0254] 2. Cluster-based vehicle cold start:

[0255] Assign the new vehicle to the nearest vehicle cluster:

[0256]

[0257] Where c j Let d be the centroid of the j-th cluster, and d be the distance function.

[0258] Initial score estimation based on intra-cluster popularity and similarity:

[0259]

[0260] in It is the set of vehicles in the cluster to which the new vehicle belongs. It is user u to vehicle v i Historical ratings.

[0261] 3. Explore and utilize balancing strategies:

[0262] Explore enhancement factors for new vehicle applications to increase their exposure in recommendations:

[0263]

[0264] Where β is the exploration weight and N is the total number of recommendations. ∈ represents the number of times a new vehicle has been recommended, and ∈ represents the smoothing term.

[0265] Hybrid initial recommendation strategy:

[0266] To address the cold start issue for both new users and new vehicles, this embodiment employs a hybrid strategy to generate initial recommendations:

[0267] 1. Hierarchical recommendation generation:

[0268] First layer: Non-personalized recommendations based on popularity and diversity (accounting for 30%)

[0269] The second layer: coarse-grained personalized recommendations based on basic user attributes (accounting for 40%).

[0270] The third layer: fine-grained personalized recommendations based on early interactions (accounting for 30%).

[0271] 2. Feedback enhances learning:

[0272] The multi-armed bandit algorithm is used to dynamically adjust the proportion of the three-layer recommendation:

[0273]

[0274] in It is the weight of the i-th layer at time t. This is the feedback received by this layer. γ is the average feedback, and γ is the learning rate.

[0275] This embodiment effectively alleviates the cold start problem through these strategies, provides relevant recommendations for new users, ensures that new vehicles receive appropriate exposure, balances exploration and utilization, and improves the overall recommendation effect.

[0276] This embodiment forms an end-to-end recommendation mechanism through four key stages:

[0277] 1. Data Acquisition and Preprocessing Stage:

[0278] Collect user's historical interaction trajectory data;

[0279] Extract and standardize vehicle feature and user behavior feature vectors;

[0280] Perform serialization transformations to construct a temporal structured representation.

[0281] 2. User preference representation learning stage:

[0282] Deploy Transformer deep network architecture to model user serialization preferences;

[0283] Implement a multi-head attention mechanism to capture interaction patterns across multiple time scales;

[0284] Personalized preference representations are constructed by integrating contextual features.

[0285] 3. Vehicle semantic space construction stage:

[0286] Perform optimized K-Means clustering on the vehicle embedding vector space;

[0287] Identify and construct semantically related vehicle families;

[0288] Establish a mapping relationship between vehicle types and user interest distribution.

[0289] 4. Multi-objective recommendation generation stage:

[0290] Calculate the predicted intensity of potential user interactions with candidate vehicles;

[0291] A balanced recommendation sequence is constructed using a diversity-aware algorithm.

[0292] Achieve the optimal trade-off between recommendation relevance and diversity.

[0293] This embodiment successfully integrates the high-dimensional representation capabilities of deep learning with the pattern discovery capabilities of unsupervised clustering at the technical implementation level, achieving a theoretically optimal balance between recommendation accuracy and diversity. Through this multi-stage fusion architecture, the system can provide users with a highly personalized and content-rich used car recommendation experience, while effectively solving many technical challenges faced by traditional recommendation systems.

[0294] Example 2

[0295] This embodiment also discloses a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the method described in Embodiment 1.

[0296] The above are merely preferred embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A used car recommendation method based on deep learning and clustering, characterized in that, Includes the following steps: Acquire user behavior sequences and vehicle characteristic data; The user behavior sequence is standardized to generate a fixed-length temporal interaction vector; The temporal interaction vector is input into the Transformer model, and user interest representations are generated through multi-head attention mechanism and positional encoding. K-Means clustering is performed on the embedded vehicle feature data to generate vehicle semantic clusters; By combining the user interest representations and the vehicle semantic clusters shown, a diverse recommendation list is generated; When a new user or vehicle is detected, the meta-learning cold start strategy is triggered.

2. The method according to claim 1, characterized in that, Standardizing user behavior sequences includes: To detect outliers in interaction intensity, Winsorization is used for boundary constraints. Missing values ​​are filled using the user-internal mean or nearest neighbor collaborative filling.

3. The method according to claim 1, characterized in that, Generating fixed-length temporal interaction vectors includes: The sequence length is standardized to N=4; Zero-padding is applied to sequences that are too short. For very long sequences, retain the most recent N interactions.

4. The method according to claim 1, characterized in that, The Transformer model processing includes: The vehicle ID is embedded and added to the trigonometric function position code; Temporal weights are calculated using a multi-head attention mechanism.

5. The method according to claim 1, characterized in that, The K-Means clustering includes: The K-Means++ algorithm is used to initialize the cluster centers; Weighted Euclidean distance based on feature importance; The optimal number of clusters K is determined by the elbow method and the silhouette coefficient.

6. The method according to claim 1, characterized in that, The process of generating a diversity recommendation list includes: Calculate the predicted interaction intensity of the user with the vehicle; Calculate the affinity between the user and each vehicle semantic cluster; Vehicles are selected from the highest affinity cluster with probability α, and from other clusters with probability 1-α.

7. The method according to claim 6, characterized in that, The probability α is dynamically adjusted based on the user interest distribution.

8. The method according to claim 1, characterized in that, Cold start for new users includes: Extract initial user interaction data; The model parameters are updated through meta-learning.

9. The method according to claim 1, characterized in that, Cold starts for new vehicles include: Calculate its similarity to vehicles in its cluster; Add exploration factors to increase exposure.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the method according to any one of claims 1-9.

Citation Information

Patent Citations

  • Intelligent customer recommendation method for second-hand car cross-border trade

    CN114357309A

  • Transform-based article-behavior cross-sequence recommendation method

    CN116644226A

  • Personalized decoration scheme recommendation method and system based on deep learning, and medium

    CN116842267A

  • Personalized second-hand car source recommendation method, computer equipment and related storage medium

    CN118981758A

  • Method and apparatus for optimizing artificial intelligence model for individualized user car recommendation

    KR102806443B1