Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (2024)

1. Introduction

1.1. Research Background

The Earth’s ecological environment is the foundation for human survival. Therefore, while promoting industrial development and technological innovation to enhance convenience and happiness, we must constantly pay attention to the health of the ecological environment and strive to conduct activities in a more environmentally friendly manner.

There are various types of energy, which can be divided into primary energy and secondary energy according to the form of energy utilization [1]. Primary energy is energy that exists in nature and has not yet been converted into other forms. It usually refers to raw energy, such as oil, natural gas, coal, nuclear energy, etc [2]; secondary energy refers to the form of energy obtained after conversion, processing, or utilization of primary energy, such as electrical energy, thermal energy, kinetic energy, etc [3]. With people’s over-exploitation and consumption of primary energy, the world is facing a serious energy crisis. Data released by the World Resources Institute in 2020 pointed out that greenhouse gases emitted via energy consumption have accounted for 73% of global emissions, and energy demand is expected to increase by nearly 10% by 2030 [4].

In previous studies on energy consumption and environmental change, Höök, M. et al. pointed out that the limits to the availability of fossil fuels will set a limit on mankind’s ability to affect the climate [5]. Akpan, U. F. et al. mentioned that the rapid rise in fossil fuel combustion has produced a corresponding rapid growth in CO2 emissions and accounts for over 80% of global anthropogenic greenhouse gas emissions (GHGs) in 2008 [6]. Qin pointed out that the global average surface temperature in the three consecutive 10 years before 2012 was higher than any 10-year period since 1850, and may have been the hottest 30 years in the past 1400 years [7]. Karl et al. believe that changes in atmospheric composition are mainly due to human activities, and these disturbances mainly come from greenhouse gas emissions related to energy use [8]. McKibben Bill et al. pointed out that the main cause of global warming is greenhouse gases emitted by humans [9]. Fang et al. believe that in addition to human activities, natural factors such as volcanic eruptions and solar activity are also affecting climate change [10].

In short, the combustion of fossil fuels as primary energy sources causes serious pollution of the natural environment. Studies have indicated that the combustion of fossil fuels is the primary cause of global climate change [5,6,11], and scholars have conducted in-depth research on the relationship between climate change and fossil fuel combustion, addressing issues such as global warming caused by fossil fuels [12,13], acid rain [14], and atmospheric pollution [15,16]. In addition, some studies have paid attention to the impact of climate change on energy consumption of buildings and residents [1,17,18]. Energy shortages and climate issues not only cause inconvenience in people’s lives but also pose a threat to the survival of the Earth. Therefore, controlling the harm caused by fossil fuel combustion and improving the sustainability of human survival and development are important topics in global governance.

Currently, the three main types of fossil fuels used by humans are coal, oil, and natural gas [19]. In the process of attempting to address energy shortages and the climate issues caused by fossil fuels, although new energy sources such as solar and wind power, as well as electricity, have been promoted and utilized, the shortcomings of existing energy storage technologies and their high costs still limit the widespread application of these energy sources. Natural gas resources are abundant, easy to use, and widely used, and are highly consistent with the energy usage patterns and systems of human society [20]. Although the use of natural gas contributes to carbon dioxide emissions and exacerbates global warming, it does not produce pollutants such as sulphur and nitrogen oxides. Compared with coal and oil, natural gas is significantly cleaner, and its price is relatively stable [21]. Additionally, research suggests that natural gas reserves have favourable diversification benefits for crude oil, heating oil, and gasoline in the short term [22]. Therefore, in the absence of sufficient clean energy sources to address energy shortages and climate issues, increasing the proportion of natural gas in the energy structure is an important measure for alleviating energy and environmental problems, and several countries are gradually advancing this initiative [23].

Monitoring consumption at the household level is crucial for understanding natural gas consumption patterns [24]. Monitoring data at the household level helps determine whether household energy consumption is abnormal and improves the efficiency of natural gas supply by companies [25]. However, there are currently several issues with household-level data monitoring: (1) natural gas companies typically only record natural gas consumption at the street or neighbourhood scale and do not monitor the consumption of each household; (2) devices for monitoring natural gas consumption are expensive and cannot be installed in every household; (3) the installation of natural gas consumption monitoring devices involves safety issues, leading to potential safety hazards; and (4) manual meter reading is time-consuming and labour-intensive, with a risk of recording errors. These issues limit the monitoring of natural gas consumption at the household level.

1.2. Research Significance

Under the influence of factors such as clean energy, stable prices, and government support, the use of natural gas in residential areas has become widespread [26]. However, owing to limitations in the recording scope of natural gas companies, the high cost of monitoring devices, safety concerns related to the installation of monitoring devices, and the low efficiency of manual meter readings, it is currently not feasible to monitor every household [27]. This study was conducted in response to this issue.

We trained an image recognition model based on the K-nearest neighbours (KNN) algorithm to identify household natural gas meters. The KNN algorithm is a machine learning algorithm used for classification and regression tasks. Because of its simple and understandable principles and easy implementation, it has been widely used in areas such as image recognition and noise monitoring. In this study, image capture devices were installed outside the natural gas meters of residential buildings. Real-time monitoring was achieved by setting an image-capture interval to obtain continuous data. The processed data were then inputted into the KNN model for training, resulting in an image recognition model capable of identifying household natural gas meters. The use of this model for automated real-time monitoring not only improves data acquisition efficiency but also enables the precise analysis of household natural gas consumption patterns. The results can be provided to households and natural gas companies for timely adjustments of consumption behaviour and gas supply.

In addition, we propose a data prediction framework based on a backpropagation (BP) neural network. With continuous data collected by the KNN model, the BP neural network model can autonomously learn and continuously optimise to achieve accurate predictions of future natural gas consumption [28]. Accurate predictions can help relevant departments plan and deploy energy in advance, improve energy supply efficiency, and provide data support for the future widespread adoption and planning of distributed clean energy, making distributed clean energy devices operate more efficiently [29].

1.3. Research Status

Instrument monitoring has become a popular topic in the field of image recognition. Liu et al. [30] applied image recognition technology to an automatic calibration system for gas alarm devices in underground coal mines and proposed a digital recognition algorithm. This algorithm achieves automatic verification of machine vision instruments by digitally recognising images captured by methane detectors with a recognition rate exceeding 99.9%. However, the computational complexity of the template matching algorithm in this method is relatively high and requires further optimisation.

Song et al. [31] proposed an instrument recognition system based on image recognition of substation instruments. The system, based on the scale-invariant feature transform (SIFT), constructs a Gaussian difference model and determines the reading method after instrument positioning, enabling the instrument recognition system to read automatically. The experimental results demonstrated that the image recognition-based system could automatically identify simple graphical interfaces and learn autonomously. However, this study focused on pointer-type instruments in substations, whereas traditional natural gas meters directly display consumption numbers. Therefore, this recognition system cannot be directly applied to monitoring natural gas meters.

