An Early Warning System for Reservoir Water Release Operation Using Agent-Based Negative Selection Model

An early warning system is one of the best solutions for flood management. It enhances the reservoir floodgate operation, flood proofing, flood insurance, and flood plain zoning processes. The timeline and accuracy of the decision to open the reservoir gate are critical. Any delay might damage the dam caused by the excess water, leading to flash flood to the surrounding areas. Consequently, huge losses could be incurred, such as the loss of lives, properties, and financial ruins. At this point, the reservoir floodgate operator would sometimes be hesitant to make an early decision due to inconsistency in getting heavy rainfall data readings, which are under manual control. Therefore, this paper proposes the use of an autonomous agent-based system based on the Artificial Immune Systems (AIS). This system would immediately send readings to the reservoir operator so that gradual release of water from the reservoir can be done to prevent it from bursting. This task requires a certain level of experience and expertise in decision making to ensure no water shortage due to the volume of water to be released. This proposed early warning system is based on the immune negative selection and intelligent agent to monitor the changes in the reservoir water level. This autonomous early detection mechanism can support the domain expert’s job to recognise the threats early on, which is required to improve the monitoring procedure.


Introduction
Reservoir monitoring system is important for water resource management. During heavy rainfalls or during the rainy season, the reservoir operator has to determine whether to maintain the water level to sustain the water supply or to release the water to prevent a sudden overflow. The decision to release water from the reservoir or dam requires crucial timing because the wrong decision will impact human lives. An efficient monitoring system is required to maintain the water level because a delayed decision could lead to damages to the dam due to excess water. Consequently, flash flood might devastate the surrounding area, leading to the loss of lives and damages to properties. The flood that occurred in Kangar District, Perlis on December 27, 2014 is a good example. It stemmed from a flood in the Tasoh Dam that was caused by Sungai Repoh overflow and flood from the surrounding area. These floods also occurred because the tide was slowing down [1].
The complex and dynamic environment in the reservoir water release operation require a rapid and accurate decision making model. The traditional decision making model is unsuitable for urgent situations because it does not consider the time for evaluation [2]. The decision making process requires a certain level of experience and expertise to ensure no water shortage due to the volume of water to be released. An early warning system for flood management is an attractive solution for water release operation. Therefore, this paper proposes the use of an autonomous agent-based system to immediately send rainfall readings to the reservoir to ensure the gradual release of water from the reservoir and prevent it from bursting. The aims of this study are to explore the learning, memory management, and recognition processes in the human immune system and to extract knowledge from previous data and experts. This study has developed an intelligent agent model for water level monitoring using the negative selection algorithm as an early detection mechanism. This early warning system enhances the reservoir operation, not only the flood gate operation and flood response management but it is also cost effective, fast, and accurate.

