# Residential Energy-Saving Lighting Based on Bioinspired Algorithms

Authors: Yuhang Wu; Yitong Zhang; Nah Ilmin; Jing Sui
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

Traditional residential lighting systems have the problem of high energy consumption. Based on artificial neural network (ANN), combined with particle swarm optimization algorithm, and genetic algorithm to optimize the initial weights and thresholds, an improved ANN prediction model for residential energy-saving lighting is proposed, and an actual residential lighting project is taken as an example to verify it. The results show that the proposed method can quickly predict the number of residential lighting lamps under the premise of meeting the standard illumination of residential lighting. The prediction accuracy can reach 98.45%, which has the characteristics of high prediction accuracy and small error. Compared with the ANN model and ANFIS model, the average relative error of the proposed prediction model is reduced by 2.29% and 0.87%, respectively, which has certain effectiveness and superiority. It provides a new idea for residential energy-saving lighting.


---

## Body

## 1. Introduction

In line with the concept of scientific and sustainable development, people’s awareness of energy conservation and environmental protection has gradually been raised, which is manifested in water conservation, energy conservation, and emission reduction. Moreover, residential buildings are the essential material form of human beings, and their energy conservation and environment protection can save social resources to a large extent, which has important significance for the environment protection and pollution abatement. Energy-saving and environmental protection of residential buildings can be realized in various ways. For example, N. Thejo Kalyani et al studied different organic materials synthesized by organic light-emitting diodes. A new organic light-emitting diode (OLED) is prepared, and energy-saving lighting is realized [1]. Sadeghian Omid et al analyzed the potential of different energy-saving schemes and their environmental impact, discussed the use of renewable energy and energy-saving lamps and other direct energy-saving schemes, and realized the energy-saving and emission reduction by using alternating energy storage system control strategies and technologies [2]. Under different climate conditions, Maučec Damjan et al. carried out sensitivity analysis on different input parameters where global sensitivity analysis technology based on elementary effect is adopted. The main design parameters affecting energy saving are determined, and the energy saving of timber structure building is realized by adjusting these parameters [3]. Grobe Oliver Lars innovated the windowing irregular reflection and transmission, and thus, the solar radiation is redirected, selectively admitted, or blocked. Also, the modeling technology of optical complex fenestration is proposed. Finally, the design of energy-saving green buildings is realized [4]. In the environment of the oil crisis and global warming caused by emissions of greenhouse gases, Vasiliu A et al. took Romania residence as the research object and adopted a cross-dialectical analysis method to analyze passive energy-saving buildings, such as low energy consumption, green house, and net zero-energy buildings. Thus, they thought that residential building designed according to Nzeb standard can meet the low energy consumption residential minimum requirements [5]. Rijal Hom B et al collected 19,081 pieces of thermal comfort data from 94 households in 69 apartments in Japan, connected indoor comfort temperature with outdoor temperature, quantified changes in the thermal environmental comfort temperature of Japanese residential buildings with seasons, and established a domestic adaptability model of Japanese high-insulation residential buildings. Adaptive thermal comfort energy-saving building is designed [6]. Based on data mining techniques, Himmetoğlu Salih et al. proposed a multifactor PSACONN analysis framework to study the influence of climate and building enclosure structure on building heat (heat and cold) energy consumption at the design stage. It is found that the estimation accuracy of this framework reaches 99% and 98%, respectively, which can effectively find the envelope combination that provides the minimum energy consumption for different climate regions and realize the residential energy saving [7]. Wu Weidong et al. reconstructed the reference building envelope and renewable energy system with zero-energy consumption, constructed the control function, and optimized the solution to obtain the optimal reconstruction scheme, which provides guidance for the reconstruction of zero-energy residential buildings [8]. Among them, under the premise of ensuring the standard lighting intensity, using limited resources to create a good lighting environment and realize energy saving is the most common way at present. However, as the characteristics of three-dimensional spatial distribution and dynamic time change of residential lighting, there are many nonlinear relationship problems in residential lighting, which is a great challenge to the design of residential energy-saving lighting.


## 2. Basic Methods

### 2.1. ANN Networks