Cai et al. [32] proposed an improved Fletcher–Reeves conjugate gradient descent algorithm based on a BP neural network for instrument recognition in a chemical plant inspection robot. The algorithm required fewer iterations under optimal detection performance than the traditional standard gradient descent algorithms, adaptive learning rate gradient descent algorithms, and Fletcher–Reeves conjugate gradient algorithms. However, the recognition accuracy of this algorithm varies significantly; the recognition accuracy for the numbers 1 and 9 is below 80%, indicating suboptimal performance.

Shaikh et al. [33] introduced an Android application that automatically reads gas meters using a mobile camera, and employs optical character recognition technology to analyse the numbers on the gas meters for consumption data retrieval. However, the initial cost of optical character recognition technology is relatively high, its operation is complex, and it requires support from multiple devices.

Various forecasting methods have been proposed to predict natural gas consumption [34]. To date, hundreds of advanced prediction models have been developed to enhance prediction accuracy, including traditional statistical models, artificial intelligence-based models, and combination models [35]. Sanchez-Ubeda and Berzosa [36] proposed a prediction model combining three components based on the decomposition method, achieving high-resolution (daily) predictions of medium-term (1–3 years) final industrial consumption in Spain. Aydinalp-Koksal et al. [37] studied the use of conditional demand analysis (CDA) and modelled residential terminal energy consumption at the national level. Wei et al. [38] proposed a hybrid method called the complexity measure for load shifting (CMLS) and investigated the impact of data complexity of daily natural gas consumption on the predictive performance in the UK and Greece. Thaler et al. [39] established an energy consumption model for a Slovenian gas distribution system using a radial basis function neural network to predict system consumption and risk of excess demand. Gelo [40] established an econometric model for natural gas demand through regression analysis based on a survey of gas consumption among residential customers in Croatia. Potočnik et al. [41] used a statistical machine prediction model to forecast Slovenia’s future natural gas consumption in 2005 and 2006. Merkel et al. [42] predicted the natural gas consumption of 176 operating regions in the United States using a deep neural network (DNN) model based on the restricted Boltzmann machine (RBM) algorithm. The results indicated that under various conditions, the RBM-DNN outperformed the artificial neural network (ANN) and logistic regression (LR) models, particularly at higher flow rates.

The above analysis reveals that the existing methods in instrument image recognition research have shortcomings in terms of computational complexity, recognition accuracy, and technical cost. In terms of predictions, current research tends to focus on large-scale analyses of countries or regions, with limited studies on the patterns and predictions of household natural gas consumption.

2. Methods and Materials

2.1. Overall Methodology

Owing to the limited scope of natural gas company records, the high cost of natural gas consumption monitoring devices, safety hazards associated with the installation of these devices, and the inefficiency of manual meter reading, monitoring natural gas consumption at the household level is challenging [43]. Therefore, this study proposes a KNN-based monitoring method. This method involves training an image recognition model capable of identifying residential natural gas meters by inputting meter images. An adaptive prediction system framework is introduced based on the monitored data. The overall methodology of this study is shown in Figure 1.

2.2. KNN Algorithm Principle

In this study, the objective of natural gas consumption monitoring is to input digital images from natural gas meters and obtain the corresponding numerical values. To achieve this, a KNN model is used to classify digits on natural gas meters, thereby facilitating household natural gas consumption monitoring.

In the classification task, the core idea of the KNN algorithm is that if the majority of the K-nearest neighbouring samples in the feature space of a sample belong to a particular class, then the sample is also assigned to that class and exhibits the characteristics of the samples within that class [44].

The specific steps in the KNN algorithm are as follows:

  • Collect and preprocess the data.

  • Calculate the distances between the test sample and all the samples in the training set.

    The distance between two points in the feature space represents the similarity between these two sample points [45]. A shorter distance indicates a higher degree of similarity, whereas a longer distance implies a lower degree of similarity. The distance metric chosen in this study was the Euclidean distance, which is a computationally efficient and accurate measure of sample similarity. In n-dimensional space, the Euclidean distance between two points x=(x1,x2,,xn) and y=(y1,y2,,yn) is computed using the formula:

    dx,y=i=1nxiyi2

    where d(x,y) represents the distance between the test sample point x and training sample point y in an n-dimensional space, xi is the ith feature of the test sample, and yi is the ith feature of the training sample.

  • Sort the distance values in ascending order and select the K samples with the smallest distances.

    K is a hyperparameter manually specified in the KNN algorithm. Determining K has a crucial impact on the prediction results of the KNN algorithm. When K is small, the sample region influencing the predictive results is limited, leading to a smaller algorithmic neighbour error. However, an excessively small K can increase the estimation errors because certain noise points may have a significant impact on the results, potentially causing model overfitting. For large K, the sample region influencing the predictive results is more extensive, improving the robustness of the model. However, larger K values mean that points farther away can influence the predictive results, potentially leading to model underfitting. This study employed cross-validation to determine the optimal K by dividing the dataset into training and testing sets.

  • Count the frequencies of the labels corresponding to the K samples, and the label with the highest frequency becomes the predicted category.

    Specifically, the predicted category for a sample is determined by the following formula:

    y=argmaxxiNk(x)I(yi,cj)

    where y represents the predicted category of the sample, Nk(x) is the set of K-nearest training samples to the sample x, yi is the label of the ith sample (i = 1, 2, …, N), cj is the set of categories (j = 1, 2, …, K), and I is the indicator function defined as:

    Ix,y=1,ifx=y0,ifxy

2.3. Backpropagation Neural Network (BPNN)

The goal of the adaptive prediction system used in this study is to predict future consumption based on existing natural gas monitoring data. Backpropagation neural network (BPNN) is a multilayer feedforward network trained using error backpropagation [46]. The basic concept of a BPNN is gradient descent, which utilises gradient search techniques to minimise the mean squared error between the actual and expected output values. Therefore, the BPNN can autonomously learn from the input data, continuously reduce the model error through training, and subsequently predict the future. Furthermore, by continuously updating the input data, the BPNN can adapt and optimise the model accordingly [47]. Therefore, this study uses BPNN for predicting natural gas consumption and proposes an adaptive prediction system framework.

Figure 2 shows the framework of a BPNN model. The model comprises three parts: an input layer, one or more hidden layers, and an output layer [48]. The input layer receives training data. The hidden layers contain parameters (weight matrices), and the BPNN computation process involves functions that comprise these parameters and activation functions. The final result is output by the output layer. The basic BP algorithm includes two processes: the forward propagation of signals and the backward propagation of errors [49]. During forward propagation, the input signals pass through the hidden layers to the output nodes, thereby producing output signals. If the predicted output does not match the expected output, the process proceeds to error backpropagation. Error backpropagation involves transmitting output errors layer by layer from the output layer to the input layer and distributing the error to all units in each layer. The error signals obtained from each layer serve as the basis for adjusting the weight of each unit. By adjusting the connection strengths between the input and hidden layer nodes, as well as between the hidden layer and output nodes, along with the thresholds, the error decreases in the gradient direction [50]. Through repeated learning and training, the network parameters (weights and thresholds) corresponding to the minimum error are determined, and the training is considered complete. At this point, the trained neural network can process the input information and minimise output errors through nonlinear transformations.

