# Advanced Methodology for Fraud Detection in Energy Using Machine Learning Algorithms
## 3 Research Method
Typically, electricity and gas consumption patterns are correlated, but discrepancies--such as low gas usage alongside high electricity consumption--raised suspicions of meter bypassing or alternative energy sources being used to conceal fraudulent activities. Following preprocessing and EDA, multiple machine learning algorithms were implemented to enhance fraud detection accuracy. k-nearest neighbors (kNN) was effective in identifying patterns resembling past fraud cases, while decision trees provided an interpretable classification model. Random forest reduced overfitting and improved classification accuracy, while artificial neural networks (ANNs) captured complex consumption behaviors. A hybrid model combining random forest, ANNs, and the fraud scoring model achieved the highest fraud detection accuracy of 94.2%. Before deploying machine learning models, an extensive exploratory data analysis (EDA) was conducted to uncover patterns, trends, and potential fraud indicators within the dataset. The following methods were utilized. To improve fraud detection accuracy, various machine learning models were implemented, each contributing distinct strengths to the classification process. k-nearest neighbors (kNN) was utilized for its ability to detect fraud based on historical consumption patterns. The algorithm categorized customers by assessing their similarity to previously identified fraudulent users, with different distance metrics, such as Euclidean and Manhattan distances, tested to determine the optimal approach. A decision tree model provided an interpretable framework for fraud classification, identifying key decision points based on customer behavior and energy consumption. This model facilitated a better understanding of fraud-related factors, making it easier to develop rule-based fraud detection mechanisms. To enhance classification accuracy and mitigate overfitting, a random forest model was employed. By leveraging an ensemble of decision trees, this approach increasedrobustness and generalization. Feature importance analysis highlighted critical fraud indicators, including sudden drops in consumption and irregular billing patterns. Artificial neural networks (ANNs) were implemented to capture complex consumption patterns. The ANN model incorporated multiple hidden layers to learn non-linear relationships between energy usage, customer behavior, and fraud likelihood. Hyperparameter tuning was conducted to optimize the number of layers, activation functions, and learning rates. A hybrid model integrating random forest, ANN, and a fraud scoring system achieved the highest fraud detection accuracy of 94.2%. This ensemble approach combined domain knowledge with machine learning capabilities, ensuring high predictive accuracy and adaptability to evolving fraud patterns. The preprocessing steps, EDA techniques, and machine learning models collectively enhanced fraud detection accuracy and provided a systematic approach for identifying fraudulent activities in energy consumption. The hybrid model proved to be the most effective, achieving a fraud detection rate of 94.2%, making it a viable solution for real-world fraud-detection applications in the energy sector. The dataset was split into training (70%), validation (15%), and testing (15%) subsets to ensure model generalization. Performance metrics included accuracy, precision, recall, F1-score, and ROC-AUC. To validate model predictions, field inspections were conducted by DELGAZ GRID, involving five specialized teams over three weeks. These inspections prioritized cases with high fraud probability based on machine learning predictions. Key fraud indicators were identified to detect suspicious activities related to energy consumption. Sudden drops in electricity usage, despite no reported outages, raised concerns about potential fraud or meter tampering. Irregular billing patterns, such as unexpected fluctuations in charges, indicated possible manipulation or unauthorized consumption.