A Network Intrusion Detection Method and System Based on Swarm Intelligence Algorithm and Deep Learning

By using a network intrusion detection method based on swarm intelligence algorithms and deep learning, and dynamically optimizing hyperparameter combinations, the problem of low convergence efficiency in the hyperparameter optimization process of network intrusion detection models is solved, enabling rapid identification and adaptation to future attack patterns.

CN123123022APending Publication Date: 2026-11-17NANCHANG INST OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611594531.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-15
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing network intrusion detection models have low convergence efficiency during hyperparameter optimization, which makes it impossible to identify new attack patterns in a timely manner.

Method used

By employing a swarm intelligence algorithm and deep learning approach, a prior knowledge graph is constructed by analyzing the trends of historical attack data of the target network. The hyperparameter distribution is then adjusted using the particle swarm algorithm to dynamically optimize the hyperparameter combination and adapt to future attack patterns.

Benefits of technology

It significantly improves the processing model's adaptability to future attack patterns and training efficiency, reduces the waste of computing resources, and achieves faster convergence speed and recognition capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123123022A_ABST
    Figure CN123123022A_ABST
Patent Text Reader

Abstract

This invention relates to the technical field of network intrusion detection, specifically to a network intrusion detection method and system based on swarm intelligence algorithms and deep learning. The invention analyzes historical network attack data to derive various target attack patterns for future periods. Similar historical attack data is selected to validate the processing model, obtaining the model's fitness on the corresponding historical attack data. Based on the distribution of fitness for different hyperparameter combinations in a multidimensional hyperparameter space, the gradient of fitness change in each region is calculated, determining the sensitivity of each hyperparameter combination in spatial distribution. This sensitivity is then introduced into a particle swarm optimization algorithm, dynamically adjusting the algorithm's weights to iteratively calculate target hyperparameter combinations suitable for various target attack patterns. The processing model is configured according to the target hyperparameter combinations, and intrusion detection is performed on the target network. This technical solution improves the hyperparameter training convergence efficiency of the processing model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of network intrusion detection, and specifically to a network intrusion detection method and system based on swarm intelligence algorithms and deep learning. Background Technology

[0002] An intrusion detection system (IDS) is a detection technology that monitors potential threats in real time during network transmission and issues early warnings. It typically detects unauthorized, security policy-violating, or malicious behaviors in a network or system based on abnormal behavior strategies. When traffic or other behaviors that deviate significantly from normal patterns occur, an alarm is issued.

[0003] Because network attacks are complex and constantly evolving, intrusion detection for a server network requires the processing model to be able to identify new attack patterns. Therefore, existing processing models typically need to undergo periodic online learning to enable them to recognize new attack patterns. However, current hyperparameter selection for retraining these models lacks effective optimization strategies. They are generally determined using preset empirical values ​​or random presets, and then optimized using swarm intelligence algorithms. This approach results in slow training efficiency, leading to the model failing to promptly identify new attack patterns after deployment. Summary of the Invention

[0004] To address the technical problem of low convergence efficiency during hyperparameter optimization in network intrusion detection processing models, this invention aims to provide a network intrusion detection method and system based on swarm intelligence algorithms and deep learning. The specific technical solution adopted is as follows: In a first aspect, embodiments of the present invention provide a network intrusion detection method based on swarm intelligence algorithms and deep learning, the method comprising: A real-time network intrusion detection processing model is constructed for the target network. The processing model is configured with multiple hyperparameters based on deep learning application features. Perform trend analysis on the network attack data of the target network in historical periods to obtain various target attack patterns of the target network in future periods; Historical attack data with similar attack patterns of various targets were selected, and the fitness of the processing model and historical attack data was verified under different combinations of hyperparameter values, so as to determine the sensitivity of hyperparameter combinations in spatial distribution. The particle distribution and updated weights of the particle swarm optimization algorithm are adjusted according to the sensitivity to iteratively calculate the target hyperparameter combination that is suitable for various target attack modes. Configure the processing model based on the target hyperparameter combination, and perform intrusion detection on the target network in future time periods.

[0005] In one optional embodiment, a processing model for real-time network intrusion detection is constructed for the target network, including: Collect traffic and behavior data from the target network, and perform feature extraction and standardization to obtain the input vector; A deep learning network model consisting of an input layer, a hidden layer, and an output layer is constructed based on the input vector. The hidden layer is a convolutional neural network structure or a long short-term memory network structure. Multiple hyperparameters and their corresponding value ranges are configured for the deep learning network model and initial training is performed to obtain a processing model for real-time intrusion detection of the target network. The multiple hyperparameters include the sequence window length of the hidden layer, the window sliding step size, the regularization rate, the learning rate, the batch size, the optimizer type, and the activation function.

[0006] In one optional embodiment, trend analysis is performed on network attack data of the target network over historical periods to obtain various target attack patterns of the target network in future periods, including: Extract attack event information from historical network attack data of the target network. The attack event information includes the attacker, attack type, and attack target. Based on all attack event information, a prior knowledge graph centered on the attack target is constructed, and a graph embedding algorithm is used to map the entities and relations in the prior knowledge graph into low-dimensional dense vectors. Statistical analysis of the same attack targets based on low-dimensional dense vectors is used to obtain the attack probability indicators of each target in the future time period. When the attack potential index exceeds the preset index threshold, the attack methods that were not used by the corresponding attack target are identified as the target attack patterns of the target network in the future.

[0007] In one optional embodiment, statistical analysis of the same attack targets is performed based on low-dimensional dense vectors to obtain attack probability indicators for each target in future time periods, including: The number of attacks on each target in the historical period, the interval between adjacent attacks, and the longest interval between all attacks are obtained from the low-dimensional dense vector. Attack density statistics are performed on the time dimension based on the interval between each adjacent attack on each target and the longest interval between all attacks to obtain the cumulative density of each target. Based on the number of attacks and cumulative density of attacks on each target, we obtain the potential attack indicators for the corresponding target in the future.

[0008] In one optional embodiment, historical attack data with similar attack patterns for various targets are selected, including: Each type of target attack pattern is converted into a corresponding target attack vector, and the cosine similarity between the historical attack vector corresponding to each historical attack pattern and the target attack vector in historical attack events is calculated. Based on the cosine similarity scores of each target attack vector that are greater than the similarity threshold, obtain the set of similarity scores for the corresponding target attack vectors. The ranking of cosine similarity in the similarity set of each target attack vector is used as the data volume screening index to filter the associated data of historical attack patterns, so as to obtain the historical attack data of the corresponding target attack vector. The associated data includes the traffic data and behavior data of the target network in historical attack events.

