Muhammad Mahmoud Hanafy

Dr. Muhammad Mahmoud Hanafy

Information System and Artificial Intelligence, Matrouh University Faculty of Computers and Artificial Intelligence, Cairo, Al Qāhirah, Egypt
orcid

Research Focus & Metrics

Academic Career Length

5Years (2022-Present)

(Calculated once Scilit publication data is synced: current year − year of first publication + 1)

Representative Publications

View All Publications
20 July 2022 in Sensors
Verified
Journal Article
Open access
PDF file
EOEsam Othman
Esam Othman
Muhammad Mahmoud HanafyMuhammad Mahmoud Hanafy
Muhammad Mahmoud Hanafy
HDHabib Dhahri
Habib Dhahri
HAHatem Abdulkader
Hatem Abdulkader
AMAwais Mahmood
Awais Mahmood
MIMina Ibrahim
Mina Ibrahim
Liver cancer is a life-threatening illness and one of the fastest-growing cancer types in the world. Consequently, the early detection of liver cancer leads to lower mortality rates. This work aims to build a model that will help clinicians determine the type of tumor when it occurs within the liver region by analyzing images of tissue taken from a biopsy of this tumor. Working within this stage requires effort, time, and accumulated experience that must be possessed by a tissue expert to determine whether this tumor is malignant and needs treatment. Thus, a histology expert can make use of this model to obtain an initial diagnosis. This study aims to propose a deep learning model using convolutional neural networks (CNNs), which are able to transfer knowledge from pre-trained global models and decant this knowledge into a single model to help diagnose liver tumors from CT scans. Thus, we obtained a hybrid model capable of detecting CT images of a biopsy of a liver tumor. The best results that we obtained within this research reached an accuracy of 0.995, a precision value of 0.864, and a recall value of 0.979, which are higher than those obtained using other models. It is worth noting that this model was tested on a limited set of data and gave good detection results. This model can be used as an aid to support the decisions of specialists in this field and save their efforts. In addition, it saves the effort and time incurred by the treatment of this type of cancer by specialists, especially during periodic examination campaigns every year.

22 May 2026 in PeerJ Computer Science
Verified
Journal Article
Open access
PDF file
Muhammad Mahmoud HanafyMuhammad Mahmoud Hanafy
Muhammad Mahmoud Hanafy
SMSouham Meshoul
Souham Meshoul
MBMohamed Batouche
Mohamed Batouche
Mohamed HammadMohamed Hammad
Mohamed Hammad
The increasing complexity of network threats demands smarter and faster analytical tools. Existing models often struggle with zero-day attacks or high-volume traffic. Retrieval-augmented generation (RAG) offers a promising approach by combining retrieval from knowledge sources with generative reasoning. In this study, we evaluate and improve RAG-based architecture for network packet analysis. We propose a novel Hybrid Cache-Graph RAG framework that merges graph-based structural reasoning with strategic multi-level caching. Four architectures are compared: Traditional RAG, Graph RAG, Cache RAG, and the proposed hybrid model. Evaluation is conducted using intrusion detection evaluation dataset (CIC-IDS2017), the raw network packets (UNSW-NB15), and custom packet capture (PCAP) datasets across multiple metrics including accuracy, latency, and robustness under zero-day and high-load conditions. Results demonstrate that the Hybrid Cache-Graph RAG outperforms all baseline architectures, achieving an 18% improvement in retrieval accuracy (MAP) and a 54% reduction in latency. Ablation studies confirm the importance of adaptive component weighting in realizing these gains. This work underscores the value of integrating structural reasoning with memory optimization for building next-generation, adaptive cybersecurity solutions.

4 September 2026 in Sensors
Verified
Journal Article
Open access
PDF file
Mohammed FarsiMohammed Farsi
Mohammed Farsi
Muhammad Mahmoud HanafyMuhammad Mahmoud Hanafy
Muhammad Mahmoud Hanafy
Abdelmoniem HelmyAbdelmoniem Helmy
Abdelmoniem Helmy
Published quantum-streaming theory establishes quantum memory advantages for specific streaming problems; how a correlation-sensitive proxy model behaves under the structured dependence typical of sensor and telemetry streams, however, remains uncharted. We present a proxy-based diagnostic and hypothesis-generation framework for correlation-sensitive streaming analysis. Operational proxies for the refreshing time τ and repetition number r, introduced in this paper, are estimated on five synthetic non-IID regimes (IID, Markov switching, seasonal drift, burst repetition, and long-range dependence) and mapped onto a (τ,r) sensitivity landscape—the paper’s central artifact. Three memory-bounded classical baselines (online SGD, averaged SGD, and Count-Min) supply empirical reference points; no quantum algorithm is implemented or simulated and all quantum curves are heuristic proxy estimates. Analytic and empirical refreshing-time estimates diverge by up to 125× under long-range dependence (≈8× for Markov)—the two estimators answer different questions about temporal dependence. Using empirical τ, the proxy model predicts a hypothesised proxy-favourable region under mild-to-moderate Markov correlation that closes as correlation strengthens: the mean curves cross at ρ*≈0.82 under the operating constants (C=2, δ=0.05; the crossing moves between ρ*≈0.38 and beyond the sweep range across a C–δ grid, so only the ordinal reading is robust), and by ρ=0.88 the classical baseline exceeds the proxy estimate (Hodges–Lehmann difference 0.046). Applied unchanged to two real NAB telemetry streams, the same estimators place NYC Taxi inside and Machine Temperature outside the hypothesised favourable region—an ordering that persists across all tested encoder resolutions—with imbalance-aware metrics guarding against majority-class artefacts. Ablations over the τ estimator, forward window, stream length, target function, and proxy constants preserve the regime ordering within each estimator family.