Related Study
This section discusses several related works on the decision making models, as well as on the immune system, AIS applications, and the negative selection method. The human immune system is an effective learning system. The abilities of the B-cells and T-cells to fight against antigen attacks and remove them from the system have inspired researchers to implement similar systems in computational applications. The negative selection algorithm from the field of artificial immune system is often used in decision making.
Other methods have also been used in the decision making process, such as the recognition-primed decision, the case-based reasoning, neural network, and data mining.
[2] proposed the recognitionprimed decision (RPD) to model an expert's experience in the decision making process in an emergency. The major elements in this model are related to experience and situation recognition. The decision making process is made based on previous experiences for future or current decision. The RPD model draws from the experience, and then, the rule-based (RB) reasoning is produced to represent the expert's experience.
[3] used the Experience-based Decision Making model for decision making. This study used the case-based reasoning (CBR) as an algorithm to model an expert's experience to solve a problem using previous experiences stored in a case-based system. The CBR has two main components, namely, the specification and the solution. Both components use the past experiences of the expert and from previous cases. In a CBR model, incremental learning capabilities and automatic knowledge acquisition are advantageous, in terms of improving the learning ability of the system. An incremental learning algorithm allows a model to learn new information from the data while maintaining previously learnt information. The algorithm does not require access to the original data and is able to learn new incoming data. Both [2] and [3] used the experience-based reasoning and combined all approaches into knowledge-based. Previous cases were collected with the assumption that all events are important to be noted. The larger dataset could cause storage problem and the system could become slower when they need to make a decision. Table 1 shows the different features between rulebased and case-based reasoning, and artificial immune system.  Table 1 shows that the redundancy of data, storage memory, knowledge acquisition, and the size of data are better with AIS compared with rule-based and case-based reasoning. The AIS model was used as the central theme to demonstrate the naturalistic decision making process in an emergency situation in this current study. The human immune system has the ability to control a complex system.
[4] listed several advantages of the immune system that are of interest in computing, such as recognition process, feature extraction, diversity, learning ability, memory keeping, distributed detection, selfregulation, metadynamics, and immune network.
In an emergency situation, errors may lead to a wrong or right decision that comes with a delay in assessing and recognising the situation. Decision error or "sensation error" [5] could also have a catastrophic effect on the situation, people, and properties.
[6] opined that sources of error could come from situation assessment (SA) or course of action (COA).  Table 2 shows that an experienced officer took shorter time to select a course of action and to execute the action compared to a novice officer.
[7] also agreed that being experienced is important in making a good decision under time pressure and uncertainty. Thus, water level monitoring is always conducted and managed by experienced operators. However, this type of experience-based reasoning makes early water release decision difficult because a senior operator is required to guide a junior operator before taking any appropriate solution.
AIS has also been used in the Reservoir Flood Control Operation (RFCO) to resolve related issues in flood management. A preference-based immune algorithm named MOIA-PS was proposed by [8] for solving multiobjective reservoir flood control operation problems.
[9] focused on two key issues within RFCO, namely, objective space and decision space, and introduced a method called M-NNIA2 to solve these problems. The negative selection algorithm is able to differentiate between elements of self and non-self in the system, which are inspired by the adaptive immune system. The negative selection was first introduced in 1994 [10] and known as negative detection. The detectors are intended to detect the non-  The first step is to collect datasets containing representative self-samples. Then, the candidate detectors are randomly generated and compared with the self-sets. Based on the negative selection method used by the T-cells, only detectors that did not match any element of the self-sample sets are retained. Meanwhile, [12] used a different negative selection method in terms of data representation, matching rules, and detector generation mechanism. Their negative selections have the ability to make classification, with several features that were suitable with the agents, which were independent and require minimal human intervention. Thus, the negative selection technique was selected for the development of an early decision making model in this study. To ensure a successful water release decision, parallel actions or information sharing among relevant entities must be fast and accurate.
Another technique that bears a resemblance with AIS characteristics is intelligent agent. The intelligent agent is one of the subfields of Artificial Intelligence. The uniqueness and capabilities of an agent in decision making are motivating researchers to improve the decision making model using agent-based approach combined with other techniques. An intelligent agent (IA or agent) can be considered as an autonomous decision making system situated within some environment, and capable of sensing and acting within its environment [13].
Intelligent agent is an entity that can be viewed as perceiving its environment through sensors and acting upon its environment through effectors [13]. [14] stated that an agent is a hardware and/or a software-based computer system displaying the properties of autonomy, social adeptness, reactivity, and proactivity. Intelligent agent, also known as a program, can behave autonomously to perform a task based on the programme set by a user. Agents can continuously perform four functions, such as perception, reasoning, decision making, and action. Agents can also autonomously detect changes in a situation without any intervention from humans or other systems. They can change their behaviour based on the context of the surrounding environment, which is a key feature of an agent.
Negative Selection is one of the methods for producing artificial immune detector. An important aspect of negative selection is the ability to identify self and non-self. The current AIS has only adopted a few immune mechanisms, such as the immune network theory, the mechanisms of negative selection, and the clonal selection principles. These applications use learning, memory, and associative retrieval to solve recognition and classification tasks. Some applications using AIS are implemented in pattern recognition, fault detection, computer security, and others applications in computer engineering. This study has concentrated on agents and their characteristics to develop a model of the Artificial Immune System by adopting the intelligent agent approach. The intelligent agent system has several features that are similar with the immune system, which provided the scope for applying immune system methodologies. Based on the observation of similarities between an agent and the immune system, this study explored AIS modelling based on the agent approach to determine better ways to integrate agents into AIS application. The uniqueness and strength of the negative selection algorithm are the basis for the entire discussion, such as no prior knowledge of non-self is required [15], inherently distributable, which means no communication between detectors is needed [15], it can hide the self-concept [16], and symmetric protection is provided; therefore, malicious manipulation of detector set can be detected by the normal behaviour of the system [10]. The negative selection has ability in classification and there are some features that suitable with the agent which are independent and always requiring minimal human intervention. Negative Selection technique will be select for an early water release decision making model in this study.