[0009] In one optional embodiment, the fitness of the processing model to historical attack data is verified under different combinations of hyperparameter values ​​to determine the sensitivity of the hyperparameter combinations to spatial distribution, including: The range of values ​​for each hyperparameter is normalized to a preset interval, and multiple particles are configured as initial particles for the particle swarm algorithm based on the preset interval of each hyperparameter. Construct a multidimensional hyperparameter space with each hyperparameter as its dimension, and map each initialized particle to its corresponding position in the multidimensional hyperparameter space. Calculate the fitness of the processing model and historical attack data under the hyperparameter combination corresponding to each initialized particle. Based on the distribution of each fitness in the multidimensional hyperparameter space, the influence of changes in the hyperparameter values ​​of each dimension on the fitness changes is calculated to obtain the sensitivity of each dimension's hyperparameter region.

[0010] In one optional embodiment, the fitness of the processing model and historical attack data under each initial particle corresponding hyperparameter combination is calculated, including: The processing model is initially trained under the hyperparameter combination corresponding to each initial particle, and the false alarm rate and evaluation index of the processing model are calculated based on the validation set. The amount of training data used for the initial training is a preset proportion of the historical attack data, or the number of training iterations for the initial training is configured to be less than a preset value. A performance evaluation function is constructed based on the evaluation index and false alarm rate, and a regularization penalty term is introduced into the performance evaluation function to obtain the fitness of each initial particle under the corresponding hyperparameter combination.

[0011] In one optional embodiment, based on the distribution of each fitness in the multidimensional hyperparameter space, the degree of influence of changes in hyperparameter values ​​in each dimension on fitness changes is calculated to obtain the sensitivity of each dimension's hyperparameter region, including: The multidimensional hyperparameter space is divided into multiple hyperparameter space regions, and the average value of particle fitness in each hyperparameter space region is calculated to obtain the region fitness of the corresponding region. Calculate the difference between the fitness of each region and the average fitness of its adjacent outer regions in each dimension, and normalize the difference to obtain the sensitive gradient of the corresponding hyperparameter space region. The sensitivity of the corresponding hyperparameter space region is obtained based on the sensitivity gradient and region fitness of each hyperparameter space region.

[0012] In one optional embodiment, the particle distribution and updated weights of the particle swarm optimization algorithm are adjusted according to sensitivity to iteratively calculate target hyperparameter combinations suitable for various target attack modes, including: The multidimensional hyperparameter space is reconstructed based on the sensitivity of each hyperparameter space region, so that a higher proportion of particles are configured in regions with higher sensitivity, and the number of particles is reduced in regions with lower sensitivity. The redistributed particles are resampled or reinitialized to concentrate them in a hyperparameter space region with higher sensitivity. The inertia weight of the particle swarm algorithm is dynamically adjusted according to the sensitivity of each hyperparameter space region, so that the corresponding dimension of the region with higher sensitivity is reduced for local search, and the corresponding dimension of the region with lower sensitivity is increased for global search. The particle swarm is iteratively calculated based on the updated particle distribution and velocity update rules until the preset convergence conditions are met, at which point the target hyperparameter combination adapted to various target attack modes is output.

[0013] Secondly, embodiments of the present invention also provide a network intrusion detection system based on swarm intelligence algorithms and deep learning, wherein the detection system is the system corresponding to any of the detection methods in the first aspect; the system includes: The building module is used to construct a processing model for real-time network intrusion detection on the target network. The processing model is configured with multiple hyperparameters based on deep learning application features. The acquisition module is used to perform trend analysis on network attack data of the target network in historical periods in order to obtain various target attack patterns of the target network in future periods. The determination module is used to select historical attack data with similar attack patterns for various targets, and to verify the fitness of the processing model and historical attack data under different combinations of hyperparameter values, so as to determine the sensitivity of hyperparameter combinations in spatial distribution. The processing module is used to adjust the particle distribution and update the weights of the particle swarm algorithm according to the sensitivity, so as to iteratively calculate the target hyperparameter combination that is suitable for various target attack modes. The detection module is used to configure the processing model based on the target hyperparameter combination and to perform intrusion detection on the target network in future time periods.

[0014] The present invention has the following beneficial effects: The technical solution of this invention constructs a real-time network intrusion detection processing model for the target network. To avoid the processing model relying on historical static data and failing to adapt to future attack trends, trend analysis is performed on network attack data of the target network over historical periods to derive various target attack patterns that may appear in the future. For each target attack pattern, similar historical attack data is selected as validation samples. The processing model is validated and calculated under different combinations of hyperparameter values, and the fitness of the processing model on the corresponding historical attack data is obtained. Based on the distribution of fitness corresponding to different hyperparameter combinations in the multidimensional hyperparameter space, the hyperparameter space is divided into regions, and the fitness change gradient of each region is calculated to determine the sensitivity of each hyperparameter combination in spatial distribution. Sensitivity is introduced into the particle swarm optimization algorithm, and the weights of the particle swarm optimization algorithm are dynamically adjusted so that sensitive regions perform local search and non-sensitive regions perform global search, iteratively calculating target hyperparameter combinations that are suitable for various target attack patterns. The processing model is configured according to the target hyperparameter combinations, and intrusion detection is performed on the target network in the future. This technical solution reduces the ineffective iterations of the particle swarm optimization algorithm in low-sensitivity regions and reduces the blind search of the entire hyperparameter space. Under the same computing resource conditions, it can locate the hyperparameter region that is adapted to the attack mode in the future time period more quickly, significantly improve the convergence efficiency of the hyperparameter optimization process of the processing model, and enhance the adaptability of the processing model to future attack modes. Attached Figure Description

[0015] Figure 1 A flowchart illustrating a network intrusion detection method based on swarm intelligence algorithm and deep learning, provided as an embodiment of the present invention; Figure 2 This is a two-dimensional segmentation diagram of a particle mesh region provided in one embodiment of the present invention; Figure 3 This is a schematic diagram of a population particle iteration provided in one embodiment of the present invention; Figure 4 This is a schematic diagram of a network intrusion detection system based on swarm intelligence algorithm and deep learning, provided as an embodiment of the present invention. Detailed Implementation

[0016] Existing technologies for selecting and optimizing hyperparameters in processing models employ methods such as preset empirical values ​​or random presets. However, in the actual process of using swarm intelligence algorithms to optimize and obtain the optimal hyperparameters, the initial particle distribution is randomly specified. This leads to slow particle convergence and a significant waste of computational resources due to the large number of particles being used in non-optimal hyperparameter space regions. To address the shortcomings of traditional deep learning network hyperparameter selection, this invention provides an improved hyperparameter particle optimization method. By improving the initial particle distribution and subsequent fitness and speed optimization formulas, the parameter range corresponding to the optimization of the processing model can be quickly adjusted, accelerating the convergence speed of hyperparameter particles. The converged hyperparameters are the optimal parameters for the expected network attack patterns, thereby improving the convergence speed of the processing model during future training. The specific scenario addressed by this invention is: during the actual operation of an intrusion detection network, it is necessary to periodically retrain the processing model implementing network intrusion detection to adapt to new network attack patterns. During retraining, the optimal hyperparameter combination is selected to improve training efficiency. The following will, in conjunction with the accompanying drawings, specifically describe the specific scheme of the network intrusion detection method and system based on swarm intelligence algorithms and deep learning provided by this invention.

