## 3 Immune Game-Based Abnormal Node Detection Algorithm
### Detailed System Model and Problem Formulation  
#### 3.2.1 Immune Detection Algorithm  
For the convenience of research, this paper assumes that the distribution region of nodes is a rectangle of size A \(\times\) B. The node is composed of a sink node, an ordinary node, and a regional node. A sink node is a global control node. It has the highest network control and management rights and can carry on the unified management and deployment of the common nodes and regional nodes in the network. Ordinary nodes mainly undertake the functions of data collection, aggregation, and uploading. Regional nodes are mainly used to gather regional data and upload the data to the sink node through other regional nodes. In addition, the following assumptions are made [23]:  
1. Nodes are not fluid. 2. Regional nodes are not sparse, i.e., a regional node can cover a rectangular area, and there is no dead-end phenomenon. 3. The sensor identification ID is unique. 4. Ordinary nodes in a region are similar. Ordinary nodes in different regions have some incompatibilities, and regional nodes cannot manage ordinary nodes across regions. According to the SNS and DT theories of the artificial immune system (AIS), the mapping relationship between an artificial immune system and an abnormal node detection system (NS) is shown in Table 1.  
We set an \(n\)-dimensional antibody: \(Ab=\left[ \begin{array}{cccc}ab_{1}&ab_{2}&\cdots&ab_{n}\end{array} \right]\). If there are \(m\) antibodies, then every antibody has an \(n\)-dimensional character, and the antibody library can be shown as a matrix:  
\[Library_{A_{b}}=\left[ \begin{array}{cccc}Ab_{1}\\ Ab_{2}\\ \vdots\end{array} \right]=\left[ \begin{array}{cccc}ab_{11}&ab_{12}&\cdots& ab_{1n}\\ ab_{21}&ab_{22}&\cdots&ab_{2n}\\ \vdots&\vdots&\vdots&\vdots\end{array} \right]. \tag{5}\]  
Similarly, for antigens,  
\[Library_{Ag}=\left[ \begin{array}{cccc}Ag_{1}\\ Ag_{2}\\ \vdots\end{array} \right]=\left[ \begin{array}{cccc}ag_{11}&ag_{12}&\cdots& ag_{1n}\\ ag_{21}&ag_{22}&\cdots&ag_{2n}\\ \vdots&\vdots&\vdots&\vdots\end{array} \right], \tag{6}\]  
where \(Library_{Ag}\) is a set of antigens. \(A_{b}\) and \(A_{g}\) are vector representations of antibodies and antigens, respectively. The dimension of \(A_{b}\) and \(A_{g}\) is \(n\). Affinity is the degree to which antibodies bind to antigens, and it must be quantified. We use Euclidean distance to represent affinity,  
\[\text{Distance}=\sqrt{\sum_{i=1}^{n}(Ab_{i}-Ag_{i})^{2}}. \tag{7}\]  
The greater the Euclidean distance the lower the affinity. We use affinity as a criterion to judge similar antigens and identify sources of danger. As shown in Figure 4, it is assumed that ultra-2D data are projected into two-dimensional space by nonlinear mapping of high-dimensional images. On this basis, the antibody library model is simulated as two \begin{table}
\begin{tabular}{c c} \hline
**Artificial Immune System** & **Abnormal Node Detection System** \\ \hline Artificial immunity & Node security \\ B-cells & Node \\ Antibody & Detector \\ Antigen & Feature information \\ Affinity between antibodies and antigens & Threshold matched \\ Response & Match \\ Antibodies are killed & Lost information \\ Clone & Duplication/mutation \\ Mature detectors & Abnormal Node affirmed \\ Memory detectors & Abnormal Node that often occurs \\ \hline \end{tabular}
\end{table} 
Table 1: Corresponding relationship between AIS and NS. concentric circles in two-dimensional space, whose common center is that of the antibody library, i.e., the vaccine that produces the antibody bank, expressed as  
\[\text{Vaccine}=\left[\frac{ag_{11}+ag_{21}+\cdots+ag_{m1}}{m}\cdots\frac{ag_{1n}+ ag_{2n}+\cdots+ag_{mn}}{m}\right] \tag{8}\]  
The radius of the circle is based on Euclidean distance. The inner circle is the identification area, where resulting antibodies are distributed. The outer ring is the update area, and any antigens falling in this area, if conditions are met, will trigger the update of the antibody library.