A recommendation method of a robust community detection model based on ensemble learning
By using an ensemble learning-based robust community detection model, improving the Louvain algorithm and consensus network creation algorithm, and combining it with nonnegative matrix factorization, the performance degradation problem of community detection algorithms under network attacks is solved, achieving efficient recommendation in recommendation systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-07
- Publication Date
- 2026-03-24
AI Technical Summary
Existing community detection algorithms suffer from performance degradation when facing network attacks, and traditional robust community detection algorithms require prior knowledge that is difficult to obtain, resulting in poor performance in recommendation systems.
A robust community detection model based on ensemble learning is adopted. By combining the improved Louvain algorithm and consensus network creation algorithm with non-negative matrix factorization, the community structure is generated by learning relevant knowledge on its own.
It improves the robustness and accuracy of community detection, maintains good performance under different attacks, adapts to diverse datasets, and enhances the performance of recommendation systems.
Smart Images

Figure CN116383668B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data mining technology, and in particular to a recommendation method based on an ensemble learning-based robust community detection model. Background Technology
[0002] Community detection algorithms hold significant research value in network data studies, aiming to analyze the potential higher-order network structures within networks. Network data is an unavoidable data type across various fields, such as social networks in sociology, protein-protein interaction networks in biology, and transaction networks in finance. Against this backdrop, researchers have developed numerous traditional community detection algorithms, including the Louvain algorithm, spectral clustering, nonnegative matrix factorization (NMF), and deep learning-based community detection.
[0003] As community detection technology has evolved, research into attack algorithms targeting community detection has grown alongside the development of community detection algorithms in order to protect personal privacy. Examples include modularity-based attack algorithms (Q-attack), heuristic-based algorithms (DICE), and random noise-based algorithms (random). These methods process network information, degrading the performance of traditional community detection algorithms and thus achieving the goal of protecting node information within the network.
[0004] To overcome the impact of adversarial attacks on traditional community detection algorithms, robust community detection algorithms have recently gained attention from researchers. Examples include motif-based community enhancement algorithms (Edmot), network enhancement-based community detection algorithms (ND), and network-enhanced community detection algorithms based on network node similarity (RcdSe). These can be summarized in two steps: first, by observing and hypothesizing the characteristics of an adversarial attack, and then repairing the network to address these characteristics; finally, community detection is performed on the repaired network. These methods, through simple assumptions, focus the key research area on how to repair the network.
[0005] Given the global reach of the internet, product manufacturers and service providers have the opportunity to advertise to a vast customer base worldwide. Simultaneously, consumer choices have multiplied. While this allows for greater possibilities and wider selection, it also has some significant implications. On one hand, it becomes increasingly difficult for producers and providers to improve advertising efficiency because, considering the diversity of their needs, it's challenging to select and target consumers whose preferences better match their products or services. On the other hand, given the diversity and widespread availability of options, coupled with time constraints, consumers struggle to find suitable products or services that better align with their interests. Therefore, recommender systems have become a crucial application area for machine learning. In the process of using community detection to address recommender system applications, a high-quality community structure directly impacts subsequent recommendation results. However, research has revealed that the user-user network generated during the process is incomplete. Some elements are hidden, such as actions that users haven't yet performed in reality. These elements can be viewed as introducing noise without prior knowledge, rather than the perfect network assumed by traditional community detection. This leads to unsatisfactory performance of traditional community detection in practical applications. Furthermore, existing robust community detection algorithms require strong prior assumptions and have severe limitations in their use. When the attack algorithm used does not conform to its prior assumptions, the algorithm's performance will still be severely degraded. Summary of the Invention
[0006] This invention provides a recommendation method based on a robust community detection model using ensemble learning. By employing ensemble learning, the model learns relevant knowledge independently, thus avoiding the problem of unknowable prior knowledge.
[0007] This invention provides a recommendation method based on an ensemble learning-based robust community detection model, comprising the following steps:
[0008] Step S110: Collect data to obtain a user-product matrix of user ratings for products;
[0009] Step S120: Construct an N Given an empty matrix A of N, if users i and j are interested in the same item, then... A ij A ij 1. After completing the statistics, matrix A is regarded as an adjacency matrix, thereby generating the user network G;
[0010] Step S130: Input the user network G into the robust community detection model based on ensemble learning to obtain its community structure;
[0011] Step S140: Predict the target products that each target user has not rated;
[0012] In step S140, the following method is used to predict the target products that each target user has not rated:
[0013] First, find the community where the target user belongs, and use cosine similarity to calculate the similarity value between the community members and the target user. Then, use the ratings of these members for the target product to obtain the predicted value through a weighted average. Perform this operation for each unrated item. Finally, each target user will have a set of predicted values for unrated products, and recommendations will be made according to the predicted values from largest to smallest.
[0014] The construction of the robust community detection model based on ensemble learning includes:
[0015] Step 1: Obtain a preliminary set of results: Repeat k The improved Louvain algorithm, acting as a deviator module, yields a set of preliminary results. ;
[0016] Step 2: Generate an enhanced consensus network: Use the improved consensus network creation algorithm as the equals module to aggregate the initial results. Integrating into a consensus network ;
[0017] Step 3, Community Testing: The consensus network generated in Step 2... Community detection is performed using nonnegative matrix factorization. The community detection process includes: first, randomly initializing matrices X and Y, with shapes N. L and L N, where N is the number of nodes and L is the number of communities; then the matrix is iterated through cross-processing. X sum matrix Y The process involves iteration and convergence to obtain convergence matrices X and Y. Convergence matrix X is the community mapping function matrix, and convergence matrix Y is the community member matrix. Finally, the community number corresponding to the largest element in the column of each node in convergence matrix Y is output as the community to which that element belongs. Each node can obtain the final community division, and the community structure is finally obtained by unified output.
[0018] Step one includes:
[0019] Step 11: For each node The operation is as follows: Calculate the modularity gain of the neighbors using the following formula (1). ;
[0020] Formula (1)
[0021] In formula (1), and Number the nodes. for The sum of the link weights of all nodes in the community; for The sum of the link weights of all nodes corresponding to the community; For nodes Corresponding communities and nodes The sum of the link weights between the corresponding communities; It is the sum of the link weights of all nodes in the network;
[0022] Let weight The neighbor weights are assigned to the corresponding intervals according to the following formula (2), and then a random number is generated. The neighbors corresponding to the interval where the random number falls are the selected neighbors. Step 11 considers the modularity gain. If there are no neighbors with a value greater than 0, no further merging will be performed.
[0023] Formula (2);
[0024] Step 12: Merge each node selected in Step 11 into a new node. The edge weights between the new nodes are the sum of the edge weights between the original nodes being merged.
[0025] Step 13: Repeat steps 11 and 12 until no more nodes are merged, then output the result. The final network structure consists of original nodes contained within each node, forming a community structure. ,in The number of clubs discovered. This indicates that this is the [number]. Preliminary results;
[0026] Step 14: Merge the preliminary results to obtain a set of preliminary results. ;
[0027] Step two includes:
[0028] Step 21: Calculate the similarity between preliminary results using the normalized mutual information index, and then use the similarity to perform clustering. The preliminary results are divided into a small collection , ;
[0029] Step 22: Generate a preliminary consensus network for each subclass using the following formula (3). ;
[0030] Formula (3)
[0031] In formula (3), It's an indicator function that outputs 1 if two of its parameters are equal, and 0 otherwise. It is the output exist The label number in This is a preliminary result belonging to this subcategory;
[0032] Step 23, A preliminary consensus network Using formula (4), an enhanced consensus network is formed. Output;
[0033] Formula (4).
[0034] The technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:
[0035] The embodiments of the present invention learn relevant knowledge on their own through an ensemble learning method, thus avoiding the problem of unknown prior knowledge. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments of the present invention or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 A flowchart of a recommendation method based on an ensemble learning robust community detection model provided by this invention;
[0038] Figure 2 A detailed flowchart of a recommendation method based on an ensemble learning robust community detection model provided by this invention;
[0039] Figure 3 A flowchart illustrating an application example of a recommendation method based on an ensemble learning robust community detection model provided by this invention;
[0040] Figure 4 The table below shows a comparative experiment between the robust community detection method of this invention and existing methods on various processed datasets.
[0041] Figure 5 This is a table showing the specific data from independent ablation experiments performed in steps one and two according to an embodiment of the present invention.
[0042] Figure 6This document presents comparative test data of the robust community detection method and the Louvain algorithm in a collaborative filtering framework within a practical application of a recommendation system, as described in this invention. Detailed Implementation
[0043] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0044] Existing robust community detection algorithms all require prior knowledge, which is extremely difficult to obtain in practice. This invention, through ensemble learning, learns the relevant knowledge itself, thus avoiding the problem of unknowable prior knowledge.
[0045] The Louvain algorithm is a commonly used non-overlapping and non-distributed community detection algorithm. The clustering process can be divided into two main phases. The algorithm treats each node as a community. During the merging process, multiple nodes are combined into a single entity, and ultimately, these merged nodes are grouped into one community. These two phases are repeated until the network no longer changes, and the community results are output. Ensemble algorithms are common machine learning frameworks that analyze the results of multiple base algorithms, combining the beneficial parts of each result to obtain a superior final result. Existing research has shown that ensemble algorithms can enhance the robustness of algorithms.
[0046] This invention's Louvain method, based on maximizing modularity, calculates the modularity gain of each node, continuously merging nodes into one by selecting the node with the largest gain. Output is given when all nodes have a modularity gain, and the merged nodes in each final node are considered a community. The consensus network of this invention is a network data structure representing a set of community discovery results. (Establishing a new network...) ,in It is the set of nodes in the original network. This is a weighted adjacency matrix. This embodiment of the invention will improve the Louvain algorithm and existing consensus networks. Within the framework of ensemble algorithms, a set of results is first obtained using the improved Louvain algorithm. ,Will Input the improved consensus network creation module to obtain an enhanced consensus network. Finally, the nonnegative matrix factorization algorithm was used in the new network. The final community structure is obtained from this.
[0047] Please see Figure 1 This invention provides a recommendation method based on a robust community detection model using ensemble learning, comprising the following steps:
[0048] Step 1: Obtain a preliminary set of results: Repeat k The improved Louvain algorithm, acting as a deviator module, yields a set of preliminary results. .
[0049] For further details, please refer to Figure 2 Step one includes:
[0050] Step 11: For each node The operation is as follows: Calculate the modularity gain of the neighbors using the following formula (1). ;
[0051] Formula (1)
[0052] In formula (1), nodes choose The neighboring nodes corresponding to the given interval are merged, where and It is the node number. for The sum of the link weights of all nodes in the community; for The sum of the link weights of all nodes corresponding to the community; For nodes Corresponding communities and nodes The sum of the link weights between the corresponding communities; It is the sum of the link weights of all nodes in the network;
[0053] Let weight The neighbor weights are assigned to the corresponding intervals according to the following formula (2), and then a random number is generated. The neighbors corresponding to the interval where the random number falls are the selected neighbors;
[0054] Formula (2);
[0055] Step 12: Merge each node selected in Step 11 into a new node. The edge weights between the new nodes are the sum of the edge weights between the original nodes being merged.
[0056] Step 13: Repeat steps 11 and 12 until no more nodes are merged, then output the result. The final network structure consists of original nodes contained within each node, forming a community structure. ,in The number of clubs discovered. This indicates that this is the [number]. Preliminary results;
[0057] Step 14: Merge the preliminary results to obtain a set of preliminary results. .
[0058] Step 2: Generate an enhanced consensus network: Use the improved consensus network creation algorithm as the equals module to aggregate the initial results. Integrating into a consensus network .
[0059] For more details, please continue reading. Figure 2 Step two includes:
[0060] Step 21: Calculate the similarity between preliminary results using the normalized mutual information index, and then use the similarity to perform clustering. The preliminary results are divided into a small collection , ;
[0061] Step 22: Generate a preliminary consensus network for each subclass using the following formula (3). ;
[0062] Formula (3)
[0063] In formula (3), It's an indicator function that outputs 1 if two of its parameters are equal, and 0 otherwise. It is the output exist The label number in This is a preliminary result belonging to this subcategory;
[0064] Step 23, A preliminary consensus network Using formula (4), an enhanced consensus network is formed. Output;
[0065] Formula (4).
[0066] Step 3, Community Testing: The consensus network generated in Step 2... Community detection is performed using nonnegative matrix factorization. The process includes: first, randomly initializing matrices X and Y, with shapes as follows: N L and L N Where N is the number of nodes and L is the number of communities; then the matrix is iterated through cross-processing. Xsum matrix Y The process involves iteration and convergence to obtain convergence matrices X and Y. Convergence matrix X is the community mapping function matrix, and convergence matrix Y is the community member matrix. Finally, the community number corresponding to the largest element in the column of each node in convergence matrix Y is output as the community to which that element belongs. Each node can obtain the final community division, and the community structure is finally obtained by unified output.
[0067] For more details, please continue reading. Figure 2 Step three involves using nonnegative matrix decomposition to perform community detection on the adjacency matrix generated in step two. Specifically, two matrices are first randomly initialized. X and Y , shape is N L and L N ,in N The number of nodes L The number of clubs; then, through cross-iteration... X and Y The update is performed, and convergence usually occurs after about 100 iterations. The specific iteration formulas are shown in formulas (5) and (6) below.
[0068] Formula (5)
[0069] Formula (6);
[0070] When a convergent matrix is obtained X and Y back, X It is the community mapping function matrix, and Y This refers to the community member matrix, which, in this embodiment of the invention, will... Y The community ID corresponding to the largest element in the column of each node is output as the community to which that element belongs. Each node yields the final community division, and the final output is the unified community structure.
[0071] Please see Figure 3 The construction of a robust community detection model based on ensemble learning provided in this embodiment of the invention includes:
[0072] Step S110: Collect data to obtain a user-product matrix of user ratings for products;
[0073] Step S120: Construct an N Given an empty matrix A of N, if users i and j are interested in the same item, then... A ij = A ij+1, after completing the statistics, matrix A is regarded as an adjacency matrix, thus generating the user network G;
[0074] Step S130: Input the user network G into a robust community detection model based on ensemble learning to obtain its community structure;
[0075] Step S140: Predict the target products that each target user has not rated.
[0076] In one possible implementation, in step S140, the following method is used to predict the target products that have not been rated by each target user:
[0077] First, locate the target user's community and calculate the similarity score between community members and the target user using cosine similarity. Then, use the weighted average of these members' ratings of the target product to obtain a predicted value. Perform this operation for each unrated item. Ultimately, each target user will receive a set of predicted values for unrated products, which are then recommended in descending order of predicted value.
[0078] The four publicly available datasets were processed using both a heuristic-based algorithm (DICE) and a random noise-based algorithm (random). The robust community detection method (ECRCD) of this invention was then compared with existing methods (Louvain, ND, and RcdSe) on each of the processed datasets. The performance metric used was the NMI value; a higher NMI value indicates better community detection performance. Please refer to [link to relevant documentation]. Figure 4 The comparative experimental results show that the robust community detection method of this invention demonstrates advantages on all datasets. This reflects that the robust community detection method of this invention is designed to be highly robust against attacks targeting community detection algorithms. Furthermore, this performance is maintained under different attacks, solving the practical application problem that existing methods only perform well on specific data.
[0079] Please see Figure 5Furthermore, this invention also conducted independent ablation experiments on the two innovative modules. Firstly, overall, comparing the removal of one module separately, this invention achieved the best results on all datasets except the PubMed-Random dataset, indicating that neither module alone can achieve optimal performance. Secondly, the comparison of removing (the deviator) confirms the motivation of this invention. The goal of the base algorithm (Louvain) is affected by adversarial attacks, resulting in the provided basic solution still repeating erroneous information, thus failing to yield a better solution after aggregation. In the results of removing (the equalizer), it exhibits the same problem as other comparative algorithms in the comparative experiments, namely, difficulty in handling datasets with different attack methods and characteristics, which is the universality emphasized in this invention. In conclusion, combined with the experimental results, this invention demonstrates the correctness of its motivation and the effectiveness of the two module designs.
[0080] To illustrate the practical value of the algorithm in this invention, the embodiments of this invention select recommender systems, a currently popular research topic, as the application target. Using this invention and the Louvain algorithm, tests were conducted within the most commonly used collaborative filtering framework in practical recommender system applications. For details, please refer to [link to relevant documentation]. Figure 6 As shown. Commonly used metrics include precision and recall; higher values indicate better performance. On both datasets, this algorithm demonstrates a significant improvement over the original method (louvain). This phenomenon precisely proves the impact of data noise on community detection algorithms. Real-world data is often highly noisy; therefore, the algorithm in this embodiment achieves far better results than the basic algorithm in practical applications, highlighting the practical application value of this invention.
[0081] The various embodiments in this specification are described in a progressive manner. For the same or similar parts between the various embodiments, please refer to each other. Each embodiment focuses on describing the differences from other embodiments.
[0082] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of this application.
Claims
1. A recommendation method based on a robust community detection model using ensemble learning, characterized in that, Includes the following steps: Step S110: Collect data to obtain a user-product matrix of user ratings for products; Step S120: Construct an N Given an empty matrix A of N, if users i and j are interested in the same item, then... A ij A ij 1. After completing the statistics, matrix A is regarded as an adjacency matrix, thereby generating the user network G; Step S130: Input the user network G into the robust community detection model based on ensemble learning to obtain its community structure; Step S140: Predict the target products that each target user has not rated; In step S140, the following method is used to predict the target products that each target user has not rated: First, locate the community where the target user belongs, and use cosine similarity to calculate the similarity value between the community members and the target user; then, use the ratings of these members for the target product to obtain the predicted value through a weighted average. This process is repeated for each unrated item, and eventually each target user will receive a set of predicted values for the unrated products, which are then recommended in descending order of predicted value. The construction of the robust community detection model based on ensemble learning includes: Step 1: Obtain a preliminary set of results: Repeat k The improved Louvain algorithm, acting as a deviator module, yields a set of preliminary results. ; Step 2: Generate an enhanced consensus network: Use the improved consensus network creation algorithm as the equals module to aggregate the initial results. Integrating into a consensus network ; Step 3, Community Testing: The consensus network generated in Step 2... Community detection is performed using nonnegative matrix factorization. The community detection process includes: first, randomly initializing matrices X and Y, with shapes N. L and L N, where N is the number of nodes and L is the number of communities; then the matrix is iterated through cross-processing. X sum matrix Y The process involves iteration and convergence to obtain convergence matrices X and Y. Convergence matrix X is the community mapping function matrix, and convergence matrix Y is the community member matrix. Finally, the community number corresponding to the largest element in the column of each node in convergence matrix Y is output as the community to which that element belongs. Each node can obtain the final community division, and the community structure is finally obtained by unified output. Step one includes: Step 11: For each node The operation is as follows: Calculate the modularity gain of the neighbors using the following formula (1). ; Official (1) In formula (1), and Number the nodes. for The sum of the link weights of all nodes in the community; for The sum of the link weights of all nodes corresponding to the community; For nodes Corresponding communities and nodes The sum of the link weights between the corresponding communities; It is the sum of the link weights of all nodes in the network; Let weight The neighbor weights are assigned to the corresponding intervals according to the following formula (2), and then a random number is generated. The neighbors corresponding to the interval where the random number falls are the selected neighbors. Step 11 considers the modularity gain. If there are no neighbors with a value greater than 0, no further merging will be performed. Official (2); Step 12: Merge each node selected in Step 11 into a new node. The edge weights between the new nodes are the sum of the edge weights between the original nodes being merged. Step 13: Repeat steps 11 and 12 until no more nodes are merged, then output the result. The final network structure consists of original nodes contained within each node, forming a community structure. ,in The number of clubs discovered. This indicates that this is the [number]. Preliminary results; Step 14: Merge the preliminary results to obtain a set of preliminary results. ; Step two includes: Step 21: Calculate the similarity between preliminary results using the normalized mutual information index, and then use the similarity to perform clustering. The preliminary results are divided into a small collection , ; Step 22: Generate a preliminary consensus network for each subclass using the following formula (3). ; Official (3) In formula (3), It's an indicator function that outputs 1 if two of its parameters are equal, and 0 otherwise. It is the output exist The label number in This is a preliminary result belonging to this subcategory; Step 23, A preliminary consensus network Using formula (4), an enhanced consensus network is formed. Output; Formula (4).
2. The recommendation method based on the robust community detection model using ensemble learning according to claim 1, characterized in that, Step three involves using nonnegative matrix decomposition to perform community detection on the adjacency matrix generated in step two. Specifically, two matrices are first randomly initialized. X and Y , shape N L and L N ,in N The number of nodes L The number of clubs; then, through cross-iteration... X and Y The update process typically converges after approximately 100 iterations. The specific iteration formulas are shown in formulas (5) and (6) below: Official (5) Official (6); When a convergent matrix is obtained X and Y back, X It is the community mapping function matrix, and Y It is the matrix of club members, which will Y The community number corresponding to the largest element in the column of each node is output as the community to which that element belongs; each node can obtain the final community division, and the final unified output yields the community structure.