Reservoir Gate Operation
In Malaysia, the flood response operation involves multiple agencies working together under a Flood Management Committee for each district, such as the District Office, Fire and Rescue Department, Royal Malaysia Police, Social Welfare Department, Drainage and Irrigation Department, Health Department, and Public Works Department [2]. Making the right decision for reservoir operation is crucial because any mistake can lead to excess water (floods) and water shortage (droughts). Preparation for floods or droughts is extremely important, especially to ensure safety to humans, properties, and existing development. Rapid and accurate decision making is a key issue in flood management system. The forecasting process is challenging and difficult to anticipate because it involves various factors and sometimes, it happens in a short time. This concern is the motivation behind this study.
The decision for opening the reservoir gates is always made by a dam engineer through the rainfall and water level measurements. A dam engineer may not always make the appropriate decision when he/she is under constant pressure. When the engineer is promoted to a new position and transferred to a new location, the new engineer who will be taking over that position would need to start from scratch before becoming an expert. Moreover, other factors, such as education, training, and knowledge could affect one's ability to make viable decisions during an emergency situation. Stress is one of the influencing factors of decision making in an emergency situation [17]. Common stressors, such as time pressure, lack of information, and/or too much information usually make it difficult for the decision maker to choose the best solution. Other disadvantages include difficulty in planning, providing emergency assistance, and taking actions. Therefore, the right decision at the right time requires complete information to facilitate the decision making process.
The opening of the dam's spillway gate must be adequate to ensure that the reservoir capacity will not exceed its limits and the discharges will not cause an overflow downstream [18]. The decision to release water is very critical and requires a good team of decision makers, equipped with detailed information. The dam operator needs to make a quick decision to avoid flood downstream, which can damage the dam structure. Releasing the water earlier before the reservoir has reached its full capacity might reduce the flood risk downstream and save human lives and property. Several approaches have been used in the spillway gate operation, such as Neural Network, Fuzzy logic, Data Mining, Casebased Reasoning, and Expert System [19].   [25,26,27], artificial immune system [28], multi-agent [29], data mining [30], and ant colony optimisation [31]. Different studies used different techniques, for example, [2] used rule-based while [3] used experience-based reasoning techniques. In general, RBR approach is a conventional way of representing knowledge. This approach works well with inaccurate and incomplete information [32]. However, these traditional techniques based on rule have a few drawbacks, such as difficulty of knowledge acquisition, poor efficiency of inference, and ineffectiveness in dealing with exception [33].
Neural network (NN), on the other hand, is capable of generalising patterns that mimic the experience-based model. It can capture such experiences through a set of learning algorithms. It can also solve a non-linear problem [34]. However, NN lacks reasoning ability since it can only capture knowledge in the black-box model process [35]. It can also take a longer time period to develop an established model [36].
The AIS method is as one of the best computational intelligence communities. According to [37], artificial immune system (AIS) is a computational system inspired by the biological immune system and biological medical theories. Like other biologically inspired techniques, the artificial immune system also has a unique characteristic in the process of self and non-self identification to solve computational problems.

Methodology
The Timah Tasoh reservoir is the chosen sample for this study. It is the largest multipurpose reservoir located at Sungai Korok, in the state of Perlis. This reservoir is responsible for supplying adequate and sufficient domestic and industrial water supply to meet irrigation needs. In this study, data from 1998 This study applied the negative selection algorithm with intelligent agent to develop this model. The immune system is an adaptive system that can recognise self and non-self elements. The non-self elements are known as antigen or foreign substances, which are removed from the human body. This feature is what makes this method special and interesting to explore. There are two important steps in this model. Fig. 2 shows the procedures for the negative selection training phase. The important step is collecting the data that identify as self-sets. Then, random candidates are compared with the self-set. Detectors are generated when the data do not match with the self-set. This process is inspired by the T-cells process, whereby only detectors that do not match any self-sample sets are retained.
The first step is to create the memory pool that consists of self-set patterns and memory antibodies that consist of non-self patterns. Several intelligent agents are involved, such as the information agent, alert agent, NSA agent, and decision agent. Each agent will have relevant information needed to assist in making the decision for early water release. The self-set stores data that has normal features representing the normal operation. Then, this process is continued by calculating the similarity between the self elements using the affinity measure (Euclidean Distance). If the affinity measure is higher than the affinity threshold, then the self element is removed. Otherwise, it is set as a new self. Subsequently, the self-set will be ready to start creating the lymphocytes that will monitor the system. The next step is the process of generating detectors and the system will be ready to start looking for abnormal system behaviour. The new data will be compared with the data contained in the non-selfpatterns. If any detector matches the new data, then that data is known as an abnormal behaviour. It would also mean that the early warning system must be activated. All agents will communicate among themselves to distribute the information and action that must be taken automatically.
The parallel information and action commencement is important to make a decision in the spillway gate operation. New data that are similar to the existing detectors will be destroyed to prevent Step2: Initialise the training set of self patterns as S and non-self patterns as NS, as a binary or real number; Step3: Calculate similarity, the affinity between input xi and each pattern in S, NS, lymphocytes(L), MA; If the calculated affinity with at least one pattern in MP is higher than affinity threshold, then, reject xi; else if the calculated affinity has at least one pattern in MA, then, reject xi and the suggested action should be taken; otherwise, add xi to set C as a new pattern; Update the database for Information agent. Alert agent, NSA agent, and Decision Making Agent Step 4: Repeat or Stop until size of data equals the predefined number; Alert agent ready for alert message