ANN network is a complex network system that simulates human brain behavior and consists of a large number of neurons. It has intelligent processing functions such as learning and computing. There are many ANN network models, including the Hopfield model and BP model. For the convenience of explanation, the BP network model is used to illustrate where the input and output of BP network model can be expressed by activation function or transfer function, and neurons at each layer have a certain threshold and internal state [9]. In the BP model, there are three layers: input layer, hidden layer, and output layer. Furthermore, each layer of neurons only receives the neurons’ output of the previous layer, and output information is generated through the weight of each layer and changes of each neuron, which are shown in Figure 1.Figure 1
Schematic diagram of BP network model.As can be seen from the figure, inputXj and output Oj of the neuron at layer j can be expressed as(1)Xj=∑iWji•Oi,Oj=FXj,where Wji is the weight of layer j and layer i; f is the activation function, usually an S-type function.(2)fx=11+exp−βx−θ,where β is the slope of the activation function; θ is the neuron threshold.Fork samples, BP network training output error is(3)εk=tk−Ok,where tk and Ok are the target output and real output of k.The total error function is(4)E=12∑ktk−Ok2.In the whole BP network training, the adjustment rule of weight is as follows [10]:(5)ΔWkj=−η•∂E∂Wkj,where η is the learning rate. By substituting the above formula into (4), the adjustment rules of weight can be obtained.(6)ΔWkjn+1=η•δk•Oj,(7)ΔWjin+1=η•δj•Oi.Nodeδj of hidden layer and node δk of output layer can be expressed as(8)δj=Oj1−Oj•∑kWkj•δk,δk=tk−Ok•1−Ok.In practical application, the momentum factor is usually introduced to adjust weight, so (6) and (7) can be rewritten as(9)ΔWkjn+1=η•δk•Oj+α•Wkjn,ΔWjin+1=η•δj•Oi+α•Wjin,where a is the momentum factor, and its value range is (0,1).The threshold values of the hidden layer and output layer can be used as the expansion of neuron input of this layer, and its adjustment rules can be expressed as(10)Δθjn+1=−η•δj+α•Δθjn,Δθin=−η•δi+α•Δθin.BP network has powerful computing capacity and can process more data quickly, but it also has certain limitations. For initial weight and threshold assignment, the different assignment has a certain influence on the performance of the network. In order to avoid this problem, this paper combines the highly complementary searching ability to conduct search optimization on the optimal assignment of initial weights and thresholds, so as to improve the prediction accuracy of the ANN network [11].


### 2.2. Improvement of ANN Algorithm

The specific operation process of adopting PSO and GA to optimize the initial weights and thresholds of the ANN network is as follows:(1)
Combine initial weights and thresholds of the ANN network according to the binary real-number coding method. The parameters to be optimized in each coding group represent genes, and each coding group is an individual. In reverse solution, binary numbers can be converted into decimal numbers through (11) [12].(11)Fai1,ai2,n,ail=Ri+Ti−Ri2l−1∑j=1iaij2j−1,whereai1,ai2,n,ail is the i section with l length, and ai1  = 0 or ai1  = 1. Ti and Ri are the endpoints of the definition domain i.The population containingS individuals is denoted as M, and the genome of individual u is Mu, which are denoted as(12)M=M1,M2,…Ms,Mu=Mu1,Mu2,…Muσ,whereσ is the total number of weights and thresholds.(2)
The purpose of ANN network training is to make the predicted valuey approximate the real value b, so the fitness function can be determined as [13](13)F=∑0y0−b0.(3)
Calculate individual fitness values and population fitness values of PSO and GA initial populations, respectively, and select the optimal value as the optimal value group to form the initial parent population.Where the update formulas for the position and speed of PSO are(14)vi,jt+1=ρvi,jt+c1r1pbesti−xi,jt+c2r2gbest−xi,jt,xit+1=xit+vit+1, where ρ represents inertia weight; c1 and c2 are particle accelerations; r1 and r2 are random vectors; pbesti represents the local optimal value of the current particle; gbest represents the global optimal value.(4)
For the initial parent population, the PSO algorithm and GA algorithm are adopted to update the population, respectively, which means that the PSO algorithm updates the population by updating individual speed and position space [14]. GA algorithm realizes population renewal through selection, mutation, and crossover operation [15].(5)
When the PSO algorithm and GA algorithm meet the termination conditions, the best individual is selected and input it into the ANN network for training;(6)
Calculate the network error, and stop the iteration when the termination condition is met.The process can be illustrated in Figure2.Figure 2
Optimization flowchart.


### 2.3. Prediction Model Construction of Residential Energy-Saving Lighting Based on Improved ANN

According to the residential energy-saving lighting requirements, the specific design of the PSO algorithm and GA algorithm optimizing and improving the ANN network model is as follows.


#### 2.3.1. Network Layers

The theory proves that a three-layer neural network structure can achieve any nonlinear mapping [16]. Therefore, this paper sets the residential energy-saving lighting prediction ANN network as a three-layer network model that includes an input layer, hidden layer, and output layer.


#### 2.3.2. Neurons of Input Layer

The function of the input layer is to receive the input model data and transmit it to the hidden layer. According to the residential energy-saving lighting requirements, it can be seen that the efficiency of lamps, luminous flux of light source, average reflectance ratio of wall surfaces, the installation height of lamps, working area, maintenance coefficient of lamps, effective floor reflectance, and effective ceiling reflectance have a significant impact on residential energy-saving lighting [17–21]. Therefore, the above 8 types of data are selected as input data, and the number of neurons in the input layer is 8.


#### 2.3.3. Neurons of Output Layer