[0017] Please see Figure 1 , Figure 1 The diagram illustrates a flowchart of a network intrusion detection method based on swarm intelligence algorithms and deep learning, according to an embodiment of the present invention. This intrusion detection method can be applied to a detection terminal to perform intrusion detection on a target network. The detection terminal can be a gateway device, a computer, or a server, as long as it can run the detection method; no specific limitations are imposed here. The detection method includes: S11: Construct a real-time network intrusion detection processing model for the target network. The processing model is based on deep learning application features and configured with multiple hyperparameters.

[0018] Specifically, the target network can be any network requiring intrusion detection, and can be selected based on the user's security detection needs, choosing a network connected to the internet. Similarly, the processing model can be built based on network intrusion detection requirements, such as using a deep learning convolutional neural network model architecture. The processing model can distinguish and identify different types of network attacks by configuring the value ranges of multiple hyperparameters. It's understandable that after the processing model is built, it needs to be trained before it can identify network attacks online. This training dataset is manually labeled, and after local training, it is adjusted for online execution. The following section describes how, after running online for a period of time, the processing model is retrained based on historical attack data from the target network to improve its ability to identify new network attack patterns.

[0019] For example, step S11 includes sub-steps S11-1 to S11-3, which are described in detail below: S11-1: Collect traffic and behavioral data from the target network, and perform feature extraction and standardization to obtain an input vector. When the target network is under attack, its traffic will change accordingly; for example, traffic increases with increasing access frequency. Similarly, behavioral data can be used to analyze the type and purpose of the attack on the target network. The two types of data can be processed separately to obtain a high-dimensional input vector.

[0020] S11-2: Construct a deep learning network model consisting of an input layer, hidden layers, and an output layer based on the input vector. The hidden layer uses a Convolutional Neural Network (CNN) or a Long Short-Term Memory (LSTM) structure. The data is normalized before input to obtain high-dimensional vectors representing short-term traffic and behavior data. The input layer needs to be adapted to this high-dimensional input vector. Activation functions in the hidden layers include ReLU and sigmoid, and regularization is applied to reduce the risk of overfitting. The output layer outputs a high-dimensional category vector, with one category representing normal traffic and the others representing attack types.

[0021] S11-3: Configure multiple hyperparameters and their corresponding value ranges for the deep learning network model and perform initial training to obtain a processing model for real-time intrusion detection using the target network. These hyperparameters include the sequence window length of the hidden layer, window sliding step size, regularization rate, learning rate, batch size, optimizer type, and activation function. The parameters can be pre-set and adjusted according to actual needs, and the value range of each hyperparameter can be obtained based on transfer learning or prior knowledge. All the required pre-set hyperparameters for the processing model are output as a single interface, through which these hyperparameters can be directly adjusted.

[0022] At this point, the processing model has been constructed using the above method, and we proceed to step S12.

[0023] S12: Perform trend analysis on the network attack data of the target network in historical periods to obtain various target attack patterns of the target network in future periods.

[0024] Specifically, attacks on target networks are significantly unpredictable. However, from the attacker's perspective, cyberattacks generally have a clear purpose, such as stealing data or extorting money. Attack tools, facilities, and target selection exhibit observable patterns within specific timeframes; that is, general cyberattack patterns are inherently linked in the short term, and attackers may attempt multiple related attack methods to achieve their goals. Therefore, predicting the expected attack patterns of a network intrusion can be done by analyzing existing attack methods to obtain related data distribution characteristics of predicted attack traffic. These characteristics may represent key attack patterns that require focused defense in the future. The duration of the historical timeframe can be configured based on actual needs, such as weekly or monthly. Trend analysis of historical attack data can identify attack patterns not used against targets in the past, which can then be identified as target attack patterns for the future.

[0025] For example, step S12 includes sub-steps S12-1 to S12-4, which are described in detail below: S12-1: Extract attack event information from historical network attack data of the target network. Since attack event information includes attacker, attack type, and attack target, corresponding triple information can be derived based on the attack event information, such as attacker, XSS injection attack, and data theft. The triple information is represented using vectorization. Among them, various attack types and attack purposes can be represented using one-hot vectors, etc.; the attacker's relevant information can be described using fixed features, such as attacker IP and access frequency.

[0026] S12-2: Construct a prior knowledge graph centered on the attack target based on all attack event information, and use graph embedding algorithms (such as Node2Vec, TransE, or GraphSAGE) to map the entities and relations in the prior knowledge graph into low-dimensional dense vectors. When constructing the prior knowledge graph using triple information of various attack methods collected historically, the attack target is the core, and the pointers of other attackers to the attack target are knowledge pointers, with the relationship between the two representing the attack type.

[0027] It is understandable that cyber attackers typically exhibit clear and short-term stable attack patterns, and the data distribution characteristics of attack traffic usually change with these patterns. Similar attacks may occur repeatedly in the short term. Therefore, a knowledge graph network of cyber attack patterns, i.e., a prior knowledge graph, can be constructed. This prior knowledge graph can be used to obtain information about recent historical attack patterns and predict potential future attack methods.

[0028] S12-3: Statistical analysis of the same attack targets is performed based on low-dimensional dense vectors to obtain potential attack indicators for each target in the future. Based on the acquired recent or suspected network attack behaviors, this behavioral information is identified using deep networks or subsequent analysis to obtain the attack type and construct relevant descriptive vectors for the attacker. For some attack methods, the attacker's true purpose is unknown, requiring a rough estimate. This estimate can be evaluated using the attacker's attack vector. The low-dimensional dense vector represents the characteristics of the network attack. This vector can be composed of the first two elements of the aforementioned triplet information, including attacker information and attack type. Based on recent historical attack behaviors and attacker-related information, a vector representation is created. Similarity evaluation is performed on existing related vectors in the knowledge graph to obtain the attack vector with the highest similarity, which is likely the suspected attack target of the current attack.

