DOI: 10.5281/zenodo.17576388
title: SustainSafe: Proactive Safety Risk Assessment Framework

description: DescriptionThe Proactive Safety Risk Model is a modular and extensible framework designed for early detection of safety risks in industrial, organizational, and operational environments. The system supports both tabular and temporal data, enabling the prediction of incidents or risk escalation before they occur. It aims to provide organizations with a lightweight but practical baseline for building proactive safety intelligence pipelines using machine learning and deep learning methods.

This repository contains the full training pipeline, dataset utilities, model implementation, and inference scripts. It is suitable for research, prototyping, and integration into internal analytics workflows. Users may adapt the components to specific datasets, operational constraints, or regulatory standards.

Dataset InformationThis repository does not ship datasets directly but includes a dataset interface compatible with CSV files. The system is designed for datasets containing workplace incidents, proactive risk indicators, monitoring data, or early warning system logs. Typical data sources include:

Workplace safety incident recordsSurveillance or monitoring system signalsProactive inspection metricsHuman factors and organizational behavior indicatorsEquipment health and environmental dataTime-series logs relevant to sustained safety performanceUsers must provide a CSV file with numeric features and one supervised target column. The dataset module supports:

Single-step classificationTemporal windows for sequential modelingAutomatic normalizationFeature extraction and labelingThe dataset class references several publicly available safety-related datasets which may serve as inspiration, including workplace safety statistics, proactive risk monitoring datasets, sustainable safety practice datasets, and early warning system performance datasets.

Code InformationThe repository is structured into independent modules to ensure clarity and extensibility.

model.pyContains neural network implementations for proactive risk modeling. Supports both simple feed-forward models and temporal GRU-based models.

dataset.pyDefines the SafetyRiskDataset class which loads CSV data, extracts feature vectors, constructs sequences, and performs normalization.

train.pyRuns training and validation loops. Handles logging, optimization, checkpoint saving, and configuration management.

inference.pyLoads a trained model checkpoint and runs inference on new CSV data. Produces predicted labels and probabilities.

utils.pyUtility helpers for metrics, seeding, logging, device configuration, checkpointing, and reproducibility.

Usage InstructionsPreparing the datasetUsers should prepare a CSV file with the following fields:

One supervised target column (default name: label)All other columns representing input featuresOptional temporal ordering if sequential analysis is requiredMissing values should be filled or preprocessed before training.

Training the modelRun the training script with required arguments:

python train.py --train_csv path/to/train.csv --val_csv path/to/val.csv --label_column label --batch_size 64 --max_epochs 50 --output_dir outputs/experiment

Validation metrics such as accuracy, precision, recall, and F1 score will be logged throughout the training process. The best model checkpoint is automatically saved.

Running inferenceUse the inference script to apply a trained model to new data:

python inference.py --checkpoint outputs/experiment/best_model.pt --data_csv path/to/test.csv --output_csv path/to/results.csv

The output file will contain predicted labels and confidence scores.

RequirementsThe main dependencies include:

Python 3.8 or abovePyTorch 1.12 or laterNumPyPandasSciPy (optional)scikit-learnCUDA (optional for GPU acceleration)

Install dependencies using pip:

pip install torch pandas numpy scikit-learn

MethodologyThe general methodology behind this repository follows the principles of proactive safety risk assessment and early warning in complex environments.

Data ingestionRaw incident and monitoring data are cleaned, normalized, and transformed into model-ready tensors. For temporal prediction, sliding windows are constructed to model risk evolution over time.

Model constructionTwo families of models are supported:Feed-forward neural networks for independent observationsRecurrent neural networks (GRU-based) for sequential risk dynamicsUsers may extend the model file to integrate transformers, attention modules, or graph-based risk modeling.

Training and optimizationCross-entropy loss is used for classification tasks.AdamW optimizer handles the parameter updates.Early stopping is recommended to mitigate overfitting risks.Weighted sampling or cost-sensitive losses may be used if incidents are rare.

EvaluationAccuracy, precision, recall, and F1 score are computed per epoch.Probabilistic outputs may be used to rank high-risk samples.Users may integrate AUROC, PR AUC, or calibration metrics.

Deployment or integrationInference outputs can feed into dashboards, automated alerts, or decision-support systems.Predictions should always be reviewed by safety experts before operational deployment.

CitationsIf this project is used in academic research, please reference the underlying safety risk literature and any external datasets you adopt. Example citations include topics such as proactive safety management, early warning systems, latent risk modeling, and sustainable safety practices.

Example references (adapt as needed):

Studies on proactive risk assessment and early warning modelingResearch on safety incident prediction using machine learningNeural network architectures for time-series risk forecastingDatasets describing workplace safety incidents or monitoring environments

LicenseThis repository is intended for research and educational use. Users may modify and redistribute the code based on their own licensing requirements. Add a license file (for example MIT, Apache 2.0, or GPL) if you plan to publish or share the repository.

Contribution GuidelinesContributions are welcome. Suggested ways to contribute include:

Improving model architectures or introducing transformer-based modelsAdding new dataset loaders or preprocessing utilitiesEnhancing metrics, calibration tools, or explainability modulesProviding real-world examples, notebooks, or pipelinesSubmitting documentation improvements

Before submitting contributions, ensure the code adheres to consistent formatting, includes comments, and passes basic tests.

DisclaimerThis project is not a certified safety system and should not be used directly in operational safety-critical environments without expert review and testing. Organizations must verify the validity, reliability, and suitability of any predictive system before using it in decision-making.