The prediction of residential energy-saving lighting is mainly to determine the number of lamps and illumination value, so the number of neurons in the output layer can be determined as 2.


#### 2.3.4. Neurons of Hidden Layer

For a three-layer ANN network, the number of neuronsX in the hidden layer is generally determined by the following equation [21]:(15)x=m+n+a,where m and n are the number of nodes in the input layer and output layer, respectively; a is a constant between 0 and 10. Combined with PSO and GA algorithm to optimize ANN parameters, the number of neurons in the hidden layer is 15.Based on the above analysis, the structure of the improved ANN network is shown in Figure3.Figure 3
Structure diagram of the optimized ANN network.Therefore, according to the actual situation of residential lighting, the realization process of residential energy-saving lighting prediction is shown in Figure4. Firstly, the model sample data are determined, and the samples after preprocessing are divided into the training set, testing set, and cross-validation set according to a certain proportion. Moreover, the initial weights and thresholds of the network are optimized. Thus, the network structure and related model parameters are determined, and the optimal ANN network model is obtained. Finally, the number of lamps and illumination of residential energy-saving lighting are predicted through the optimal ANN network model.Figure 4
Prediction process of residential energy-saving lighting based on improved ANN.


## 2.1. ANN Networks

ANN network is a complex network system that simulates human brain behavior and consists of a large number of neurons. It has intelligent processing functions such as learning and computing. There are many ANN network models, including the Hopfield model and BP model. For the convenience of explanation, the BP network model is used to illustrate where the input and output of BP network model can be expressed by activation function or transfer function, and neurons at each layer have a certain threshold and internal state [9]. In the BP model, there are three layers: input layer, hidden layer, and output layer. Furthermore, each layer of neurons only receives the neurons’ output of the previous layer, and output information is generated through the weight of each layer and changes of each neuron, which are shown in Figure 1.Figure 1
Schematic diagram of BP network model.As can be seen from the figure, inputXj and output Oj of the neuron at layer j can be expressed as(1)Xj=∑iWji•Oi,Oj=FXj,where Wji is the weight of layer j and layer i; f is the activation function, usually an S-type function.(2)fx=11+exp−βx−θ,where β is the slope of the activation function; θ is the neuron threshold.Fork samples, BP network training output error is(3)εk=tk−Ok,where tk and Ok are the target output and real output of k.The total error function is(4)E=12∑ktk−Ok2.In the whole BP network training, the adjustment rule of weight is as follows [10]:(5)ΔWkj=−η•∂E∂Wkj,where η is the learning rate. By substituting the above formula into (4), the adjustment rules of weight can be obtained.(6)ΔWkjn+1=η•δk•Oj,(7)ΔWjin+1=η•δj•Oi.Nodeδj of hidden layer and node δk of output layer can be expressed as(8)δj=Oj1−Oj•∑kWkj•δk,δk=tk−Ok•1−Ok.In practical application, the momentum factor is usually introduced to adjust weight, so (6) and (7) can be rewritten as(9)ΔWkjn+1=η•δk•Oj+α•Wkjn,ΔWjin+1=η•δj•Oi+α•Wjin,where a is the momentum factor, and its value range is (0,1).The threshold values of the hidden layer and output layer can be used as the expansion of neuron input of this layer, and its adjustment rules can be expressed as(10)Δθjn+1=−η•δj+α•Δθjn,Δθin=−η•δi+α•Δθin.BP network has powerful computing capacity and can process more data quickly, but it also has certain limitations. For initial weight and threshold assignment, the different assignment has a certain influence on the performance of the network. In order to avoid this problem, this paper combines the highly complementary searching ability to conduct search optimization on the optimal assignment of initial weights and thresholds, so as to improve the prediction accuracy of the ANN network [11].


## 2.2. Improvement of ANN Algorithm

The specific operation process of adopting PSO and GA to optimize the initial weights and thresholds of the ANN network is as follows:(1)
Combine initial weights and thresholds of the ANN network according to the binary real-number coding method. The parameters to be optimized in each coding group represent genes, and each coding group is an individual. In reverse solution, binary numbers can be converted into decimal numbers through (11) [12].(11)Fai1,ai2,n,ail=Ri+Ti−Ri2l−1∑j=1iaij2j−1,whereai1,ai2,n,ail is the i section with l length, and ai1  = 0 or ai1  = 1. Ti and Ri are the endpoints of the definition domain i.The population containingS individuals is denoted as M, and the genome of individual u is Mu, which are denoted as(12)M=M1,M2,…Ms,Mu=Mu1,Mu2,…Muσ,whereσ is the total number of weights and thresholds.(2)
The purpose of ANN network training is to make the predicted valuey approximate the real value b, so the fitness function can be determined as [13](13)F=∑0y0−b0.(3)
Calculate individual fitness values and population fitness values of PSO and GA initial populations, respectively, and select the optimal value as the optimal value group to form the initial parent population.Where the update formulas for the position and speed of PSO are(14)vi,jt+1=ρvi,jt+c1r1pbesti−xi,jt+c2r2gbest−xi,jt,xit+1=xit+vit+1, where ρ represents inertia weight; c1 and c2 are particle accelerations; r1 and r2 are random vectors; pbesti represents the local optimal value of the current particle; gbest represents the global optimal value.(4)
For the initial parent population, the PSO algorithm and GA algorithm are adopted to update the population, respectively, which means that the PSO algorithm updates the population by updating individual speed and position space [14]. GA algorithm realizes population renewal through selection, mutation, and crossover operation [15].(5)
When the PSO algorithm and GA algorithm meet the termination conditions, the best individual is selected and input it into the ANN network for training;(6)
Calculate the network error, and stop the iteration when the termination condition is met.The process can be illustrated in Figure2.Figure 2
Optimization flowchart.