25 November 2025
Verified
Conference Paper
Closed access
MMMostafa Mohamed
Mostafa Mohamed
SISaad M. Ibrahim
Saad M. Ibrahim
AAAmr A. Abohany
Amr A. Abohany
Muhammad Mahmoud HanafyMuhammad Mahmoud Hanafy
Muhammad Mahmoud Hanafy
The rapid proliferation of Internet of Things (IoT) devices has created unprecedented cybersecurity challenges, necessitating advanced intrusion detection systems capable of identifying sophisticated attack patterns in real-time. This paper presents APEX-IDS (Advanced Performance Excellence IoT Detection System), a novel deep learning framework that integrates convolutional neural networks (CNNs), long short-term memory (LSTM) networks, and explainable artificial intelligence (XAI) techniques for comprehensive IoT intrusion detection. Our multi-layered architecture combines spatial and temporal feature extraction with attention mechanisms to achieve superior detection accuracy while maintaining computational efficiency for edge deployment. Extensive evaluation on multiple benchmark datasets including CICIoT2023, UNSW-NB15, ToN_IoT, NSLKDD, and IoT-23 demonstrates exceptional performance with 99.23 % accuracy, 98.87 % precision, 99.15 % recall, 99.01 % F1score, and 0.996 AUC. The integration of SHAP and LIME explainability techniques provides transparent decision-making capabilities essential for operational deployment. Statistical significance testing confirms APEX-IDS superiority over existing approaches ($\mathbf{p}<0.001$), while maintaining practical deployment feasibility with $\mathbf{2. 3 m s}$ detection time and $\mathbf{4 5. 2 M B}$ memory footprint.

4 June 2026 in Scientific Reports
Verified
Journal Article
Open access
PDF file
Muhammad Mahmoud HanafyMuhammad Mahmoud Hanafy
Muhammad Mahmoud Hanafy
SMSouham Meshoul
Souham Meshoul
MBMohamed Batouche
Mohamed Batouche
Mohamed HammadMohamed Hammad
Mohamed Hammad
Urban traffic congestion incurs high economic and environmental costs, including fuel wastage, increased greenhouse gas emissions, and driver frustration. Current genetic algorithm-based traffic routing systems do not adapt when real-time conditions deviate from their offline optimization assumptions, exacerbating congestion during incidents and demand surges. These systems lack three critical capabilities: online adaptation without retraining, coordination to prevent route oscillation, and transfer across cities with different topologies. To address these gaps, we formulate adaptive traffic routing as a Decentralized Partially Observable Markov Decision Process (Dec-POMDP) and propose MA-GRL, a multi-agent graph reinforcement learning framework. MA-GRL combines Graph Attention Networks (GAT) with Multi-Agent PPO under the Centralized Training with Decentralized Execution (CTDE) paradigm. Each vehicle executes a decentralized policy that processes local traffic observations through a 3-hop GAT encoder. A novel coordination reward implicitly penalizes simultaneous route switches by nearby agents, enabling stable cooperation without explicit communication. Experiments on the Monaco MoST scenario with 100 vehicles over 3600-second episodes show that MA-GRL reduces average travel time by 11.1% compared to genetic algorithm routing (\(p < 0.001\), Cohen’s \(d = 0.80\)), recovers from 10% road closures within 45 steps, and achieves 87% zero-shot transfer retention across Monaco, Luxembourg, and Bologna city scenarios. Our framework demonstrates the potential for scalable, adaptive, and transferable traffic management systems that can alleviate congestion and its associated societal burdens.

21 August 2026 in Biomedical Signal Processing and Control
Verified
Journal Article
Closed access
Abdelmoniem HelmyAbdelmoniem Helmy
Abdelmoniem Helmy
Muhammad Mahmoud HanafyMuhammad Mahmoud Hanafy
Muhammad Mahmoud Hanafy