Dear Label_Name,

Greetings! I hope you are well.

I am writing on behalf of an international publishing house, Science and Education Publishing, USA (http://www.sciepub.com).

Science and Education Publishing (SciEP) is a multidisciplinary open access publisher of Journals covering the fields of Science, Technology and Medicine. All SciEP publications are subject to high-quality peer review, editorial and production processes and are freely available online.

Welcome to the April, 2013 edition of SciEP newsletter, providing monthly summaries of articles on science & education related topics of interest to scientist and professionals. The mission of our journals is to provide an open access forum for publishing new findings on issues pertinent to scientific and academic field. We also invite you to submit original research papers, review articles, short reports, or case studies are considered for publication in our Multidisciplinary Journals.

American Journal of Public Health Research
DOI: 10.12691/ajphr-1-1-3

The Implementation of a Tele-Homecare System with Service Oriented Architecture and HL7 Message Transmission Standard
Ching-Sung Wang

American Journal of Medical and Biological Research
DOI: 10.12691/ajmbr-1-1-2

The Influence of Ethanol on Pyruvate Kinases Activity in Vivo, in Vitro, in Silico
Lelevich Sergey Vladimirovich, Khrustalev Vladislav Victorovich, Barkovsky Eugene Victorovich, Shedogubova Tatyana Aleksandrovna

American Journal of Medical Sciences and Medicine
DOI: 10.12691/ajmsm-1-1-1

Clinical and Histological Features in Wegener Granulomatosis
Li Cavoli Gioacchino, Passantino Rita, Bono Luisa, Tortorici Calogera, Ferrantelli Angelo, Giammarresi Carlo, Rotolo Ugo

American Journal of Infectious Diseases and Microbiology
DOI: 10.12691/ajidm-1-1-2

The Curse of Lymphatic Filariasis: Would the Continual Use of Diethylcarbamazine Eliminate this Scourge in Papua New Guinea?
Anne Lanham, Lillian Mwanri

We have released issues of some journals on February 2013.
American Journal of Public Health Research
American Journal of Medical Sciences and Medicine
American Journal of Medical and Biological Research
American Journal of Pharmacological Sciences
American Journal of Clinical Medicine Research
American Journal of Nursing Research
American Journal of Cancer Prevention
American Journal of Medicine Studies
American Journal of Infectious Diseases and Microbiology
American Journal of Cardiovascular Disease Research
American Journal of Biomedical Research
American Journal of Mechanical Engineering
American Journal of Microbiological Research
Journal of Preventive Medicine
American Journal of Food and Nutrition
American Journal of Hypertension Research
American Journal of Sports Science and Medicine
Journal of Cancer Research and Treatment
American Journal of Zoological Research
Journal of Biomedical Engineering and Technology
American Journal of Microbiological Research
Biomedical Science and Engineering

We are pleased to announce that submissions are now being accepted for peer review for all the journals across all our subject areas in SciEP.

Please submit your manuscript via our online submission system:
http://www.sciepub.com/author/signin

To unsubscribe from our mailing list, please click on the following link: unsubscribe

I am looking forward to hearing from you.

Kind regards,

David Rain
Email:join@sciepub.com
Science and Education Publishing (http://www.sciepub.com)

An Integrated Machine Learning Algorithm for Energy Management and Predictions

Daniel Abode*, Samson Oyetunji

Electrical and Electronics Engineering, Federal University of Technology Akure, Akure, Nigeria

Abstract: Management of energy consumption from the demand side has been inefficient and this has inadvertently affected the efforts of energy management on the supply side. This paper describes how machine learning integrated with Internet of things can enhance energy consumption management on the consumer side. Sensor nodes were designed and installed to gather data including date, time, temperature, humidity, light intensity, human presence and state of the load point switches. The sensor nodes transferred the data collected to a google firebase cloud storage which stored the data. The data collected was used in MATLAB neural network toolbox to train a machine learning algorithm that can predict the states of the receptacles, the ambient condition and the energy consumption statistics. The results show 99.7% success and 0.3% failure in the prediction of the state of the receptacle, 98.9% success and 1.1% failure in the prediction of the light state. In addition, the performance of the trained network for solving the classification and the regression problems that were involved in the prediction of the states of the switches and receptacles, the ambient condition and energy consumption statistics were shown graphically. Graphical results were also developed to show the relationship between the energy consumption, time of the day, human presence, and temperature. Conclusion was drawn on how time of the day, human presence and temperature affected the energy consumption on the consumer side.

Keywords: sensor, temperature, humidity, light intensity, toolbox, energy consumption, classification, regression, management, consumption, energy

Citation: Daniel Abode, Samson Oyetunji, An Integrated Machine Learning Algorithm for Energy Management and Predictions. American Journal of Energy Research, 5 (3). 103-113. January 2017. doi:10.12691/ajer-5-3-5

1. Introduction

Energy is essential for the creation of wealth and improved standard of living; this means that reliable supply of energy is required to ensure sustainable growth [1]. The per capital electricity consumption of the developing countries has been increasing due to increase in various electrical and electronics devices that is meant to bring comfort to our daily life [2]. Increase in consumption means increase in cost of living and also increase in maintenance cost for the electric energy generation, transmission and distribution companies.

However, a large percentage of this consumed power are usually wasted due to negligence by the consumer. Hence, there is a need for the development of an integrated machine learning algorithm that can help in the management and prediction of energy consumption on the consumer side and provide useful data in future planning for electrical energy consumers and suppliers.

This form of prediction is generally beyond the empirical form of data analysis. With the ever increasing amounts of data becoming available, there is good reason to believe that machine learning will become more pervasive as a necessary ingredient for technological progress [3].

Machine learning was defined by Arthur Samuel as a field of study that gives the computer the ability to learn without being explicitly programmed [4]. It has since been gaining wide recognition in application to big data [5]. Various industries are using machine learning process to learn patterns from big data and discover new fact [6].

Machine learning was formally defined by Tom Mitchell as a means by which a computer program learns from experience E with respect to some class of Tasks T and performance measure P, if its performance in class T, as measured by P, improves with experience E [7]. A supervised learning algorithm works by generating a hypothesis function (h), after the learning algorithm has learnt from the training set. If the input features (x) is passed through h, it will give a predicted value (y) [8] as shown in equation 1 for linear regression, classification algorithm uses the sigmoid function [9] as shown in equation 2.

[picture] | (1)

[picture] | (2)

The value of and is the value that can minimize the cost function J (, ) shown in equation 3.

[picture] | (3)

This can be achieved by using the gradient descent algorithm which helps to calculate the value of and that minimizes J (, ) as shown in equation 4 by iterating the value of Ѳj until convergence.

[picture] | (4)

This paper shows how we can apply machine learning on sensor data in order to predict user’s behavior in terms of the energy consumption statistics, state of electrical receptacles and switches and also ambient condition of the place of interest. The study is based on sensor data logged automatically with the use of a designed data-logging device that carries sensor node for measuring human presence rating, relative humidity, temperature, date and time information, and also state of the switch and electrical receptacles. The data was collected in a lab environment with two receptacles, one serving the lab attendant office, the other serving a lab desk and a light point. The data collected were used to train a machine learning algorithm using the MATLAB development environment, which generates function that can help to predict the energy consumption statistics, the ambient condition of the place and the states of the light switch and receptacles.

The rest of this paper is structured as follows. Section 2 gives detail description of the system, Section 3 discusses the result and Section 4 draws conclusion and presents some recommendation for future works.

2. System Description

The system includes several components as shown in Figure 1. It includes a sensor node for measuring light intensity, temperature, humidity and socket1 state connected via Wi-Fi communication to another sensor node measuring time, date, human presence, socket2 state and also carrying the data logging SD_CARD module. In addition, a software part which is MATLAB neural network toolbox for developing the learning algorithm.

Figure 1. System Components

2.1. Sensor Node A

This sensor node consists of sensors, a 5v switch mode power (SMP) supply, an indicator and ESP8266 NodeMCU, a system on chip (SOC) that carries an esp8266 module for Wi-Fi communication and a Tensilica X10 microcontroller [10]. The sensors on this node include a MAX44009 for measuring luminous intensity, a DHT11 sensor for measuring temperature and humidity. It also includes a light dependent resistor (LDR) mounted on the indicator of socket1 to detect when the socket is switched on or off. The circuit diagram for this node is shown in Figure 2.

Figure 2. Circuit Diagram for Sensor Node 1

2.2. Sensor Node B

Sensor node B consist of PIR motion sensor for detecting human movement, a LDR mounted on the indicator of socket 2. A DS1302 RTC module for monitoring the real time, a SD_CARD module for logging the data, the ESP8266 NodeMCU SOC including a 5v SMP power supply module. The circuit diagram for this node is shown in Figure 3.

Figure 3. Circuit Diagram for Sensor Node 2

2.3. Description of Data Logged

Day type (DT): day type distinguish weekend from work day, 1 was chosen for weekend and 2 for week day and it was label.

Day of the week (DOW): day of the week helps to label each day in the week, Monday was counted as 1 up till Sunday which was labelled 7.

Hour of the day (HD): Hour of the day was labelled 0-24 for the 24-hour clock. The feature was labeled

Minute of the hour (MH): Minute of the way was logged using number 0-60 to cover the 60 min in an hour range. DS1302 RTC module was used to perform the real time clock function.

Human presence (HP): Human presence was detected with the use of a PIR motion sensor, it outputs 1 when it detects a human movement and a zero otherwise, the result of the output was averaged over 2 minute before it was logged, its value ranges from 0.00 – 1.00.

Light Intensity (LI): The light intensity of the room was detected using MAX44009 light sensor, it measures the light intensity in lux.

Temperature (TP): The temperature of the room was also logged, the temperature was sensed using DHT11 temperature and humidity sensor.

Humidity (HM): The humidity of the room was sensed using DHT11.

Light State (LS): By using the MAX44009 the sensor was position to be shielded from ambient light, when the light is switched on there is a sudden increase in the light intensity, this behavior was used to detect when the light is on or off.

Socket1 state (S1S): The state of the first socket was detected using an LDR, placed inside the socket and focusing on its indicator, when the socket is off the reading of the LDR is low and when on the reading is high, this behavior was used to determine when the socket is on (1) and off (0).

Socket2 State (S2S): The state of the second socket was also detected using the same method used to detect socket1 State.

The data were logged every 2 min for 30 days, at the end of the data logging period a total of 10940 data were logged per features. An extract of the data is shown in Figure 4.

2.4. Data Preprocessing

The data were preprocessed before they were fed to the machine learning algorithm, text data as shown in Figure 4 in column 1 and column 2 were removed as the needed data on time and day as been represented with column 3,4,5 and 6. In addition, some rows of data containing the text ‘xx’ was removed they contain incomplete information as the data at those specific time were logged when sensor node A was unable to pass its data to sensor node B. The remaining data was divided to form input data and output data for the various learning algorithm. For the receptacles state prediction, “DT, DOW, HD, MH, HP, LI, TP and HM” features were used as input features and the output features were LS, S1S, S2S respectively for the light state, socket1 state and socket2state. For the ambient condition prediction “DT, DOW, HD, MH, HP and LI” were the input features and the output features were TP and HM respectively for temperature and humidity.

2.5. Machine Learning Process

The machine learning consists of two different problems, a classification problem and a regression problem. Both the classification and the regression problem can be solved using neural network. The problem of predicting the states of the switch and the receptacles which in turn sums up the energy consumption pattern of the user is classification. Whereas the problem of predicting the ambient condition i.e. temperature and humidity of the room is a regression problem.

2.5.1. Classification Problem

The classification algorithm which helps to predict the states of the switches and in turn predicts the energy consumption pattern was developed using the classification neural network toolbox of MATLAB following the steps in Figure 5.

Figure 4. An extract of the data logged

Figure 5. Classification Algorithm

The performance of the training was analyzed by using the confusion matrix generated at the end of the training, cross validation and testing. After the training the toolbox automatically generates a function that can take sample input data as input and gives a prediction.

Figure 6. Regression Algorithm

2.5.2. Regression Problem

The prediction of the temperature and humidity of the room is a regression problem and it was solved using the regression neural network toolbox of the MATLAB environment and it was carried out by the steps as shown in Figure 6. Analyzing the prediction of the regression problem showed a large deviation of predicted to actual value, which was a sign that the algorithm was suffering from bias. To overcome this, a MATLAB program was written to generate higher order polynomials of the input features up to degree 3. Hence a total number of 83 input features were generated from the existing 6 input features. The algorithm was retrained with this input features and the output showed an improvement. This was better improved by generating higher order polynomial of degree 5, so that a total number of 461 input features was regenerated to retrain the algorithm to improve its accuracy.

3. Results and Discussion

3.1. Network Result for Socket 1 state Classification Prediction

Figure 7 shows the confusion matrix result of socket1 state classification result for both training, validation and testing. The network outputs are very accurate; this can be seen in Figure 7. The green squares show the correct responses and the red squares show the incorrect responses. The lower right blue squares show the overall accuracies. For training, there were 6259 correct responses for class 0 “off state” and 1355 correct responses for 1 “on state”. Likewise, 12 responses were incorrectly predicted as 0 and 10 responses was incorrectly predicted as 1. The blue square shows the overall responses as 99.7% success and 0.3% failure. For the cross validation, 1323 responses were correctly predicted as 0 and 309 were correctly predicted as 1. 2 responses were mistakenly predicted as 0 and 2 responses were mistakenly predicted as 1. The blue square shows the overall responses as 99.8% success and 0.2% failure. For the test confusion matrix, 1340 responses were correctly predicted as 0 and 292 were correctly predicted as 1. 1 response was incorrectly predicted as 0 and 3 responses were mistakenly predicted as 1. The blue square shows the overall responses as 99.8% success and 0.2% failure. The overall confusion matrix blue square shows the overall network accuracy as 99.7%.

Figure 7. Confusion matrix for socket1 state training

110 samples of the input features were taken at interval and fed to the function generated by the network for prediction. The result of the predicted value and the actual value is shown in Figure 8. Samples where the red line overlap the blue line shows 100% accuracy of prediction. It is also shown on the plot that there was small deviation in some few samples.

Figure 8. Comparing actual and predicted value for socket1 state network

3.2. Network Result for Light State Classification Prediction

Figure 9 shows the confusion matrix result of light state classification for both training, validation and testing. The network outputs are very accurate but not as accurate as socket1 state network. The green squares show the correct responses and the red square shows the incorrect responses. The lower right blue squares show the overall accuracies. For training, there were 6293 correct responses for class 0 “off state” and 1257 correct responses for 1 “on state”. Likewise, 72 responses were incorrectly predicted as 0 and 14 responses was incorrectly predicted as 1. The blue square shows the overall responses as 98.9% success and 1.1% failure. For the cross validation, 1342 responses were correctly predicted as 0 and 281 were correctly predicted as 1. 10 responses were mistakenly predicted as 0 and 3 responses were mistakenly predicted as 1. The blue square shows the overall responses as 99.2% success and 0.8% failure. For the test confusion matrix, 1347 responses were correctly predicted as 0 and 269 were correctly predicted as 1. 15 responses were incorrectly predicted as 0 and 5 responses were mistakenly predicted as 1. The blue square shows the overall responses as 98.8% success and 1.2% failure. The overall confusion matrix blue square shows the overall network accuracy as 98.9%.

Figure 9. Confusion matrix for light state training

110 samples of the input features were taken at interval and fed to the function generated by the network for prediction. The result of the predicted value and the actual value is shown in Figure 10. Samples where the red line overlap the blue line shows 100% accuracy of prediction. It is also shown on the plot that there was small deviation in some few samples.

Figure 10. Comparing actual and predicted value for socket1 state network

3.3. Energy Consumption Profile

The energy consumption was measured as the average of load points in use at any particular time. This was derived by summing the predictions for the states of the sockets and the light point and then finding the mean for each hour of occurrence. As shown in Figure 11, the energy consumption was greater between the hour of 8am in the morning and 16pm in the afternoon. Figure 12 shows the energy consumption statistics vs human presence rating; it can be seen that the energy consumption was concentrated in the region of human presence rated 0.3 to 1 which shows high activity in the area. Though in few samples, energy consumption was high at human presence rating 0, this is because at some points when there is no activity in the room for more than 2 minute, the load points where still in use. This can be characterized as energy wastage if it occurs at an unusual time when energy consumption is low as shown in Figure 13.

Figure 11. Energy consumption against time of the day

Figure 12. Energy consumption against human presence

Figure 13. Human presence rating against hour of the day

3.4. Ambient Condition Prediction

Figure 14 shows the plot of predicted value shown in red and the actual value shown in blue for temperature prediction. Deviation occurs in more samples with only few samples overlapping. Effort were made to generate higher order polynomial input features up to degree 5 which increased the accuracy of the prediction. Nevertheless, to obtain higher accuracy there is a need to generate more data for training the algorithm. Figure 15 shows the effect of temperature on the energy consumption profile. It can be seen on the figure that energy consumption is relatively high in the region of higher temperature, between 24°C and 28°C, this value skyrocketed on getting to higher temperature between 29°C and 30°C. Higher energy consumption in the day can also be justified by Figure 16 showing a drastic increase in temperature from the period of 8am to 16pm.

This same period of the day has been seen earlier in Figure 11 as having the highest energy consumption statistics.

Figure 14. Comparison of actual and predicted value for temperature

Figure 15. Energy Consumption against temperature

Figure 16. Temperature against hour of the day

4. Conclusion and Recommendation

According to the results in section 3, it can be concluded that the energy consumption profile depends on several factors including temperature, human presence rating and time of the day. All this factors invariably contribute to the complexity of energy management on the consumer side. Developing a machine learning algorithm integrated with internet of things can be useful in learning from these factors in order to automate consumption of energy on the consumer side. Hence, enhancing energy consumption management on the consumer side.

This paper presented the application of machine learning to energy consumption management and prediction. A machine learning algorithm was developed to learn from sensor data and user attitude towards usage of the load points. After the analysis of the learning network, it can be concluded that the energy consumption pattern and ambient condition of a location can be predicted based on sensor data. The results obtained are encouraging and the analysis can be extended by creating a larger network of sensor nodes and increasing the number of days for data collection.

Future study can look into developing an online learning algorithm hosted on the cloud server that can be used to learn from this data real time as they stream to the database. This can help create a more robust and accurate system.

Acknowledgements

I acknowledge the effort of my supervisor, DR. S.A. Oyetunji for his moral and mental support during the course of this research. I also acknowledge Engr. Sola Oladiran, the lab instructor, PCB design lab FUTA.

Statement of Competing Interests

The author has no competing interest.

References

[1]   | Raphael A.W. Energy Efficiency and Mangement in Industries- a case study of Ghana's largest Industrial Area. Linkoping: Institute of Technology Linkoping University, 2012. LIU-IEI-TEK-A-12/01311-SE.
[2]   | An Approach to Energy Saving and COst of Energy Reduction Using an Improved Efficient Technology. Abubakar K.A., Abba L.B., et al. 4, s.l.: Open Journal of Energy Efficiency, 2015, Vol. I.
[3]   | Alex S., Vishwanathan S.V.N. Introduction to Machine Learning. Cambridge: Cambridge University Press, 2008.
[4]   | Some Studies in Machine learning Using the Game Checkers. Arthur L.S. Stanford: IBM Journal of Reasearch and Development, 1959.
[5]   | Using Machine Learning on Sensor Data. Alexandra M., Marko P., et al. 4, Ljubjana: Journal of Computing and Information Technology, 2010, Vol. I.
[6]   | Machine Learning Applied to Sensor Data Analysis. Go T., Moe T., et al. 1, Yokogawa: Yokogawa Technical Report, 2016, Vol. 59.
[7]   | Mitchell T. Machine learning. Louisiana: McGraw Hill, 1997.
[8]   | Andrew N.G. Machine learning Stanford University. [Video] s.l.: Cousera, 2017.
[9]   | Artificial Neural Networks: A Tutorial. Anil K.J., Jianchang M., Mohiuddin K.M.,. s.l.: ACM Digital Library, 1996, Vol. 29.
[10]   | EspressIf System IOT Team. ESP8266EX Datasheet. s.l.: http://bbs.espressif.com/, 2015.