2.3.1. Forward Propagation

For a single sample, the computation of neurons in the hidden and output layers during forward propagation follows the formula:

a[l]=σ(wlal1+b[l])

where a[l] is the output matrix of layer l, σ is the activation function, ωl is the weight matrix of layer l, al1 is the input matrix of layer l, and b[l] is the bias matrix of layer l.

For multiple samples, the forward propagation process is represented as:

Al=σwlAl1+bl

where A[l1]=||a[l1](1)a[l1](2)|||a[l1](m)| and m is the number of samples.

2.3.2. Backward Propagation

Backpropagation adjusts the weight (w) and bias (b) parameters by computing the model error. For updating, it is necessary to calculate the partial derivatives of the error with respect to w and b. To compute these partial derivatives, the error values must first be calculated. The calculation process is as follows.

  • Output Layer Error

    • For a single sample:

      δ[L]=aLσ(z[L])

      where δ[L] is the error of the output layer L, aL is the partial derivative of the loss function with respect to a[L], and σ(z[L]) is the derivative of the activation function, where z[L]=wLaL1+b[L].

    • For multiple samples:

      dZ[L]=ACσ(Z[L])

      where dZ[L] is the error of the output layer, AC is the partial derivative of the loss function with respect to aA[L], and σ(Z[L]) is the derivative of the activation function, where Z[L]=wLAL1+b[L]. A and C are the matrices of a and L, respectively, after superposition of multiple samples.

  • Hidden Layer Error

    • For a single sample:

      δ[l]=[w[l+1]δ[l+1]]σ(z[l])

      where δ[l] is the error of layer l, w[l+1] is the weight of layer (l+1), δ[l+1] is the error of layer (l+1), and σ(z[l]) is the derivative of the activation function, where z[l]=wlal1+b[l].

    • For multiple samples:

      dZ[l]=[w[l+1]TdZ[l+1]]σ(Z[l])

      where dZ[l] is the error of layer l, w[l+1]T is the transpose of the weight matrix for layer (l+1), dZ[l+1] is the error of layer (l+1), and σ(Z[L]) is the derivative of the activation function, where Z[L]=wLAL1+b[L].

  • Parameter Change Rates

    • For a single sample:

      Lw[l]=δ[l]al1T

      where Lw[l] is the partial derivative of the loss function with respect to w of layer l, δ[l] is the error of layer l, and al1T is the transpose of the input matrix of layer l.

      Lb[l]=δ[l]

      where Lb[l] is the partial derivative of the loss function with respect to w of layer b, and δ[l] is the error of layer l.

    • For multiple samples:

      dw[l]=Cw[l]=1mdZ[l]Al1T

      where dw[l] is the partial derivative of the loss function with respect to w of layer l, m is the number of samples, dZ[l] is the error of layer l, and Al1T is the transpose of the input matrix of layer l.

      db[l]=Cb[l]=1mmeanOfEachRow(dZ[l])

      where db[l] is the partial derivative of the loss function with respect to b of layer l, m is the number of samples, and dZ[l] is the error of layer l.

  • Parameter Updates

    • For a single sample:

      w[l]=w[l]αLw[l]

      where w[l] is the weight of layer l, α is the learning rate, and Lw[l] is the partial derivative of the loss function with respect to w of layer l.

      b[l]=b[l]αLb[l]

      where b[l] is the bias of layer l, α is the learning rate, and Lb[l] is the partial derivative of the loss function with respect to b of layer l.

    • For multiple samples:

      w[l]=w[l]αCw[l]

      b[l]=b[l]αCb[l]

      where C is the matrix of L after superposition of multiple samples.

3. Experimental Procedures

3.1. Experimental Equipment and Data Collection

For monitoring residential natural gas consumption, we selected the commonly used CG-Z-2.5 IC card membrane gas meter in residential buildings in Xi’an, China, as the capture target. The gas meter area was recorded using an additional camera (Figure 3a) to obtain raw data.

The reading area of the CG-Z-2.5 IC card membrane gas meter has eight digital display cells, as shown in Figure 3b. Each cell’s numerical range is 0–9. The black and red areas represent the integer and decimal parts, respectively. The reading, from left to right, represents the digits in ten thousand, thousand, hundred, ten, one, tenth, hundredth, and thousandth places.

3.2. Data Preprocessing

To implement natural gas consumption monitoring using the KNN algorithm, model training requires labelled image data. Therefore, image data preprocessing, involving data collection and label creation, was performed before training the KNN model.

3.2.1. Data Collection

As the data obtained through the camera are videos over a period of time, and the KNN algorithm can recognise and classify images but not video data, screenshots were taken at regular intervals before training to obtain images at different time points. In this study, Python and the computer vision library OpenCV (version 4.6.0) in PyCharm (version 2022.3.3) were used for capturing images. A five-minute interval was chosen to capture images reflecting the consumption behaviour patterns of residents while analysing the natural gas consumption data. A five-minute interval adequately reflects the variation in household natural gas consumption throughout the day, balancing data richness and computational efficiency.

During image recognition using the KNN algorithm, only the digits in the reading area must be identified. However, the captured images contained a large amount of extraneous information outside the reading area (Figure 3b). This additional information can adversely affect the efficiency and accuracy of the model. Therefore, the captured images were cropped. Additionally, directly recognising the eight digits in the card-reading area could lead to an enormous number of possibilities (up to 108), requiring a large number of samples during the training phase and resulting in an excessive number of model parameters, making training challenging. Alternatively, an eight-digit number can be obtained by individually recognising each digit in the grid and performing simple mathematical calculations. The range of each digit in the grid is 0–9. This recognition method reduces the label values to only ten possible cases, significantly decreasing the required training samples and parameters while improving the computational efficiency of the model. Therefore, in this study, cropping of the captured images was performed using OpenCV (version 4.6.0) in PyCharm (version 2022.3.3) to obtain images of individual grid digits (Figure 3c).

3.2.2. Label Creation

Based on the obtained data screenshots, image labelling is necessary. The first seven digits can be recognised by setting ten label types (0–9) in the training set and training the KNN model. However, the eighth digit continuously scrolls during natural gas consumption, and the captured image may display a value between the two digits, making it challenging to recognise. Three labelling methods have been proposed to address this issue.

  • When an image displays a value between two digits, it is recognised as the digit above it (as shown in Table 1).

2.

Only recognise images where digits are fully visible; when the captured image displays a value between two digits, label the image as “NA” (Not Applicable) (as shown in Table 2).

3.

Through empirical testing, the KNN model demonstrated 100% accuracy in recognising complete representations of the digits 0 and 1. In the context of natural gas consumption, the eighth digit, consistently displayed as zero, signifies the completion of a cycle since its last manifestation as 0. During this interval, the corresponding natural gas consumption registers at 0.01 m3. Consequently, meticulous recording of only the eighth digit permits the derivation of accurate measurements for natural gas consumption. The procedural implementation involves incrementing the recorded natural gas consumption by 0.01 m3 whenever the recognition outcome for the eighth digit is 0. The labelling method is to label “NA” when the eighth digit displays a value between two digits and label based on the actual digit value when it displays a complete digit. The recognition results of this labelling method are listed in Table 3.

