1. Introduction
With the continuous expansion of household and industrial and commercial distributed photovoltaic (PV) scale, the issues of inadequate operation and maintenance support systems and equipment health management capabilities for PV power stations have become increasingly prominent, significantly constraining the operational efficiency of PV systems throughout their entire lifecycle and the safety of grid integration [
1,
2,
3,
4]. Approximately 50–55% of the distributed PV market is independently operated and maintained by property owners, commonly seen in household distributed PV, relying on simple cleaning and fault reporting by users, with relatively weak technical maintenance capabilities [
5,
6,
7]. Some users, without reporting installation, privately increase their grid-connected capacity to boost their own power generation in order to fraudulently obtain national subsidies, potentially leading to transformer power exceeding limits in the substation area and affecting distribution safety. Therefore, proposing a method to detect abnormal users who fraudulently increase their capacity based on PV metering data holds significant practical importance.
Unlike distributed photovoltaic electricity theft, which merely increases the amount of on-grid electricity through meter tampering, unauthorized capacity expansion will increase the injection power of photovoltaics into the grid system, potentially causing local voltage to exceed the stable range and affecting system safety. Given the current scarcity of research related to unauthorized photovoltaic capacity expansion, it may be considered necessary to refer to methods related to photovoltaic electricity theft detection to detect anomalies in photovoltaic capacity expansion. Ref. [
8] calculates the user line loss contribution factor based on multidimensional sequences (electricity quantity, voltage) and combines Monte Carlo simulation and OPTICS clustering to locate electricity theft users. However, the DC side metering is not connected to the acquisition system, making data acquisition difficult. This method faces significant challenges in practical applications. Ref. [
9] proposes identifying anomalies by analyzing the data deviation between the gateway meter (which records the electricity drawn from the grid by users) and the photovoltaic meter (which records the photovoltaic power generation), but this method is affected by the AC load on the user side, reducing the accuracy of identification.
Photovoltaic power generation is significantly influenced by weather conditions and is closely related to factors such as irradiance, temperature, wind speed, and humidity [
10,
11]. With the advancement of deep learning technology, researchers have begun to utilize historical meteorological data to estimate actual power generation through BP neural networks [
12]. Another study has developed a photovoltaic prediction model based on the “XGBoost + new features” method [
13], which is used to identify users’ electricity theft behavior and its severity based on relevant parameters.
Currently, distributed photovoltaic (PV) stations are commonly equipped with sensors and monitoring and data acquisition systems that can store PV system operation data. Based on this system data, a series of PV anomaly detection methods have been derived. Ref. [
14] selects sunny days as the detection scenario to reduce the interference of weather factors. It uses a Gated Recurrent Unit (GRU)–Bayesian neural network to train and obtain the normal PV power range for subsequent detection. Refs. [
15,
16] propose a clear sky day filtering mechanism, selecting output curves from different clear sky days of the power station under test for longitudinal comparison to eliminate various interference factors in anomaly detection. The interference-free output data is then input into a neural network model to fit the normal PV output range. Based on this normal output range, faulty distributed PV power stations can be identified. Ref. [
17] conducts infrared thermal imaging detection on multiple operational PV power stations and summarizes the typical characteristics and causes of common faults in PV power stations based on the infrared thermal imaging detection results. Ref. [
18] decomposes the active power time series data of PV generation into three components using seasonal decomposition, constructs a Bayesian model to obtain the regional PV output, and calculates the earth mover distance between the actual value and the regression value for detecting abnormal states. The aforementioned studies have achieved relatively accurate anomaly detection for PV systems. However, a single perception model or method is inefficient in batch processing of DPV clusters and lacks sufficient practical engineering value. Meteorological factors such as irradiation intensity in PV generation directly and significantly affect the level of PV power. When the influence of terrain and topography is not considered, such meteorological characteristics exhibit significant similarity in adjacent spaces [
19,
20].
In recent years, extreme learning machines (ELMs) have found applications in the field of photovoltaic (PV) forecasting due to their advantages such as high learning efficiency and good generalization performance. For instance, some studies have incorporated the seasonal characteristics of PV power generation [
21] to construct a prediction model based on ELMs; other studies have investigated the impact of numerical weather prediction (NWP) errors on PV forecasting [
22] and proposed a method to correctly predict errors using ELMs. However, the random generation of hidden layer weights and biases in ELMs leads to inconsistency in prediction results [
23,
24]. Additionally, current grid metering and data collection systems typically only record limited data such as PV power generation and on-grid electricity, and the process of obtaining regional meteorological data is complex. Coupled with the inherent randomness of prediction models, these factors limit the applicability of predictive methods in detecting PV capacity expansion [
25].
Considering the practical issues of limited photovoltaic (PV) metering data and the insufficient accuracy of current prediction models [
26,
27,
28], this paper proposes a PV anomaly detection model based on a hybrid optimization of gray wolf–particle swarm optimization for robust extreme learning machines. Firstly, cosine similarity and dynamic time warping are employed to preprocess the input historical PV power generation data, reducing the impact of regional meteorological differences on the subsequent detection model. Then, by balancing the global search capability of the gray wolf algorithm and the rapid convergence characteristics of the particle swarm optimization, the robust extreme learning machine is hybridly optimized to establish a PV power plant prediction fitting model. Compared with other algorithm models, the effectiveness of the proposed method is highlighted. By comparing the actual power generation with the model’s predicted output, the illegal capacity expansion index K is calculated. Based on the collaborative analysis of the K value and feature mutation time points, dynamic diagnosis of the intensity and implementation stage of illegal capacity expansion for PV users is achieved. An empirical analysis model is constructed, and simulation verification is conducted using a power generation time series dataset from real operating scenarios to validate the effectiveness and accuracy of the proposed method.
2. Data Preprocessing
2.1. Data Cleaning
The measurement data of distributed photovoltaics often exhibits phenomena such as missing values. Therefore, preprocessing of the raw data is necessary before analysis. The primary method employed is data cleaning, which aims to ensure the quality and reliability of photovoltaic power generation data [
29]. During the data cleaning process, we typically remove duplicate data, missing data, and outliers to ensure the accuracy and integrity of the data. For duplicate data, we can choose to retain the data that appears first or perform data merging or averaging; missing data may affect the results of data analysis and modeling, and methods such as interpolation can be considered to estimate the missing values; to avoid the impact of outliers on data analysis and model establishment, they are directly deleted.
2.2. Meteorological Consistency Screening
In the implementation process of promoting photovoltaic policies across the entire county, distributed photovoltaic systems exhibit an overall distribution characteristic of numerous points and a wide area. Photovoltaic stations within the same region exhibit similar power generation characteristics on the same day; thus, it is possible to consider utilizing reference power stations within the region for analysis. The status of the reference power station is related to the final detection results and can be evaluated from aspects such as power station operation management, equipment operation status, and credit rating.
Variations in weather conditions within the same region can occur. To mitigate the impact of such variations, the similarity of photovoltaic power generation in the same area can be utilized for preprocessing power data. In this paper, we employ cosine similarity combined with dynamic time warping (DTW) to process photovoltaic data, aiming to enhance the accuracy of identifying output similarity among photovoltaic power stations. The mathematical expression for cosine similarity (COS) is as follows:
In the formula, Zu represents the daily power generation data of the reference power station; Wu represents the daily power generation data of the photovoltaic site to be tested; and m represents the number of times the power point is collected daily. The closer the value of cosine similarity is to 1, the more similar the two sets of data are in terms of the changing trend of curve shape.
In the photovoltaic scenario, dynamic time warping addresses the nonlinear shift in the time axis caused by cloud movement by finding the globally optimal alignment scheme, reducing the impact of transitional weather on the identification of station correlation. The core recursive formula for the cumulative distance matrix in dynamic time warping is:
represents the minimum alignment cost from the starting point to (i,j); represents the power difference between the reference power station at time i and the power station to be tested at time j; and represents the minimum cumulative cost path selected in dynamic programming to reach the current position.
The steps to reduce the impact of meteorological factors by using cosine similarity combined with dynamic time warping are as follows:
Step 1: Obtain the daily normalized photovoltaic output sequence for the target power station and the daily normalized photovoltaic output sequence for the reference power station. Regarding the issue of missing and anomalous data during data collection, the current solution is to remove the corresponding segment of the output sequence.
Step 2: Calculate the daily cosine similarity coefficient using the cosine similarity formula and analyze the obtained coefficients. If the coefficient is greater than a threshold , there is considered to be meteorological consistency between the stations on that day; otherwise, the meteorological difference between the stations is considered to be significant and fails to meet the requirement of meteorological consistency. In this paper, the threshold is set to 0.9. The cosine similarity is used to perform a preliminary screening of data samples, quickly excluding clearly dissimilar stations.
Step 3: Calculate the minimum path distance between each power station that passed the preliminary screening in Step 2 and the reference power station, and set a reference threshold . In this paper, considering the impact of load fluctuations, this threshold is set to 1. When the minimum path distance between a power station and the reference power station is less than or equal to the reference threshold , there is considered to be meteorological consistency between the stations; otherwise, the meteorological difference between the stations is considered to be significant, and no further judgment is performed.
3. Gray Wolf–Particle Swarm Hybrid Optimization Robust Extreme Learning Machine
The traditional Gray Wolf Optimizer (GWO) is a swarm intelligence algorithm inspired by the social hierarchy and hunting behavior of gray wolves. It optimizes and adjusts parameters by simulating the behaviors and interactions among gray wolf populations, transforming the problem into simulating the behavior of gray wolves in the search space, which includes competition and cooperation among individuals. The Gray Wolf Optimizer can balance local search and global search well, making it less prone to getting stuck in local optima. However, its convergence speed is not fast enough. Therefore, we consider the addition of particle swarm optimization (PSO) to improve the convergence speed of the algorithm. At the same time, the particle swarm optimization algorithm is prone to convergence into local optima. Therefore, hybrid optimization of the two algorithms can utilize the exploration ability of the Gray Wolf Optimizer and the fast convergence of the particle swarm optimization algorithm to enhance the comprehensive performance of the optimization algorithm.
3.1. Subsection
The gray wolf population is divided into four hierarchical levels:
wolves (the optimal solution),
wolves (the suboptimal solution),
wolves (the third-best solution), and
wolves (the remaining individuals). Assuming
represents the spatial distance between a gray wolf and its prey, and
denotes the position of the prey, this allows for a better understanding and description of the positional relationship between gray wolves and their prey, as well as its implications. The equation for gray wolf predation behavior is derived as follows:
The meanings of other symbols in Equation (3) are as follows:
represents the current position of a gray wolf individual at time step
t;
is a random perturbation vector to prevent the algorithm from prematurely converging to a local optimum,
, where
is a random vector in
;
is the convergence coefficient vector, which controls the movement direction of the gray wolves, and is defined as
, where
decreases linearly from 2 to 0, given by
, and
is a random vector in
.
represents the new position of a gray wolf at the next time step
\(t + 1
\), which is used to update the wolf’s position based on the current prey position and the distance
, progressively approaching the optimal solution. The attacking and prey-searching behaviors of gray wolves are illustrated in
Figure 1.
3.2. Particle Swarm Optimization
The particle swarm optimization algorithm is a swarm intelligence optimization algorithm inspired by the social behavior of bird flocks or fish schools. Its core idea is to simulate the collaborative optimization process of particles in the search space, where each particle dynamically adjusts its flight speed and direction based on its own historical optimal position and the historical optimal position of the swarm, gradually approaching the optimal solution of the problem.
The core formulas of the particle swarm optimization algorithm are the velocity update formula and the position update formula:
Among them,
represents the movement velocity of particle
at time step
;
is the inertia weight, used to control the influence of historical velocity and balance global exploration with local exploitation;
and
are acceleration constants, typically set to 2;
and
are random numbers in the interval
; and
and
are the individual historical optimal position of the particle and the global historical optimal position of the swarm, respectively. The particle velocity direction update process is shown in
Figure 2.
3.3. GWO-PSO Hybrid Optimization
The social hierarchy structure (
,
, and
wolves) of the Gray Wolf Optimization (GWO) algorithm is introduced into the particle swarm optimization (PSO) algorithm. This integration enhances the global search capability through a multi-leader guidance mechanism, while preserving the individual historical optimality characteristic of PSO. The improved particle swarm velocity update formula after introducing the Gray Wolf algorithm is as follows:
The newly introduced parameter is the leader weight coefficient, satisfying ; is the social cognitive coefficient, which controls the influence intensity of the guides and is set to 1.5; is a random number in the interval ; and represents the social hierarchy leaders of the swarm (where correspond to the optimal positions of the , , and wolves respectively).
Based on the traditional global optimum of particle swarm optimization (equivalent to -optimality in particle swarm optimization), the introduction of , and wolf optimal positions reduces the reliance on a single global optimum and enhances global exploration capabilities.
3.4. Robust Extreme Learning Machine
3.4.1. Standard Extreme Learning Machine
The standard extreme learning machine (ELM) typically features a single hidden layer network structure, balancing algorithmic scalability and accuracy. It boasts advantages such as high learning efficiency, minimal parameter tuning, and strong generalization capabilities, and has been widely applied across various industries. ELM-based methods have also been used for short-term PV power forecasting correction, demonstrating their applicability to PV output modeling [
30]. However, due to the random initialization and fixation of its hidden layer parameters, as well as the limitations of its shallow structure, the ELM’s ability to handle data with complex nonlinear relationships is limited.The architecture of the standard ELM model is illustrated in
Figure 3.
The mapping expression of its hidden layer is:
In the formula, is the hidden layer output matrix; is the activation function; is the input data matrix, where represents the number of samples and represents the number of features per sample; is the weight matrix connecting the input layer to the hidden layer; is the number of hidden nodes (or neurons); and is the bias vector of the hidden layer.
The error equation of the extreme learning machine is:
By introducing the weight matrix
, the error equation satisfies the constraint that minimizes
. Consequently, the parameters to be estimated,
, can be solved using the following formula:
3.4.2. Robust Extreme Learning Machine (MELM)
M-estimation is a robust estimation method that reduces the influence of outliers through a robust loss function, and is suitable for scenarios where data contains noise or outliers.
M is estimated to adhere to the following guidelines:
We calculate the output weight matrix under M-estimation as:
It can be solved by giving initial trial values, similar to the process of least squares estimation.
The objective fitness function of robust ELM is
where
is the regularization coefficient, determined through cross-validation, with a numerical range of
.
Adaptive Weight Objective Fitness Function:
The indicator function (which equals if the residual exceeds the threshold and otherwise) represents the proportion of outliers (abnormal samples). This serves as a penalty term for the threshold to prevent it from becoming excessively large or small.
Dynamic inertia weight fitness function:
During the iterative process of solving, multiple weighted corrections need to be made to the generated errors, so that the weight coefficients containing larger gross errors gradually approach 0 or some extremely small value, thereby avoiding the interference of gross errors.
The process of obtaining the output weight values of ELM under M estimation can be represented by MELM, and the weight function of MELM is selected using the one-norm minimization method.
The steps of the MELM algorithm are as follows:
Step 1: Select the initial input weights and hidden layer biases as random numbers within the interval .
Step 2: Construct the matrix using the activation function .
Step 3: Substitute the matrix obtained in Step 2 into the equation to calculate the initial values for the parameters to be estimated. The initial error is then obtained via Equation (11).
Step 4: Assign initial values to each observation using and calculate using Equation (15).
Step 5: Adaptively adjust ; if the mean absolute error (MAE) is large, increase to improve accuracy.
Step 6: Iterate through Steps 1 to 5 until the condition is met or the maximum number of iterations is reached. At this point, stop the calculation, output the optimal parameters, and calculate the final predicted values.
3.5. Construction of a Robust Extreme Learning Machine Expansion Detection Model Based on GWO-PSO Hybrid Optimization
The robustness of the original ELM is limited by the random initialization characteristics of its hidden layer weights and bias matrix. The randomness of initial parameters easily leads to the model being sensitive to noise and outliers, thereby affecting the generalization performance of the robust extreme learning machine. To address this, a parameter adaptation strategy based on GWO-PSO hybrid optimization is proposed. This strategy utilizes the global search mechanism of the Gray Wolf Optimization (GWO) algorithm and the local optimization capability of the particle swarm optimization (PSO) algorithm to collaboratively optimize the initial parameter space. The loss function and adaptive weights of the robust extreme learning machine are mapped to the dual-objective fitness function of the hybrid algorithm, respectively. This constructs a dynamic inertia weight balancing exploration and exploitation process, and utilizes the swarm intelligence iterative mechanism to select the weight–bias combination with optimal robustness. This strategy aims at robust fitting of photovoltaic power data. By minimizing the Huber loss, it simultaneously suppresses outlier interference and model overfitting during the training process, ensuring high-precision power prediction capability even under complex weather fluctuation scenarios.
Figure 4 illustrates the architecture of the GWO-PSO-optimized MELM model.
The process of capacity expansion detection is as follows:
Considering the potential capacity differences among various photovoltaic power stations, it is necessary to normalize the input photovoltaic data first, ensuring it falls within the range of .
- (2)
Robust extreme learning machine based on GWO-PSO hybrid optimization
Based on the training samples, the GWO-PSO hybrid optimization algorithm is employed to optimize the input weights and biases of the MELM hidden layer, thereby obtaining the optimal solution.
- (3)
Train the robust extreme learning machine with optimal parameters
Based on the optimal parameters of the GWO-PSO hybrid optimization algorithm, we map the loss function and adaptive weights of the robust extreme learning machine to the dual-objective fitness function of the hybrid algorithm, filter the optimal solution set, and obtain the MELM detection model for photovoltaic output.
We input the data corresponding to the sample set to be tested into the trained MELM detection model, and compare the model output results with the actual output power results of the site to be tested, in order to analyze the capacity expansion of the site. The overall capacity expansion detection workflow is presented in
Figure 5.
Based on the aforementioned theory, the constructed photovoltaic capacity expansion perception model, which is based on the GWO-PSO-optimized robust extreme learning machine, follows the following process:
- (1)
Perform data preprocessing on the original photovoltaic power generation dataset, remove outliers, fill in missing values, and merge duplicate values.
- (2)
Perform cosine similarity calculation and DTW distance calculation on the processed photovoltaic data, respectively. By comparing the differences between the power generation data of the test power station and the reference power station, screen the meteorological consistency of the power station.
- (3)
Divide the filtered photovoltaic data into corresponding training and testing sets as a dataset, input it into the gray wolf particle swarm optimization MELM model, evaluate the fitness of MELM through continuous iteration, update particle parameters, and output the final optimal gray wolf result.
- (4)
Input the processed photovoltaic data from 2 into the model in 3 for calculation, and output the photovoltaic power plant output prediction results. Compare these results with the actual output data of the photovoltaic power plant. If the difference exceeds the set threshold, the power plant output is considered abnormal, and the expansion factor of the power plant is calculated.
Figure 6 presents the overall workflow of the proposed PV capacity expansion sensing method.
Figure 6 presents the overall workflow of the proposed PV capacity expansion sensing method.
4. Case Study Analysis
4.1. Dataset
The measured data used in this article comes from the actual measurement data of the State Grid Corporation of China’s metering system. The distributed photovoltaic power generation data in Changsha in June 2024 is selected as the original sample data, with a sampling interval of 15 min. Only the effective data from 6:00 to 19:00 is selected as the input data, with a total of 52 sampling time points per day.
4.2. Evaluation Metric
The quality of the detection model is evaluated using mean absolute error (MAE), root mean square error (RMSE), and the goodness-of-fit parameter (R-squared, ) of the detection model. The root mean square error (RMSE) is used to measure the difference between the true value and the model output value. A smaller difference indicates more accurate model detection. Compared to RMSE, mean absolute error (MAE) is more robust, as it uses absolute error rather than relative error. A smaller MAE value indicates better detection performance of the model. The goodness-of-fit parameter , also known as the coefficient of determination, is used to measure the degree of fit of the detection model. A value closer to 1 indicates better fit of the model.
4.3. Parameter Settings
To prevent the Gray Wolf Optimizer (GWO) from falling into a local optimum, the population size is set to 20. The lower and upper bounds of the weight coefficients are set to 0.4 and 0.9, respectively, to prevent a loss of global search capability caused by values that are too low, or non-convergence due to excessive oscillations caused by values that are too high. To ensure particle velocities do not become so fast that they bypass the optimal region, the acceleration constant is limited to . Finally, to prevent model underfitting or overfitting, the regularization coefficient is set within the range .
The final calculation results of MELM are influenced by the number of hidden layers and nodes. Therefore, ten repeated experiments were conducted to find the optimal parameters, and the results are presented in
Table 1.
From
Table 1, it can be seen that when the detection model has four hidden layers and a total of 120 neuron nodes, the mean absolute error (MAE) is the largest; when the model has two hidden layers and 100 neuron nodes, the root mean square error (RMSE) is the largest. Considering the three evaluation metrics comprehensively, it can be concluded that when the model has three hidden layers and a total of 100 nodes, the comprehensive metric is optimal, and the model fitting degree is high. When keeping the number of hidden layers at three and increasing the number of nodes, the reduction in various errors is not significant, and the improvement in model fitting accuracy is also not obvious. However, this will result in an increase in the corresponding iteration time, affecting the overall performance. Therefore, three hidden layers and a total of 100 nodes are chosen as the parameters for the robust limit learning machine expansion detection model proposed in this paper using GWO-PSO hybrid optimization.
By optimizing the hidden layer weights and biases of MELM using the GWO-PSO hybrid approach, the efficiency of hidden layer nodes can be enhanced, thereby improving model performance. The comparison of the mean absolute error (RMSE) curves for different methods under various hidden layer nodes is illustrated in
Figure 7. With the same number of hidden layer nodes (3), the mean absolute error of MELM optimized using the GWO-PSO hybrid approach is consistently lower than that of MELM and the traditional extreme learning machine (ELM).
4.4. Model Validation
To evaluate the performance of the proposed hybrid optimization in optimizing MELM parameters, we selected the standalone Gray Wolf Optimization Algorithm (GWO), Ant Colony Algorithm (ACA), and Whale Optimization Algorithm (WOA) as the horizontal control groups. The maximum iteration count was uniformly set to 50 to balance optimization accuracy and computational efficiency. The trend of fitness variation with the number of iterations for different optimization algorithms is shown in
Figure 8.
As can be seen from
Figure 8, WOA has the fastest convergence speed but falls into local optima and cannot escape; GWO has a relatively fast convergence speed, reaching global optimality after 20 iterations, but its fitness function value is relatively large; ACA has a slower convergence speed, reaching global optimality only after 40 s; and GWO-PSO has the fastest convergence speed, obtaining the global optimal solution after only 16 iterations, and with the lowest fitness value. A comprehensive comparison of the convergence speed and search capabilities of various optimization algorithms reveals that GWO-PSO hybrid optimization exhibits superior optimization capabilities when dealing with photovoltaic data.
We compare the different effects of the optimized MELM and unoptimized MELM constructed using different algorithms on photovoltaic (PV) forecasting. We use the PV power generation data from a reference PV power plant as the model input, and the PV power generation data from the site to be tested as the model output. We iteratively train each algorithm model and select the PV power generation data under typical weather conditions such as sunny, cloudy, and rainy days as the test set to verify the performance of the algorithm.
Before distributed photovoltaic (PV) users carry out PV capacity expansion, the closer the prediction model is to the actual value, and the smaller the residuals of the model parameters, the better the model performance. The comparison of the prediction performance of different prediction models on sunny days is shown in
Figure 9.
The explanation of the shaded area in the above figure is shown in
Figure 10 below. From
Figure 10,
Figure 11 and
Figure 12, it can be observed that the prediction performance of various models under sunny conditions is not significantly different and exhibits similar trends. The degree of agreement between predicted and actual values is relatively high. By comparing the evaluation metrics of different models in
Table 2, it is evident that the fit of each model is very high, approaching 1. Compared to the standalone MELM model, optimizing with both WOA and ACA affects the performance of MELM, increasing the error. Both GWO and the proposed algorithm can reduce the error, with the latter performing better in terms of evaluation.
Similarly, we compare the prediction performance of different forecasting models on non-sunny days. Compared to sunny days, non-sunny days are characterized by more variable weather, which places higher demands on the models. Therefore, we discuss the prediction performance of each model on non-sunny days.
Figure 13 presents the prediction results of different models on non-sunny days, while
Figure 14 provides a local enlargement of the highlighted region. The corresponding residual comparison is shown in
Figure 15. The proposed method exhibits significantly lower RMSE and MAE values compared to other compared model algorithms on non-sunny days, indicating better detection performance.
The corresponding quantitative evaluation metrics for non-sunny conditions are summarized in
Table 3.
Figure 16 further summarizes the evaluation metrics of each model under non-sunny conditions using a radar plot.
4.5. Identification of User Unauthorized Capacity Expansion
4.5.1. Violation Expansion Coefficient
The installed capacity of distributed photovoltaic (PV) systems has been increasing year by year, but the rapid development has led to a significant number of distributed PV systems lacking monitoring devices. Some users, in order to obtain policy subsidies, have privately increased capacity by connecting unreported PV systems, which can easily cause the transformer in the substation area to exceed its reverse power transfer capacity limit, affecting the safety of power distribution operations.
To quantify capacity expansion behavior, a violation capacity expansion coefficient
is introduced. When the actual power generation of a user exceeds the theoretical power generation, there is considered to be capacity expansion behavior. When capacity expansion behavior exists, the capacity expansion coefficient is greater than 1; when it does not exist, the capacity expansion coefficient is set to 0. The definition of the violation capacity expansion coefficient
is as follows:
In the formula, is the actual power generation of the user at time ; is the theoretical power generation of the user output by model .
To verify the advantages of the proposed model in capacity expansion detection, a probability density function (PDF) is introduced to evaluate the sensitivity of each model toward photovoltaic (PV) capacity expansion behavior. The actual capacity of the selected PV users in the dataset is set to 1.3 times the contracted capacity, meaning the expansion capacity is 30% of the contracted capacity. A Gaussian kernel function is employed to calculate the probability density of the unauthorized expansion coefficient
. The calculation for the probability density function is as follows:
In the formula, is the number of data points; is the bandwidth; is the standard deviation of the sample data; is the kernel function; and arg max represents the parameter value that maximizes the function.
Figure 17 shows the probability density distribution of the unauthorized expansion coefficient for different models when the user expansion capacity is 30%.
4.5.2. Capacity Expansion Verification
In practical engineering applications, users may randomly install new photovoltaic (PV) arrays at specific time points to achieve capacity expansion. Simply detecting capacity expansion behavior at a single time point may not accurately identify the range of capacity factors expanded. Therefore, it is necessary to perform capacity expansion detection and analysis on a long-term time scale for PV users. By monitoring long-term changes in user capacity, the time points of capacity expansion can be more accurately located, enabling timely adjustments to the grid’s power generation capacity and improving the safe operation and stability of the grid. Based on the constructed GWO-PSO-MELM model, the time of illegal capacity expansion of PV users is verified. The expansion ratios are set to 10%, 20%, 40%, and 60% of the installed capacity. Data from distributed photovoltaic power generation in a certain area of Changsha in June is selected, and the set expansion ratios are sequentially applied on the 2nd, 10th, 18th, and 26th of the month. The detection results of the model are shown in
Figure 18,
Figure 19,
Figure 20 and
Figure 21.
Based on the analysis of the five users’ capacity expansion behaviors in
Figure 18,
Figure 19,
Figure 20 and
Figure 21, it can be observed that the detection values of the users’ illegal capacity expansion coefficients remained between 1.00 and 1.03 before capacity expansion. After the tested five users increased their capacity, the time of capacity expansion coefficient increase was consistent with the time of capacity increase, and the capacity expansion coefficients all increased to a multiple close to the set capacity expansion coefficient. Although there were fluctuations in the capacity expansion coefficients of each user, the fluctuation amplitude did not exceed 4%, proving the accuracy of the proposed model. Based on the long-term sequential characteristics of the above capacity expansion behaviors, long-term monitoring of photovoltaic users can accurately capture the time nodes of illegal behaviors, providing accurate time information for regulatory authorities and strong data support for the management and operation maintenance of distributed photovoltaic users.
6. Conclusions
This paper proposes a photovoltaic capacity expansion detection model based on a hybrid gray wolf–particle swarm optimization robust extreme learning machine. By employing data preprocessing strategies such as cosine similarity and dynamic time warping (DTW), the impact of regional meteorological differences on the model is effectively reduced. Combining the global exploration capability of the gray wolf algorithm with the rapid convergence characteristics of the particle swarm algorithm significantly enhances the optimization efficiency of the initial parameters of the robust extreme learning machine. Experimental validation based on actual photovoltaic data from Changsha demonstrates that the model exhibits superior performance in both typical sunny and non-sunny scenarios. Compared to traditional extreme learning machines (ELMs) and improved models using single optimization algorithms (such as WOA, ACA, and GWO), it leads in terms of fitting degree, root mean square error, and mean absolute error, proving stronger parameter optimization capabilities and fitting accuracy. The proposed method demonstrates good detection results in actual capacity expansion user detection. When the user capacity expansion ratio is 18.7%, the detection deviation is 1.3%; when the user capacity expansion ratio is 55%, the detection deviation is 2%. Therefore, the model achieves good detection results both when the user capacity expansion ratio is small or large, improving the effective identification rate of photovoltaic capacity expansion users.
However, this method relies on the consistency of meteorological conditions between the reference power station and the area where the power station under test is located. If there is a significant difference in weather, model fitting will be limited. In the future, it is necessary to further optimize detection efficiency for scenarios with a surge in the scale of distributed users and explore adaptive improvement solutions for cross-regional meteorological differences.