OSCR

An edge-AI enabled wearable platform for real-time epileptic seizure detection with geolocated alerting.

Code ↔ Paper

3 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 3 matches
  1. [1] § Methods ↔ Real_Time_Seizure_Detection_and_Alert_System.ipynb, lines 208–248 · score 0.80 · Linear SVM, maximum depth, ReLU, Neural Network, Adam, dropout
  2. [2] § Methods ↔ Real_Time_Seizure_Detection_and_Alert_System.ipynb, lines 394–514 · score 0.56 · heart rate, seizure detection, predictions, activities, preprocessing, acceleration
  3. [3] § System architecture ↔ Real_Time_Seizure_Detection_and_Alert_System.ipynb, lines 394–514 · score 0.56 · seizure detection model, heart rate, Preprocessing, accelerometer, configuration, sensor

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Jupyter notebook · 561 lines · 20 KB · no license · 3 matches

  1. # %% [markdown]
  2. # <a href="https://colab.research.google.com/github/abdibbey/Real_Time_Seizure_Detection_and_Alert_System/blob/main/Real_Time_Seizure_Detection_and_Alert_System.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
  3. # %% [markdown]
  4. # # **Real-Time Seizure Detection and Alert System**
  5. # ### **Overview**
  6. #
  7. # This project implements a real-time seizure detection system using machine learning and sensor data, optimized for deployment on a Raspberry Pi 3 Model B. It prioritizes high recall to minimize missed seizures, efficient processing, and robust data handling.
  8. #
  9. # ### **Key Objectives**
  10. #
  11. # * **Maximize Recall:** Ensure detection of all potential seizures.
  12. # * **Real-Time Performance:** Achieve low-latency inference on Raspberry Pi 3 Model B.
  13. # * **Robust Preprocessing:** Manage noisy sensor data effectively.
  14. #
  15. #
  16. # ### **Workflow**
  17. #
  18. # 1. **Data Preprocessing**: Load, clean, and normalize sensor data.
  19. # 2. **Feature Engineering**: Extract relevant features.
  20. # 3. **Model Training**: Train Random Forest, SVM, and Neural Network models.
  21. # 4. **Model Evaluation**: Assess training/testing performance, resource usage, and fitting status (overfit, underfit, ideally fit).
  22. # 5. **Model Selection**: Select the optimal model.
  23. # 6. **Raspberry Pi Deployment**: Export model and configurations.
  24. # %% [markdown]
  25. # ## **Step 1: Library Import and Initialization**
  26. #
  27. # Imports and verifies required Python libraries.
  28. #
  29. # ### **Libraries**
  30. #
  31. #
  32. # * **Data Processing:** Pandas, NumPy, JSON.
  33. # * **Visualization:** Matplotlib, Seaborn
  34. # * **Machine Learning:** Scikit-learn
  35. # * **Deep Learning:** TensorFlow/Keras
  36. # * **Class Balancing:** Imbalanced-learn (RandomUnderSampler).
  37. # * **Model Persistence:** Joblib
  38. # * File System: os.
  39. # %%
  40. print("=" * 50)
  41. print("📦 Step 1: Importing Libraries")
  42. print("=" * 50)
  43. try:
  44. import pandas as pd
  45. import numpy as np
  46. import json
  47. import matplotlib.pyplot as plt
  48. import seaborn as sns
  49. import joblib
  50. import os
  51. from sklearn.preprocessing import MinMaxScaler
  52. from sklearn.model_selection import train_test_split
  53. from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score, roc_auc_score
  54. from sklearn.ensemble import RandomForestClassifier
  55. from sklearn.svm import LinearSVC
  56. import tensorflow as tf
  57. from tensorflow.keras.models import Sequential
  58. from tensorflow.keras.layers import Dense, Dropout
  59. from imblearn.under_sampling import RandomUnderSampler
  60. # Check pandas and others
  61. assert pd is not None, "pandas not imported"
  62. assert tf is not None, "TensorFlow not imported"
  63. print("✅ Libraries imported")
  64. print(f"- Pandas: {pd.__version__}")
  65. print(f"- Scikit-learn: {joblib.__version__}")
  66. print(f"- TensorFlow: {tf.__version__}")
  67. except ImportError as e:
  68. print(f"❌ Import error: {e}")
  69. raise
  70. except AssertionError as e:
  71. print(f"❌ Critical import missing: {e}")
  72. raise
  73. # %% [markdown]
  74. # ## **Step 2: Data Preparation**
  75. #
  76. # Prepares the dataset by cleaning, normalizing, and balancing it, with visualizations for class distributions and train/test splits.
  77. #
  78. # ### **Sub-Steps**
  79. #
  80. # 1. Load Dataset: Read CSV data.
  81. #
  82. # 2. Identify Columns: Detect sensor and target columns.
  83. #
  84. # 3. Convert Labels: Map labels to binary (0: normal, 1: seizure).
  85. #
  86. # 4. Clean Data: Remove missing values.
  87. #
  88. # 5. Normalize Features: Apply MinMax scaling.
  89. #
  90. # 6. Balance Classes: Use UNDERSAMPLE for oversampling minority class.
  91. #
  92. # 7. Split Data: Create train/test sets.
  93. # %%
  94. print("=" * 50)
  95. print("🔍 Step 2: Data Preparation")
  96. print("=" * 50)
  97. def handle_error(step, error):
  98. print(f"❌ Error in {step}: {error}")
  99. exit()
  100. # Load Data
  101. try:
  102. data = pd.read_csv("/content/drive/MyDrive/Dataset/SHAR-100-20.csv")
  103. print(f"✅ Loaded dataset: {data.shape[0]} samples, {data.shape[1]} features")
  104. except Exception as e:
  105. handle_error("loading dataset", e)
  106. # Identify Columns
  107. try:
  108. if 'label' in data.columns:
  109. data = data.rename(columns={'label': 'seizure_status'})
  110. sensor_cols = [col for col in data.columns if any(x in col.lower() for x in ['accel', 'gyro', 'hr', 'heart'])]
  111. target_col = next((col for col in data.columns if 'seizure' in col.lower() or 'status' in col.lower()), None)
  112. if not sensor_cols or not target_col:
  113. raise ValueError("Sensor or target columns not found")
  114. print(f"✔ Sensor features: {len(sensor_cols)}")
  115. print(f"✔ Target: {target_col}")
  116. except Exception as e:
  117. handle_error("column identification", e)
  118. # Convert Labels
  119. try:
  120. data[target_col] = data[target_col].replace({'normal': 0, 'seizure': 1, 'no': 0, 'yes': 1, 0: 0, 1: 1})
  121. class_distribution = data[target_col].value_counts(normalize=True)
  122. print("✔ Class distribution:")
  123. for cls, proportion in class_distribution.items():
  124. print(f" - {cls}: {proportion:.6f}")
  125. except Exception as e:
  126. handle_error("label conversion", e)
  127. # Clean Data
  128. try:
  129. initial_count = len(data)
  130. data = data[sensor_cols + [target_col]].dropna()
  131. print(f"✔ Removed {initial_count - len(data)} rows with missing values")
  132. except Exception as e:
  133. handle_error("data cleaning", e)
  134. # Normalize Features
  135. try:
  136. X = data[sensor_cols].values
  137. y = data[target_col].values
  138. scaler = MinMaxScaler().fit(X)
  139. X = scaler.transform(X)
  140. print("✔ Features normalized")
  141. except Exception as e:
  142. handle_error("feature normalization", e)
  143. # Balance Classes with Visualization
  144. try:
  145. plt.figure(figsize=(10, 4))
  146. plt.subplot(1, 2, 1)
  147. sns.countplot(x=y)
  148. plt.title('Original Class Distribution')
  149. plt.xlabel('Class (0: Normal, 1: Seizure)')
  150. plt.ylabel('Count')
  151. undersampler = RandomUnderSampler(random_state=42)
  152. X, y = undersampler.fit_resample(X, y)
  153. plt.subplot(1, 2, 2)
  154. sns.countplot(x=y)
  155. plt.title('Balanced Class Distribution (Undersampling)')
  156. plt.xlabel('Class (0: Normal, 1: Seizure)')
  157. plt.ylabel('Count')
  158. plt.tight_layout()
  159. plt.show()
  160. print(f"✔ Dataset balanced: {len(X)} samples")
  161. except Exception as e:
  162. handle_error("class balancing", e)
  163. # Split Data with Visualization
  164. try:
  165. X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42, stratify=y)
  166. print(f"✔ Training set: {X_train.shape[0]} samples")
  167. print(f"✔ Test set: {X_test.shape[0]} samples")
  168. plt.figure(figsize=(12, 4))
  169. plt.subplot(1, 3, 1)
  170. sns.countplot(x=y)
  171. plt.title('Full Dataset')
  172. plt.xlabel('Class')
  173. plt.subplot(1, 3, 2)
  174. sns.countplot(x=y_train)
  175. plt.title('Training Set')
  176. plt.xlabel('Class')
  177. plt.subplot(1, 3, 3)
  178. sns.countplot(x=y_test)
  179. plt.title('Test Set')
  180. plt.xlabel('Class')
  181. plt.tight_layout()
  182. plt.show()
  183. except Exception as e:
  184. handle_error("data splitting", e)
  185. # %% [markdown]
  186. # ## **Step 3: Model Training**
  187. #
  188. # Trains three models: Random Forest, Linear SVM, and Neural Network.
  189. #
  190. #
  191. #
  192. # * **Random Forest:** Configured with 35 trees, a maximum depth of 5, and a subsample ratio of 0.7.
  193. #
  194. # * **Linear SVM:** Uses a regularization parameter C of 0.7 and a maximum of 2000 iterations.
  195. # * **Neural Network:** Features 10 ReLU neurons in the input layer, a 0.2 dropout rate, a single sigmoid output neuron, and is optimized with Adam.
  196. # %%
  197. print("=" * 50)
  198. print("⚙️ Step 3: Model Training")
  199. print("=" * 50)
  200. models = {}
  201. # Random Forest
  202. rf_model = RandomForestClassifier(n_estimators=50, max_depth=7, max_samples=0.8, random_state=42)
  203. rf_model.fit(X_train, y_train)
  204. models['RF'] = rf_model
  205. print("✅ Random Forest trained")
  206. # Linear SVM
  207. svm_model = LinearSVC(C=0.7, dual=False, random_state=42, max_iter=2000)
  208. svm_model.fit(X_train, y_train)
  209. models['SVM'] = svm_model
  210. print("✅ Linear SVM trained")
  211. # Neural Network
  212. nn_model = Sequential([
  213. Dense(16, activation='relu', input_shape=(X_train.shape[1],)),
  214. Dropout(0.2),
  215. Dense(1, activation='sigmoid')
  216. ])
  217. nn_model.compile(optimizer=tf.keras.optimizers.Adam(0.001), loss='binary_crossentropy', metrics=['accuracy'])
  218. nn_model.fit(X_train, y_train, epochs=50, batch_size=32, validation_split=0.2, verbose=0)
  219. models['NN'] = nn_model
  220. print("✅ Neural Network trained")
  221. # %% [markdown]
  222. # ## **Step 4: Model Evaluation**
  223. #
  224. # Evaluates models on training and testing performance metrics, resource usage, and fitting status (overfit, underfit, ideally fit), with bar plots comparing training vs. testing metrics and testing performance.
  225. #
  226. # **Metrics**
  227. # * Accuracy, Recall, F1 Score (for both training and testing).
  228. # * Resource usage: Size (KB), Speed (ms), Parameters.
  229. # * Fitting Status: Determined by comparing training and testing performance.
  230. # %%
  231. print("=" * 50)
  232. print("🔍 Step 4: Model Evaluation")
  233. print("=" * 50)
  234. def evaluate_models(models, X_train, y_train, X_test, y_test):
  235. results = []
  236. for name, model in models.items():
  237. # Training predictions
  238. y_train_pred = (model.predict(X_train) > 0.5).astype(int) if name == 'NN' else model.predict(X_train)
  239. # Testing predictions
  240. y_test_pred = (model.predict(X_test) > 0.5).astype(int) if name == 'NN' else model.predict(X_test)
  241. # Calculate metrics
  242. train_accuracy = accuracy_score(y_train, y_train_pred)
  243. test_accuracy = accuracy_score(y_test, y_test_pred)
  244. train_recall = recall_score(y_train, y_train_pred)
  245. test_recall = recall_score(y_test, y_test_pred)
  246. train_f1 = f1_score(y_train, y_train_pred)
  247. test_f1 = f1_score(y_test, y_test_pred)
  248. # Determine fitting status
  249. acc_gap = train_accuracy - test_accuracy
  250. recall_gap = train_recall - test_recall
  251. if train_accuracy > 0.9 and (acc_gap > 0.1 or recall_gap > 0.1):
  252. fit_status = "Overfit"
  253. elif train_accuracy < 0.7 and test_accuracy < 0.7:
  254. fit_status = "Underfit"
  255. else:
  256. fit_status = "Ideally Fit"
  257. results.append({
  258. 'Model': name,
  259. 'Train Accuracy': train_accuracy,
  260. 'Test Accuracy': test_accuracy,
  261. 'Train Recall': train_recall,
  262. 'Test Recall': test_recall,
  263. 'Train F1': train_f1,
  264. 'Test F1': test_f1,
  265. 'Fit Status': fit_status,
  266. 'Size (KB)': estimate_size(model, name),
  267. 'Speed (ms)': estimate_speed(model, name),
  268. 'Params': count_parameters(model, name)
  269. })
  270. return pd.DataFrame(results)
  271. def estimate_size(model, model_type):
  272. if model_type == 'RF':
  273. return round((50 * (2**7) * 4) / 1024, 1)
  274. elif model_type == 'SVM':
  275. return round((model.coef_.size * 4) / 1024, 1)
  276. return round((model.count_params() * 4) / 1024, 1)
  277. def estimate_speed(model, model_type):
  278. return {'RF': 10, 'SVM': 5, 'NN': 20}[model_type]
  279. def count_parameters(model, model_type):
  280. if model_type == 'RF':
  281. return model.n_estimators * (2**model.max_depth)
  282. elif model_type == 'SVM':
  283. return model.coef_.size
  284. return model.count_params()
  285. results_df = evaluate_models(models, X_train, y_train, X_test, y_test)
  286. # Visualize Training vs. Testing Performance
  287. plt.figure(figsize=(12, 6))
  288. results_melted = results_df.melt(id_vars='Model', value_vars=['Train Recall', 'Test Recall', 'Train F1', 'Test F1', 'Train Accuracy', 'Test Accuracy'],
  289. var_name='Metric', value_name='Score')
  290. sns.barplot(x='Model', y='Score', hue='Metric', data=results_melted)
  291. plt.title('Training vs. Testing Performance Comparison')
  292. plt.ylabel('Score')
  293. plt.ylim(0, 1)
  294. plt.legend(bbox_to_anchor=(1.05, 1), loc='upper left')
  295. plt.tight_layout()
  296. plt.show()
  297. # Visualize Testing Performance Only
  298. plt.figure(figsize=(10, 6))
  299. results_melted_test = results_df.melt(id_vars='Model', value_vars=['Test Recall', 'Test F1', 'Test Accuracy'],
  300. var_name='Metric', value_name='Score')
  301. sns.barplot(x='Model', y='Score', hue='Metric', data=results_melted_test)
  302. plt.title('Testing Performance Comparison')
  303. plt.ylabel('Score')
  304. plt.ylim(0, 1)
  305. plt.show()
  306. # Visualize Ideally Fit Models
  307. plt.figure(figsize=(10, 6))
  308. ideal_df = results_df[results_df['Fit Status'] == 'Ideally Fit']
  309. if not ideal_df.empty:
  310. ideal_melted = ideal_df.melt(id_vars='Model', value_vars=['Test Recall', 'Test F1', 'Test Accuracy'],
  311. var_name='Metric', value_name='Score')
  312. sns.barplot(x='Model', y='Score', hue='Metric', data=ideal_melted)
  313. plt.title('Ideally Fit Models: Test Performance')
  314. plt.ylabel('Score')
  315. plt.ylim(0, 1)
  316. else:
  317. plt.text(0.5, 0.5, 'No Ideally Fit Models Found',
  318. horizontalalignment='center', verticalalignment='center', fontsize=12)
  319. plt.title('Ideally Fit Models: Test Performance')
  320. plt.gca().set_xticks([])
  321. plt.gca().set_yticks([])
  322. plt.tight_layout()
  323. plt.show()
  324. print("\n📊 Model Comparison:")
  325. print(results_df[['Model', 'Train Accuracy', 'Test Accuracy', 'Train Recall', 'Test Recall', 'Train F1', 'Test F1', 'Fit Status', 'Size (KB)', 'Speed (ms)']])
  326. # %% [markdown]
  327. # ## **Step 5: Model Selection**
  328. #
  329. # Selects the best model based on test recall, F1 score, fitting status, and hardware constraints.
  330. #
  331. # **Criteria**
  332. #
  333. # * Primary: High recall
  334. # * Secondary: Test F1 score, test accuracy, ideally fit status.
  335. # * Hardware: Size, speed, RAM usage (Raspberry Pi 3 Model B has ~1GB RAM, 1.2 GHz quad-core CPU).
  336. # %%
  337. print("=" * 50)
  338. print("🔍 Step 5: Model Selection")
  339. print("=" * 50)
  340. # Select model with highest test recall, preferring ideally fit models
  341. best_model = results_df.loc[results_df['Test Recall'].idxmax()]
  342. print(f"✅ Best model: {best_model['Model']}")
  343. print(f"- Test Recall: {best_model['Test Recall']:.3f}")
  344. print(f"- Test F1 Score: {best_model['Test F1']:.3f}")
  345. print(f"- Fit Status: {best_model['Fit Status']}")
  346. print(f"- Size: {best_model['Size (KB)']} KB")
  347. print(f"- Speed: {best_model['Speed (ms)']} ms")
  348. # %% [markdown]
  349. # ## **Step 6: Raspberry Pi Deployment**
  350. #
  351. # Exports the selected model (named by model type, e.g., random_forest.pkl) and configurations to a single Google Drive folder (/content/drive/MyDrive/SeizureDetection_Models/). The Raspberry Pi runs a Python script to load the model, interface with sensors (e.g., via I2C/SPI), and send alerts.
  352. #
  353. # ### **Deployment Steps**
  354. #
  355. # 1. Create a Google Drive folder for output files.
  356. #
  357. #
  358. #
  359. # 2. Save the model (e.g., random_forest.pkl, svm.pkl, or neural_network.h5), scaler, and configurations in the folder.
  360. #
  361. #
  362. #
  363. # 3. Generate a Python script for Raspberry Pi, referencing the model file.
  364. #
  365. # 4. Provide instructions for setting up the Raspberry Pi environment.
  366. # %%
  367. print("=" * 50)
  368. print("🚀 Step 6: Raspberry Pi Deployment")
  369. print("=" * 50)
  370. # Define output folder locally
  371. output_folder = '/content/SeizureDetection_Models/'
  372. try:
  373. os.makedirs(output_folder, exist_ok=True)
  374. print(f"✅ Output folder created/verified: {output_folder}")
  375. except Exception as e:
  376. print(f"❌ Error creating output folder: {e}")
  377. exit()
  378. # Save Model and Scaler
  379. try:
  380. best_model_name = best_model['Model']
  381. model = models[best_model_name]
  382. # Map model names to file names
  383. model_file_map = {
  384. 'RF': 'random_forest.pkl',
  385. 'SVM': 'svm.pkl',
  386. 'NN': 'neural_network.h5'
  387. }
  388. model_file = model_file_map[best_model_name]
  389. model_file_path = os.path.join(output_folder, model_file)
  390. scaler_file_path = os.path.join(output_folder, 'scaler.pkl')
  391. if best_model_name == 'NN':
  392. model.save(model_file_path)
  393. else:
  394. joblib.dump(model, model_file_path)
  395. joblib.dump(scaler, scaler_file_path)
  396. print(f"✅ Model saved as {model_file_path}")
  397. print(f"✅ Scaler saved as {scaler_file_path}")
  398. except Exception as e:
  399. print(f"❌ Error saving model or scaler: {e}")
  400. exit()
  401. # Save Preprocessing Configuration
  402. try:
  403. preprocessing_config = {
  404. 'sensor_columns': sensor_cols,
  405. 'scaler_params': {
  406. 'min': scaler.data_min_.tolist(),
  407. 'max': scaler.data_max_.tolist()
  408. }
  409. }
  410. preprocessing_file_path = os.path.join(output_folder, 'preprocessing.json')
  411. with open(preprocessing_file_path, 'w') as f:
  412. json.dump(preprocessing_config, f)
  413. print(f"✅ Preprocessing configuration saved: {preprocessing_file_path}")
  414. except Exception as e:
  415. print(f"❌ Error saving preprocessing configuration: {e}")
  416. exit()
  417. # Generate Raspberry Pi Script
  418. pi_script = f"""
  419. import numpy as np
  420. {'import tensorflow as tf' if best_model_name == 'NN' else 'import joblib'}
  421. import json
  422. # Load model and scaler
  423. model = {'tf.keras.models.load_model("' + model_file + '")' if best_model_name == 'NN' else 'joblib.load("' + model_file + '")'}
  424. scaler = joblib.load("scaler.pkl")
  425. # Load preprocessing configuration
  426. with open('preprocessing.json', 'r') as f:
  427. config = json.load(f)
  428. sensor_cols = config['sensor_columns']
  429. # Simulated sensor data reading (replace with actual sensor code, e.g., I2C/SPI)
  430. def read_sensor_data():
  431. # Example: Read from accelerometer, gyroscope, heart rate sensor
  432. # Use libraries like smbus2 or spidev for I2C/SPI communication
  433. return np.random.rand({len(sensor_cols)}) # Replace with real sensor data
  434. # Inference loop
  435. while True:
  436. data = read_sensor_data()
  437. data_scaled = scaler.transform([data])
  438. prediction = model.predict(data_scaled)
  439. prediction = (prediction > 0.5).astype(int) if '{best_model_name}' == 'NN' else prediction
  440. if prediction[0] == 1:
  441. print("⚠️ Seizure detected! Sending alert...")
  442. # Add code for SMS/email alert (e.g., using smtplib or Twilio API)
  443. else:
  444. print("✔ Normal activity")
  445. # Adjust sleep time based on sensor sampling rate
  446. import time
  447. time.sleep(0.1)
  448. """
  449. # Save script
  450. try:
  451. script_file_path = os.path.join(output_folder, 'seizure_detection_pi.py')
  452. with open(script_file_path, 'w') as f:
  453. f.write(pi_script)
  454. print(f"✅ Raspberry Pi script generated: {script_file_path}")
  455. except Exception as e:
  456. print(f"❌ Error saving script: {e}")
  457. exit()
  458. # %% [markdown]
  459. # ## **Deployment Instructions**
  460. #
  461. # 1. **Locate Files**: Find the model file (random_forest.pkl, svm.pkl, or neural_network.h5), scaler.pkl, preprocessing.json, and seizure_detection_pi.py in the Google Drive folder /content/drive/MyDrive/SeizureDetection_Models/. Copy these files to your Raspberry Pi 3 Model B (e.g., via SCP, USB, or downloading from Google Drive).
  462. #
  463. #
  464. # 2. **Include Libraries**:
  465. #
  466. # * Random Forest: Requires joblib (included in scikit-learn)
  467. #
  468. # * SVM: Requires joblib (included in scikit-learn).
  469. # * Neural Network: Requires tensorflow.
  470. # * Install on Raspberry Pi:
  471. # $ pip3 install numpy scikit-learn tensorflow joblib
  472. # 3. **Implement Preprocessing**: Use preprocessing.json to configure sensor data scaling in the Raspberry Pi script.
  473. #
  474. # 4. **Test**: Validate the script with sample sensor data before production deployment.
  475. #
  476. # ### **Notes**
  477. #
  478. # * Verify file paths in the Raspberry Pi script (seizure_detection_pi.py). Ensure random_forest.pkl, svm.pkl, or neural_network.h5, scaler.pkl, and preprocessing.json are in the same directory as the script on the Raspberry Pi.
  479. #
  480. #
  481. #
  482. # * Monitor memory usage during inference (Raspberry Pi 3 Model B has ~1GB RAM).
  483. #
  484. #
  485. #
  486. # * Periodically validate model performance with real-world data.
  487. #
  488. # * In Colab, files in /content/SeizureDetection_Models/ are temporary and will be deleted after the session ends. Download them promptly.
  489. #
  490. # ### **Visualizations Displayed**
  491. #
  492. #
  493. #
  494. #
  495. #
  496. # * **Class Distribution:** Original vs. undersampled classes.
  497. #
  498. #
  499. #
  500. # * **Train/Test Split:** Full dataset, training, and test sets
  501. #
  502. #
  503. # * **Model Performance:** Training vs. testing recall, F1, accuracy comparison; testing performance comparison; ideally fit models’ test performance (or a message if none are ideally fit).