ICoRAST2019
Journal of Physics: Conference Series 1551 (2020) 012009 IOP Publishing doi:10.1088/1742-6596/1551/1/012009 8 redundant detectors. Therefore, the number of detectors can be reduced and execution time can be improved. The detailed process is presented in the testing phase.

Training Phase
The multiagent architecture was used to demonstrate an automated information process and AIS was used as a model for classification within the normal situation and abnormal situation. An abnormal situation is where an emergency decision must be made for the protection of citizens and property. The main operation would be focused on an early warning system in the spillway gate operation during an emergency situation to issue an alert message before the flood occurs. In this study, the communication among the agents at six rainfall stations, the reservoir water level, and rainfall readings were variables taken for predicting an impending flood event. The spillway gate operation will consider the following two main components: a. Normal situation/self where the gates are already open; and b. Abnormal situation/non-self where the gates are at one day before they are close.
This study collected 2,861 records, which were in the temporal record form. The collected data were imported and sorted by date using MS Excel. The data were divided into two categories, namely, event data and non-event data. In this study, the event data means that the gates are open, whereas during the previous day, the gates are closed. For the segmentation process, the sliding window technique was applied using size 2, which represented 2 days of delay before the water level was increased.

Testing Phase
The testing phase was conducted to test the effectiveness of the system in identifying the collected data, either as non-self or as an alert message for decision making by the operator. Non-self data will be stored as a detector during the data training phase. The new data were tested with the stored set of detectors. Any similarities between the new antigen and the detector set will activate the alarm for early decision making. The main steps in this algorithm, as shown in Fig. 3, are listed as follows: Step 1. The new data or candidates are censored by matching them with detector sets. New data that match with the detectors will activate an alarm for early detection.
Step 2. If the new data or candidates do not match with the detectors, this process will proceed with similarity measure using Euclidean Distance. If a match is found, then, the alarm for early detection will be activated. If no match is found, the next step will commence.
Step 3. Candidates that match with a subclass of self are discarded and the remaining candidates are kept as new detectors.
In the traditional Negative Selection method, every candidate or non-self data must be compared with all detectors. If they do not match, then the data will be known as a self-set. However, for the best implementation, data that do not match with the detectors must be compared with all self-sets before being discarded. This method is not suitable for big data usage because it takes a long time to perform data comparison. To enhance the efficiency of the testing stage, this model compared random data with similar subclasses for every self-set. This means only similar classes will be compared rather than comparing all self-set data. This study proposed an AIS model using the intelligent agent approach. This proposed model has been tested using previous cases to measure its performance. The activities shown in this study can be used as a guideline for system development using the Agent-based Negative Selection Model.
The dataset consisted of unbalanced data where the number of events was lower than the number of non-events. Usually, the spillway gates are kept closed and will be opened only when the water level rises to a certain limit. This frequently happens during the wet season towards the end of the year. The performance measurement of this study was adopted from [38], as shown in Table 4 Table 4 shows the comparison of performance results for set A to set G. Each group that shows the optimum value of similarity will show a higher accuracy. Optimum similarity means the values in Spec, Acc, and Sen must be 1. The experimental results for this study were higher compared to a previous study [16]. The similarity value for the previous study was 88.75%, while this current study obtained a higher similarity of 95.41%, as shown in Table 5. Interestingly, this method also produced a lower false alarm of 6% at the optimum value of similarity. Therefore, the agent-based negative selection model can be used for classifying water release operations. Negative selection method has several advantages for decision making since the operating rules in the memory set could continue updating dynamically, making it easier to deliver the information to the users. This method can also reduce the number of redundant data and save the storage memory because the same data with self will be removed and only detectors will be retained.

Conclusions
Reservoir operators have been manually monitoring the changes in water level and consulting their superior officers before taking the appropriate action. Unpredictable weather conditions make it difficult to make an early decision for releasing the water in the reservoir. Several techniques are available for developing early warning systems, but there are limitations and disadvantages with these techniques. Thus, this study proposed the use of the autonomous agent-based system based on the Artificial Immune System (AIS), to immediately send rainfall readings to the reservoir for the gradual release of water to prevent it from bursting. The results have shown that the negative selection algorithm can be a good classification technique compared to case-based reasoning and rule-based reasoning to support decision making. Findings in this study can be used as alternative information by the reservoir operators in making the early decision for reservoir water release. An early water release from the reservoir will reserve enough space for incoming inflow due to heavy upstream rainfall. In addition, the water release can be controlled within the capacity of the downstream river. Thus, the risk of flood downstream due to extreme water release from the reservoir can be reduced. In this study, window sliding has been shown to be a successful approach to model time delays, while the neural