[0029] Furthermore, the attack probability indicators are calculated based on the following methods, specifically including: The first step is to obtain the number of attacks on each target in the historical time period, the interval between adjacent attacks, and the longest interval between all attacks based on the low-dimensional dense vector. Based on the low-dimensional dense vector, relevant data for the same target in the historical time period can be statistically analyzed, including the number of attacks and the interval for each target. The target is denoted as q, where q is a natural number greater than 0; the number of attacks on target q in the historical time period is denoted as... The interval between the e-th and e+1-th attacks on target q in the historical time period is: The unit is days or hours, and e is a natural number greater than 0; the longest interval between all attacks in the historical time period M is .

[0030] The second step involves statistically analyzing attack density over time based on the intervals between adjacent attacks on each target and the longest interval between all attacks, to obtain the cumulative density of each target. Taking target q as an example, its cumulative density over historical periods is... exp is an exponential function with the natural constant as its base, based on the longest interval duration. Involvement in the calculation can prevent the function from growing too fast.

[0031] The third step is to obtain the attack probability index for each target in the future based on the number of attacks and the cumulative density of attacks. The attack probability index of target q is marked as follows: ,but Here, `norm` represents the normalization function. Based on the above formula, we can conclude that the more attacks there are, the more popular the target is; the greater the cumulative density, the denser the attack targets, and the higher the calculated attack probability index; conversely, the lower the attack probability index, the lower the calculated attack probability index. The attack probability index is mainly determined by the recent attack frequency and trend of the target `q`. When the number of attacks is less than 2, this index is not calculated or is set to a default low value; similarly, if the calculated longest interval duration... If the value is 0, then assign it a preset time constant (such as 24 hours); alternatively, you can directly set the cumulative density of the attack target to 0.

[0032] In this embodiment of the invention, norm represents a normalization function. This normalization can specifically be, for example, maximum and minimum value normalization. It should be noted that the maximum and minimum values ​​in the maximum and minimum value normalization process can be obtained based on prior experience. Furthermore, when the current data is greater than the maximum value or less than the minimum value, the data is truncated to the corresponding maximum and minimum values ​​to ensure the reliability of the calculation results. The specific processing of other normalizations is the same, and will not be elaborated further.

[0033] S12-4: When the attack probability index exceeds a preset threshold, the attack methods that have not been used against the corresponding target are identified as the target network's target attack patterns for the future. The threshold can be set based on actual needs and prior experience, sufficient to filter out attack targets that are more likely to occur in the future. For example, through multiple experiments, the threshold can be set to 0.75. When the attack probability index exceeds this threshold, the target is considered a key suspected attack target for the future and requires critical protection.

[0034] For attack targets exceeding the threshold, based on the constructed prior knowledge graph, other attack methods not employed by these targets are identified. These methods are then considered as the expected primary attack patterns for the future. Furthermore, these attack methods are merged to form a vectorized representation, thus yielding various target attack patterns. Target attack patterns can be represented using vector representations or other variable forms; no specific restrictions are imposed here.

[0035] At this point, based on the above methods, the various target attack patterns of the target network in the future time period have been obtained, and we proceed to step S13.

[0036] S13: Select historical attack data with similar attack patterns for various targets, and verify the fitness of the processing model and historical attack data under different combinations of hyperparameter values, so as to determine the sensitivity of hyperparameter combinations in spatial distribution.

[0037] Specifically, considering the dynamic nature of cyberattacks, the processing model for monitoring and identifying cyberattacks needs to undergo periodic online learning based on real-time data to improve its ability to dynamically identify attack patterns and achieve self-evolution. While deep learning models typically require pre-setting hyperparameters, different combinations of hyperparameters result in varying learning speeds and efficiency for different attack patterns. For example, certain attack patterns may predominate, and deep networks with high learning rates and the Adam optimizer may exhibit the highest learning speed and best performance in identifying these specific attack patterns. Therefore, the actual online processing model needs to maintain incremental learning to cope with potential cyberattacks. Since cyberattack patterns are dynamic, hyperparameters need to be dynamically adjusted to match the expected attack pattern types to accelerate training and convergence. This necessitates trend analysis using recent historical attack patterns to construct a priori knowledge graph of cyberattacks, which can roughly predict target attack patterns in the present and near future. Secondly, the sensitivity of hyperparameters to these attack patterns under mainstream target attack patterns should be used to optimize hyperparameters.

[0038] It should be noted that the above steps, which anticipate target attack patterns in the future, require the training hyperparameters of the current network to be appropriately adjusted to reflect these anticipated attack patterns. This optimizes the processing model's accuracy in identifying these patterns and improves training efficiency. In practical applications, hyperparameters primarily refer to the preset parameters of the processing model. Different combinations of parameters result in varying accuracy and training efficiency for specific network attack patterns. Therefore, it is necessary to dynamically adjust the hyperparameter combinations (or hyperparameter sets) of the processing model to accommodate potential changes in data sources caused by anticipated network attacks.

[0039] In the actual process of hyperparameter tuning, it is necessary to roughly obtain the parameter space range sensitive to the expected target attack pattern. This allows for the provision of more hyperparameter particles within this range when using swarm optimization algorithms. This prevents the optimization speed from being slowed down by initially randomly setting particle positions during particle iteration, thus enabling faster finding of the global optimum. Therefore, for the expected target attack pattern, various hyperparameter combinations are mapped to particle positions in a multidimensional hyperparameter space. The fitness of the corresponding particles is obtained through verification calculations using different hyperparameter combinations and historical attack data. Fitness characterizes the degree to which the processing model matches historical attack data under specific hyperparameter combinations. Based on the distribution of particle fitness in the multidimensional hyperparameter space, the hyperparameter space is divided into regions, and the gradient of fitness changes between regions is calculated. This quantifies the sensitivity of each hyperparameter space region to changes in the processing model's performance. Sensitivity characterizes the intensity of the influence of different hyperparameter regions on fitness changes, providing a basis for subsequent focused searches in highly sensitive regions by the particle swarm optimization algorithm.

[0040] For example, step S13 includes sub-steps S13-1 to S13-6, which are described in detail below: S13-1: Convert each type of target attack pattern into a corresponding target attack vector, and calculate the cosine similarity between the historical attack vector corresponding to each historical attack pattern and the target attack vector in historical attack events. Based on historical network attack traffic and behavior data that have been classified, vectorization is performed on known types to obtain the historical attack vector corresponding to the historical attack pattern. The cosine similarity between the historical attack vector and the target attack vector is calculated using the cosine similarity formula. The cosine similarity can characterize the degree of similarity between the historical attack vector and the target attack vector.

[0041] S13-2: Based on the cosine similarity scores of each target attack vector that are greater than the similarity threshold, obtain the similarity set of the corresponding target attack vector. When the cosine similarity between a historical attack vector and a target attack vector is greater than the similarity threshold, it indicates that the target attack vector is quite similar to the historical attack vector. The cosine similarity scores of these historical attack vectors are grouped into a similarity set, thus obtaining the similarity set of the corresponding target attack vector.