## 2.3. Prediction Model Construction of Residential Energy-Saving Lighting Based on Improved ANN

According to the residential energy-saving lighting requirements, the specific design of the PSO algorithm and GA algorithm optimizing and improving the ANN network model is as follows.


### 2.3.1. Network Layers

The theory proves that a three-layer neural network structure can achieve any nonlinear mapping [16]. Therefore, this paper sets the residential energy-saving lighting prediction ANN network as a three-layer network model that includes an input layer, hidden layer, and output layer.


### 2.3.2. Neurons of Input Layer

The function of the input layer is to receive the input model data and transmit it to the hidden layer. According to the residential energy-saving lighting requirements, it can be seen that the efficiency of lamps, luminous flux of light source, average reflectance ratio of wall surfaces, the installation height of lamps, working area, maintenance coefficient of lamps, effective floor reflectance, and effective ceiling reflectance have a significant impact on residential energy-saving lighting [17–21]. Therefore, the above 8 types of data are selected as input data, and the number of neurons in the input layer is 8.


### 2.3.3. Neurons of Output Layer

The prediction of residential energy-saving lighting is mainly to determine the number of lamps and illumination value, so the number of neurons in the output layer can be determined as 2.


### 2.3.4. Neurons of Hidden Layer

For a three-layer ANN network, the number of neuronsX in the hidden layer is generally determined by the following equation [21]:(15)x=m+n+a,where m and n are the number of nodes in the input layer and output layer, respectively; a is a constant between 0 and 10. Combined with PSO and GA algorithm to optimize ANN parameters, the number of neurons in the hidden layer is 15.Based on the above analysis, the structure of the improved ANN network is shown in Figure3.Figure 3
Structure diagram of the optimized ANN network.Therefore, according to the actual situation of residential lighting, the realization process of residential energy-saving lighting prediction is shown in Figure4. Firstly, the model sample data are determined, and the samples after preprocessing are divided into the training set, testing set, and cross-validation set according to a certain proportion. Moreover, the initial weights and thresholds of the network are optimized. Thus, the network structure and related model parameters are determined, and the optimal ANN network model is obtained. Finally, the number of lamps and illumination of residential energy-saving lighting are predicted through the optimal ANN network model.Figure 4
Prediction process of residential energy-saving lighting based on improved ANN.


## 2.3.1. Network Layers

The theory proves that a three-layer neural network structure can achieve any nonlinear mapping [16]. Therefore, this paper sets the residential energy-saving lighting prediction ANN network as a three-layer network model that includes an input layer, hidden layer, and output layer.


## 2.3.2. Neurons of Input Layer

The function of the input layer is to receive the input model data and transmit it to the hidden layer. According to the residential energy-saving lighting requirements, it can be seen that the efficiency of lamps, luminous flux of light source, average reflectance ratio of wall surfaces, the installation height of lamps, working area, maintenance coefficient of lamps, effective floor reflectance, and effective ceiling reflectance have a significant impact on residential energy-saving lighting [17–21]. Therefore, the above 8 types of data are selected as input data, and the number of neurons in the input layer is 8.


## 2.3.3. Neurons of Output Layer

The prediction of residential energy-saving lighting is mainly to determine the number of lamps and illumination value, so the number of neurons in the output layer can be determined as 2.


## 2.3.4. Neurons of Hidden Layer

For a three-layer ANN network, the number of neuronsX in the hidden layer is generally determined by the following equation [21]:(15)x=m+n+a,where m and n are the number of nodes in the input layer and output layer, respectively; a is a constant between 0 and 10. Combined with PSO and GA algorithm to optimize ANN parameters, the number of neurons in the hidden layer is 15.Based on the above analysis, the structure of the improved ANN network is shown in Figure3.Figure 3
Structure diagram of the optimized ANN network.Therefore, according to the actual situation of residential lighting, the realization process of residential energy-saving lighting prediction is shown in Figure4. Firstly, the model sample data are determined, and the samples after preprocessing are divided into the training set, testing set, and cross-validation set according to a certain proportion. Moreover, the initial weights and thresholds of the network are optimized. Thus, the network structure and related model parameters are determined, and the optimal ANN network model is obtained. Finally, the number of lamps and illumination of residential energy-saving lighting are predicted through the optimal ANN network model.Figure 4
Prediction process of residential energy-saving lighting based on improved ANN.