Experimental testing indicated that the first two labelling methods achieved accuracies of approximately 70% and 60%, respectively, and thus failed to meet the precision requirements for practical engineering. The third labelling method not only achieved high accuracy but also reduced the data volume significantly, improving model efficiency. Therefore, this study adopted the third labelling method during the model construction process.

3.3. KNN Model Training

The original dataset for this study was established after data collection and preprocessing. The KNN model was trained to determine the optimal K value that maximises the recognition accuracy of the model. The training process based on the original dataset is shown in Figure 4.

  • Randomly split the original dataset into training (70%) and testing (30%) datasets.

  • Calculate the Euclidean distance from each test sample point to every sample point in the training set.

  • Sort the distances in ascending order.

  • Initialise K to 1.

  • For each test sample point, select the nearest K training sample points.

  • Count the frequencies of the labels corresponding to the K samples; the label with the highest frequency is the predicted category.

  • Compare the predicted values of all test samples with their actual labels and calculate the prediction accuracy of the KNN model.

  • Check whether the prediction accuracy of the model satisfies the requirements. If satisfied, the KNN model training is complete. Otherwise, increase the K value and return to Step 3. In this study, the step size for increasing K was set to 1. If K becomes greater than or equal to the number of samples (N) in the training dataset minus 10, the training ends, and the KNN model with the highest prediction accuracy is the output.

4. Results

4.1. Equipment and Methods

In the first part of this study, which focuses on natural gas consumption monitoring based on the KNN algorithm, and after thorough investigation and relevant analysis of the integration of the KNN algorithm with the research problem, the equipment, and methods utilized at each stage are presented in Table 4. The rationale behind the selection of these devices and methods will be elucidated in Chapter 5.

4.2. Natural Gas Consumption Monitoring Results

This study selected the natural gas consumption data from a residential building in Xi’an from 16 October 2022 to 18 October 2022; 16 October was Sunday, and 17–18 October were weekdays. The results are depicted in Figure 5. The horizontal axis in the images represents time, and the vertical axis represents natural gas consumption every 5 min.

The blue polyline in Figure 5 shows the variation trend in natural gas consumption on 16 October 2022. From 0:00 to 6:00, no natural gas consumption was detected. Natural gas consumption commenced at 6:00, with consumption of approximately 0.025 m3 every 5 min until 7:00, then it abruptly peaked at 0.08 m3. The period around 9:00 exhibited significant consumption, reaching approximately 0.075 m3. From 10:00 to 24:00, natural gas consumption occurred frequently. Notably, continuous consumption was observed at 12:00–13:00 and 18:00–19:00. The consumption rate was around 0.03 m3 every 5 min from 10:00 to 20:00, increasing to approximately 0.04 m3 from 20:00 to 23:00, and dropping to about 0.02 m3 at around 24:00.

The orange polyline in Figure 5 displays the variation trend in natural gas consumption on 17 October 2022. Minimal consumption occurred from 0:00 to 1:30, with a consumption rate of approximately 0.02 m3 every 5 min. No gas consumption was recorded between 1:30 and 7:00. From 7:00 to 10:00, the consumption rate reached a daily peak of approximately 0.09 m3. No consumption occurred from 10:00 to 22:00, and from 22:00 to 24:00, the consumption rate was about 0.05 m3 every 5 min.

The green polyline in Figure 5 shows the variation trend in natural gas consumption on 18 October 2022. Minimal consumption occurred from 0:00 to 1:30, with a rate of approximately 0.03 m3 every 5 min. No consumption was recorded between 1:30 and 7:00. The period from 7:00 to 10:00 exhibited the highest daily consumption, reaching approximately 0.11 m3. No consumption was observed during the three periods of 10:00–13:00, 14:00–18:00, and 19:00–22:00. The consumption rate during the three time periods of 13:00–14:00, 18:00–19:00, and 22:00–24:00 was approximately 0.03 m3 every 5 min.

5. Discussion

5.1. Analysis of Equipment and Methods

As described in Section 4.1, each step of natural gas consumption monitoring based on KNN involves specific experimental equipment or methods for data collection, data preprocessing, and KNN model training. These choices are the result of thorough investigation and experimental analysis.

5.1.1. Data Collection

Through investigation, we found several deficiencies in the monitoring of household natural gas usage in Xi’an. Due to limited recording coverage by natural gas companies, expensive monitoring equipment, potential safety hazards associated with equipment installation, and inefficiencies in manual meter reading, monitoring natural gas consumption at the household level in Xi’an is challenging. Therefore, in the data collection phase, we opted to use the commonly employed CG-Z-2.5 IC Card Film Gas Meter found in residential buildings in Xi’an, China, as the capture device. Additionally, we installed cameras to record the gas meter area, thus obtaining raw data.

5.1.2. Data Preprocessing

  • Capture Data Screenshots: During the process of acquiring image data, it is necessary to capture and further process images at specified time intervals. OpenCV offers extensive image processing capabilities, including image reading, display, saving, transformation, filtering, cropping, and more. With OpenCV, various image processing operations can be conveniently performed. Moreover, OpenCV provides a Python interface, facilitating its integration with PyCharm for image-processing tasks. Consequently, the combination of PyCharm and OpenCV offers a convenient and powerful platform for image processing, meeting the requirements for scheduled image capture and cropping, and is easy to implement and operate.

  • Label Creation: For the natural gas consumption monitoring task, labelled data that meets the experimental requirements must be created. Since the eighth digit on natural gas meters continuously cycles during gas consumption, it may appear as an intermediate value between two digits in captured images, making it difficult to discern. To address this issue, this study proposes three labelling methods:

    • When an image displays a value between two digits, it is recognised as the digit above it;

    • Only recognise images where digits are fully visible; when the captured image displays a value between two digits, label the image as “NA” (Not Applicable);

    • Through empirical testing, the KNN model demonstrated 100% accuracy in recognising complete representations of the digits 0 and 1. In the context of natural gas consumption, the eighth digit, consistently displayed as 0, signifies the completion of a cycle since its last manifestation as 0. During this interval, the corresponding natural gas consumption registers at 0.01 m3. Consequently, meticulous recording of only the eighth digit permits the derivation of accurate measurements for natural gas consumption. The procedural implementation involves incrementing the recorded natural gas consumption by 0.01 m3 whenever the recognition outcome for the eighth digit is 0. The labelling method is to label “NA” when the eighth digit displays a value between two digits and label based on the actual digit value when it displays a complete digit;

Experimental testing indicated that the first two labelling methods achieved accuracies of approximately 70% and 60%, respectively, and thus failed to meet the precision requirements for practical engineering. The third labelling method not only achieved high accuracy but also reduced the data volume significantly, improving model efficiency. Therefore, this study adopted the third labelling method during the model construction process.

5.1.3. KNN Model Training