[0042] S13-3: The ranking of cosine similarity in the similarity set of each target attack vector is used as the data volume screening criterion. Corresponding data for historical attack patterns are then filtered to obtain historical attack data for the corresponding target attack vectors. This associated data includes traffic and behavioral data of the target network during historical attack events. There is a correspondence between the cosine similarity in the similarity set and the historical attack vectors. Based on the historical attack vectors, the corresponding historical attack data can be derived. Based on the ranking of the cosine similarity in the similarity set, the k most similar historical network attack data of known types can be selected as the current verification dataset. Furthermore, the cosine similarity is used as the proportion of data selected during the selection process, and the value of k is generally chosen as 3 based on experience. For example, if the cosine similarity of the most similar historical network attack types k0, k1, and k2 is arranged in descending order as simk0, simk1, and simk2, then the number of attacks selected for each corresponding type is mk0, mk1, and mk2. The amount of data for mk0, mk1, and mk2 decreases sequentially, so that more attacks of the network attack type with greater cosine similarity are selected. The total amount of data selected in this way is much lower than the data generated by the target network in its operating environment.

[0043] The selected historical attack data is divided into a validation set and a training set. The training set represents the dataset used to train the processing model under the corresponding parameter conditions after acquiring hyperparameter particles. The validation set represents the dataset used for data validation after initial training under the corresponding parameter conditions of the processing model. The ratio of the validation set to the training set can be determined based on actual needs, and will not be elaborated here.

[0044] S13-4: Normalize the value ranges of each hyperparameter to a preset interval, and configure multiple particles as initial particles for the particle swarm optimization algorithm based on the preset interval of each hyperparameter. When constructing the processing model, the initial number of hyperparameters and the corresponding value range of each hyperparameter can be determined based on transfer learning or experience. Define each particle in the particle swarm optimization algorithm as the hyperparameter vector to be optimized, define the value range of the hyperparameter vector as the value space, and normalize the region transformation standard of each particle, that is, transform the original value range of parameter a [a0, an] to [0, 1]. Let the i-th initial particle be denoted as . For example, if a combination of hyperparameters includes learning rate, batch size, and regularization rate, then the dimension of hyperparameter particle D is 3, and its value may be (0.001, 128, 0.3). The learning rate ranges from [1e-5, 0.1], the batch size ranges from [64, 512], and the regularization rate is [0.1, 0.6] (these are mainly example values ​​and not the actual dimensions and values).

[0045] S13-5: Construct a multi-dimensional hyperparameter space with each hyperparameter as its dimension, and map each initialized particle to its corresponding position in the multi-dimensional hyperparameter space. Calculate the fitness of the processing model under each initial particle's corresponding hyperparameter combination with historical attack data. Based on historical attack data, training and validation sets for the processing model can be constructed. With the constructed dataset, it is necessary to initially detect which parameter particle intervals are significantly sensitive to the expected attack pattern data features, and uniformly divide the original hyperparameter space into multiple points. For example, in a four-dimensional hyperparameter particle space, a uniformly distributed grid is used from (0,0,0,0) to (1,1,1,1). For each uniformly distributed grid point particle, the network structure parameters are set according to the particle values. Initial training is performed using the training set obtained above, and then validation is performed based on the validation set to obtain the fitness of the processing model under the hyperparameter combination with historical attack data.

[0046] Furthermore, fitness is calculated based on the following methods, specifically including: The first step involves preliminary training of the processing model under the hyperparameter combinations corresponding to each initialized particle, and calculating the false positive rate and evaluation metrics of the processing model based on the validation set. The amount of training data used in the preliminary training is a preset proportion of the historical attack data, or the number of training iterations in the preliminary training is configured to be less than a preset value. The preliminary training is a low-fidelity evaluation, which specifically means using a small sample dataset (such as 10% of the original dataset) or reducing the number of training iterations (such as training for only 1-5 epochs) to quickly obtain a rough fitness of the hyperparameters, rather than performing a complete model training.

[0047] The second step involves constructing a performance evaluation function based on the evaluation metrics and false alarm rate, and introducing a regularization penalty term into the performance evaluation function to obtain the fitness of each initialized particle under its corresponding hyperparameter combination. This can be based on the formula: Calculate the fitness of the particle's position. Through fitness In subsequent iterations, a penalty coefficient can be added on top of this. This is an evaluation metric that represents the corresponding evaluation of the processing model on the data under the hyperparameter conditions corresponding to the particles, consistent with the evaluation metrics of traditional deep learning networks. The false alarm rate can be determined by the proportion of numbers that were not accurately identified. This represents the regularization rate, indicating the false negative rate for detecting the target attack. When a predefined attack type is not detected, a severe penalty is imposed. The regularization rate is calculated as follows: different attack behaviors are assigned scores; the more similar an attack is to the expected attack, the higher its score. The score is calculated as the ratio of the final score for undetected false positives to the original total score. Scores can be determined based on an attack category weight table or a feature vector similarity calculation method. For each attack sample, its similarity value to the target attack pattern is calculated, and this similarity value is used as the score for that attack sample. The attack category weight table is a correspondence between attack types and scores; for example, the score for a DDoS attack is 1; the score for an SQL injection attack is 0.9; and the score for an XSS attack is 0.7, etc.

[0048] It is understandable that, during the fitness calculation process, the sum of the scores corresponding to attack samples that were not falsely reported and were successfully detected is calculated, and then the ratio is taken with the total score of the original attack samples to obtain the regularization rate. By introducing the regularization rate, the particle fitness, while evaluating the overall detection performance of the model, focuses more on the ability to identify target attack patterns, thereby guiding the hyperparameter optimization process to converge towards the target attack pattern.

[0049] S13-6: Based on the distribution of fitness values ​​in the multidimensional hyperparameter space, calculate the impact of changes in hyperparameter values ​​in each dimension on fitness changes to obtain the sensitivity of each hyperparameter region. The N-dimensional hyperparameter space can be divided into multiple hyper-grids, where N is a natural number greater than 1. Each grid region is described by the particles at its vertices. Therefore, if a hyperparameter region has the highest fitness and exhibits a tendency to cluster from the outer to the inner regions, then that region is a highly sensitive region. Specifically, the two-dimensional segmentation of the region is as follows: Figure 2 As shown in the diagram, each point represents a particle, and a region is composed of particles surrounding it. The outermost layer of this region is represented by a larger hypercube (in this case, a square). Therefore, when a region is sensitive to the expected network features, its fitness is generally high, and the region tends to shrink significantly as it extends outwards, indicating high sensitivity.