## 3. Simulation Experiment

### 3.1. Experimental Environment

In this experiment, the improved PSO prediction model is constructed on MATLAB2014 software. The operating system is Windows7, and the CPU is Intel(R) Core(TM) i7-7770hq 2.8 GHz. Moreover, the memory is 8G.


### 3.2. Data Sources and Preprocessing

Data in this experiment are the lighting-related data of dozens of residential buildings of different sizes from May to December 2020 in Xi’an, Shaanxi, including 100 sets of data, such as indoor area, isometric efficiency, and the number of lamps [22, 23].Considering that the dimensions of sample data are different and the span of data is large, it is easy to cause difficulties in subsequent model analysis. To solve this problem, deviation standardization is adopted to normalize sample data in the experiment, as shown in the following equation [24]:(16)A=A0−AminAmax−Amin,where A is the data whose value range is [0,1]; A0 is the original data value; Amax and Amin are the maximum and minimum values of A0.There are 70 groups of samples randomly selected from the experimental samples as the training set, 15 groups of samples as the testing set, and 15 groups of sample data as the cross-validation set.


### 3.3. Evaluation Indicators

In the experiment, average relative error (MAPE) is selected as the indicator to evaluate model performance, and its calculation method is as follows [25]:(17)MAPE=1n∑i=1nactualt−forecasttactualt∗100%.


### 3.4. Experimental Results

#### 3.4.1. Model Verification

To verify the effectiveness of the proposed model, the predicted results of the model on the number of lights and illuminance are tested experimentally and compared with the actual values, which are shown in Figure5 where the predicted value curve of the proposed model for the number of lights and illumination has a good fitting effect with the actual value curve, which almost coincides with each other, indicating that the proposed model has a good prediction accuracy.Figure 5
Prediction results of improved PSO.
(a)(b)Figure6 shows the error convergence curves on the training set, testing set, and cross-validation sample set before and after the ANN model is improved. It can be seen that when it is iterated for 9 times before improvement, the mean square error of the ANN model is 44.45. When it is iterated for 14 times after improvement, the mean square error is 5.89. Therefore, PSO and GA algorithms can improve the convergence speed of the ANN model.Figure 6
Error convergence curve of models. (a) ANN network. (b) Improved ANN network.Figure7 shows the linear regression diagram of the proposed model before and after improvement. As can be seen that the fitting accuracy of training samples and cross-validation samples before model improvement is R = 0.9768, the fitting accuracy of validation samples is R = 0.9538, and the overall fitting accuracy is R = 0.9845. After model improvement, the fitting accuracy of training samples, cross-validation samples, validation samples, and overall fitting samples is R = 0.99999. Therefore, after optimizing the ANN network by PSO and GA algorithms, the prediction accuracy of the model can be improved, and the proposed model has a high prediction accuracy of residential energy-saving lighting.Figure 7
Linear regression diagram of models. (a) PSO network. (b) Improved PSO network.In conclusion, the improved ANN model has a high prediction accuracy for residential energy-saving lighting, which reaches 98.45%. In addition, the convergence speed of the model is fast. It can predict and calculate the number of lamps and illuminance degree of residences under the design requirements of the residential energy-saving lighting prediction model.


#### 3.4.2. Model Comparison

To further verify the validity of the proposed model, the experiment compares the prediction effect of the proposed model with the common prediction model ANN and fuzzy neural network model (ANFIS) on the experimental data set, and the results are shown in Table1 where the ANFIS network structure and initial parameters are determined by the fuzzy C-means clustering algorithm. After debugging, the initial number of clusters is set to 2; the target error is set to 0.1; the classification matrix index is set to 10; and the maximum number of iterations is set to 100. At this time, ANFIS has good prediction accuracy. Compared with ANN and ANFIS models, the prediction error of the proposed model is 1.28%, and the average relative error decreases to varying degrees, which means that the proposed model has better performance and is more suitable for solving the residential energy-saving lighting problem.Table 1
Comparison of average relative errors of models.
IndicatorImproved ANN (%)ANN (%)ANFIS (%)MAPE1.283.572.15


#### 3.4.3. Example Verification

To verify the prediction effect of the proposed model in the actual residential energy-saving lighting, a senior residence is taken as the research object for verification. Compared with the prediction results of the ANN network and fuzzy neural network before improvement, the results are shown in Table2. Here, the predicted results of the proposed model, ANN network model, and fuzzy neural network model all meet the standard value of illumination requirements of relevant national specifications. On this basis, the use of lamps in the proposed model is the least (69 lamps), and the value of illumination is closer to the standard value. Therefore, compared with the ANN model and fuzzy neural network model, the proposed model meets the requirements of residential energy-saving lighting and has certain effectiveness and superiority.Table 2
Comparison of prediction results of different models.
ModelNumber of lamps/lampIllumination/lmStandard illumination/lmNeural network calculation method76912750Fuzzy neural network calculation method71795750BP network calculation method optimized by PSO-GA69765750