PyCharm, as a Python development tool, efficiently integrates Python scientific computing libraries and machine learning libraries, while also offering a wealth of features and tools, thereby facilitating the training of KNN models. Therefore, the latest version of PyCharm, version 2022.3.3, was selected as the software for training the KNN model during the experiments.

5.2. Analysis of Natural Gas Consumption Monitoring Results

From Figure 5, it is evident that from 0:00 to 6:00 on 16 October, no natural gas consumption occurred, which is attributed to sleeping hours. The period from 6:00 to 9:00 experienced higher consumption every 5 min due to activities such as washing, bathing, cooking, and dish washing, reaching its peak for the day. From 10:00 to 24:00, frequent gas consumption occurred owing to the regular hot water supply and other factors. Notably, sustained consumption was observed at 12:00–13:00 and 18:00–19:00, corresponding to lunch and dinner, respectively. The increased gas consumption at approximately 22:00–23:00 can be attributed to activities such as washing.

From 0:00 to 1:30 on 17 October, some gas consumption occurred because the residents stayed up late the previous night. The period from 1:30 to 7:00 was sleep time, with no gas consumption. Gas consumption from 7:00 to 10:00 reached its daily peak, around 0.09 m3, attributed to activities like washing, bathing, cooking, and dishwashing. The period from 10:00 to 22:00 represents the working hours, resulting in no gas consumption. From 22:00 to 24:00, the residents engaged in activities such as washing, leading to gas consumption.

On 18 October, gas consumption occurred from 0:00 to 1:30, similar to the previous days. The period from 1:30 to 7:00 was sleep time, with no gas consumption. Gas consumption from 7:00 to 10:00 reached its daily peak, around 0.11 m3, due to activities like washing, bathing, cooking, and dishwashing. Remarkably, despite sharing a common workday attribute, the data deviated from the preceding day (17 October) between 10:00 and 22:00 on 18 October. Specifically, at 13:00–14:00 and 18:00–19:00, instances of gas consumption emerged, possibly indicative of residents returning home and briefly sojourning, thereby incurring a marginal increase in natural gas usage. From 22:00 to 24:00, the residents engaged in activities such as washing, leading to gas consumption.

Contrasting the natural gas consumption data on 16 October with those on 17–18 October revealed substantial disparities in consumption levels and patterns between weekdays and weekends. First, during the 0:00–2:00 timeframe, gas consumption was evident on the weekdays, whereas there was no discernible consumption during the weekend. This distinction arises from the increased flexibility in managing time during weekends when individuals are not constrained by work obligations. Consequently, people tend to retire early on the previous night without the pressure of impending work, whereas on weekdays, the desire for more leisure and recreational activities may lead to later bedtimes and nocturnal activities that incur gas consumption. In the 7:00–10:00 timeframe, gas consumption on weekdays was more frequent and exhibited larger 5-min consumption than on weekends. This discrepancy is attributed to the necessity to complete a series of activities such as washing, bathing, cooking, and dishwashing before leaving for work. In contrast, weekends afford a more relaxed schedule, allowing for the omission of some essential weekday activities and resulting in lower natural gas consumption during this timeframe. During the 10:00–22:00 period, weekdays typically witness minimal gas consumption, as residents are away for work. In contrast, on weekends, residents tend to engage in activities or rest at home, leading to increased natural gas consumption.

6. Prediction Framework Based on BPNN

Using the KNN model, the actual natural gas consumption data for residential areas can be obtained. A BPNN can be used to construct and train a model based on statistical data, enabling the prediction of future natural gas consumption. As data continue to accumulate, the BPNN can autonomously learn and adapt, continually improving the prediction accuracy. By incorporating different variables, such as temperature and number of household members, into the model, predictions for short-term, medium-term, and long-term natural gas consumption can be made.

The framework for a BPNN-based prediction system is shown in Figure 6.

  • Data acquisition: Obtain data based on the KNN algorithm, including the time and corresponding natural gas consumption. Owing to the multifaceted nature of gas consumption, considering factors such as time, temperature, and household size, collecting short-term data is insufficient to obtain comprehensive information, potentially leading to model underfitting and affecting prediction accuracy. Continuous data collection is necessary to enhance predictive accuracy by forming databases for daily, weekly, monthly, quarterly, and even yearly updates. With continuously updated data, the BPNN-based model can autonomously learn and optimise parameters, thereby improving its predictive capabilities.

  • Neural network definition: A neural network is defined by determining its structure, initialising parameters, and selecting activation functions. The structure of a neural network, which specifies the number of layers and units in each layer, directly influences the predictive performance of the model. The parameters were initialised with random values, and the ReLU function was chosen as the activation function in this model.

  • Forward computation of node outputs: The function outputs of each node are calculated in a forward manner. Similar computations are performed at each node in the hidden and output layers. The results for each node can be obtained by performing layer-by-layer operations on the input data, and these results are temporarily stored.

  • Loss function computation: The loss function measures whether the precision of the model satisfies the requirements. During training, after the model completes the forward computation and outputs the predicted values, the loss function is computed by comparing the predicted values with the actual labels.

  • Evaluate if the loss function meets requirements: If requirements are met, the model training is considered complete. If not, compute the partial derivatives of the loss function with respect to each parameter, adjust the parameter values through a gradient descent, and return to Step 3.

  • Predict future natural gas consumption data for days, weeks, months, quarters, and years based on the trained model.

7. Conclusions

In recent years, as energy shortages and climate issues have become increasingly severe, more countries and regions have emphasised the use of clean energy to reduce the proportion of energy sources that emit substantial pollutants in the energy structure. Natural gas is one of the most widely consumed clean energy sources [51]. The use of clean energy such as natural gas contributes to alleviating climate issues. Effective monitoring and prediction of energy consumption can further reduce energy waste and enhance energy efficiency. In the realm of natural gas monitoring, difficulties arise at the household level owing to factors such as high monitoring device costs, safety hazards in device installation, and inefficient manual meter reading. Regarding the prediction of natural gas consumption, existing research often focuses on larger scales, such as the national or regional levels, with limited studies on smaller scales of household natural gas consumption [24]. This study focuses on residents in Xi’an and constructs models based on KNN and BPNN at the micro level to monitor and predict natural gas consumption. This approach provides feedback to households and gas companies, enabling them to conveniently understand consumption data and patterns, thereby improving natural gas supply efficiency and reducing waste. The main conclusions are as follows.

  • For natural gas data monitoring based on the KNN algorithm, a method was proposed to obtain image data from a natural gas meter.

By capturing videos of the natural gas meter with a camera and subsequently using the OpenCV (version 4.6.0) computer vision library in Python in PyCharm (version 2022.3.3) to capture and crop the images, a digital image of the natural gas meter reading area was obtained.

2.

An appropriate data-labelling method was proposed.