Real_Time_Seizure_Detection_and_Alert_System.ipynb at commit 9ac52ea, no license · at the source

Overview

Authors: Tsion Fekadu1, Kidist Dagnachew1, Abdi Bekele1
ORCID iDs: Tsion Fekadu
  1. Department of Computer Engineering, Dilla University,Dilla, Ethiopia
Institutions: Dilla University (Ethiopia)
Journal: BMC biomedical engineering, volume 8, issue 1, article 13
Dates: received 10 August 2025; accepted 18 June 2026; published online 3 July 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1186/s42490-026-00116-9 · PMID 42400041 · PMCID PMC13332600 · OpenAlex W7167278261
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: other (modality), epilepsy (population)
Methods: Connectivity, Machine learning, Statistics, Physiology & signal measures
Keywords: Edge AI, Seizure detection, Wearable technology, Real-time monitoring, Geolocated alerting
Topic: EEG and Brain-Computer Interfaces (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Citations: not cited yet (Europe PMC); 34 references in the paper

Abstract

The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.

Repository

Its files are read in the Code ↔ Paper reader above, with 3 matches between paragraphs and lines of code.

abdibbey/Real_Time_Seizure_Detection_and_Alert_System

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 9ac52ea359e553a7c68ab9581838797c901847c3, 30 June 2025
Languages: Jupyter (1)
Size: 2 files, 1 script
Software Heritage: not archived
Found in: “Data availability”
Holds: README, 1 notebook
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: imbalanced-learn (1 file), Keras (1 file), Matplotlib (1 file), NumPy (1 file), pandas (1 file), scikit-learn (1 file), seaborn (1 file), TensorFlow (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
2 files

The paper's code and data availability statement is in the Data section.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 1 script, each with its path and the digest of its content;
  • 3 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

No dataset and no data link were found in the paper.

Code and data availability statement

The paper has a code and data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:

Read it in the paper: doi.org/10.1186/s42490-026-00116-9.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 2, 28 September 2026

  • Funding: added Dilla University

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 3 authors, 5 keywords, 27 references.

Cite

This paper

Fekadu, T., Dagnachew, K., & Bekele, A. (2026). An edge-AI enabled wearable platform for real-time epileptic seizure detection with geolocated alerting. BMC biomedical engineering, 8(1), 13. https://doi.org/10.1186/s42490-026-00116-9

BibTeX

@article{fekadu2026edge,
author = {Fekadu, Tsion and Dagnachew, Kidist and Bekele, Abdi},
title = {{An edge-AI enabled wearable platform for real-time epileptic seizure detection with geolocated alerting}},
journal = {BMC biomedical engineering},
year = {2026},
month = jul,
volume = {8},
number = {1},
pages = {13},
publisher = {BMC},
issn = {2524-4426},
doi = {10.1186/s42490-026-00116-9},
url = {https://doi.org/10.1186/s42490-026-00116-9},
pmid = {42400041},
pmcid = {PMC13332600}
}

RIS

TY - JOUR
AU - Fekadu, Tsion
AU - Dagnachew, Kidist
AU - Bekele, Abdi
TI - An edge-AI enabled wearable platform for real-time epileptic seizure detection with geolocated alerting
T2 - BMC biomedical engineering
J2 - BMC Biomed Eng
PY - 2026
DA - 2026/07/03
VL - 8
IS - 1
SP - 13
SN - 2524-4426
PB - BMC
DO - 10.1186/s42490-026-00116-9
UR - https://doi.org/10.1186/s42490-026-00116-9
LA - en
ER -

CSL-JSON

{
"id": "10.1186/s42490-026-00116-9",
"type": "article-journal",
"title": "An edge-AI enabled wearable platform for real-time epileptic seizure detection with geolocated alerting",
"container-title": "BMC biomedical engineering",
"author": [
{
"family": "Fekadu",
"given": "Tsion"
},
{
"family": "Dagnachew",
"given": "Kidist"
},
{
"family": "Bekele",
"given": "Abdi"
}
],
"container-title-short": "BMC Biomed Eng",
"volume": "8",
"issue": "1",
"page": "13",
"DOI": "10.1186/s42490-026-00116-9",
"PMID": "42400041",
"PMCID": "PMC13332600",
"ISSN": "2524-4426",
"publisher": "BMC",
"URL": "https://doi.org/10.1186/s42490-026-00116-9",
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
3
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1038/s42003-026-10957-8 [code]
Brain defence by the extracellular matrix protein Cochlin.
Journal: Communications biology
In common: imbalanced-learn, Keras, TensorFlow, 5 other tools
[2] doi:10.3390/s26175327 [code]
Subject Identity Confounds qEEG Emotion Recognition on DEAP and DREAMER.
Journal: Sensors (Basel, Switzerland)
In common: imbalanced-learn, Keras, TensorFlow, 5 other tools
[3] doi:10.1038/s41598-026-55163-y [code]
Autism spectrum disorder identification using machine learning models on MRI data.
Journal: Scientific reports
In common: imbalanced-learn, Keras, TensorFlow, 5 other tools
[4] doi:10.1038/s41398-026-04081-8 [code]
Functional system-specific brain aging across the Alzheimer's disease continuum.
Journal: Translational psychiatry
In common: imbalanced-learn, Keras, TensorFlow, 5 other tools
[5] doi:10.1038/s41598-026-52330-z [code]
SHAP analysis of an improved EEG-based mental workload classification framework: utilizing data augmentation and explainable AI.
Journal: Scientific reports
In common: imbalanced-learn, Keras, TensorFlow, 4 other tools
[6] doi:10.1002/ana.78203 [code]
AI-Driven Mapping of Seizure Spread Patterns.
Journal: Annals of neurology
In common: Keras, TensorFlow, seaborn, 4 other tools, epilepsy
[7] doi:10.1093/sleepadvances/zpag051 [code]
What matters beyond model choice for wearable sleep staging? How personalization, evaluation choices, and easy-to-classify wake impact performance.
Journal: Sleep advances : a journal of the Sleep Research Society
In common: Keras, TensorFlow, seaborn, 4 other tools, other
[8] doi:10.1371/journal.pone.0347867 [code]
LiteFeatNet: A parameter-efficient and performance-centric deep learning model for multi-ocular disease identification using intermediate feature reduction from fundus images.
Journal: PloS one
In common: Keras, TensorFlow, seaborn, 4 other tools, other
[9] doi:10.64898/2026.05.06.26352540 [code]
Generating synthetic tau-PET scans in Alzheimer’s disease from MRI, blood biomarkers and demographics with deep learning
Journal: medRxiv (preprint)
In common: Keras, TensorFlow, seaborn, 4 other tools, other
[10] doi:10.1038/s41598-026-42310-8 [code]
Sleep awake detection from leg-worn wearables using deep sensor fusion.
Journal: Scientific reports
In common: Keras, TensorFlow, seaborn, 4 other tools, other

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.