#### 3.4.4. Simulation Results of DIALux Modeling

To verify the generalization ability of the proposed model, DIALux lighting software is used for modeling and simulation. DIALux lighting software can provide a variety of parameters for calculation according to the actual residential building requirements and can be compared and analyzed according to the input set value. DIALux lighting software is used to simulate the residential illumination values, and the results are shown in Table3. Compared with the ANN model and ANFIS model, the average illuminance value of the proposed model is the smallest and closest to the standard illuminance (750lx), which is 765lx. Furthermore, the illuminance uniformity is the largest, which is 0.85. So it indicates that the proposed model can provide a better lighting environment with more uniform illumination and energy saving under the premise of ensuring lighting requirements.Table 3
Comparison of illumination index values of different models.
CategoryAverage illumination (lx)Minimum illumination (lx)Maximum illumination (lx)Minimum illumination/average illuminationMinimum illumination/maximum illuminationANN91272911010.810.66ANFIS7956809300.860.73Improve ANN7657048320.920.85Table4 shows the comparison of GR values of glare index of different models at 5 observation points. As can be seen from the table, the GR values of the five observation points of the ANN model are all over 30, and there are three observation points that GR values of the ANFIS model are all over 30. The GR values of the five observation points of the proposed model are all within 30 (including 30), which meets the maximum glare index (30) stipulated by the state. Therefore, the proposed model meets the requirements of the national specification.Table 4
Comparison of GR values of different models.
CategoryGR observation point 1GR observation point 2GR observation point 3GR observation point 4GR observation point 5ANN3432343535ANFIS3132303230Improve ANN3028302930


## 3.1. Experimental Environment

In this experiment, the improved PSO prediction model is constructed on MATLAB2014 software. The operating system is Windows7, and the CPU is Intel(R) Core(TM) i7-7770hq 2.8 GHz. Moreover, the memory is 8G.


## 3.2. Data Sources and Preprocessing

Data in this experiment are the lighting-related data of dozens of residential buildings of different sizes from May to December 2020 in Xi’an, Shaanxi, including 100 sets of data, such as indoor area, isometric efficiency, and the number of lamps [22, 23].Considering that the dimensions of sample data are different and the span of data is large, it is easy to cause difficulties in subsequent model analysis. To solve this problem, deviation standardization is adopted to normalize sample data in the experiment, as shown in the following equation [24]:(16)A=A0−AminAmax−Amin,where A is the data whose value range is [0,1]; A0 is the original data value; Amax and Amin are the maximum and minimum values of A0.There are 70 groups of samples randomly selected from the experimental samples as the training set, 15 groups of samples as the testing set, and 15 groups of sample data as the cross-validation set.


## 3.3. Evaluation Indicators

In the experiment, average relative error (MAPE) is selected as the indicator to evaluate model performance, and its calculation method is as follows [25]:(17)MAPE=1n∑i=1nactualt−forecasttactualt∗100%.


## 3.4. Experimental Results

### 3.4.1. Model Verification

To verify the effectiveness of the proposed model, the predicted results of the model on the number of lights and illuminance are tested experimentally and compared with the actual values, which are shown in Figure5 where the predicted value curve of the proposed model for the number of lights and illumination has a good fitting effect with the actual value curve, which almost coincides with each other, indicating that the proposed model has a good prediction accuracy.Figure 5
Prediction results of improved PSO.
(a)(b)Figure6 shows the error convergence curves on the training set, testing set, and cross-validation sample set before and after the ANN model is improved. It can be seen that when it is iterated for 9 times before improvement, the mean square error of the ANN model is 44.45. When it is iterated for 14 times after improvement, the mean square error is 5.89. Therefore, PSO and GA algorithms can improve the convergence speed of the ANN model.Figure 6
Error convergence curve of models. (a) ANN network. (b) Improved ANN network.Figure7 shows the linear regression diagram of the proposed model before and after improvement. As can be seen that the fitting accuracy of training samples and cross-validation samples before model improvement is R = 0.9768, the fitting accuracy of validation samples is R = 0.9538, and the overall fitting accuracy is R = 0.9845. After model improvement, the fitting accuracy of training samples, cross-validation samples, validation samples, and overall fitting samples is R = 0.99999. Therefore, after optimizing the ANN network by PSO and GA algorithms, the prediction accuracy of the model can be improved, and the proposed model has a high prediction accuracy of residential energy-saving lighting.Figure 7
Linear regression diagram of models. (a) PSO network. (b) Improved PSO network.In conclusion, the improved ANN model has a high prediction accuracy for residential energy-saving lighting, which reaches 98.45%. In addition, the convergence speed of the model is fast. It can predict and calculate the number of lamps and illuminance degree of residences under the design requirements of the residential energy-saving lighting prediction model.