Three labelling methods were proposed in this study:

  • When an image displays a value between two digits, it is recognised as the digit above it;

  • Only recognise images where digits are fully visible; when the captured image displays a value between two digits, label the image as “NA” (Not Applicable);

  • Through empirical testing, the KNN model demonstrated 100% accuracy in recognising complete representations of the digits 0 and 1. In the context of natural gas consumption, the eighth digit, consistently displayed as 0, signifies the completion of a cycle since its last manifestation as 0. During this interval, the corresponding natural gas consumption registers at 0.01 m3. Consequently, meticulous recording of only the eighth digit permits the derivation of accurate measurements for natural gas consumption. The procedural implementation involves incrementing the recorded natural gas consumption by 0.01 m3 whenever the recognition outcome for the eighth digit is 0. The labelling method is to label “NA” when the eighth digit displays a value between two digits and label based on the actual digit value when it displays a complete digit.

Experimental testing indicated that the first two labelling methods achieved accuracies of approximately 70% and 60%, respectively, and thus failed to meet the precision requirements for practical engineering. The third labelling method not only achieved high accuracy but also reduced the data volume significantly, improving model efficiency. Therefore, this study adopted the third labelling method during the model construction process.

3.

A model based on the KNN algorithm was constructed and used to obtain natural gas monitoring data.

The pre-processed dataset was inputted into the model for training, resulting in a model accuracy of 100%. Using this model, the natural gas consumption of residents in a specific residential area in Xi’an was monitored from 16–18 October 2022. Analysis of the monitoring results revealed consumption patterns on weekdays and weekends.

Common patterns in natural gas consumption for residents on weekdays and weekends were identified: no gas consumption occurred during sleep hours; after waking up in the morning, gas consumption peaked every five minutes due to activities such as washing, bathing, cooking, and dishwashing; and residents engaged in gas-consuming activities in the evenings.

Differences in natural gas consumption by residents on weekdays and weekends were observed. Between 0:00–2:00, gas consumption occurred on weekdays but not on weekends. This discrepancy is attributed to greater work pressure on weekdays, causing residents to stay up later to enjoy more leisure and entertainment. Compared with weekends, gas consumption on weekdays was more frequent and had a higher consumption rate every five minutes between 7:00–10:00. This was because residents needed to complete a series of activities, such as washing, bathing, cooking, and dishwashing, before going to work on weekdays, whereas weekends had a more relaxed schedule, and some essential activities could be omitted. Between 10:00–22:00, gas consumption on weekdays was generally absent, as residents were usually away for work. However, on weekends, residents were more likely to stay at home, leading to increased gas consumption.

4.

A BPNN-based prediction framework was proposed.

By continuously inputting the collected natural gas consumption data, the BPNN-based model could autonomously learn to accurately simulate natural gas consumption at various times, thereby achieving predictions for future natural gas consumption.

The monitoring method proposed in this study, based on the KNN algorithm for household natural gas meters, achieved an experimental accuracy of 100%. This method not only aids residents in comprehensively understanding their energy usage patterns, enabling timely adjustments to their energy consumption behaviours but also facilitates real-time, point-to-point monitoring of natural gas consumption by each household in residential areas by gas companies. Consequently, it reduces energy losses and enhances energy efficiency. Regarding digital meter recognition, the household natural gas meter recognition method proposed in this study also contributes to the advancement of recognition methods in other fields. Furthermore, building upon natural gas consumption monitoring, this study introduces a data prediction framework based on the BP neural network. Effective prediction assists relevant departments in proactively planning and deploying energy resources, thereby improving energy supply efficiency. Additionally, it provides data support for the future comprehensive dissemination and planning of distributed clean energy, enhancing the operational efficiency of distributed clean energy devices.

During the research process, it was noted that the commonly used energy-measuring instruments on the market, such as the CG-Z-2.5 IC card membrane gas meter selected in this study, displayed small numbers, had a single colour, and had small number intervals in the data display area. This can lead to situations in which two numbers are displayed but not fully visible, thereby impacting the image recognition accuracy. If instrument manufacturing companies can improve the data display, recognition accuracy could be enhanced.

While this study has achieved overall satisfactory results, there are still some limitations to address. Firstly, identifying natural gas meters requires the camera to be positioned very close to the meter. Otherwise, the obtained images containing digits may lack clarity, significantly affecting recognition accuracy. Furthermore, although we have proposed effective labelling methods to achieve 100% recognition accuracy for meter digits, this labelling method only provides precision up to two decimal places. It may not meet higher precision requirements. To address these shortcomings, further research and improvements are warranted. Additionally, owing to budget constraints, a concrete implementation of the proposed method was not performed. In the future, we aim to improve the prediction accuracy of the BPNN method for short-, medium-, and long-term natural gas consumption across different time periods.

Author Contributions

Conceptualization, Y.H., X.W., Y.D. and D.Z.; Formal analysis, C.W.; Investigation, X.W., Y.D., D.Z. and Y.L.; Methodology, Y.H. and H.C.; Resources, Y.Y. and Y.L.; Software, H.C.; Supervision, H.C., I.L., Y.Y. and J.Z.; Writing—original draft, C.W., I.L. and J.Z. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the National Key R&D Program of China (2022YFB3303200), the Key Scientific Research Projects of Colleges and Universities in Henan Province (22B560020), and the Key Scientific and Technological Project of Henan Province (Grant No. 232102240024).

Data Availability Statement