[0050] The following section will explain in detail how the sensitivity calculation method for each dimension of hyperparameter region is performed, including: The first step is to divide the multidimensional hyperparameter space into multiple hyperparameter space regions and calculate the average particle fitness within each region to obtain the region fitness. The range of hyperparameter values ​​is divided according to a preset segmentation method, thus forming several hyperparameter space regions in the multidimensional space. Each region contains several particles, and each particle corresponds to a set of hyperparameter combinations. The hyperparameter space region is denoted as W. Within this region, there are multiple particles, and each particle has a fitness under its corresponding hyperparameter combination. Therefore, the region fitness can be derived based on the average particle fitness within the hyperparameter space region W. For each hyperparameter space region, the average fitness of all particles within that region is calculated as the region fitness, which reflects the overall performance of the model within the range of hyperparameter values.

[0051] The second step is to calculate the difference between the fitness of each region and the average fitness of its adjacent outer regions in each dimension, and then normalize this difference to obtain the sensitivity gradient for the corresponding hyperparameter space region. The sensitivity gradient is... norm represents the normalization function; The fitness of the Wth hyperparameter space region is calculated from the average initial fitness of the surrounding space particles. This represents the average fitness of the outermost hyperparameter region, where the hyperparameter region is located at the edge of the value space and there is no outer region. Take the global minimum fitness, 0, or only calculate the mean of existing neighboring regions.

[0052] The third step is to obtain the sensitivity of each hyperparameter space region based on its sensitivity gradient and region fitness. This is achieved using the formula: The sensitivity of region 'a' in the hyperparameter space is calculated; norm represents the normalization function. Regions with higher sensitivity indicate that they not only have higher fitness, but also show a significant performance degradation as they extend into outer regions, indicating that these regions are highly sensitive to changes in model performance. Through the above steps, the sensitivity of different regions in the multidimensional hyperparameter space is quantitatively calculated.

[0053] At this point, the sensitivity of the hyperparameter combination to spatial distribution has been obtained through the above method, and we proceed to step S14.

[0054] S14: Adjust the particle distribution and update the weights of the particle swarm optimization algorithm according to the sensitivity, so as to iteratively calculate the target hyperparameter combination that is suitable for various target attack modes.

[0055] Specifically, based on the sensitivity of different hyperparameter space regions, the particle distribution density in the multidimensional hyperparameter space is redistributed, causing particles to cluster in highly sensitive regions. Simultaneously, the inertia weight and velocity update amplitude of the particle swarm optimization algorithm are dynamically adjusted based on sensitivity, enabling high-sensitivity regions to perform small-step local fine-grained searches, while low-sensitivity regions maintain larger-step global searches. For example, if the maximum number of particles within a hyperparameter space region is N, then the number of particles within each region is determined by its sensitivity. ;norm represents the normalization function. The number of particles corresponding to each region is initially distributed according to a random distribution principle, including the initial velocity direction; This indicates rounding down, and specifies that the minimum number of particles in each region is at least 1.

[0056] After the initial distribution is completed, the processing models corresponding to these particles are initially trained using a dataset (including training and validation sets) constructed from historical attack data. Then, the fitness is calculated on the validation set. The fitness calculation method is similar to the initial calculation, but it can incorporate regularization to allow particles to move in other directions, such as: In the formula This represents the fitness of particles after the regularization coefficient is superimposed. represents the regularization rate, which is a random value of (0,1); Fit represents the fitness of the particle obtained by the initial regularization coefficient calculation method.

[0057] During iterative calculations, the direction and velocity of the particle in the next stage, based on traditional particle swarm optimization (PSO) algorithms, include inertial direction, self-aware direction, and swarm awareness direction. However, since preliminary verification has shown that there are optimal particle sensitivity evaluations in different regions, it is necessary to add regional awareness direction. A traditional velocity iteration based on particle swarm optimization is illustrated below. Figure 3 As shown in the figure, the velocity directions of two particles a and b, which are updated synchronously in the global state, from the current i-th state to the next state are represented. The coordinates of particle a in the state with the highest fitness are the current position, the coordinates of the particle with the highest global fitness are the i-th state coordinates of particle b, then a2 is the group cognition direction of particle a in the next state, and a0 is the inertial direction.

[0058] When adjusting particle distribution and updating weights in a particle swarm optimization algorithm based on sensitivity, the corresponding local cognitive weights can be calculated based on the sensitivity of each hyperparameter space region. To ensure the comparability of weights across different hyperparameter space regions, the sensitivity of each region is normalized. Let the maximum sensitivity of all regions be... The minimum value is Then the sensitivity to any region a Perform linear normalization to obtain the normalized sensitivity. The calculation formula is: Normalized sensitivity The value ranges from 0 to 1. It can be based on the sensitivity of each region. The regional cognitive weight of each particle within the region is directly derived. That is, the regional cognitive weight of each particle within the region. Equal to the sensitivity of this area Alternatively, the sensitivity can be further normalized. As the base value for weight calculation, and combined with preset weight adjustment coefficients, regional cognitive weights are constructed. Of course, to enhance the discriminative power of highly sensitive regions, nonlinear mapping methods, such as exponential or power function mapping, can be used to convert normalized sensitivity into corresponding regional cognitive weights.

[0059] It should be noted that, in When all parameters are the same value, all parameters are normalized to the value 1 to avoid calculation errors.

[0060] During the iteration process, the speed is mainly calculated using the following formula: In the formula, This indicates that a particle in region a... The target velocity of the next iteration process is a vector containing direction and step size. This represents the local cognitive weight of the corresponding region a; This indicates the iteration speed of the particle during the optimization process using the traditional swarm particle algorithm; This represents the directional velocity within a local region a, and its value is the vector pointing from the current particle to the position of the particle with the highest fitness within local region a. , For the local optimal position, This represents the current particle position.

[0061] It should be noted that the velocity of the particle swarm optimization algorithm is a vector containing direction and step size. For example, if the spatial coordinates of the current position are (0,0,0) and the spatial coordinates of the next position are (0.1,0,0), then the velocity vector is calculated by subtracting the former from the latter, resulting in a velocity of (0.1,0,0). In the above formula... This is the traditional iterative direction, which includes an inertia term, a self-awareness term, and a group awareness term, used to maintain the particle's ability to explore in the global space. The inertia term reflects the continuity of the particle's previous iterative direction, the self-awareness term represents the particle's tendency to move closer to its historical individual optimal position, and the group awareness term represents the particle's tendency to move closer to the global optimal position. The awareness direction velocity... Defined as the vector difference between the current particle position and the position of the best-fit particle within its hyperparameter space region. The weights are calculated using region sensitivity during velocity updates. By weighted fusion of traditional global search components and regional local search components, particles are more guided by regional cognitive direction in highly sensitive areas, thus performing local fine-grained search with a smaller step size; while in low-sensitivity areas, they maintain strong global exploration capabilities and achieve cross-regional search with a large step size. This constructs an adaptive optimization mechanism that balances global search capability and local convergence efficiency.

