دمج أجهزة إنترنت الأشياء (IoT) في أنظمة سكادا (SCADA) وفّر تقنيات فعّالة ومحسّنة لجمع البيانات ونقلها. يأتي هذا التحسين مصحوبًا بتحديات أمنية جسيمة، إذ كشف الأنظمة المعزولة تقليديًا لشبكة الإنترنت العامة. وتُعدّ الأجهزة الأمنية الفعّالة والموثوقة للغاية، مثل أنظمة كشف التسلل (IDS) وأنظمة منع التسلل (IPS)، بالغة الأهمية. استخدمت دراسات لا حصر لها خوارزميات التعلم العميق لتصميم نظام كشف تسلل فعّال؛ غير أن المشكلة الجوهرية المتمثلة في اختلال توازن مجموعات البيانات لم تُعالَج بالكامل. في بحثنا، درسنا أثر اختلال البيانات على تطوير نظام فعّال لكشف التسلل قائم على سكادا. ولاستقصاء أثر تقنيات موازنة البيانات المختلفة، اخترنا مجموعتي بيانات غير متوازنتين، هما مجموعة موريس لبيانات الطاقة ومجموعة CICIDS2017، وشملت التقنيات: أخذ العينات العشوائي، والاختيار أحادي الجانب (OSS)، وخوارزمية القريب الأدنى (near-miss)، وSMOTE، وADASYN. وللتصنيف الثنائي، دُمجت الشبكات العصبية الالتفافية مع الذاكرة الطويلة قصيرة المدى (CNN-LSTM). وقِيست فعّالية النظام بمصفوفة الالتباس، التي تشمل مقاييس التقييم مثل الدقة (accuracy) والإحكام (precision) ومعدل الكشف ودرجة F1. وتُظهر أربع تجارب على مجموعتي البيانات أثر اختلال البيانات. يهدف هذا البحث إلى مساعدة باحثي الأمن على فهم مجموعات البيانات المختلة وأثرها على أنظمة كشف التسلل لسكادا القائمة على التعلم العميق.
تُستخدم أنظمة التحكم الإشرافي وتحصيل البيانات (سكادا) في طيف واسع من الصناعات لمراقبة العمليات الصناعية والتحكم فيها، مثل التصنيع والطاقة والنقل. وتتكون من حاسوب مركزي أو خادم يتواصل مع شبكة من الأجهزة، كالحساسات وأنظمة التحكم، لجمع البيانات وضبط مختلف العمليات [1]. ففي صناعة الطاقة مثلًا، قد يُستخدم نظام سكادا لمراقبة تدفق الكهرباء عبر شبكة الطاقة والتحكم فيه، حيث تجمع الحساسات داخل الشبكة بيانات عن تدفق الكهرباء، ويستخدمها النظام لضبط الشبكة آنيًا لضمان توزيع الكهرباء بكفاءة وأمان.
شهدت السنوات الأخيرة تزايدًا في دمج إنترنت الأشياء في أنظمة سكادا. إذ تربط منصة إنترنت الأشياء مليارات الأجهزة، بما فيها وحدات التحكم المنطقية القابلة للبرمجة (PLC) والمشغّلات والأجهزة الإلكترونية الذكية (IED) الخاصة بأنظمة التحكم الصناعية (ICS) [1]. وتستفيد أنظمة سكادا من إنترنت الأشياء استفادة كبيرة في الأتمتة وتحسين المراقبة وجمع البيانات، إذ مكّنت الصناعة الحديثة من مراقبة الأنظمة الفيزيائية والتحكم فيها بكفاءة، بما أثمر جمعًا ذكيًا للبيانات ومعالجةً وإدارةً ناجحة للأعمال. ولا يمكن استخدام إنترنت الأشياء في سكادا ما لم يُكسَر عزل شبكات سكادا، لأن هذه الأجهزة تتواصل عبر الإنترنت العامة.
أدّى كسر هذا العزل إلى تعريض أنظمة سكادا لهجمات سيبرانية، مثل هجمات الحرمان من الخدمة (DoS) وهجمات القوة الغاشمة وحقن الأوامر. لذا أُنشئت أنظمة كشف التسلل (IDS) لتأمين هذه الأنظمة [5]. غير أن بناء نموذج تعلم آلي أو تعلم عميق فعّال يتطلب مجموعة بيانات جيدة، وتمثل موازنة البيانات تحديًا رئيسيًا: فعندما تتجاوز نسبة صنفٍ ما نسبةَ صنف آخر يحدث اختلال البيانات [6]، ما يُدخل تحيزًا في نتائج النماذج التي تميل إلى تصنيف المدخلات ضمن الصنف الغالب.
يتمثل الحلان الرئيسيان المنشوران لهذه المشكلة في تقليل العينات (undersampling) وزيادة العينات (oversampling): الأول يخفّض نسبة الصنف الغالب، والثاني يرفع نسبة الصنف الأقل بزيادة عيناته. تدرس هذه الورقة أثر اختلال مجموعات البيانات على أداء أنظمة كشف التسلل لسكادا باستخدام نموذج CNN-LSTM، وتقارن تقنيات الموازنة المختلفة على مجموعتي بيانات، وتُجيب عن أسئلة البحث المتعلقة بأفضل استراتيجية موازنة لكل مجموعة بيانات.
دَرس باحثو الأمن على نطاق واسع موضوع اختلال مجموعات البيانات في الأدبيات. اختيرت المنشورات المناقَشة وفق معايير: (أ) نُشرت بين 2018 و2022، (ب) أوراق مراجعة أو أبحاث منشورة في دوريات فقط، (ج) احتوت على مصطلحي “IDS” و“imbalanced dataset”. وجُمعت هذه المقالات من ScienceDirect وWiley Online Library وGoogle Scholar. وقبل استعراض الأعمال ذات الصلة، يجب تعريف مفاهيم مثل أنظمة سكادا وأنظمة كشف التسلل واختلال البيانات وتقليل العينات وزيادتها.
تتكون أنظمة سكادا من مكوّنين رئيسيين: الأجهزة الميدانية مثل وحدات الأطراف البعيدة (RTU) ووحدات التحكم المنطقية القابلة للبرمجة (PLC)، وواجهة الإنسان والآلة (HMI). تراقب هذه الأنظمة الخصائص وتتحكم فيها عبر رقعة جغرافية واسعة، وتُؤتمت العمليات الصناعية وتضبطها. تجمع أجهزة إنترنت الأشياء البيانات في أنظمة سكادا الحديثة، وتُنقل البيانات عبر شبكة الإنترنت العامة، ومن هنا جاءت الحاجة إلى أنظمة كشف التسلل [5].
تُصنف أنظمة كشف التسلل إلى قائمة على الشبكة أو قائمة على المضيف، وتعمل في ثلاثة أنماط: القائم على القواعد، وكشف الشذوذ، والهجين. وتقع نماذج التعلم الآلي (ML) والتعلم العميق (DL) في قلب أنظمة كشف الشذوذ هذه. ويحتاج تدريب هذه النماذج إلى مجموعة بيانات جيدة يمكن الحصول عليها من نظام سكادا كامل أو من نظام محاكى باستخدام منصات اختبار. ومن الصعوبات التي يواجهها الباحثون اختلال البيانات، الذي يُفسَّر مشكلةً لأنه يُحيّز نتائج النماذج [6].
نشرت أعمال عن حلين رئيسيين: تقليل العينات، بأساليب اختيار السجلات المراد الاحتفاظ بها أو حذفها أو الجمع بينهما؛ وزيادة العينات بإعادة إنتاج الصنف الأقل عشوائيًا أو اصطناعيًا. ويستعرض القسم التالي الأعمال التي استخدمت هذين النهجين، بما فيها أخذ العينات العشوائي، وSMOTE، وADASYN، والاختيار أحادي الجانب، وخوارزمية القريب الأدنى.
يعرض هذا القسم الخطوات اللازمة للإجابة عن أسئلة البحث وتحقيق هدف الورقة، وهو فهم أثر اختلال مجموعات البيانات على تطوير أنظمة كشف التسلل في سكادا. نُظّم القسم كالتالي: أولًا تدريب نموذج CNN-LSTM على بيانات مختلة؛ ثانيًا تدريبه على بيانات متوازنة؛ ثالثًا وصف موجز لمجموعتي البيانات؛ وأخيرًا مناقشة بيئة التجارب وإعداداتها.
في التجربة الأولى ضُبطت مجموعات سكادا غير المتوازنة باستخدام MinMaxScaler مع تخصيص 70% من البيانات للتدريب و30% للاختبار، وذلك في ثلاث خطوات: (1) المعالجة المسبقة بتحويل السمات الفئوية إلى عددية ثم تطبيع القيم بين 0 و1 وفق المعادلة (1): xi = (xi − Min)/(Max − Min)؛ (2) التدريب والاختبار بتطوير نموذج CNN-LSTM واختيار أفضل معلمات التدريب؛ (3) التقييم بمقاييس مثل الدقة والاستدعاء ودرجة F1. وحُوّلت سمة “العلامة” (Marker) الفئوية الوحيدة في مجموعة موريس (Normal وAttack) ترميزًا ثنائيًا (0 و1)، وكذلك الأصناف المتعددة في CICIDS2017 إلى طبيعي وهجوم، وأُزيلت السجلات ذات القيم المفقودة والسمات الثابتة في أكثر من 80% من السجلات.
في التجارب 2 و3 و4 قُسّمت مجموعة البيانات وفق صنفيها الغالب والأقل، ووُازنت بتقليل عينات الصنف الغالب وزيادة عينات الصنف الأقل. شمل تقليل العينات: أساليب اختيار السجلات المراد الاحتفاظ بها مثل القريب الأدنى (near miss) وقاعدة الجار الأقرب المكثف؛ وأساليب اختيار العينات المراد حذفها مثل روابط Tomek وقاعدة الجيران المحرَّرة؛ وأساليب تجمع بينهما مثل الاختيار أحادي الجانب وقاعدة تنظيف الجوار. وشملت زيادة العينات: الزيادة العشوائية، وSMOTE، وSMOTE الحدّي (Borderline–SMOTE)، والزيادة الحدّية بـSVM، وأخذ العينات التكيفي الاصطناعي (ADASYN).
استُخدمت مجموعتا بيانات: مجموعة موريس لبيانات الطاقة (72,073 سجلًا: طبيعي وهجوم) ومجموعة CICIDS2017 (1,161,344 سجلًا: طبيعي وهجوم) في تصنيف ثنائي. واختيرت السمات بأعلى قيمة ANOVA F، وقُسّمت البيانات 70:30 للتدريب والاختبار، ودُرّب نموذج CNN-LSTM الذي يجمع الطبقات الالتفافية لاستخلاص السمات مع طبقات LSTM لالتقاط التبعيات الزمنية في حركة الشبكة.
نُفّذت أربع تجارب: الأولى بدون موازنة كخط أساس، والثانية بتقليل العينات (RUS والاختيار أحادي الجانب والقريب الأدنى)، والثالثة بزيادة العينات (ROS وSMOTE وADASYN)، مع تقييم كل إعداد بالدقة والإحكام والاستدعاء ودرجة F1 المستخرجة من مصفوفة الالتباس.
نعرض في هذا القسم النتائج العددية لتجاربنا في كشف الهجمات عبر أساليب موازنة مجموعات البيانات المختلفة، بهدف الإجابة عن أسئلة البحث. استُخدم نموذج CNN-LSTM لتصنيف الهجمات في بيانات شبكة سكادا، مع عرض مقاييس التقييم والنتائج.
أولًا قُورن أداء مجموعتي البيانات دون أي استراتيجية موازنة. في مجموعة موريس للطاقة كانت الدقة أعلى عند إزالة السمات الثابتة في أكثر من 70% من السجلات، بينما ظلت دقة CICIDS2017 ثابتة مع مختلف العتبات. وحققت المجموعتان: موريس (الدقة 73.63، الإحكام 73.22، الاستدعاء 74.84، F1 بدرجة 58.06) وCICIDS2017 (الدقة 98.42، الإحكام 98.03، الاستدعاء 98.12، F1 بدرجة 98.44). غير أن الدقة ليست أفضل مقياس في سيناريوهات كشف التسلل ذات البيانات المختلة، لأن خوارزميات التدريب تنحاز لتقدير كل البيانات طبيعية متجاهلةً النسبة الصغيرة من أحداث الهجوم [8].
في المرحلة الثانية وُازنت البيانات بتقليل العينات. في مجموعة موريس خفّض أخذ العينات العشوائي صنف الهجوم بنسبة 35.3%، والاختيار أحادي الجانب الصنف الغالب بنسبة 2.3% فقط، بينما حقق القريب الأدنى أفضل النتائج بتخفيض صنف الهجوم إلى النصف. ورغم أن العشوائي أعطى دقة أعلى، حقق القريب الأدنى أعلى درجة F1 (66%)، وهي المقياس الرئيسي في بحثنا، بتحسن 9% عن مجموعة البيانات غير المتوازنة (57%). وفي CICIDS2017 حقق القريب الأدنى أفضل النتائج أيضًا (الدقة 99.25، F1 بدرجة 99.34) مقابل 96% للعشوائي و97.67% للأحادي الجانب.
في التجربة الثالثة استُخدمت أساليب زيادة العينات فقط (ROS وSMOTE وADASYN). في مجموعة موريس ضاعف ROS الصنف الأقل، وقارب SMOTE الموازنة التامة بزيادة الصنف الطبيعي، وأدى ADASYN جيدًا دون الأمثلية. وكانت دقة كل الخوارزميات نحو 71%، لكن SMOTE تفوقت في درجة F1 مسجلةً 64%. وفي CICIDS2017 حسّنت زيادة العينات الأداء إلى نحو 99% في جميع المقاييس، مؤكدةً أن موازنة البيانات تحسّن كشف التسلل في كلتا المجموعتين.
تُظهر النتائج أن اختلال البيانات يُدهور أداء كشف التسلل بشدة، خاصة في مجموعة موريس حيث قفزت درجة F1 من 57–58% إلى 66% بعد الموازنة، بينما كانت مجموعة CICIDS2017 الأكبر والأكثر تنوعًا أقل تأثرًا. ويُعدّ القريب الأدنى أفضل أساليب تقليل العينات وSMOTE أفضل أساليب زيادتها في هذه التجارب.
خلاصة التحليل: الدقة مضللة في البيانات المختلة ويجب الاعتماد على درجة F1 والاستدعاء؛ وموازنة البيانات خطوة ضرورية قبل تدريب نماذج التعلم العميق لأنظمة كشف التسلل في سكادا؛ ويتفوق القريب الأدنى وSMOTE على الأساليب العشوائية البسيطة في الحفاظ على حدود القرار المفيدة للكشف.
أثبتت هذه الدراسة أن اختلال مجموعات البيانات يؤثر تأثيرًا كبيرًا على أداء أنظمة كشف التسلل القائمة على التعلم العميق في بيئات سكادا. فبتطبيق تقنيات الموازنة (تقليل العينات وزيادتها) تحسّن أداء نموذج CNN-LSTM تحسنًا ملموسًا على مجموعتي موريس للطاقة وCICIDS2017، وكان القريب الأدنى وSMOTE الأكثر فعّالية.
تشمل الأعمال المستقبلية اختبار أساليب موازنة هجينة تجمع تقليل العينات وزيادتها، وتوسيع التقييم ليشمل مجموعات بيانات سكادا أخرى ونماذج تعلم عميق إضافية، ودراسة أثر الموازنة على كشف فئات هجومية محددة بدل التصنيف الثنائي العام. ويهدف هذا البحث إلى مساعدة باحثي الأمن على فهم مجموعات البيانات المختلة وأثرها على أنظمة كشف التسلل لسكادا القائمة على التعلم العميق.
Integrating IoT devices in SCADA systems has provided efficient and improved data collection and transmission technologies. This enhancement comes with significant security challenges, exposing traditionally isolated systems to the public internet. Effective and highly reliable security devices, such as intrusion detection systems (IDSs) and intrusion prevention systems (IPS), are critical. Countless studies used deep learning algorithms to design an efficient IDS; however, the fundamental issue of imbalanced datasets was not fully addressed. In our research, we examined the impact of data imbalance on developing an effective SCADA-based IDS. To investigate the impact of various data balancing techniques, we chose two unbalanced datasets, the Morris power dataset and the CICIDS2017 dataset, including random sampling, one-sided selection (OSS), near-miss, SMOTE, and ADASYN. For binary classification, convolutional neural networks were coupled with long short-term memory (CNN-LSTM). The system’s effectiveness was determined by the confusion matrix, which includes evaluation metrics such as accuracy, precision, detection rate, and F1-score. Four experiments on the two datasets demonstrate the impact of the data imbalance. This research aims to help security researchers in understanding imbalanced datasets and their impact on DL SCADA-IDS.
Supervisory control and data acquisition (SCADA) systems are used in a variety of industries to monitor and control industrial processes, such as manufacturing, energy, and transportation. They consist of a central computer or server that communicates with a network of devices, such as sensors and control systems, to collect data and control various processes [1]. For example, in the energy industry, a SCADA system might be used to monitor and control the flow of electricity through a power grid, where sensors collect data on electricity flow and the system adjusts the grid in real time to distribute electricity efficiently and safely.
In recent years, there has been an increase in the integration of IoT in SCADA systems. An IoT platform connects billions of devices, including PLCs, actuators, and intelligent electronic devices (IEDs) of industrial control systems (ICS) [1]. SCADA systems benefit greatly from IoT in automation, improved monitoring, and data collection, enabling modern industry to monitor and control physical systems efficiently, with intelligent data collection, processing, and successful business management. The use of IoT in SCADA is impossible unless the isolation of SCADA networks is broken, as these devices communicate over the public internet.
Breaking this isolation has exposed SCADA systems to cyberattacks such as denial of service (DoS), brute-force, and command-injection attacks. Intrusion detection systems (IDSs) were therefore created to secure such systems [5]. Building an effective machine learning or deep learning model requires a good dataset, and data balancing is a major challenge: when one class has a higher percentage than another, data imbalance occurs [6], biasing model results toward classifying inputs into the majority class.
The two main published solutions are undersampling, which lowers the proportion of the majority class, and oversampling, which raises the minority share. This paper studies the impact of dataset imbalance on SCADA IDS performance using a CNN-LSTM model, compares balancing techniques on two datasets, and answers which balancing strategy suits each dataset best.
Security researchers have widely studied dataset imbalance in the literature. The publications discussed were chosen based on the following criteria: (a) published between 2018 and 2022, (b) review or research papers published only in journals, and (c) containing the terms “IDS” and “imbalanced dataset.” These articles were gathered from ScienceDirect, Wiley Online Library, and Google Scholar. Before examining the related works, concepts such as SCADA systems, intrusion detection systems, data imbalance, undersampling, and oversampling must be defined.
SCADA systems are control systems comprised of two major components: field devices, such as remote terminal units (RTUs) and programmable logic controllers (PLCs), and the human machine interface (HMI). These systems monitor and control properties across a large geographic area and automate industrial operations. IoT devices collect data in modern SCADA systems, transmitted via the public internet network, hence IDSs were created to secure such systems [5].
Intrusion detection systems are classified as either network-based or host-based, operating in three modes: rule-based, anomaly detection, and hybrid. Machine learning (ML) and deep learning (DL) models are at the heart of these anomaly detection systems. Training such models requires a good dataset, obtainable from an entire SCADA system or a simulated system utilizing testbeds. Data imbalance is interpreted as a problem since it introduces bias into ML/DL model results [6].
Published works cover two primary solutions: undersampling, via methods that select records to keep or to delete or combinations of both; and oversampling by randomly or synthetically reproducing the minority class. The following review covers works employing these approaches, including random sampling, SMOTE, ADASYN, one-sided selection, and near-miss.
This section provides the steps needed to answer the research questions and achieve the goal of this paper: understanding the impact of dataset imbalance on IDS development in SCADA systems. It is organized as follows: first training the CNN-LSTM with imbalanced datasets; second, training with balanced data; third, a brief description of the datasets; and finally, the experiment environment and settings.
In the first experiment, the unbalanced SCADA datasets were adjusted using MinMaxScaler with 70% of the data for training and 30% for testing, in three steps: (1) preprocessing, converting categorical features to numerical and normalizing values between 0 and 1 per Equation (1): xi = (xi − Min)/(Max − Min); (2) training and testing, developing the CNN-LSTM model and choosing the best training parameters; (3) evaluation using metrics such as accuracy, recall, and F1-score. The single categorical attribute “marker” in the Morris dataset (Normal, Attack) was binary-encoded (0 and 1), as were the CICIDS2017 multiclass labels (Normal vs Attack); instances with missing values and features constant in over 80% of records were removed.
In Experiments 2, 3, and 4, the dataset was divided by majority and minority classes, balancing by undersampling the majority and oversampling the minority. Undersampling comprised: methods selecting records to keep (near miss, condensed nearest neighbor); methods selecting instances to delete (Tomek links, edited nearest neighbors); and combinations of both (one-sided selection, neighborhood cleaning rule). Oversampling comprised: random oversampling, SMOTE, Borderline–SMOTE, Borderline oversampling with SVM, and adaptive synthetic sampling (ADASYN).
Two datasets were used: the Morris power dataset (72,073 records: Normal and Attack) and CICIDS2017 (1,161,344 records: Normal and Attack) for binary classification. Features were selected by ANOVA F-value, data split 70:30 for training and testing, and a CNN-LSTM model combined convolutional layers for feature extraction with LSTM layers capturing temporal dependencies in network traffic.
Four experiments were run: the first without balancing as a baseline, the second with undersampling (RUS, one-sided selection, near miss), the third with oversampling (ROS, SMOTE, ADASYN), each evaluated with accuracy, precision, recall, and F1-score from the confusion matrix.
In this section, we present the numerical results of our experiments in detecting attacks through different dataset-balancing approaches, aiming to answer the research questions. We used the CNN-LSTM model to classify attacks in SCADA network data, detailing the evaluation metrics and outcomes.
First, dataset performance was compared without any balancing strategy. On the Morris power dataset, accuracy was highest when features constant in more than 70% of instances were removed, while CICIDS2017 accuracy remained constant across thresholds. The datasets scored: Morris (accuracy 73.63, precision 73.22, recall 74.84, F1-score 58.06) and CICIDS2017 (accuracy 98.42, precision 98.03, recall 98.12, F1-score 98.44). However, accuracy is not the best measure in imbalanced intrusion detection scenarios, because training algorithms are skewed toward estimating all data as normal, disregarding the small percentage of attack events [8].
In the second phase, data were balanced with undersampling. On Morris, random undersampling cut the attack class by 35.3%, one-sided selection reduced the majority by only 2.3%, while near miss performed best, halving the attack class. Although random sampling gave higher accuracy, near miss achieved the highest F1-score (66%), our primary metric — a 9% improvement over the unbalanced dataset (57%). On CICIDS2017, near miss was also best (accuracy 99.25, F1-score 99.34) versus 96% for random and 97.67% for one-sided selection.
The third experiment used only oversampling (ROS, SMOTE, ADASYN). On Morris, ROS doubled the minority class, SMOTE nearly balanced the dataset by growing the normal class, and ADASYN performed well but not optimally. All algorithms reached around 71% accuracy, but SMOTE led on F1-score at 64%. On CICIDS2017, oversampling lifted performance to about 99% on all metrics, confirming that balancing improves intrusion detection on both datasets.
Results show data imbalance severely degrades IDS performance, especially on Morris where F1 jumped from 57–58% to 66% after balancing, while the larger, more diverse CICIDS2017 was less affected. Near miss was the best undersampling method and SMOTE the best oversampling method in these experiments.
In summary: accuracy is misleading on imbalanced data — F1-score and recall must be used; balancing is a necessary step before training deep learning SCADA IDS models; and near miss and SMOTE outperform naive random methods in preserving decision boundaries useful for detection.
This study proved that dataset imbalance significantly impacts the performance of deep learning-based intrusion detection systems in SCADA environments. Applying balancing techniques (undersampling and oversampling) tangibly improved CNN-LSTM performance on both the Morris power and CICIDS2017 datasets, with near miss and SMOTE the most effective.
Future work includes testing hybrid balancing combining under- and oversampling, extending evaluation to additional SCADA datasets and deep learning models, and studying balancing effects on detecting specific attack classes rather than generic binary classification. This research aims to help security researchers understand imbalanced datasets and their impact on DL SCADA-IDS.