The original contributions presented in the study are included in the article, further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Meng, F.; Li, M.; Cao, J.; Li, J.; Xiong, M.; Feng, X.; Ren, G. The effects of climate change on heating energy consumption of office buildings in different climate zones in China. Theor. Appl. Climatol. 2018, 133, 521–530. [Google Scholar] [CrossRef]
  2. Pérez-Lombard, L.; Ortiz, J.; Velázquez, D. Revisiting Energy Efficiency Fundamentals. Energy Effic. 2013, 6, 239–254. [Google Scholar] [CrossRef]
  3. Long, S.; Li, Y.; Huang, J.; Li, Z.; Li, Y. A review of energy efficiency evaluation technologies in cloud data centers. Energy Build. 2022, 260, 14. [Google Scholar] [CrossRef]
  4. Liu, Y.; He, M.L. The relationship between temperature changes and energy consumption. West. China 2023, 3, 80–91. [Google Scholar]
  5. Höök, M.; Tang, X. Depletion of Fossil Fuels and Anthropogenic Climate Change—A Review. Energy Policy 2013, 52, 797–809. [Google Scholar] [CrossRef]
  6. Akpan, U.F.; Akpan, G.E. The Contribution of Energy Consumption to Climate Change: A Feasible Policy Direction. Int. J. Energy Econ. Policy 2012, 2, 21–33. [Google Scholar]
  7. Qin, D.H. Climate change science and sustainable human development. Prog. Geography. 2014, 33, 874–883. [Google Scholar]
  8. Karl, T.R.; Trenberth, K.E. Modern Global Climate Change. Science 2003, 302, 1719–1723. [Google Scholar] [CrossRef]
  9. Bill, M. Climate change 2007: The physical science basis: Summary for policymakers. N. Y. Rev. Books 2007, 54, 44–45. [Google Scholar]
  10. Fang, J.Y.; Zhu, J.L.; Wang, S.P.; Yue, C.; Shen, H.C. Global warming, carbon emissions and uncertainty. Sci. China Press. 2011, 41, 1385–1395. [Google Scholar]
  11. Read, D.; Bostrom, A.; Morgan, M.G.; Fischhoff, B.; Smuts, T. What Do People Know About Global Climate Change? 2. Survey Studies of Educated Laypeople. Risk Anal. 1994, 14, 971–982. [Google Scholar] [CrossRef]
  12. Romanello, M.; Napoli, C.D.; Drummond, P.; Green, C.; Kennard, H.; Lampard, P.; Scamman, D.; Arnell, N.; Ayeb-Karlsson, S.; Ford, L.B.; et al. The 2022 Report of the Lancet Countdown on Health and Climate Change: Health at the Mercy of Fossil Fuels. Lancet 2022, 400, 1619–1654. [Google Scholar] [CrossRef]
  13. Bonneuil, C.; Choquet, P.-L.; Franta, B. Early Warnings and Emerging Accountability: Total’s Responses to Global Warming, 1971–2021. Glob. Environ. Chang. 2021, 71, 102386. [Google Scholar] [CrossRef]
  14. Morris, S.C. Energy and Environmental Chemistry, Volume 2. Acid Rain; Ann Arbor Science Publishers: Ann Arbor, MI, USA, 1982. [Google Scholar]
  15. Cook, D.E.; Gale, S.J. The Curious Case of the Date of Introduction of Leaded Fuel to Australia: Implications for the History of Southern Hemisphere Atmospheric Lead Pollution. Atmos. Environ. 2005, 39, 2553–2557. [Google Scholar] [CrossRef]
  16. Thurston, G.D. Fossil Fuel Combustion and PM2.5 Mass Air Pollution Associations with Mortality. Environ. Int. 2022, 160, 107066. [Google Scholar] [CrossRef]
  17. Isaac, M.; Van Vuuren, D.P. Modeling global residential sector energy demand for heating and air conditioning in the context of climate change. Energy Policy 2009, 37, 507–521. [Google Scholar] [CrossRef]
  18. Thatcher, M.J. Modelling Changes to Electricity Demand Load Duration Curves as a Consequence of Predicted Climate Change for Australia. Energy 2007, 32, 1647–1659. [Google Scholar] [CrossRef]
  19. Zhou, T.J.; Chen, X.L.; Zhang, W.X.; Zhang, L.X. Climate change and carbon neutrality. Chin. J. Nat. 2024, 1, 1–11. [Google Scholar]
  20. Zou, C.N.; Lin, M.J.; Ma, F.; Liu, H.L.; Yang, Z.; Zhang, G.S.; Yang, Y.C.; Guan, C.X.; Liang, Y.B.; Wang, Y.; et al. Progress, challenges and countermeasures of China’s natural gas industry under the goal of carbon neutrality. Pet. Explor. Dev. 2024, 1–18. [Google Scholar] [CrossRef]
  21. van Egteren, M. Natural Gas for Electric Power Generation: Advantages, Availability and Reliability. Util. Policy 1993, 3, 145–153. [Google Scholar] [CrossRef]
  22. Mensi, W.; Rehman, M.U.; Vo, X.V. Dynamic Frequency Relationships and Volatility Spillovers in Natural Gas, Crude Oil, Gas Oil, Gasoline, and Heating Oil Markets: Implications for Portfolio Management. Resour. Policy 2021, 73, 102172. [Google Scholar] [CrossRef]
  23. Liu, E.; Li, W.; Cai, H.; Peng, S. Formation Mechanism of Trailing Oil in Product Oil Pipeline. Processes 2018, 7, 7. [Google Scholar] [CrossRef]
  24. Ma, Y.; Li, Y. Analysis of the Supply-Demand Status of China’s Natural Gas to 2020. Pet. Sci. 2010, 7, 132–135. [Google Scholar] [CrossRef]
  25. Rui, X.; Feng, L. The Affordability of Natural Gas Price in China: A Literature Review; Atlantis Press: Amsterdam, The Netherlands, 2018; pp. 36–39. [Google Scholar] [CrossRef]
  26. Reymond, M. European Key Issues Concerning Natural Gas: Dependence and Vulnerability. Energy Policy 2007, 35, 4169–4176. [Google Scholar] [CrossRef]
  27. Wang, Z.Y.; Luo, D.K.; Wang, G. Developing Rules and Prospect of Natural Gas Utilization in China. Nat. Gas Ind. 2014, 34, 121–127. [Google Scholar]
  28. Xiong, Q.; Ye, P.; Han, J.; Gong, J.; Xia, H.; Liu, S.; Yang, X. Machine-Learning-Based Method for Gait Assessment in Post-Mastectomy Patients, Involves Comparing Training Results of Back Propagation (BP) Neural Network and Genetic Algorithm (GA)-BP Neural Network, and Inputting Verification Sample Data Set into BP Neural Network and GA-BP Neural Network; Univ Shanghai Sci & Technology: Shanghai, China, 2023. [Google Scholar]
  29. Su, Y.; Xu, Z.; Luo, K. Status and Development Trend Analysis of China’s Natural Gas Metering Technology. J. Clean Energy Technol. 2017, 5, 328–333. [Google Scholar] [CrossRef]
  30. Liu, Z.; Luo, Z.; Gong, P.; Guo, M. The Research of Character Recognition Algorithm for the Automatic Verification of Digital Instrument. In Proceedings of the 2013 2nd International Conference on Measurement, Information and Control, Harbin, China, 16–18 August 2013; Volume 1, pp. 177–181. [Google Scholar] [CrossRef]
  31. Song, Y.; Zhou, Z.; Xiang, P.; Fang, S. Instrument Recognition in Transformer Substation Base on Image Recognition Algorithm. In Proceedings of the 2020 5th Asia-Pacific Conference on Intelligent Robot Systems (ACIRS), Singapore, 17–19 July 2020; pp. 7–11. [Google Scholar] [CrossRef]
  32. Cai, P.; Meng, X. Research on Digital Instrument Recognition Technology of Inspection Robot. In Proceedings of the 2020 2nd International Conference on Machine Learning, Big Data and Business Intelligence (MLBDBI), Chengdu, China, 23–25 October 2020; pp. 430–433. [Google Scholar] [CrossRef]
  33. Shaikh, M.; Qureshi, Z.; Sheikh, H.H.; Sami, M. The Adoption of Mobile App for Automating Gas Meter Reading in Industry 4.0. Eng. Proc. 2022, 20, 32. [Google Scholar] [CrossRef]
  34. Balestra, P.; Nerlove, M. Pooling Cross Section and Time Series Data in the Estimation of a Dynamic Model: The Demand for Natural Gas. Econometrica 1966, 34, 585–612. [Google Scholar] [CrossRef]
  35. Liu, J.; Wang, S.; Wei, N.; Chen, X.; Xie, H.; Wang, J. Natural Gas Consumption Forecasting: A Discussion on Forecasting History and Future Challenges. J. Nat. Gas Sci. Eng. 2021, 90, 103930. [Google Scholar] [CrossRef]
  36. Sánchez-Úbeda, E.F.; Berzosa, A. Modeling and Forecasting Industrial End-Use Natural Gas Consumption. Energy Econ. 2007, 29, 710–742. [Google Scholar] [CrossRef]
  37. Aydinalp-Koksal, M.; Ugursal, V.I. Comparison of Neural Network, Conditional Demand Analysis, and Engineering Approaches for Modeling End-Use Energy Consumption in the Residential Sector. Appl. Energy 2008, 85, 271–296. [Google Scholar] [CrossRef]
  38. Wei, N.; Yin, L.; Li, C.; Liu, J.; Li, C.; Huang, Y.; Zeng, F. Data Complexity of Daily Natural Gas Consumption: Measurement and Impact on Forecasting Performance. Energy 2022, 238, 122090. [Google Scholar] [CrossRef]
  39. Thaler, M.; Grabec, I.; Poredoš, A. Prediction of Energy Consumption and Risk of Excess Demand in a Distribution System. Phys. Stat. Mech. Its Appl. 2005, 355, 46–53. [Google Scholar] [CrossRef]
  40. Gelo, T. Econometric Modelling of Gas Demand. Ekon. Pregl. 2006, 57, 80–96. [Google Scholar]
  41. Potočnik, P.; Thaler, M.; Govekar, E.; Grabec, I.; Poredoš, A. Forecasting Risks of Natural Gas Consumption in Slovenia. Energy Policy 2007, 35, 4271–4282. [Google Scholar] [CrossRef]
  42. Merkel, G.D.; Povinelli, R.J.; Brown, R.H. Deep Neural Network Regression for Short-Term Load Forecasting of Natural Gas. In Proceedings of the 37th Annual International Symposium on Forecasting, Cairns, Australia, 25–28 June 2017. [Google Scholar]
  43. Li, Y.; Chiu, Y.H.; Cen, H.; Wang, Y.; Lin, T.Y. Residential gas supply, gas losses and CO2 emissions in China. J. Nat. Gas Sci. Eng. 2020, 83, 103532. [Google Scholar] [CrossRef]
  44. Al-Awadhi, F.A.; Alhajraf, A. Prediction of non-methane hydrocarbons in Kuwait using regression and Bayesian kriged Kalman model. Environ. Ecol. Stat. 2012, 19, 393–412. [Google Scholar] [CrossRef]
  45. Liu, J.; Li, Y.; Ma, X.; Liu, H. Method for Classifying User Based on KNN Algorithm, Involves Receiving Personal Information of User, and Classifying Users According to Personal Information and Pre-Established KNN User Classification Model; Bank China Ltd.: Hong Kong, China, 2022. [Google Scholar]
  46. Dai, H.; MacBeth, C. Effects of Learning Parameters on Learning Procedure and Performance of a BPNN. Neural Netw. 1997, 10, 1505–1521. [Google Scholar] [CrossRef]
  47. Karsoliya, S. Approximating Number of Hidden Layer Neurons in Multiple Hidden Layer BPNN Architecture. Int. J. Eng. Trends Technol. 2012, 3, 714–717. [Google Scholar]
  48. Ghose, D.K.; Panda, S.S.; Swain, P.C. Prediction of Water Table Depth in Western Region, Orissa Using BPNN and RBFN Neural Networks. J. Hydrol. 2010, 394, 296–304. [Google Scholar] [CrossRef]
  49. Hu, H.Y.; Lee, Y.C.; Yen, T.M.; Tsai, C.H. Using BPNN and DEMATEL to Modify Importance–Performance Analysis Model—A Study of the Computer Industry. Expert Syst. Appl. 2009, 36, 9969–9979. [Google Scholar] [CrossRef]
  50. Asaad, R.R.; Ali, R.I. Back Propagation Neural Network(BPNN) and Sigmoid Activation Function in Multi-Layer Networks. Acad. J. Nawroz Univ. 2019, 8, 216–221. [Google Scholar] [CrossRef]
  51. Ma, X. Natural Gas and Energy Revolution: A Case Study of Sichuan–Chongqing Gas Province. Nat. Gas Ind. B 2017, 4, 91–99. [Google Scholar] [CrossRef]

Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (1)