[0062] For example, step S14 includes sub-steps S14-1 to S14-4, which are described in detail below: S14-1: Reconstruct the multidimensional hyperparameter space according to the sensitivity of each hyperparameter space region, so that a higher proportion of particles are configured in regions with higher sensitivity, and more particles are concentrated in the region for fine search; reduce the number of particles in regions with lower sensitivity, so as to reduce the computational overhead caused by invalid search.

[0063] S14-2: Resample or reinitialize the redistributed particles to concentrate them in a hyperparameter space region with higher sensitivity. Particles that were originally in a low-sensitivity region and exhibited poor fitness can have their positions reset and be resampled to a more sensitive hyperparameter space region. Simultaneously, the particle velocity vectors are reset to align with the search direction of the high-fitness region. By resampling or reinitializing particles, the spatial distribution inconsistencies caused by early random initialization can be reduced, encouraging particles to cluster towards potentially optimal regions, thereby improving the training convergence efficiency of the processing model.

[0064] S14-3: The inertia weights of the particle swarm optimization (PSO) algorithm are dynamically adjusted based on the sensitivity of each hyperparameter space region. This allows for a decrease in the velocity update magnitude of the corresponding dimension in regions with higher sensitivity, enabling local searches, while the velocity update magnitude of the corresponding dimension in regions with lower sensitivity is increased, allowing for global searches. This differentiated weight adjustment method allows particles to have different search scales in different dimensions, achieving multi-scale collaborative searches. This prevents the PSO algorithm from prematurely getting trapped in local optima during iterations, while simultaneously improving the convergence speed in potential regions.

[0065] S14-4: Iteratively calculate the particle swarm based on the updated particle distribution and velocity update rules until a preset convergence condition is met, then output a target hyperparameter combination adapted to various target attack modes. The above steps describe the particle direction and velocity in the initial iteration. Repeat the above particle direction iteration steps until any of the following convergence conditions are met, at which point the process terminates. Convergence conditions include: reaching the preset maximum number of iterations; the global optimal fitness showing no significant improvement in multiple consecutive iterations; and reaching a preset fitness threshold.

[0066] After the iterative loop is completed, the coordinates of the particle at the globally optimal position are output, which represent the optimal hyperparameter combination. This yields the final optimal hyperparameter particle that matches the expected network attack type. This particle is used as the adjustment parameter for the processing model. If the transformed parameters do not involve the current network structure, the current network model can be directly used as the preset processing model, and retrained using current and historical network attack data. Similarly, if the transformed parameters involve changing the network architecture, a portion of the original deep network model is randomly selected as the training basis, and retrained using recent historical attack data. The retraining data primarily consists of recently generated data, which has not been learned from the initial model training and therefore needs to be relearned to adapt to new network attack patterns.

[0067] At this point, the target hyperparameter combination of the processing model has been obtained based on the above method, and we proceed to step S15.

[0068] S15: Configure the processing model based on the target hyperparameter combination and perform intrusion detection on the target network in the future time period.

[0069] Specifically, the target hyperparameter combination is suitable for processing models to identify multiple target attack patterns in future time periods, enabling the processing model to adapt to the convergence of target attack patterns more quickly. Therefore, the processing model can be configured based on the target hyperparameter combination, and the configured processing model can be trained using historical attack data. The trained processing model can then be deployed to a real-time intrusion monitoring environment. By acquiring network traffic, behavior, and other information in real time, and standardizing it to the model input format, the normalized probability expression of the network attack method output by the model input can be obtained. Different warning probability thresholds for different network attack classification methods can be set according to the actual situation. When the probability of a certain classification is greater than the threshold, it is considered that there may be a corresponding network intrusion in the current network environment, and a network intrusion alarm is issued, requiring further analysis or processing by manual means.

[0070] Based on the same technical concept as the detection method, this embodiment of the invention also provides a network intrusion detection system based on swarm intelligence algorithms and deep learning. This detection system corresponds to any of the detection methods described above. Please refer to... Figure 4 , Figure 4 This is a schematic diagram of the detection system, which includes a construction module 41, an acquisition module 42, a determination module 43, a processing module 44, and a detection module 45.

[0071] Module 41 is used to build a processing model for real-time network intrusion detection on the target network. The processing model is configured with multiple hyperparameters based on deep learning application features.

[0072] The acquisition module 42 is used to perform trend analysis on the network attack data of the target network in historical periods in order to obtain various target attack patterns of the target network in future periods.

[0073] The determination module 43 is used to select historical attack data with similar attack patterns for various targets, and to verify the fitness of the processing model and historical attack data under different combinations of hyperparameter values, so as to determine the sensitivity of hyperparameter combinations in spatial distribution.

[0074] The processing module 44 is used to adjust the particle distribution and update the weights of the particle swarm algorithm according to the sensitivity, so as to iteratively calculate the target hyperparameter combination that is suitable for various target attack modes.

[0075] The detection module 45 is used to configure the processing model according to the target hyperparameter combination and to perform intrusion detection on the target network in the future time period.

[0076] The technical effects achieved by the system-side embodiments are the same as those of the invention-side embodiments, and no further limitations or elaborations are made here.

Claims

1. A network intrusion detection method based on swarm intelligence algorithm and deep learning, characterized in that, The method includes: A real-time network intrusion detection processing model is constructed for the target network, and the processing model is configured with multiple hyperparameters based on deep learning application features; Trend analysis is performed on the network attack data of the target network in historical periods to obtain various target attack patterns of the target network in future periods; Historical attack data with similar attack patterns of various targets are selected, and the fitness of the processing model with the historical attack data is verified under different combinations of hyperparameter values, so as to determine the sensitivity of hyperparameter combinations in spatial distribution. The particle distribution and updated weights of the particle swarm optimization algorithm are adjusted according to the sensitivity to iteratively calculate the target hyperparameter combination that is suitable for various target attack modes. The processing model is configured based on the target hyperparameter combination, and intrusion detection is performed on the target network in a future time period.

2. The network intrusion detection method based on swarm intelligence algorithm and deep learning according to claim 1, characterized in that, A processing model for real-time network intrusion detection is constructed for the target network, including: Traffic and behavioral data of the target network are collected, and feature extraction and standardization are performed on them to obtain an input vector; A deep learning network model comprising an input layer, a hidden layer, and an output layer is constructed based on the input vector, wherein the hidden layer is a convolutional neural network structure or a long short-term memory network structure. The deep learning network model is configured with multiple hyperparameters and their corresponding value ranges and initial training is performed to obtain a processing model for real-time intrusion detection of the target network. The multiple hyperparameters include the sequence window length of the hidden layer, the window sliding step size, the regularization rate, the learning rate, the batch size, the optimizer type, and the activation function.