### 3.4.2. Model Comparison

To further verify the validity of the proposed model, the experiment compares the prediction effect of the proposed model with the common prediction model ANN and fuzzy neural network model (ANFIS) on the experimental data set, and the results are shown in Table1 where the ANFIS network structure and initial parameters are determined by the fuzzy C-means clustering algorithm. After debugging, the initial number of clusters is set to 2; the target error is set to 0.1; the classification matrix index is set to 10; and the maximum number of iterations is set to 100. At this time, ANFIS has good prediction accuracy. Compared with ANN and ANFIS models, the prediction error of the proposed model is 1.28%, and the average relative error decreases to varying degrees, which means that the proposed model has better performance and is more suitable for solving the residential energy-saving lighting problem.Table 1
Comparison of average relative errors of models.
IndicatorImproved ANN (%)ANN (%)ANFIS (%)MAPE1.283.572.15


### 3.4.3. Example Verification

To verify the prediction effect of the proposed model in the actual residential energy-saving lighting, a senior residence is taken as the research object for verification. Compared with the prediction results of the ANN network and fuzzy neural network before improvement, the results are shown in Table2. Here, the predicted results of the proposed model, ANN network model, and fuzzy neural network model all meet the standard value of illumination requirements of relevant national specifications. On this basis, the use of lamps in the proposed model is the least (69 lamps), and the value of illumination is closer to the standard value. Therefore, compared with the ANN model and fuzzy neural network model, the proposed model meets the requirements of residential energy-saving lighting and has certain effectiveness and superiority.Table 2
Comparison of prediction results of different models.
ModelNumber of lamps/lampIllumination/lmStandard illumination/lmNeural network calculation method76912750Fuzzy neural network calculation method71795750BP network calculation method optimized by PSO-GA69765750


### 3.4.4. Simulation Results of DIALux Modeling

To verify the generalization ability of the proposed model, DIALux lighting software is used for modeling and simulation. DIALux lighting software can provide a variety of parameters for calculation according to the actual residential building requirements and can be compared and analyzed according to the input set value. DIALux lighting software is used to simulate the residential illumination values, and the results are shown in Table3. Compared with the ANN model and ANFIS model, the average illuminance value of the proposed model is the smallest and closest to the standard illuminance (750lx), which is 765lx. Furthermore, the illuminance uniformity is the largest, which is 0.85. So it indicates that the proposed model can provide a better lighting environment with more uniform illumination and energy saving under the premise of ensuring lighting requirements.Table 3
Comparison of illumination index values of different models.
CategoryAverage illumination (lx)Minimum illumination (lx)Maximum illumination (lx)Minimum illumination/average illuminationMinimum illumination/maximum illuminationANN91272911010.810.66ANFIS7956809300.860.73Improve ANN7657048320.920.85Table4 shows the comparison of GR values of glare index of different models at 5 observation points. As can be seen from the table, the GR values of the five observation points of the ANN model are all over 30, and there are three observation points that GR values of the ANFIS model are all over 30. The GR values of the five observation points of the proposed model are all within 30 (including 30), which meets the maximum glare index (30) stipulated by the state. Therefore, the proposed model meets the requirements of the national specification.Table 4
Comparison of GR values of different models.
CategoryGR observation point 1GR observation point 2GR observation point 3GR observation point 4GR observation point 5ANN3432343535ANFIS3132303230Improve ANN3028302930


## 3.4.1. Model Verification

To verify the effectiveness of the proposed model, the predicted results of the model on the number of lights and illuminance are tested experimentally and compared with the actual values, which are shown in Figure5 where the predicted value curve of the proposed model for the number of lights and illumination has a good fitting effect with the actual value curve, which almost coincides with each other, indicating that the proposed model has a good prediction accuracy.Figure 5
Prediction results of improved PSO.
(a)(b)Figure6 shows the error convergence curves on the training set, testing set, and cross-validation sample set before and after the ANN model is improved. It can be seen that when it is iterated for 9 times before improvement, the mean square error of the ANN model is 44.45. When it is iterated for 14 times after improvement, the mean square error is 5.89. Therefore, PSO and GA algorithms can improve the convergence speed of the ANN model.Figure 6
Error convergence curve of models. (a) ANN network. (b) Improved ANN network.Figure7 shows the linear regression diagram of the proposed model before and after improvement. As can be seen that the fitting accuracy of training samples and cross-validation samples before model improvement is R = 0.9768, the fitting accuracy of validation samples is R = 0.9538, and the overall fitting accuracy is R = 0.9845. After model improvement, the fitting accuracy of training samples, cross-validation samples, validation samples, and overall fitting samples is R = 0.99999. Therefore, after optimizing the ANN network by PSO and GA algorithms, the prediction accuracy of the model can be improved, and the proposed model has a high prediction accuracy of residential energy-saving lighting.Figure 7
Linear regression diagram of models. (a) PSO network. (b) Improved PSO network.In conclusion, the improved ANN model has a high prediction accuracy for residential energy-saving lighting, which reaches 98.45%. In addition, the convergence speed of the model is fast. It can predict and calculate the number of lamps and illuminance degree of residences under the design requirements of the residential energy-saving lighting prediction model.


