# Advanced Methodology for Fraud Detection in Energy Using Machine Learning Algorithms
## 4 The Proposed System's Goals, Approach, and Architecture  
Given the above context, where unauthorized consumption has been identified in the Iasi area, we build upon these findings to conduct an extensive analysis using advanced techniques, such as data mining, anomaly detection, data fusion, exploratory data analysis, time series analysis, and scoring models. To begin with, the three identified cases of unauthorized electricity use are insufficient for creating a comprehensive fraud profile. Therefore, we expanded our dataset to include 1872 cases of electricity fraud detected in Iasi County between 2017 and 2023. The main goal of the machine learning models is to determine whether an energy consumer is involved in fraudulent activities by analyzing historical consumption data. Trained on past fraud cases, these models identify unusual patterns that may indicate fraudulent behavior. They detect abrupt increases or decreases in electricity usage that deviate from normal consumption trends. Additionally, billing irregularities, such as significantly lower charges compared to similar households, act as key warning signs. Furthermore, inconsistencies across utilities--where fluctuations in electricity and gas consumption suggest potential meter tampering--aid in pinpointing suspicious activities. To ensure model reliability and prevent overfitting, the dataset was divided into three subsets. Seventy percent of the data (26,950 records) was allocated for training, enabling the models to learn fraud patterns effectively. Fifteen percent (5775 records) was used for validation, allowing for parameter fine-tuning and hyperparameter optimization. The remaining fifteen percent (5775 records) was set aside for testing, ensuring that the models could generalize well to unseen data. By learning from historical fraud cases, the models identified key anomalies indicative of fraudulent activity. These include sudden drops or spikes in electricity consumption that deviate from past usage trends, billing anomalies where charges remain unusually low compared to similar households, and cross-utility inconsistencies where fluctuations in electricity and gas usage suggest possible meter tampering. The models were evaluated using standard performance metrics, including accuracy, precision, recall, F1-score, and ROC-AUC, to assess their effectiveness in identifying fraudulent activity. This broader dataset revealed a consistent fraud pattern involving the tampering with or removal of metrological seals, a tool made to protect electric meters and stop illegal entry or tampering with readings. This fraudulent behavior is a critical factor in energy theft, directly affecting the recorded consumption. By analyzing these cases, we aimed to refine our fraud-detection techniques and develop more robust methodologies to detect similar behaviors in future datasets. Table 2 lists the traits that fraudulent consumers have in common. The most important factor found is a billing amount under EUR 25, which frequently indicates possible theft. The meter index is another crucial indicator of fraud when it displays differences from predicted usage. However, we acknowledge that such low billing amounts may also occur in abandoned properties, vacation homes, or rarely used facilities. To reduce false positives, the fraud detection model incorporates additional contextual factors, including prior billing history, property status, and irregular usage patterns, to distinguish between genuine non-usage and potential energy theft. Along with the fraudulent instances, we also examine the consumption habits of 1872 lasi County clients who are not fraudulent. For comparison analysis, their consumption statistics from 2018 to 2023 are examined. In order to differentiate between normal and atypical consumption patterns, this time frame guarantees that we capture fluctuations influenced by seasonal and economic factors. Histogram of Billing Amounts: The histogram displays the billing amount distribution for both fraudulent and non-fraudulent consumers.