3. The network intrusion detection method based on swarm intelligence algorithm and deep learning according to claim 1, characterized in that, Perform trend analysis on the network attack data of the target network over historical periods to obtain various target attack patterns of the target network in future periods, including: The attack event information is extracted from the network attack data of the target network during a historical period. The attack event information includes the attacker, the attack type, and the attack target. Based on all attack event information, a prior knowledge graph centered on the attack target is constructed, and a graph embedding algorithm is used to map the entities and relations in the prior knowledge graph into low-dimensional dense vectors. Based on the low-dimensional dense vector, the same attack targets are statistically analyzed to obtain the attack probability indicators of each attack target in the future time period. When the attack probability index exceeds a preset threshold, the attack method that was not used by the corresponding attack target is determined as the target attack mode of the target network in the future time period.

4. The network intrusion detection method based on swarm intelligence algorithm and deep learning according to claim 3, characterized in that, Based on the low-dimensional dense vector, statistical analysis of the same attack targets is performed to obtain potential attack indicators for each target in future time periods, including: The attack count, the interval between adjacent attacks, and the longest interval between all attacks for each target in the historical period are obtained based on the low-dimensional dense vector. Attack density statistics are performed on the time dimension based on the interval between each adjacent attack on each target and the longest interval between all attacks to obtain the cumulative density of each target. Based on the number of attacks and cumulative density of attacks on each target, we obtain the potential attack indicators for the corresponding target in the future.

5. The network intrusion detection method based on swarm intelligence algorithm and deep learning according to claim 1, characterized in that, Historical attack data with similar attack patterns across various target groups were selected, including: Each type of target attack pattern is converted into a corresponding target attack vector, and the cosine similarity between the historical attack vector corresponding to each historical attack pattern in the historical attack event and the target attack vector is calculated. Based on the cosine similarity scores of each target attack vector that are greater than the similarity threshold, obtain the set of similarity scores for the corresponding target attack vectors. The ranking of cosine similarity in the similarity set of each target attack vector is used as the data volume screening index to filter the associated data of historical attack patterns, so as to obtain the historical attack data of the corresponding target attack vector. The associated data includes the traffic data and behavior data of the target network in historical attack events.

6. The network intrusion detection method based on swarm intelligence algorithm and deep learning according to claim 1, characterized in that, The fitness of the processing model to the historical attack data was verified under different combinations of hyperparameter values ​​to determine the sensitivity of the hyperparameter combinations to spatial distribution, including: The range of values ​​for each hyperparameter is normalized to a preset interval, and multiple particles are configured as initial particles for the particle swarm algorithm based on the preset interval of each hyperparameter. Construct a multidimensional hyperparameter space with each hyperparameter as the dimension, and map each initial particle to the corresponding position in the multidimensional hyperparameter space. Calculate the fitness of the processing model and historical attack data under the hyperparameter combination corresponding to each initial particle. Based on the distribution of each fitness in the multidimensional hyperparameter space, the influence of changes in the hyperparameter values ​​of each dimension on the fitness changes is calculated to obtain the sensitivity of each dimension's hyperparameter region.

7. The network intrusion detection method based on swarm intelligence algorithm and deep learning according to claim 6, characterized in that, Calculate the fitness of the processing model and historical attack data under each initial particle hyperparameter combination, including: The processing model is initially trained under the hyperparameter combination corresponding to each initial particle, and the false alarm rate and evaluation index of the processing model are calculated based on the validation set; the amount of training data used in the initial training is a preset proportion of the historical attack data, or the number of training iterations in the initial training is configured to be less than a preset value. A performance evaluation function is constructed based on the evaluation index and the false alarm rate, and a regularization penalty term is introduced into the performance evaluation function to obtain the fitness of each initial particle under the corresponding hyperparameter combination.

8. The network intrusion detection method based on swarm intelligence algorithm and deep learning according to claim 6, characterized in that, Based on the distribution of each fitness level in the multidimensional hyperparameter space, the influence of changes in hyperparameter values ​​in each dimension on fitness changes is calculated to obtain the sensitivity of each hyperparameter region, including: The multidimensional hyperparameter space is divided into multiple hyperparameter space regions, and the average value of particle fitness in each hyperparameter space region is calculated to obtain the region fitness of the corresponding region. Calculate the difference between the fitness of each region and the average fitness of its adjacent outer regions in each dimension, and normalize the difference to obtain the sensitive gradient of the corresponding hyperparameter space region. The sensitivity of the corresponding hyperparameter space region is obtained based on the sensitivity gradient and region fitness of each hyperparameter space region.

9. The network intrusion detection method based on swarm intelligence algorithm and deep learning according to claim 1, characterized in that, The particle distribution and updated weights of the particle swarm optimization algorithm are adjusted based on the sensitivity to iteratively calculate target hyperparameter combinations suitable for various target attack modes, including: The multidimensional hyperparameter space is reconstructed based on the sensitivity of each hyperparameter space region, so that a higher proportion of particles are configured in regions with higher sensitivity, and the number of particles is reduced in regions with lower sensitivity. The redistributed particles are resampled or reinitialized to concentrate them in a hyperparameter space region with higher sensitivity. The inertia weight of the particle swarm algorithm is dynamically adjusted according to the sensitivity of each hyperparameter space region, so that the corresponding dimension of the region with higher sensitivity is reduced for local search, and the corresponding dimension of the region with lower sensitivity is increased for global search. The particle swarm is iteratively calculated based on the updated particle distribution and velocity update rules until the preset convergence conditions are met, at which point the target hyperparameter combination adapted to various target attack modes is output.

10. A network intrusion detection system based on swarm intelligence algorithms and deep learning, characterized in that, The detection system is the system corresponding to any one of the detection methods described in claims 1-9; the system includes: The building module is used to construct a processing model for real-time network intrusion detection on the target network. The processing model is configured with multiple hyperparameters based on deep learning application features. The acquisition module is used to perform trend analysis on the network attack data of the target network in historical periods in order to obtain various target attack patterns of the target network in future periods. The determination module is used to select historical attack data with similar attack patterns of various targets, and to verify the fitness of the processing model with the historical attack data under different combinations of hyperparameter values, so as to determine the sensitivity of the hyperparameter combination in spatial distribution. The processing module is used to adjust the particle distribution and update the weights of the particle swarm algorithm according to the sensitivity, so as to iteratively calculate the target hyperparameter combination that is suitable for various target attack modes. The detection module is used to configure a processing model based on the target hyperparameter combination and to perform intrusion detection on the target network in a future time period.