Figure 1.Overall methodology.

Figure 1.Overall methodology.

Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (2)

Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (3)

Figure 2.BPNN model.

Figure 2.BPNN model.

Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (4)

Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (5)

Figure 3.Experimental equipment and images: (a) CG-Z-2.5 IC card membrane gas meter and camera; (b) Image captured by the camera; (c) Image of an individual grid digit.

Figure 3.Experimental equipment and images: (a) CG-Z-2.5 IC card membrane gas meter and camera; (b) Image captured by the camera; (c) Image of an individual grid digit.

Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (6)

Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (7)

Figure 4.Training process for the KNN model.

Figure 4.Training process for the KNN model.

Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (8)

Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (9)

Figure 5.Natural gas consumption on 16–18 October 2022.

Figure 5.Natural gas consumption on 16–18 October 2022.

Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (10)

Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (11)

Figure 6.Prediction framework based on BPNN.

Figure 6.Prediction framework based on BPNN.

Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (12)

Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (13)

Table 1.Recognition results of the first labelling method.

Table 1.Recognition results of the first labelling method.

ImageRecognition Result
Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (14)0
Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (15)2
Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (16)6

Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (17)

Table 2.Recognition results of the second labelling method.

Table 2.Recognition results of the second labelling method.

ImageRecognition Result
Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (18)1
Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (19)NA
Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (20)NA

Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (21)

Table 3.Recognition results of the third labelling method.

Table 3.Recognition results of the third labelling method.

ImageRecognition Result
Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (22)0
Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (23)1
Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (24)NA

Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (25)

Table 4.Experimental equipment and methods.

Table 4.Experimental equipment and methods.

StepEquipment/Methods
Data CollectionCG-Z-2.5 IC Card Film Gas Meter + Camera
Data
Preprocessing
Capture Data ScreenshotsPyCharm (Version 2022.3.3) + OpenCV (Version 4.6.0)
Label CreationLabel “NA” when the eighth digit displays a value between two digits and label based on the actual digit value when it displays a complete digit.
KNN Model TrainingPyCharm (Version 2022.3.3)

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.


© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Natural Gas Consumption Monitoring Based on k-NN Algorithm and Consumption Prediction Framework Based on Backpropagation Neural Network (2024)

References

Top Articles
Latest Posts
Article information

Author: Laurine Ryan

Last Updated:

Views: 6440

Rating: 4.7 / 5 (77 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Laurine Ryan

Birthday: 1994-12-23

Address: Suite 751 871 Lissette Throughway, West Kittie, NH 41603

Phone: +2366831109631

Job: Sales Producer

Hobby: Creative writing, Motor sports, Do it yourself, Skateboarding, Coffee roasting, Calligraphy, Stand-up comedy

Introduction: My name is Laurine Ryan, I am a adorable, fair, graceful, spotless, gorgeous, homely, cooperative person who loves writing and wants to share my knowledge and understanding with you.