Recommendation system fusing fuzzy neighborhood and mixed negative sampling
By fusing fuzzy neighborhood and hybrid negative sampling, the problem of insufficient similarity measurement and negative sampling in the recommendation system is solved, thereby improving the accuracy and efficiency of the recommendation system and enhancing user preference modeling and recommendation performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-04-10
AI Technical Summary
Existing recommendation systems lack accuracy in handling ambiguity and uncertainty in user behavior, and negative sampling methods lack representativeness, thus limiting recommendation performance.
We adopt a method that integrates fuzzy neighborhood and hybrid negative sampling. By designing a similarity measurement module, a neighbor selection module, a hybrid negative sampling module, and a dual-tower generation module, we construct a dual-tower generation method guided by neighborhood information. Combined with generative adversarial network for diffusion and denoising, we select strong and weak negative samples to improve the accuracy of similarity modeling.
This improves the accuracy of similarity measurement results and the efficiency of neighborhood information utilization in recommender systems, thereby enhancing their prediction and recommendation capabilities.
Smart Images

Figure CN121834053A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of recommendation technology, and in particular to a recommendation system that integrates fuzzy neighborhood and hybrid negative sampling. Background Technology
[0002] In today's internet age, the explosive growth of data has greatly propelled the development of artificial intelligence. However, the problem of information overload is also becoming increasingly prominent, making it difficult for users to efficiently extract truly valuable content from massive amounts of information. Recommendation systems, with their excellent information filtering and personalized guidance capabilities, have become a key tool for addressing this challenge and are widely used in e-commerce, social networks, and online content platforms. Among these, collaborative filtering is one of the most widely used recommendation algorithms. In recommendation algorithms, by finding the top-k set of users most similar to the target user, the target user's rating can be predicted, thereby enabling personalized recommendations.
[0003] To improve recommendation performance, numerous similarity measurement methods have been proposed. However, most methods fail to adequately characterize the pervasive ambiguity and uncertainty in user behavior, making it difficult to accurately reflect the hesitation, contradictions, and other psychological characteristics exhibited by users when making decisions in real-world scenarios. This limits the accuracy of similarity modeling. Therefore, designing a more accurate similarity method to improve the performance of recommendation systems is of paramount importance.
[0004] Furthermore, negative sampling is a key technique for improving recommendation performance in implicit recommendation scenarios. However, most existing methods randomly select a subset of items that the user has not interacted with as negative samples, which is highly arbitrary and results in low representativeness of the selected negative samples. This makes it difficult for the recommendation system to accurately model user preferences, thus impairing recommendation performance. Therefore, it is essential to design a negative sampling method that can more accurately select high-quality negative samples. Summary of the Invention
[0005] To address the above problems, this invention proposes a recommendation system that integrates fuzzy neighborhood and hybrid negative sampling, comprising:
[0006] The data acquisition and preparation module is used to acquire and clean the data collected in the database to obtain the information required by the system.
[0007] The similarity measurement module is used to design similarity measurement methods and calculate the similarity between different users or different projects, and sort them according to the similarity value.
[0008] The neighbor filtering module is used to filter the user's nearest reciprocal neighbors and the project's farthest reciprocal neighbors, and obtain the user's nearest reciprocal neighbor matrix N and the project's farthest reciprocal neighbor matrix F, respectively.
[0009] The hybrid negative sampling module processes the farthest reciprocal neighbor matrix F of a project, filtering out strong and weak negative samples corresponding to different users to obtain the strong negative sample mask matrix e. SN and weak negative sample mask matrix e WN And together with the user-project interaction matrix C, the masking process is completed.
[0010] The dual-tower generation module is used to construct a dual-tower generation method guided by neighborhood information. It enhances the supervision of the generation process by aggregating neighbor semantics, and combines negative sampling technology with generative adversarial networks to achieve one-step denoising of the diffusion method.
[0011] The rating prediction module is used to calculate the predicted rating value p for the target user u on the unrated item i. ui .
[0012] The recommendation results module is used to evaluate the predicted rating value p. ui Sort the data and recommend the top k items with the highest predicted ratings to the target user u.
[0013] The present invention discloses a recommendation system that integrates fuzzy neighborhood and hybrid negative sampling. The similarity measurement module constructs a membership matrix M, a non-membership matrix N, and a hesitation matrix H, which are used to characterize the preference relationship between users or items from multiple dimensions such as consistency, inconsistency, and uncertainty.
[0014] Taking the three-dimensional preferences between users i and j as an example, when M is satisfied... ij +N ij When ≤1, use M ij V ij and H ij Let i and j represent the consistency, inconsistency, and uncertainty between users i and j, respectively, as shown in the following formulas:
[0015]
[0016] V ij =softsign(||ij||),
[0017] H ij =1-M ij -N ij ,
[0018] Here, i and j refer to the preference vectors of users i and j, respectively.
[0019] Conversely, when M ij +N ij When >1, then:
[0020]
[0021] Hij =0,
[0022] Furthermore, the following similarity measurement method is used to evaluate complex and ambiguous behaviors among users:
[0023]
[0024] The similarity of the user-item rating matrix R and the user-item interaction matrix C is calculated and sorted according to the similarity values.
[0025] The present invention discloses a recommendation system that integrates fuzzy neighborhood and hybrid negative sampling. The neighbor filtering module is used to filter for k devices that have the highest similarity to the target user u. N k users are the nearest neighbor set of the target user u, where k N This represents the threshold for filtering the number of a user's nearest neighbors.
[0026] Taking users i and j as an example, a reciprocal neighbor relationship exists when user i's nearest neighbor set contains user j, and user j's nearest neighbor set also contains user i. Based on the definition of reciprocal neighbors, we can obtain the nearest reciprocal neighbor sets corresponding to the user-item rating matrix R and the user-item interaction matrix C, which contain all users. After rearranging these into two matrices and taking their union, we obtain the user's nearest reciprocal neighbor matrix N.
[0027] The neighbor filtering module is also used to filter for k items that have the lowest similarity to the target item i. F k is the set of the farthest neighbors of item i. F This represents the threshold for selecting the farthest neighbors of a project. Based on the definition of reciprocal neighbors, we obtain the set of farthest reciprocal neighbors corresponding to the user-project rating matrix R and the user-project interaction matrix C, which contains all projects. After rearranging these into two matrices and taking their intersection, we obtain the farthest reciprocal neighbor matrix F.
[0028] This invention discloses a recommendation system that integrates fuzzy neighborhood and hybrid negative sampling. The hybrid negative sampling module processes the farthest reciprocal neighbor matrix F of items. First, it iterates through the items that each user has already interacted with; these items are called positive samples. Then, it extracts the farthest reciprocal neighbors corresponding to the positive samples from the farthest reciprocal neighbor matrix F, performs deduplication and removes the positive samples themselves, and then merges the remaining items as a strong negative sample candidate set for the corresponding user. Finally, for each user, k items are randomly selected from this set. SN Each item is called a strong negative sample, and a strong negative sample mask matrix e is constructed. SN , where k SNThis is the threshold for selecting the number of strongly negative samples. Then, iterate through each item that the user has not interacted with, and randomly select k samples from outside the strong negative sample candidate set. WN Each item is called a weak negative sample, and a weak negative sample mask matrix e is constructed. WN , where k WN This is the threshold for selecting the number of weak negative samples.
[0029] The present invention discloses a recommendation system that integrates fuzzy neighborhood and hybrid negative sampling. The dual-tower generation module is used to construct a dual-tower generation method guided by neighborhood information. It enhances the supervision of the generation process by aggregating neighbor semantics, combines negative sampling technology, and utilizes a generative adversarial network to achieve one-step denoising of the diffusion method. Specifically, it includes:
[0030] (1) Neighborhood information processing module, used to mine information from the nearest mutually beneficial neighbor matrix N of a user, participating in the formation of one of the "towers" in the dual-tower generation method. This module is mainly implemented using a neural network, and the specific calculation formula is as follows:
[0031]
[0032] Where L refers to the number of hidden layers in the neural network, and W... (l) and b (l) These refer to the weight matrix and bias vector of the l-th layer, respectively, and N u This refers to the nearest reciprocal neighbor vectors of the target user u. After multiple layers of linear mapping, the latent representations of the target user's neighbors can be obtained.
[0033] (2) The user information diffusion module is used to perform forward noise addition processing on the user-item interaction matrix C using the diffusion method, and participates in the formation of the other "tower" of the dual-tower generation method. For the target user u, given an initial user-item interaction vector at time t=0... The calculation formula for forward noise addition using the diffusion method is as follows:
[0034]
[0035] in, t and t refer to the Gaussian distribution and time step, respectively. and β refers to the dense representation of target user u at steps t-1 and t, respectively. t ∈(0,1) is used to control the noise scale added at step t, and I refers to the identity matrix. Based on the additivity of independent Gaussian noise, it can be directly derived from the initial user-item interaction vector. The noisy dense representation at step t is derived. The calculation formula is as follows:
[0036]
[0037] in, and This refers to the initial user-project interaction vector. To adjust the noise scale at different time steps t, a linear noise scheduling method was also employed, calculated as follows:
[0038]
[0039] Where c∈[0,1] is used to control the noise scale, α max and α min These represent the upper and lower bounds of the applied noise, respectively.
[0040] (3) The information generation module is used to fuse the neighborhood information and interaction information of the target user u to enhance the recommendation system's representation of user preferences, and to generate data using the generator G of a generative adversarial network. This involves fusing the latent representation h of the target user's neighbors. u The dense representation of the target user obtained by forward noise addition using the diffusion method The concatenation is performed and then input into the hidden layer of the neural network for linear mapping. Subsequently, after passing through the Sigmoid activation function, the output value is mapped to the [0,1] interval, calculated as follows:
[0041]
[0042] in, h refers to the potential representation of the target user's neighbors. u Dense representation of target users To perform concatenation, σ(·) refers to the Sigmoid activation function, C u This refers to the data representation generated by the generator G in a generative adversarial network (GAN). Thus, the recommendation system can comprehensively utilize the target user's neighborhood and interaction information to generate the predicted interaction probability for items the target user has not yet interacted with. This prediction result serves as fake data generated by the generator G, used to train the discriminator D of the GAN and assisting the recommendation system in learning the target user's preferences.
[0043] (4) A masking module is used to supplement certain negative signal constraints, helping the recommendation system to more accurately model the preference distribution of the target user. A zero-reconstruction regularization and partial masking mechanism are designed to mask the strong negative sample matrix e obtained from the hybrid negative sampling module. SN Weak negative sample mask matrix e WN The user-project interaction matrix C is masked using the following formula:
[0044]
[0045] Among them, C u The '⊙' symbol represents the predicted interaction probability vector of the target user u after masking, while the '⊙' symbol represents the dot product operation between variables. Refers to the positive sample mask vector of the target user u. and These refer to the strong negative sample mask vector and the weak negative sample mask vector of the target user u, respectively.
[0046] (5) The data discrimination module guides the recommendation system to learn the correct denoising direction, enabling the reverse denoising process of the diffusion method to reconstruct a user-item interaction vector that approximates the true distribution. This process requires not only understanding the dense representation of the target user u at step t-1, but also... It is also necessary to simultaneously model the predicted interaction probability vector during the reverse denoising process of the diffusion method. The correctness of the denoising direction is evaluated by judging the consistency between the two using discriminator D. Furthermore, to avoid overfitting of discriminator D, the following loss function is used to train discriminator D:
[0047]
[0048] in, The expected distribution is given, and θ and φ are the parameters of the generator G and discriminator D, respectively. This refers to the predicted interaction probability vector of target user u at step t-1. This refers to the distribution of fake data generated by generator G.
[0049] The generator G is trained using the following loss function:
[0050]
[0051] α and β are used to control the importance of strong negative samples and weak negative samples, respectively.
[0052] The present invention discloses a recommendation system that integrates fuzzy neighborhood and hybrid negative sampling. The rating prediction module is used to calculate the predicted rating value p of the target user u on the unrated item i. ui Once the recommendation system has converged during training, the initial prediction interaction probability matrix C can be obtained through the dual-tower generation module. 0 Then, the number of denoising steps T′≤T is set, and a discrimination process based on diffusion-based reverse denoising is executed to obtain the final predicted interaction probability matrix C. T-T′ .
[0053] This invention discloses a recommendation system that integrates fuzzy neighborhood and hybrid negative sampling. The recommendation result module is used to obtain a recommendation list for a target user u. This includes setting the number of items k recommended by the recommendation system for the target user u, obtaining the predicted interaction probability set of the target user u on unrated items from the rating prediction module, sorting the values in this set from largest to smallest, and selecting the k items with the highest predicted interaction probabilities to recommend to the target user u, thus forming a personalized recommendation list for the target user u.
[0054] This invention proposes a recommendation system that integrates fuzzy neighborhood and hybrid negative sampling. It designs a similarity measurement method based on fuzzy preference consistency, which characterizes the preference relationship between users or items from multiple dimensions such as consistency, inconsistency and uncertainty. It also introduces information-rich negative samples to assist in denoising training. This has a very positive effect on improving the accuracy of similarity measurement results and constructing and utilizing more reasonable neighborhood information, thereby strengthening the prediction and recommendation capabilities of the recommendation system. Attached Figure Description
[0055] Figure 1 This is a schematic diagram of the system process of the present invention;
[0056] Figure 2 This is a system framework diagram of the present invention;
[0057] Figure 3 This invention describes the changes in HR and NDCG values across three datasets. Detailed Implementation
[0058] To make the objectives, technical solutions, and advantages of this invention clearer, a recommendation system that integrates fuzzy neighborhood and hybrid negative sampling, as proposed in this invention, will be described in detail below with reference to the accompanying drawings. It should be understood that the specific implementation methods described herein are merely illustrative of the invention and are not intended to limit the invention. Any changes, modifications, additions, alterations, or substitutions made by those skilled in the art within the scope of this invention should be covered by the claims of this invention.
[0059] Figure 1 This is a schematic diagram illustrating the process of a recommendation system that integrates fuzzy neighborhood and hybrid negative sampling according to the present invention. From Figure 1As can be seen, the recommendation system proposed in this invention, which integrates fuzzy neighborhood and hybrid negative sampling, includes: acquiring and cleaning data information from a database to obtain a standardized data format; transforming the acquired user-item rating information to obtain corresponding user-item interaction information, and organizing them into matrix representations to obtain user-item rating matrices and user-item interaction matrices; designing a similarity measurement method based on fuzzy preference consistency, and using multiple dimensions of consistency, inconsistency, and uncertainty for neighbor filtering to obtain user nearest reciprocal neighbor matrices and item farthest reciprocal neighbor matrices; filtering strong negative samples based on positive samples already interacted with by the target user, and randomly selecting weak negative samples from negative samples other than strong negative samples and positive samples, constructing strong negative sample mask matrices and weak negative sample mask matrices respectively; feeding the user-item interaction matrix, strong negative sample mask matrix, and weak negative sample mask matrix into a dual-tower generation module to complete the training process; using the trained dual-tower generation module and the rating prediction method to calculate the predicted interaction probability set of the target user on unrated items; sorting the obtained predicted interaction probability set to generate a series of items that the target user is most likely to be interested in and pushing them.
[0060] Figure 2 This is a framework diagram of a recommendation system that integrates fuzzy neighborhood and hybrid negative sampling according to the present invention. From Figure 2As can be seen, the recommendation system proposed in this invention, which integrates fuzzy neighborhood and hybrid negative sampling, includes a data acquisition and preparation module, a similarity measurement module, a neighbor filtering module, a hybrid negative sampling module, a dual-tower generation module (including neighborhood information processing, user information diffusion, information generation, masking, and data discrimination modules), a rating prediction module, and a recommendation result module. The data acquisition and preparation module extracts data from the database and performs cleaning and preprocessing operations to format it as required by the similarity measurement module. The similarity measurement module characterizes the preference relationships between users or items from multiple dimensions, including consistency, inconsistency, and uncertainty, performs similarity measurement, and sorts the results. The neighbor filtering module filters the nearest reciprocal neighbor matrix for users and the furthest reciprocal neighbor matrix for items. The hybrid negative sampling module processes the furthest reciprocal neighbor matrix for items, performs strong negative sample filtering based on positive samples already interacted with by the target user, and randomly filters weak negative samples from negative samples other than strong and positive samples, constructing strong negative sample mask matrices and weak negative sample mask matrices respectively. The dual-tower generation module constructs a dual-tower system guided by neighborhood information. The generation method includes a neighborhood information processing module for mining information from the user's nearest mutually beneficial neighbor matrix, a user information diffusion module for forward noise addition to the user-item interaction matrix using a diffusion method, an information generation module for fusing the target user's neighbor information and interaction information, a masking module for supplementing certain negative signal constraints to help model the target user's preference distribution, and a data discrimination module for guiding the recommendation system to learn the correct denoising direction and restore a user-item interaction vector that approximates the true distribution. The rating prediction module calculates the predicted interaction probability set for the target user on unrated items based on the results generated by the dual-tower generation module and using a rating prediction method. The recommendation result module internally sorts the obtained predicted interaction probability set and recommends the top-ranked items to the target user.
[0061] Furthermore, the following example illustrates this further:
[0062] Suppose the user set is U = {u1, u2, ..., u...} m The set of items is I = {i1, i2, ..., i}. n Based on the explicit and implicit feedback data from users, a user-item rating matrix R can be constructed. m×n User-Project Interaction Matrix C m×n .
[0063] First, the system data is acquired and cleaned through the data acquisition and preparation module to obtain the variables in the hypothesis. The specific implementation steps of the proposed recommendation system that integrates fuzzy neighborhood and hybrid negative sampling are as follows:
[0064] S1: The data acquisition and preparation module retrieves the required data information from the database, including user ID, project ID, and rating information;
[0065] S2: The similarity measurement module constructs the membership matrix M, non-membership matrix N, and hesitation matrix H respectively. Taking users i and j as an example, when M satisfies... ij +N ij When ≤1, use M ij V ij and H ij Let i and j represent the consistency, inconsistency, and uncertainty between users i and j, respectively, as shown in the following formulas:
[0066]
[0067] V ij =softsign(||ij||),
[0068] H ij =1-M ij -N ij ,
[0069] Here, i and j refer to the preference vectors of users i and j, respectively.
[0070] Conversely, when M ij +N ij When >1, then:
[0071]
[0072] H ij =0,
[0073] Furthermore, the following similarity metric method is used to evaluate the complex and ambiguous behavior between users i and j:
[0074]
[0075] The similarity of the user-item rating matrix R and the user-item interaction matrix C is calculated and sorted according to the similarity values.
[0076] S3: The neighbor filtering module, based on the similarity results sorted in S2, obtains the nearest reciprocal neighbor matrix N for users and the furthest reciprocal neighbor matrix F for projects. First, it filters out users with the highest similarity to the target user as the nearest neighbor set. According to the definition of reciprocal neighbors, the nearest reciprocal neighbor sets corresponding to the user-project rating matrix R and the user-project interaction matrix C, containing all users, can be obtained. After rearranging these into two matrices and taking their union, the nearest reciprocal neighbor matrix N for users is obtained. Similarly, the furthest neighbor set, corresponding to the user-project rating matrix R and the user-project interaction matrix C, containing all projects, can be obtained. After rearranging these into two matrices and taking their intersection, the furthest reciprocal neighbor matrix F for projects is obtained.
[0077] S4: The hybrid negative sampling module is used to process the farthest reciprocal neighbor matrix F of the project to obtain the strong negative sample mask matrix e. SN and weak negative sample mask matrix e WN First, iterate through all the positive samples that each user has interacted with. Then, extract the farthest reciprocal neighbors corresponding to the positive samples from the farthest reciprocal neighbor matrix F, and perform deduplication and remove the positive samples themselves. Next, merge the remaining items to form a strong negative sample candidate set for the corresponding user. Then, for each user, randomly select k items from this set. SN Each item is called a strong negative sample, and a strong negative sample mask matrix e is constructed. SN , where k SN This is the threshold for selecting the number of strongly negative samples. Then, iterate through each item that the user has not interacted with, and randomly select k samples from outside the strong negative sample candidate set. WN Each item is called a weak negative sample, and a weak negative sample mask matrix e is constructed. WN , where k WN This is the threshold for selecting the number of weak negative samples.
[0078] S5: The dual-tower generation module generates the user reciprocal neighbor matrix N obtained in S3 and the strong negative sample mask matrix e obtained in S4. SN and weak negative sample mask matrix e WN This process is used to construct a dual-tower generation method guided by neighborhood information.
[0079] This includes a neighborhood information processing module, used to mine information from the user's nearest mutually beneficial neighbor matrix N. This module is mainly implemented using a neural network, and the specific calculation formula is as follows:
[0080]
[0081] Where L refers to the number of hidden layers in the neural network, and W... (l) and b(l) These refer to the weight matrix and bias vector of the l-th layer, respectively, and N u This refers to the nearest reciprocal neighbor vectors of the target user u. After multiple layers of linear mapping, the latent representations of the target user's neighbors can be obtained.
[0082] It also includes a user information diffusion module, used to perform forward noise addition processing on the user-item interaction matrix C using a diffusion method. For the target user u, given an initial user-item interaction vector at time t=0... The calculation formula for forward noise addition using the diffusion method is as follows:
[0083]
[0084] in, t and t refer to the Gaussian distribution and time step, respectively. and β refers to the dense representation of target user u at steps t-1 and t, respectively. t ∈(0,1) is used to control the noise scale added at step t, and I refers to the identity matrix. Based on the additivity of independent Gaussian noise, it can be directly derived from the initial user-item interaction vector. The noisy dense representation at step t is derived. The calculation formula is as follows:
[0085]
[0086] in, and This refers to the initial user-project interaction vector. To adjust the noise scale at different time steps t, a linear noise scheduling method was also employed, calculated as follows:
[0087]
[0088] Where c∈[0,1] is used to control the noise scale, α max and α min These represent the upper and lower bounds of the applied noise, respectively.
[0089] Next is the information generation module, which fuses the neighborhood information and interaction information of the target user u to enhance the recommendation system's representation of user preferences. Data generation is achieved using a generator G from a generative adversarial network. This involves fusing the latent representation h of the target user's neighbors. u The dense representation of the target user obtained by forward noise addition using the diffusion method The concatenation is performed and then input into the hidden layer of the neural network for linear mapping. Subsequently, after passing through the Sigmoid activation function, the output value is mapped to the [0,1] interval, calculated as follows:
[0090]
[0091] in, h refers to the potential representation of the target user's neighbors. u Dense representation of target users To perform concatenation, σ(·) refers to the Sigmoid activation function, C u In generative adversarial networks, the data representation generated by generator G is referred to as the data representation generated by generator G.
[0092] Then it enters the masking module, which is used to supplement certain negative signal constraints. This module is designed with zero reconstruction regularization and partial masking mechanisms to transform the strong negative sample mask matrix e obtained from the hybrid negative sampling module. SN Weak negative sample mask matrix e WN The user-project interaction matrix C is masked using the following formula:
[0093]
[0094] Among them, C u The '⊙' symbol represents the predicted interaction probability vector of the target user u after masking, while the '⊙' symbol represents the dot product operation between variables. Refers to the positive sample mask vector of the target user u. and These refer to the strong negative sample mask vector and the weak negative sample mask vector of the target user u, respectively.
[0095] Finally, the data discrimination module uses the following loss function to train the discriminator D:
[0096]
[0097] in, The expected distribution is given, and θ and φ are the parameters of the generator G and discriminator D, respectively. This refers to the predicted interaction probability vector of target user u at step t-1. This refers to the distribution of fake data generated by generator G.
[0098] The generator G is trained using the following loss function:
[0099]
[0100] α and β are used to control the importance of strong negative samples and weak negative samples, respectively.
[0101] S6: The rating prediction module is used to calculate the predicted rating p for the target user u on the unrated item i. ui Once the recommendation system has converged during training, the initial prediction interaction probability matrix C can be obtained through the dual-tower generation module. 0 Then, the number of denoising steps T′≤T is set, and a discrimination process based on diffusion-based reverse denoising is executed to obtain the final predicted interaction probability matrix C. T -T′ .
[0102] S7: The recommendation results module is used to obtain the recommendation list for the target user u. This includes setting the number of items k recommended by the recommendation system for the target user u, obtaining the set of predicted interaction probabilities of the target user u on unrated items from S6, sorting the values in the set from largest to smallest, and selecting the k items with the highest predicted interaction probabilities to recommend to the target user u, thus forming a personalized recommendation list for the target user u.
[0103] Figure 3 The proposed method was measured on three datasets using two metrics: hit rate (HR) and normalized depreciation cumulative gain (NDCG). Their calculation methods and measurement details are shown below:
[0104] Hit rate: This directly reflects the effectiveness of the recommendation system, measuring whether the predicted recommendation list contains items that the target user is genuinely interested in. A higher value indicates that the recommendation results better cover the target user's true preferences. The calculation formula is as follows:
[0105]
[0106] Where m represents the number of users in the recommendation system, and hits(i) represents the proportion of the first k predicted recommendation items of the i-th user in the actual recommendation item set.
[0107] Normalized depreciation cumulative gain: This measures the ranking quality of a recommendation system. It considers not only whether the recommended items match the target user's actual interests, but also the ranking position of the matched items within the list. The higher the ranking, the higher the reward. The calculation formula is as follows:
[0108]
[0109] Where DCG@k and IDCG@k represent the discounted cumulative gain and the ideal DCG, respectively, rel p The `rel` parameter is used to display the recommendation relevance of the item at position `p`, i.e., if the predicted recommended item appears in the actual recommendation list. p =1, otherwise 0.
Claims
1. A recommendation system that integrates fuzzy neighborhood and hybrid negative sampling, characterized in that, include: The data acquisition and preparation module is used to acquire and clean the data collected in the database to obtain the information required by the system. The similarity measurement module is used to design similarity measurement methods and calculate the similarity between different users or different items, and sort them according to the similarity value; The neighbor filtering module is used to filter the user's nearest reciprocal neighbors and the project's farthest reciprocal neighbors, and obtain the user's nearest reciprocal neighbor matrix N and the project's farthest reciprocal neighbor matrix F respectively; The hybrid negative sampling module processes the project's furthest reciprocal neighbor matrix F, filtering out strong and weak negative samples corresponding to different users to obtain the strong negative sample mask matrix e. SN and weak negative sample mask matrix e WN And together with the user-project interaction matrix C, the masking process is completed; The dual-tower generation module is used to construct a dual-tower generation method guided by neighborhood information. It enhances the supervision of the generation process by aggregating neighbor semantics, and combines negative sampling technology with generative adversarial networks to achieve one-step denoising of the diffusion method. The rating prediction module is used to calculate the predicted rating value p for the target user u on the unrated item i. ui ; The recommendation results module is used to evaluate the predicted rating value p. ui Sort the data and recommend the top k items with the highest predicted ratings to the target user u.
2. The recommendation system that integrates fuzzy neighborhood and hybrid negative sampling as described in claim 1, characterized in that, The similarity measurement module constructs a membership matrix M, a non-membership matrix N, and a hesitation matrix H, respectively, to characterize the preference relationship between users or items from multiple dimensions of consistency, inconsistency, and uncertainty. Taking the three-dimensional preferences between users i and j as an example, when M is satisfied... ij +N ij When ≤1, use M ij V ij and H ij Let i and j represent the consistency, inconsistency, and uncertainty between users i and j, respectively, as shown in the following formulas: V ij =softsign(||ij||), H ij =1-M ij -N ij , Where i and j refer to the preference vectors of users i and j, respectively; Conversely, when M ij +N ij When >1, then: H ij =0, Furthermore, the following similarity measurement method is used to evaluate complex and ambiguous behaviors among users: The similarity of the user-item rating matrix R and the user-item interaction matrix C is calculated separately, and then sorted according to the similarity values.
3. The recommendation system that integrates fuzzy neighborhood and hybrid negative sampling as described in claim 1, characterized in that, The neighbor filtering module is used to filter for k that has the highest similarity to the target user u. N k users are the nearest neighbor set of the target user u, where k N This represents the threshold for filtering the number of a user's nearest neighbors; Taking users i and j as an example, a reciprocal neighbor is a user i whose nearest neighbor set contains user j, and user j's nearest neighbor set also contains user i. According to the definition of reciprocal neighbors, we can obtain the nearest reciprocal neighbor set corresponding to the user-item rating matrix R and the user-item interaction matrix C, which contains all users. After organizing them into two matrices and taking their union, we can obtain the user's nearest reciprocal neighbor matrix N. The neighbor filtering module is also used to filter for k items that have the lowest similarity to the target item i. F k is the set of the farthest neighbors of item i. F The threshold for the number of farthest neighbors of a project is represented. According to the definition of reciprocal neighbors, the set of farthest reciprocal neighbors corresponding to the user-project rating matrix R and the user-project interaction matrix C, which contains all projects, is obtained. After sorting them into two matrices and taking their intersection, the farthest reciprocal neighbor matrix F of a project can be obtained.
4. The recommendation system that integrates fuzzy neighborhood and hybrid negative sampling as described in claim 1, characterized in that, The hybrid negative sampling module is used to process the farthest reciprocal neighbor matrix F of the items. First, it iterates through the items that each user has already interacted with; these items are called positive samples. Then, it extracts the farthest reciprocal neighbors corresponding to the positive samples from the farthest reciprocal neighbor matrix F, performs deduplication and removes the positive samples themselves, and then merges the remaining items as a strong negative sample candidate set for the corresponding user. Finally, for each user, k items are randomly selected from this set. SN Each item is called a strong negative sample, and a strong negative sample mask matrix e is constructed. SN , where k SN A threshold is set for the number of strongly negative samples; then, for each item that the user has not interacted with, k samples are randomly selected from those outside the strong negative sample candidate set. WN Each item is called a weak negative sample, and a weak negative sample mask matrix e is constructed. WN , where k WN This is the threshold for selecting the number of weak negative samples.
5. The recommendation system that integrates fuzzy neighborhood and hybrid negative sampling as described in claim 1, characterized in that, The dual-tower generation module is used to construct a dual-tower generation method guided by neighborhood information. It enhances the supervision of the generation process by aggregating neighbor semantics, combines negative sampling techniques, and utilizes generative adversarial networks to achieve one-step denoising of the diffusion method. Specifically, it includes: (1) Neighborhood information processing module, used to mine information from the nearest mutual neighbor matrix N of the user, and participate in the formation of one of the "towers" of the dual-tower generation method. This module is mainly implemented by neural network, and the specific calculation formula is as follows: Where L refers to the number of hidden layers in the neural network, and W... (l) and b (l) These refer to the weight matrix and bias vector of the l-th layer, respectively, and N u This refers to the nearest reciprocal neighbor vectors of the target user u; after multiple layers of linear mapping, the latent representations of the target user's neighbors can be obtained. (2) User information diffusion module, used to perform forward noise addition processing on the user-item interaction matrix C using the diffusion method, and participate in the formation of the other "tower" of the dual-tower generation method; for the target user u, given an initial user-item interaction vector at time t=0. The calculation formula for forward noise addition using the diffusion method is as follows: in, t and t refer to the Gaussian distribution and time step, respectively. and β refers to the dense representation of target user u at steps t-1 and t, respectively. t ∈(0,1) is used to control the noise scale added at step t, where I refers to the identity matrix; based on the additivity of independent Gaussian noise, it can be directly obtained from the initial user-item interaction vector. The noisy dense representation at step t is derived. The calculation formula is as follows: in, and This refers to the initial user-project interaction vector. To adjust the noise scale at different time steps t, a linear noise scheduling method is also employed, calculated as follows: Where c∈[0,1] is used to control the noise scale, α max and α min These represent the upper and lower bounds of the applied noise, respectively. (3) Information generation module, used to fuse neighborhood information and interaction information of target user u to enhance the recommendation system's representation of user preferences, and to generate data with the help of generator G of generative adversarial network; to generate the latent representation h of the target user's neighbors. u The dense representation of the target user obtained by forward noise addition using the diffusion method The concatenation is performed and input into the hidden layer of the neural network for linear mapping; subsequently, after passing through the Sigmoid activation function, the output value is mapped to the [0,1] interval, calculated as follows: in, h refers to the potential representation of the target user's neighbors. u Dense representation of target users To perform concatenation, σ(·) refers to the Sigmoid activation function, C u This refers to the data representation generated by the generator G in the generative adversarial network. Thus, the recommendation system can comprehensively utilize the target user's neighborhood information and interaction information to generate the target user's predicted interaction probability for non-interactive items. This prediction result serves as fake data generated by the generator G, used to train the discriminator D of the generative adversarial network, and assists the recommendation system in learning the target user's preferences. (4) A masking module is used to supplement certain negative signal constraints, helping the recommendation system to more accurately model the preference distribution of the target user; a zero-reconstruction regularization and partial masking mechanism are designed to transform the strong negative sample mask matrix e obtained by the hybrid negative sampling module. SN Weak negative sample mask matrix e WN The user-project interaction matrix C is masked using the following formula: Among them, C u The '⊙' symbol represents the predicted interaction probability vector of the target user u after masking, while the '⊙' symbol represents the dot product operation between variables. Refers to the positive sample mask vector of the target user u. and These refer to the strong negative sample mask vector and the weak negative sample mask vector of the target user u, respectively. (5) Data discrimination module, used to guide the recommendation system to learn the correct denoising direction, so that the reverse denoising process of the diffusion method can restore the user-item interaction vector that is close to the real distribution; in this process, it is necessary not only to master the dense representation of the target user u at step t-1. It is also necessary to simultaneously model the predicted interaction probability vector during the reverse denoising process of the diffusion method. The correctness of the denoising direction is evaluated by judging the consistency between the two using discriminator D. Furthermore, to avoid overfitting of discriminator D, the following loss function is used to train discriminator D: in, The expected distribution is given, and θ and φ are the parameters of the generator G and discriminator D, respectively. This refers to the predicted interaction probability vector of target user u at step t-1. This refers to the distribution of spurious data generated by generator G; The generator G is trained using the following loss function: α and β are used to control the importance of strong negative samples and weak negative samples, respectively.
6. The recommendation system that integrates fuzzy neighborhood and hybrid negative sampling as described in claim 1, characterized in that, The rating prediction module is used to calculate the predicted rating value p of the target user u on the unrated item i. ui Once the recommendation system has converged during training, the initial prediction interaction probability matrix C can be obtained through the dual-tower generation module. 0 Then, the number of denoising steps T′≤T is set, and a discrimination process based on diffusion-based reverse denoising is executed to obtain the final predicted interaction probability matrix C. T-T′ .
7. The recommendation system that integrates fuzzy neighborhood and hybrid negative sampling as described in claim 1, characterized in that, The recommendation result module is used to obtain a recommendation list for the target user u. This includes setting the number of items k recommended by the recommendation system for the target user u, obtaining the predicted interaction probability set of the target user u on unrated items from the rating prediction module, sorting the values in the set from largest to smallest, and selecting the k items with the highest predicted interaction probability to recommend to the target user u, so as to form a personalized recommendation list for the target user u.