Artificial Intelligence-Based Fault Diagnosis and Prediction for Smart Farm Information and Communication Technology Equipment
Abstract
:1. Introduction
2. Materials and Methods
2.1. RNNs
2.2. Smart Farming Systems
3. System Configuration
4. Model Design
- Rule 1:
- The temperature sensing values obtained from the equipment differ from those obtained from other equipment of the same type installed in the same area.
- Rule 2:
- A temperature sensor and a heater are adjacent among the equipment installed in the same area.
- Rule 3:
- Temperature and humidity sensors are installed in the same area and the current temperature is 5 °C or less and the humidity is 10% or less.
- Rule 4:
- The power measured by a power sensor is zero during the operation of some equipment.
- Rule 5:
- When both the RNN-predicted value of an installed device and Many2OneModelStatistics for the device exist, a malfunction event is added if the VARIANCE of the RNN-predicted value is greater than the VARIANCE threshold of the Many2OneModelStatistics.
5. Model Implementation and Experimentation
Algorithm 1: Prediction algorithm based on sensor sequence |
001: # ----------------------------------------------------------- 002: # Program Start 003: # ----------------------------------------------------------- 004: # Load training data 005: loadData() 006: 007: print(‘Size of training data: ‘ + str(len(trainX))) 008: print(‘Size of test data: ‘ + str(len(inputX)) 009: 010: # Input placeholders 011: X = tf.placeholder(tf.float32, [None, seq_length, data_dim]) 012: Y = tf.placeholder(tf.float32, [None, 1]) 013: 014: # Construct the RNN network 015: # RNN Cell (Available cells: Basic LSTM, LSTM, GRU, …) 016: # cell = tf.contrib.rnn.BasicLSTMCell( 017: # num_units=hidden_dim, state_is_tuple=True, activation=tf.tanh) 018: cell = tf.contrib.rnn.GRUCell( 019: num_units=hidden_dim, activation=tf.tanh) 020: 021: # Multi-RNN Cells 022: cells = tf.contrib.rnn.MultiRNNCell([cell] * NUMBER_OF_RNN_CELL_LAYERS) 023: 024: # Dynamic RNN (outputs: output, _states: previous states in the RNN network) 025: # If RNN cells and input data are given as arguments, the RNN cells are connected to form a network. 026: outputs, _states = tf.nn.dynamic_rnn(cell, X, dtype=tf.float32) 027: 028: # Add fully connected layers to obtain prediction values 029: Y_pred = tf.contrib.layers.fully_connected( 030: outputs[:, −1], output_dim, activation_fn=None) 031: 032: # Define the cost function (sum of the squares) 033: loss = tf.reduce_sum(tf.square(Y_pred − Y)) 034: 035: # Define the cost Tensor for Tensorboard 036: tf.summary.scalar(“cost”, loss) 037: 038: # Summary 039: summary = tf.summary.merge_all() 040: 041: # Define the optimizer 042: optimizer = tf.train.AdamOptimizer(learning_rate) 043: train = optimizer.minimize(loss) 044: 045: # RMSE (Root Mean Square Error, the square root of the mean squared differences between actual and predicted values) 046: targets = tf.placeholder(tf.float32, [None, 1]) 047: predictions = tf.placeholder(tf.float32, [None, 1]) 048: rmse = tf.sqrt(tf.reduce_mean(tf.square(targets − predictions)) 049: 050: with tf.Session() as sess: 051: init = tf.global_variables_initializer() 052: sess.run(init) 053: 054: # Create a summary writer 055: writer = tf.summary.FileWriter(TB_SUMMARY_DIR) 056: writer.add_graph(sess.graph) 057: global_step = 0 058: 059: # ------------------------------------------------------------- 060: # Training Phase 061: # ------------------------------------------------------------- 062: for i in range(iterations): 063: s, _, step_loss = sess.run([summary, train, loss], feed_dict={ 064: X: trainX, Y: trainY}) 065: #print(“[step: {}] loss: {}”.format(i, step_loss)) 066: 067: writer.add_summary(s, global_step=global_step) 068: global_step += 1 069: 070: # Save the training results 071: saver = tf.train.Saver() 072: saver.save(sess, ‘./model/malfunction_predict.pd’) 073: 074: # ------------------------------------------------------------- 075: # Testing Phase 076: # ------------------------------------------------------------- 077: # Perform predictions on test data and display the results using plots 078: test_predict = sess.run(Y_pred, feed_dict={X: inputX}) 079: rmse_val = sess.run(rmse, feed_dict={ 080: targets: sensingValueY, predictions: test_predict}) 081: print(“inputX RMSE: {}”.format(rmse_val)) 082: 083: correct_prediction = test_predict - sensingValueY 084: accuracy = tf.reduce_mean(correct_prediction) 085: 086: plt.figure(figsize=(20, 4)) 087: plt.plot(RevMinMaxScaler(sensingValueY), ‘b-’, label=‘Sensing’) 088: plt.plot(RevMinMaxScaler(test_predict), ‘r-’, label=‘Prediction’) 089: plt.xlabel(“Time Period”) 090: plt.ylabel(“Temperature”) 091: plt.legend(loc=‘best’) 092: 093: # Perform predictions on the first test data and display the results using plots 094: test_predict = sess.run(Y_pred, feed_dict={X: firstTestX}) 095: rmse_val = sess.run(rmse, feed_dict={ 096: targets: firstTestY, predictions: test_predict}) 097: print(“firstTestX RMSE: {}”.format(rmse_val)) 098: 099: correct prediction = test_predict - firstTestY 100: accuracy = tf.reduce_mean(correct_prediction) 101: 102: plt.figure(figsize=(20, 6)) 103: plt.plot(RevMinMaxScaler(firstTestY), ‘b-’, label=‘Sensing’) 104: plt plot(RevMinMaxScaler(test_predict), ‘r-’, label=‘Prediction’) 105: plt.xlabel(“Time Period”) 106: plt.ylabel(“Temperature”) 107: plt.legend(loc=‘best’) 108: 109: plt.show() 110: |
6. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Data Availability Statement
Conflicts of Interest
References
- Kaaya, J. Role of Information Technology in Agriculture. Proc. FOA Conf. 1999, 4, 315–328. [Google Scholar]
- Sharma, A.B.; Golubchik, L.; Govindan, R. Sensor Faults: Detection Methods and Prevalence in Real-World Datasets. ACM Trans. Sens. Netw. 2010, 6, 23. [Google Scholar] [CrossRef]
- Mourad, M.; Bertrand-Krajewski, J.L. A Method for Automatic Validation of Long Time Series of Data in Urban Hydrology. Water Sci. Technol. 2002, 45, 263–270. [Google Scholar] [CrossRef] [PubMed]
- Ahn, H.; An, S.-Y.; Kim, J.-Y.; Lee, C.W. Humidity Sensor Prediction Model Using Environmental Data Analysis in Greenhouse Smartfarm. In Proceedings of the Symposium of the Korean Institute of Communications and Information Sciences, Jeju, Republic of Korea, 18–21 June 2021; pp. 159–160. [Google Scholar]
- Lee, S. Cloud-Based Smart Farm Technology. J. Korean Inst. Commun. Sci. 2016, 34, 51–57. [Google Scholar]
- Jeffery, S.R.; Alonso, G.; Franklin, M.J.; Hong, W.; Widom, J. Declarative Support for Sensor Data Cleaning, Lecture Notes in Computer Science. In Proceedings of the of 4th International Conference on Pervasive Computing, Dublin, Ireland, 7–10 May 2006; pp. 83–100. [Google Scholar] [CrossRef]
- Ni, K.; Ramanathan, N.; Chehade, M.N.H.; Balzano, L.; Nair, S.; Zahedi, S.; Kohler, E.; Pottie, G.; Hansen, M.; Srivastava, M. Sensor Network Data Fault Types. ACM Trans. Sens. Netw. 2009, 5, 25. [Google Scholar] [CrossRef]
- Hong, S.-J.; Kim, J.H.; Kim, T.-H. An Integrated Verification System for an RNN Inference Processor. In Proceedings of the Korean Society of Electronics Engineers Conference, Jeju, Republic of Korea, 28 June–2 July 2022; pp. 1918–1921. [Google Scholar]
- Kim, Y.-D.; Jung, G.-H. Bayesian Methodology for Machine Learning. J. Korean Inst. Commun. Sci. 2016, 33, 60–64. [Google Scholar]
- Seo, D.-S.; Park, Y.-G.; Park, J.-Y.; Kim, Y.-J. A Study on Smart Farm Operation Status and Development Direction; Ministry of Agriculture, Food and Rural Affairs, National Library of Korea: Sejong, Republic of Korea, 2016; Volume 3. [Google Scholar]
- Joonyong, K.; Rack, P.K. Analysis of Accuracy and Loss Performance According to Hyperparameter in RNN Model. J. Converg. Inf. 2021, 11, 31–38. [Google Scholar]
- Introduction to the Architecture of Recurrent Neural Networks (RNNs). Available online: https://pub.towardsai.net/introduction-to-the-architecture-of-recurrent-neural-networks-rnns-a277007984b7 (accessed on 11 June 2023).
- Cho, S.M.; Kim, W. Automatic Document Title Generation with RNN and Reinforcement Learning. J. Inf. Technol. Appl. Manag. 2020, 27, 49–58. [Google Scholar]
- Shin, S.H.; Lee, M.K.; Song, S.K. A Prediction Model for Agricultural Products Price with LSTM Network. J. Korean Contents Assoc. 2018, 18, 416–429. [Google Scholar]
- Kim, D.-H. Livestock Price Prediction Study Using LSTM Based on Big Data. Ph.D. Thesis, Chonbuk National University, Cheongju, Republic of Korea, 2021. [Google Scholar]
- Oh, H.-W.; Huh, J.-D. IoT-Based Smart Factory Failure Prediction Analysis Technology for Productivity and Quality Improvement; IEEE: Piscataway, NJ, USA, 2020; pp. 33–43. [Google Scholar]
- Han, J.H.; Choi, D.-J.; Park, S.-U.; Hong, S.-K. DT-CNN Based Motor Failure Prediction Considering Outlier Data. J. Inst. Control Robot. Syst. 2020, 26, 932–939. [Google Scholar] [CrossRef]
- Ryu, M.; Cha, S.-H. Developing a Knowledge Graph Based on Ontology Learning. J. Korean Assoc. Comput. Educ. 2022, 25, 51–57. [Google Scholar]
- Park, J.; Song, M.; Ahn, S. Developing the Fault Diagnostics and Prognostics Model of a Rotating Machinery. JKORMS 2020, 45, 25–38. [Google Scholar] [CrossRef]
- Lee, S.; Lee, J. Monitoring Procedure of Autocorrelated Processes Using the Deep Learning-Based LSTM Model. J. Korean Data Inf. Sci. Soc. 2022, 33, 237–248. [Google Scholar]
- Elnahrawy, E.; Nath, B. Cleaning and Querying Noisy Sensors. In Proceedings of the of 2nd ACM International Conference on Wireless Sensor Networks and Applications, San Diego, CA, USA, 19 September 2003; pp. 78–87. [Google Scholar]
- Tolle, G.; Polastre, J.; Szewczyk, R.; Culler, D.; Turner, N.; Tu, K.; Burgess, S.; Dawson, T.; Buonadonna, P.; Gay, D.; et al. A Macroscope in the Redwoods. In Proceedings of the 2nd International Conference on Embedded Networked Sensor Systems, San Diego, CA, USA, 2–4 November 2005; ACM Press: New York, NY, USA, 2005; pp. 51–63. [Google Scholar]
- Bae, N.J. Implementation of Ontology-Based Context-Aware Control Service Model for Plant Factory Environment; Suncheon University: Suncheon, Republic of Korea, 2014. [Google Scholar]
- Park, M.Y.; Kim, M.J.; Park, Y.M.; Song, J.S. Development of Internet of Things Platform Based on oneM2M Standards to Provide Data Augmentation Features for Artificial Intelligence Services. In Proceedings of the Symposium of the Korean Institute of Communications and Information Sciences, Gyeongju, Republic of Korea, 16–18 November 2022; pp. 1683–1684. [Google Scholar]
- Ji, K.; Kwon, Y. Hadoop MapReduce Performance Optimization Analysis by Calibrating Hadoop Parameters. J. Korean Inst. Inf. Technol. 2021, 19, 9–19. [Google Scholar] [CrossRef]
- Choi, M.; Gyeong, N.-J.; Lim, J.S. Design of Smart Farming System with Kafka and Spark Streaming. In Proceedings of the Korea Contents Association Comprehensive Conference, Limassol, Cyprus, 7 September 2022; pp. 405–406. [Google Scholar]
- Lembo, D.; Stantarelli, V.; Savo, D.F.; Giacomo, G.D. Graphol: A graphical language for ontology modeling equivalent to OWL 2. Futur. Internet 2022, 14, 78. [Google Scholar] [CrossRef]
- Jeon, Y.J.; Lee, H. A Study on the Ontology Modeling by Analyzing RiC-CM v0.2. J. Korean Rec. Manag. Assoc. 2020, 20, 139–158. [Google Scholar]
- Kim, K.Y.; Jongmo, K.; Park, G.-D.; Sohn, M.M. Value of Information Assessment Framework Using Fuzzy Inference Ontology. J. Korean Soc. Manag. Eng. 2020, 25, 117–135. [Google Scholar]
- Smartfarm Datamart. Available online: https://data.smartfarmkorea.net/structuredData/selectContHortiCultureDataViewLists.do (accessed on 11 June 2023).
Ontology | Description |
---|---|
Event Ontology | Event ontology defines the concept of an “event” representing the fault diagnosis result. Events are derived by ontological semantic transformation of the modeled equipment composition data and measurement values; storage is in the form of Resource Description Framework triples and user rule-based inference. |
Detection Ontology | The sensing values exhibit specific patterns depending on various environmental factors, which enables the use of normal time series sensing values as training data to train the RNN model for the estimation of sensing values. |
To assess values exceeding a threshold as faults by comparing the predicted and measured values, it is necessary to define the concepts that the predicted values represent. | |
Moreover, based on the predicted values, the concepts necessary for fault diagnosis are defined. For fault diagnosis, it is important to configure the threshold based on statistical analysis of normal data. Detection ontology is used to determine the threshold value for each equipment type. | |
Sensor Network Ontology | The sensor network ontology is composed of the concepts that represent the equipment used for smart farming (sensors, actuators, IoT nodes, network equipment, etc.) and their respective measurement values. |
The basic pattern comprises ontologies that are suitable for smart farming and based on the semantic sensor network ontology. | |
Geospatial Ontology | Geospatial ontology comprises spaces where smart farming equipment is installed and operated, e.g., farms, greenhouses, and zones. These spatial concepts share structural relationships. |
Time Ontology | OWL-Time represents the OWL-2 DL ontology for the concept of time and is used to describe the temporal attributes of resources. |
Time ontology provides the words and phrases required to express topological (sequencing) relationships between moments and intervals related to temporal locations, including information about duration, date, and time. | |
Temporal location and duration can be expressed using the traditional (Gregorian) calendar and clock, or other time reference systems, such as Unix time, geological time, or other types of calendars. |
Category | Measure | Notes |
---|---|---|
Single-equipment (sensor) fault detection | Threshold exceeded | Single value; processing in real time. |
Improperly installed (location/process) | Metadata regarding sensor installation required (e.g., temperature sensors to be installed near ventilator and radiator at an appropriate distance). | |
Sensor expired | Sensor expiration date metadata required. | |
Disturbed communication and data collection | Storage and management of last collection date required. | |
Multi-equipment (sensor) fault detection | Detection by observing inter-sensor correlations | Collection of all correlated sensing values required (accumulation for a certain period of time before deployment) (e.g., high temperature and humidity). |
Detection by observing the difference from the nearest sensing value. | Occurrence of a difference exceeding the threshold of a given sensor. | |
Situational fault detection | Controller fault detection in an improper environment during the growth stage. | Data on growth stage required. Occurrence of an event in a suspected controller type, not a specific controller fault. |
Controller fault detection when the sensing value does not change for a long time during controller operation. | Controller activation data required. |
Rule ID | Description |
---|---|
rule_rnn_many2one | Anomaly state detection using the RNN Many2One model |
rule_rnn_seq2seq | Anomaly state detection using the RNN Seq2Seq model |
rule1 | Fault inference based on a comparison with the threshold of a single sensor |
rule2 | Fault inference based on the correlations of two or more sensing values, which yields two events |
rule3 | Actuator fault inference based on actuator control data and power sensing values |
Category | Datasets |
---|---|
Farm | Strawberry farm. |
Environment | Indoor environment, outdoor environment, hydroponic environment, soil environment. |
Sensing value | Temperature, humidity, CO2, surface temperature, humidity, solar radiation, wind speed, precipitation (dry/wet). |
Measurement Items | Alternative Items |
---|---|
Day (ref. 365 days) | Measurement season |
Measurement time | Measurement time |
Outdoor temperature | Outdoor temperature |
Solar radiation | Solar radiation, clouds, fog |
Precipitation | Dry day/wet day, amount of precipitation |
RNN Cell | RSME |
---|---|
LSTM | 0.0732 |
GRU | 0.0760 |
Number of Training Iterations | RSME |
---|---|
500 | 0.0806 |
1000 | 0.0785 |
5000 | 0.0784 |
10,000 | 0.0768 |
100,000 | 0.0928 |
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. |
© 2023 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/).
Share and Cite
Choe, H.O.; Lee, M.-H. Artificial Intelligence-Based Fault Diagnosis and Prediction for Smart Farm Information and Communication Technology Equipment. Agriculture 2023, 13, 2124. https://doi.org/10.3390/agriculture13112124
Choe HO, Lee M-H. Artificial Intelligence-Based Fault Diagnosis and Prediction for Smart Farm Information and Communication Technology Equipment. Agriculture. 2023; 13(11):2124. https://doi.org/10.3390/agriculture13112124
Chicago/Turabian StyleChoe, Hyeon O., and Meong-Hun Lee. 2023. "Artificial Intelligence-Based Fault Diagnosis and Prediction for Smart Farm Information and Communication Technology Equipment" Agriculture 13, no. 11: 2124. https://doi.org/10.3390/agriculture13112124
APA StyleChoe, H. O., & Lee, M. -H. (2023). Artificial Intelligence-Based Fault Diagnosis and Prediction for Smart Farm Information and Communication Technology Equipment. Agriculture, 13(11), 2124. https://doi.org/10.3390/agriculture13112124