# Data Transmission in Wireless Sensor Networks Based on Ant Colony Optimization Technique
## 3 Results  
Performance evaluation:  
Initialize 50 SNs, initialize the data for transmission distance, node MAC address, and battery energy, and use the ant colony algorithm to find the best route for transmitting data, as shown in Figure 24:  
In Figure 24, each node is a wireless mobile sensor consisting of multiple nodes to form a topology diagram. Each node contains information such as the transmission distance of the network topology, node MAC address, battery level, and communication link. The diagram shows the network structure models of 20 wireless mobile sensors. \begin{table}
\begin{tabular}{l l l} \hline
**Error Term** & **BP Neural Network** & **WOA-BP Neural Network** \\ \hline Mean absolute error (mae) & 2.9143 & 1.7029 \\ \hline Mean squared error (mse) & 12.1307 & 6.5033 \\ \hline Root mean squared error (rmse) & 3.4829 & 2.5501 \\ \hline Average absolute percentage & 21.3418\% & 9.7347\% \\ error (mape) & 78.6582\% & 90.2653\% \\ \hline \end{tabular}
\end{table} 
Table 4: Comparison between BP neural network and WOA-BP neural network. Figure 23: WOA-BP has an error histogram with 20 bins. The red arrows in Figure 25 represent path planning in the wireless sensor, Figure 25 simulates each wireless sensor node ant using the ACOD. Each ant searches for food in the topology diagram. If there is no food, it will check for pheromones. Each ant has a probability of making mistakes and moving toward more pheromones. If there are no pheromones, it will continue to move in its original direction, accompanied by random interference and memory. If an obstacle blocks the direction of each ant's movement, the ant will randomly choose another direction. The closer to the food it moves, the more  
Figure 24: Wireless sensor mobile node and information transmission structure diagram. Figure 25: Wireless sensor mobile node and information transmission structure diagram. ther than the other two chromosomes are sown, and the less pheromones are kept away from the food. We can use the ant colony algorithm to find the best route for transmitting data. Through 1927 computational iterations, the optimal path for transmitting data was found in Figure 26. The best routing result graph is shown in [31]. Each point in Figure 26 represents a wireless sensor node, with a total of 300 nodes in the matrix and an activity range of \(5000\times 5000\). For ease of display, the cutting range is 2500 \(\times\) 5000 on the horizontal axis and 2500 \(\times\) 5000 on the vertical axis. Each h point in the figure displays the transmission time and distance of the wireless sensor node, and calculates the optimal path using the ACOD. The 131 st calculation produced the Figure 26.  
The movement range of 300 wireless SNs in Figure 27 is a matrix of \(5000\times 5000\). For ease of display, the cutting range is as follows: the horizontal axis is 1800-3600 and the vertical axis is 1500 \(\times\) 4500. Using the ACOD, we can calculate the optimal transmission path through 500 iterations, as shown in Figure 27, Each \"\" in the figure represents a wireless sensor node, and a line connected by several \"\" is represented as the optimal transmission path. Figure 27: Calculating 500 times using the ant colony algorithm to form the optimal path map. Figure 26: Using the ant colony algorithm to calculate the optimal transmission path graph. As shown in Figure 28, Based on the data generated by the whale optimization algorithm (WOA), we input these into a backpropagation (BP) network to construct the following network:  
As shown in Table 5, The number of hidden layer nodes is 13, and only 10 are listed in the table. The smaller the mean squared error of the training set, the higher the accuracy. Among the 4 to 13 hidden layer nodes, the 12 th hidden layer node has the highest accuracy, with a mean squared error of 0.015. In addition, the 13 th has a mean squared error of 0.027, indicating a decrease in accuracy.