## 3.4.2. Model Comparison

To further verify the validity of the proposed model, the experiment compares the prediction effect of the proposed model with the common prediction model ANN and fuzzy neural network model (ANFIS) on the experimental data set, and the results are shown in Table1 where the ANFIS network structure and initial parameters are determined by the fuzzy C-means clustering algorithm. After debugging, the initial number of clusters is set to 2; the target error is set to 0.1; the classification matrix index is set to 10; and the maximum number of iterations is set to 100. At this time, ANFIS has good prediction accuracy. Compared with ANN and ANFIS models, the prediction error of the proposed model is 1.28%, and the average relative error decreases to varying degrees, which means that the proposed model has better performance and is more suitable for solving the residential energy-saving lighting problem.Table 1
Comparison of average relative errors of models.
IndicatorImproved ANN (%)ANN (%)ANFIS (%)MAPE1.283.572.15


## 3.4.3. Example Verification

To verify the prediction effect of the proposed model in the actual residential energy-saving lighting, a senior residence is taken as the research object for verification. Compared with the prediction results of the ANN network and fuzzy neural network before improvement, the results are shown in Table2. Here, the predicted results of the proposed model, ANN network model, and fuzzy neural network model all meet the standard value of illumination requirements of relevant national specifications. On this basis, the use of lamps in the proposed model is the least (69 lamps), and the value of illumination is closer to the standard value. Therefore, compared with the ANN model and fuzzy neural network model, the proposed model meets the requirements of residential energy-saving lighting and has certain effectiveness and superiority.Table 2
Comparison of prediction results of different models.
ModelNumber of lamps/lampIllumination/lmStandard illumination/lmNeural network calculation method76912750Fuzzy neural network calculation method71795750BP network calculation method optimized by PSO-GA69765750


## 3.4.4. Simulation Results of DIALux Modeling

To verify the generalization ability of the proposed model, DIALux lighting software is used for modeling and simulation. DIALux lighting software can provide a variety of parameters for calculation according to the actual residential building requirements and can be compared and analyzed according to the input set value. DIALux lighting software is used to simulate the residential illumination values, and the results are shown in Table3. Compared with the ANN model and ANFIS model, the average illuminance value of the proposed model is the smallest and closest to the standard illuminance (750lx), which is 765lx. Furthermore, the illuminance uniformity is the largest, which is 0.85. So it indicates that the proposed model can provide a better lighting environment with more uniform illumination and energy saving under the premise of ensuring lighting requirements.Table 3
Comparison of illumination index values of different models.
CategoryAverage illumination (lx)Minimum illumination (lx)Maximum illumination (lx)Minimum illumination/average illuminationMinimum illumination/maximum illuminationANN91272911010.810.66ANFIS7956809300.860.73Improve ANN7657048320.920.85Table4 shows the comparison of GR values of glare index of different models at 5 observation points. As can be seen from the table, the GR values of the five observation points of the ANN model are all over 30, and there are three observation points that GR values of the ANFIS model are all over 30. The GR values of the five observation points of the proposed model are all within 30 (including 30), which meets the maximum glare index (30) stipulated by the state. Therefore, the proposed model meets the requirements of the national specification.Table 4
Comparison of GR values of different models.
CategoryGR observation point 1GR observation point 2GR observation point 3GR observation point 4GR observation point 5ANN3432343535ANFIS3132303230Improve ANN3028302930


## 4. Conclusion

To sum up, the PSO and GA algorithms can optimize the initial weights and thresholds of the ANN network, and then, the proposed residential energy-saving lighting prediction model based on machine vision can improve the model convergence speed and prediction accuracy. The prediction accuracy can reach 99.999%. Compared with the ANN model and ANFIS model, the prediction average relative error of the proposed model is reduced by 2.29% and 0.87%, respectively. Under the premise of meeting the standard illumination of residential energy-saving lighting, the proposed model can use fewer lamps, and it can get closer to the standard illumination value, which has certain effectiveness and superiority. The innovation of this research is to apply artificial intelligence algorithm to energy-saving lighting, which provides a new way and way for scientific optimization of lighting. However, due to the influence of external factors, there are still certain limitations, which are mainly the number of data samples. To meet the requirements, the next step is to expand the collection range of sample data to improve the accuracy of model training and the generalization ability of the model.



---

*Source: 7600021-2022-05-27.xml*