Submitted:
01 July 2025
Posted:
14 July 2025
You are already at the latest version
Abstract
Keywords:
1. Introduction
2. The Migration Significance of Nash Equilibrium Ideas in Neural Network Connections
3. Model Design and Method Description
4. Experimental Design and Result Analysis
| import torch import torch.nn as nn import torch.optim as optim import torchvision import torchvision.transforms as transforms from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score, confusion_matrix import time import numpy as np # Use GPU if available device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') # Limit training/testing to 5000 images transform = transforms.Compose([ transforms.ToTensor(), transforms.Normalize((0.5,), (0.5,)) ]) # Load only 5000 train and 5000 test images for speed full_trainset = torchvision.datasets.CIFAR10(root='./data', train=True, download=True, transform=transform) trainset = torch.utils.data.Subset(full_trainset, range(5000)) full_testset = torchvision.datasets.CIFAR10(root='./data', train=False, download=True, transform=transform) testset = torch.utils.data.Subset(full_testset, range(5000)) trainloader = torch.utils.data.DataLoader(trainset, batch_size=128, shuffle=True, num_workers=0) testloader = torch.utils.data.DataLoader(testset, batch_size=128, shuffle=False, num_workers=0) # Basic MLP class MLP(nn.Module): def __init__(self): super(MLP, self).__init__() self.model = nn.Sequential( nn.Flatten(), nn.Linear(32 * 32 * 3, 512), nn.ReLU(), nn.Linear(512, 256), nn.ReLU(), nn.Linear(256, 10) ) def forward(self, x): return self.model(x) # Nash-inspired Skip Connection MLP class NashMLP(nn.Module): def __init__(self): super(NashMLP, self).__init__() self.flatten = nn.Flatten() self.fc1 = nn.Linear(32 * 32 * 3, 512) self.relu = nn.ReLU() self.fc2 = nn.Linear(512, 256) self.alpha = nn.Parameter(torch.tensor(0.5)) # learnable alpha self.fc3 = nn.Linear(512 + 256, 10) def forward(self, x): x = self.flatten(x) out1 = self.relu(self.fc1(x)) # Layer 1 output out2 = self.relu(self.fc2(out1)) # Layer 2 output mix = torch.cat([(1 - self.alpha) * out1, self.alpha * out2], dim=1) return self.fc3(mix) # Train & Evaluate Function def train_and_evaluate(model, model_name, run_id): model = model.to(device) optimizer = optim.Adam(model.parameters(), lr=0.001) criterion = nn.CrossEntropyLoss() start_time = time.time() model.train() for epoch in range(5): for images, labels in trainloader: images, labels = images.to(device), labels.to(device) optimizer.zero_grad() outputs = model(images) loss = criterion(outputs, labels) loss.backward() optimizer.step() training_time = time.time() - start_time model.eval() all_preds, all_labels = [], [] with torch.no_grad(): for images, labels in testloader: images = images.to(device) outputs = model(images) _, predicted = torch.max(outputs, 1) all_preds.extend(predicted.cpu().numpy()) all_labels.extend(labels.numpy()) accuracy = accuracy_score(all_labels, all_preds) precision = precision_score(all_labels, all_preds, average='weighted', zero_division=0) recall = recall_score(all_labels, all_preds, average='weighted', zero_division=0) f1 = f1_score(all_labels, all_preds, average='weighted') conf_matrix = confusion_matrix(all_labels, all_preds) print(f"\nRun {run_id + 1} - Model: {model_name}") print(f"Training Time: {training_time:.2f} sec") print(f"Accuracy: {accuracy:.4f}") print(f"Precision: {precision:.4f}") print(f"Recall: {recall:.4f}") print(f"F1 Score: {f1:.4f}") return accuracy, precision, recall, f1, training_time # Repeated Experiment Function def run_multiple_times(model_class, model_name): accs, precs, recalls, f1s, times = [], [], [], [], [] for i in range(10): model = model_class() acc, prec, rec, f1, t = train_and_evaluate(model, model_name, i) accs.append(acc) precs.append(prec) recalls.append(rec) f1s.append(f1) times.append(t) print(f"\n{'='*40}\nFinal Results for {model_name} (10 runs):") print(f"Accuracy Mean: {np.mean(accs):.4f} Std: {np.std(accs):.4f}") print(f"Precision Mean: {np.mean(precs):.4f} Std: {np.std(precs):.4f}") print(f"Recall Mean: {np.mean(recalls):.4f} Std: {np.std(recalls):.4f}") print(f"F1 Score Mean: {np.mean(f1s):.4f} Std: {np.std(f1s):.4f}") print(f"Training Time Mean: {np.mean(times):.2f}s Std: {np.std(times):.2f}s") print(f"{'='*40}\n") # Run Both Models 10 Times run_multiple_times(MLP, "Standard MLP") run_multiple_times(NashMLP, "Nash-Equilibrium Skip MLP") Each set of experiments was repeated 10 times to obtain robust statistical results. The results are as follows: ======================================== Final Results for Standard MLP (10 runs): Accuracy Mean: 0.4235 Std: 0.0098 Precision Mean: 0.4298 Std: 0.0071 Recall Mean: 0.4235 Std: 0.0098 F1 Score Mean: 0.4151 Std: 0.0098 Training Time Mean: 12.69s Std: 2.24s ======================================== ======================================== Final Results for Nash-Equilibrium Skip MLP (10 runs): Accuracy Mean: 0.4281 Std: 0.0069 Precision Mean: 0.4333 Std: 0.0058 Recall Mean: 0.4281 Std: 0.0069 F1 Score Mean: 0.4213 Std: 0.0063 Training Time Mean: 11.94s Std: 1.26s ======================================== |
5. Universality and Scalability
6. Conclusions and Future Work
References
- Bhardwaj, K., Li, G., & Marculescu, R. (2021). How does topology influence gradient propagation and model performance of deep networks with densenet-type skip connections?. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (pp. 13498-13507).
- Zhou, T., Ye, X., Lu, H., Zheng, X., Qiu, S., & Liu, Y. (2022). Dense convolutional network and its application in medical image analysis. BioMed Research International, 2022(1), 2384830. [CrossRef]
- Wang, H., Cao, P., Wang, J., & Zaiane, O. R. (2022, June). Uctransnet: rethinking the skip connections in u-net from a channel-wise perspective with transformer. In Proceedings of the AAAI conference on artificial intelligence (Vol. 36, No. 3, pp. 2441-2449). [CrossRef]
- Zhang, C., Benz, P., Argaw, D. M., Lee, S., Kim, J., Rameau, F., ... & Kweon, I. S. (2021). Resnet or densenet? introducing dense shortcuts to resnet. In Proceedings of the IEEE/CVF winter conference on applications of computer vision (pp. 3550-3559).
- Oyedotun, O. K., Al Ismaeil, K., & Aouada, D. (2022). Why is everyone training very deep neural network with skip connections?. IEEE transactions on neural networks and learning systems, 34(9), 5961-5975. [CrossRef]
- Gite, S., Mishra, A., & Kotecha, K. (2023). Enhanced lung image segmentation using deep learning. Neural Computing and Applications, 35(31), 22839-22853. [CrossRef]
- Li, B., Xiao, C., Wang, L., Wang, Y., Lin, Z., Li, M., ... & Guo, Y. (2022). Dense nested attention network for infrared small target detection. IEEE Transactions on Image Processing, 32, 1745-1758. [CrossRef]
- Zhang, J., Zhang, Y., Jin, Y., Xu, J., & Xu, X. (2023). Mdu-net: Multi-scale densely connected u-net for biomedical image segmentation. Health Information Science and Systems, 11(1), 13. [CrossRef]
- Zhang, J., Zheng, B., Gao, A., Feng, X., Liang, D., & Long, X. (2021). A 3D densely connected convolution neural network with connection-wise attention mechanism for Alzheimer's disease classification. Magnetic Resonance Imaging, 78, 119-126. [CrossRef]
- Ranftl, R., Bochkovskiy, A., & Koltun, V. (2021). Vision transformers for dense prediction. In Proceedings of the IEEE/CVF international conference on computer vision (pp. 12179-12188).
- Sitaula, C., & Shahi, T. B. (2022). Monkeypox virus detection using pre-trained deep learning-based approaches. Journal of Medical Systems, 46(11), 78. [CrossRef]
- Fu, Y., Wu, X. J., & Durrani, T. (2021). Image fusion based on generative adversarial network consistent with perception. Information Fusion, 72, 110-125. [CrossRef]
- Wang, R., Lei, T., Cui, R., Zhang, B., Meng, H., & Nandi, A. K. (2022). Medical image segmentation using deep learning: A survey. IET image processing, 16(5), 1243-1267. [CrossRef]
- Pandey, A., & Wang, D. (2021). Dense CNN with self-attention for time-domain speech enhancement. IEEE/ACM transactions on audio, speech, and language processing, 29, 1270-1279. [CrossRef]
- Alalwan, N., Abozeid, A., ElHabshy, A. A., & Alzahrani, A. (2021). Efficient 3D deep learning model for medical image semantic segmentation. Alexandria Engineering Journal, 60(1), 1231-1239. [CrossRef]
- Zhang, C., Cong, R., Lin, Q., Ma, L., Li, F., Zhao, Y., & Kwong, S. (2021, October). Cross-modality discrepant interaction network for RGB-D salient object detection. In Proceedings of the 29th ACM international conference on multimedia (pp. 2094-2102).
- Lyu, X., Liu, L., Wang, M., Kong, X., Liu, L., Liu, Y., ... & Yuan, Y. (2021, May). Hr-depth: High resolution self-supervised monocular depth estimation. In Proceedings of the AAAI conference on artificial intelligence (Vol. 35, No. 3, pp. 2294-2301).
- Heidari, M., Kazerouni, A., Soltany, M., Azad, R., Aghdam, E. K., Cohen-Adad, J., & Merhof, D. (2023). Hiformer: Hierarchical multi-scale representations using transformers for medical image segmentation. In Proceedings of the IEEE/CVF winter conference on applications of computer vision (pp. 6202-6212).
- Njoku, J. N., Morocho-Cayamcela, M. E., & Lim, W. (2021). CGDNet: Efficient hybrid deep learning model for robust automatic modulation recognition. IEEE Networking Letters, 3(2), 47-51. [CrossRef]
- Zuo, Q., Chen, S., & Wang, Z. (2021). R2AU-Net: attention recurrent residual convolutional neural network for multimodal medical image segmentation. Security and Communication Networks, 2021(1), 6625688. [CrossRef]
- Hou, J., Zhang, Y., Zhong, Q., Xie, D., Pu, S., & Zhou, H. (2021). Divide-and-assemble: Learning block-wise memory for unsupervised anomaly detection. In Proceedings of the IEEE/CVF International Conference on Computer Vision (pp. 8791-8800).
- Mirikharaji, Z., Abhishek, K., Bissoto, A., Barata, C., Avila, S., Valle, E., ... & Hamarneh, G. (2023). A survey on deep learning for skin lesion segmentation. Medical Image Analysis, 88, 102863. [CrossRef]
- Ashraf, A., Naz, S., Shirazi, S. H., Razzak, I., & Parsad, M. (2021). Deep transfer learning for alzheimer neurological disorder detection. Multimedia Tools and Applications, 1-26. [CrossRef]
- Chen, X., Wang, X., Zhang, K., Fung, K. M., Thai, T. C., Moore, K., ... & Qiu, Y. (2022). Recent advances and clinical applications of deep learning in medical image analysis. Medical image analysis, 79, 102444. [CrossRef]
- Abdollahi, A., & Pradhan, B. (2021). Integrating semantic edges and segmentation information for building extraction from aerial images using UNet. Machine Learning with Applications, 6, 100194. [CrossRef]
- Bao, F., Nie, S., Xue, K., Cao, Y., Li, C., Su, H., & Zhu, J. (2023). All are worth words: A vit backbone for diffusion models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition (pp. 22669-22679).
- Li, Y., Wang, Z., Yin, L., Zhu, Z., Qi, G., & Liu, Y. (2023). X-net: a dual encoding–decoding method in medical image segmentation. The Visual Computer, 1-11. [CrossRef]
- Li, Q., Zhong, R., Du, X., & Du, Y. (2022). TransUNetCD: A hybrid transformer network for change detection in optical remote-sensing images. IEEE Transactions on Geoscience and Remote Sensing, 60, 1-19. [CrossRef]
- Chen, C., Chuah, J. H., Ali, R., & Wang, Y. (2021). Retinal vessel segmentation using deep learning: a review. IEEE Access, 9, 111985-112004. [CrossRef]
- Yin, X. X., Sun, L., Fu, Y., Lu, R., & Zhang, Y. (2022). [Retracted] U-Net-Based Medical Image Segmentation. Journal of healthcare engineering, 2022(1), 4189781.
- Shiri, I., Arabi, H., Sanaat, A., Jenabi, E., Becker, M., & Zaidi, H. (2021). Fully automated gross tumor volume delineation from PET in head and neck cancer using deep learning algorithms. Clinical Nuclear Medicine, 46(11), 872-883. [CrossRef]
- Punn, N. S., & Agarwal, S. (2022). Modality specific U-Net variants for biomedical image segmentation: a survey. Artificial Intelligence Review, 55(7), 5845-5889. [CrossRef]
- Poveda, J. I., Krstić, M., & Başar, T. (2022). Fixed-time Nash equilibrium seeking in time-varying networks. IEEE Transactions on Automatic Control, 68(4), 1954-1969. [CrossRef]
- Bakhtyar, B., Qi, Z., Azam, M., & Rashid, S. (2023). Global declarations on electric vehicles, carbon life cycle and Nash equilibrium. Clean Technologies and Environmental Policy, 25(1), 21-34.
- Hsieh, Y. G., Antonakopoulos, K., & Mertikopoulos, P. (2021, July). Adaptive learning in continuous games: Optimal regret bounds and convergence to Nash equilibrium. In Conference on Learning Theory (pp. 2388-2422). PMLR.
- Ye, M., Li, D., Han, Q. L., & Ding, L. (2022). Distributed Nash equilibrium seeking for general networked games with bounded disturbances. IEEE/CAA Journal of Automatica Sinica, 10(2), 376-387. [CrossRef]
- Qian, Y. Y., Liu, M., Wan, Y., Lewis, F. L., & Davoudi, A. (2021). Distributed adaptive Nash equilibrium solution for differential graphical games. IEEE Transactions on Cybernetics, 53(4), 2275-2287. [CrossRef]
- Ye, M., Han, Q. L., Ding, L., & Xu, S. (2023). Distributed Nash equilibrium seeking in games with partial decision information: A survey. Proceedings of the IEEE, 111(2), 140-157. [CrossRef]
- Ye, M., Yin, J., & Yin, L. (2021). Distributed Nash equilibrium seeking for games in second-order systems without velocity measurement. IEEE Transactions on Automatic Control, 67(11), 6195-6202. [CrossRef]
- Nian, X., Niu, F., & Yang, Z. (2021). Distributed Nash equilibrium seeking for multicluster game under switching communication topologies. IEEE Transactions on Systems, Man, and Cybernetics: Systems, 52(7), 4105-4116. [CrossRef]
- Zhang, K., Fang, X., Wang, D., Lv, Y., & Yu, X. (2021). Distributed Nash equilibrium seeking under event-triggered mechanism. IEEE Transactions on Circuits and Systems II: Express Briefs, 68(11), 3441-3445. [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).