Next Article in Journal
A Critical Review of Nanobubble Flotation for Seawater Treatment Process
Previous Article in Journal
Sustainable Removal of Basic Fuchsine and Methylene Blue Dyes Using Chicken Bone Biomass: Thermodynamics, Kinetics, and Insights from Experimental Studies and Decision Tree with Least Squares Boosting Predictive Modeling
Previous Article in Special Issue
Water Level Forecasting Combining Machine Learning and Ensemble Kalman Filtering in the Danshui River System, Taiwan
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Combination of Large Language Models and Portable Flood Sensors for Community Flood Response: A Preliminary Study

1
Institute of Applied Mechanics, National Taiwan University, No. 1, Sec. 4, Roosevelt Rd., Taipei 106319, Taiwan
2
Department of Civil Engineering, National Yang Ming Chiao Tung University, No. 1001, Daxue Rd. East Dist., Hsinchu City 300093, Taiwan
*
Author to whom correspondence should be addressed.
Water 2025, 17(7), 1055; https://doi.org/10.3390/w17071055
Submission received: 17 February 2025 / Revised: 17 March 2025 / Accepted: 28 March 2025 / Published: 2 April 2025
(This article belongs to the Special Issue Application of Machine Learning Models for Flood Forecasting)

Abstract

:
The effectiveness of early warning systems can help people take action to mitigate the impact of extreme weather events once warnings are issued. The early warning systems developed by public agencies usually issue standard messages that, in many situations, may not affect all the people who receive the messages. In the long run, this can lead to behaviors in people who may not respond to relevant warnings, resulting in inefficiency. Users demand faster and more customized information that matches their needs, such as “How does this affect me right now?” or “What can I do to mitigate the impact?” This study proposes a decentralized framework at the community level that includes custom Internet of Things (IoT) sensors for timely information monitoring and large language models (LLMs) for the generation of user-defined warning messages. The sensors have the advantages of easy installation, low cost, and affordable maintenance fees. The trained LLMs expedite information processing given specific prompts and generate customized response messages to the users. In addition, the framework is established within a serverless environment, enabling rapid deployment and scalability. This integration of IoT sensors and LLMs demonstrates how the system performs once sensors detect flooding and how LLMs can deliver real-time, efficient, and localized action-ready information in different scenarios. This combination significantly enhances the responsiveness during flood events.

1. Introduction

The economic and social losses caused by flooding are the most serious of those caused by all natural disasters. According to the Emergency Event Database (EM-DAT), 223 of the 432 natural disasters in the world in 2021 were related to floods [1]. Togawa et al. [2] mentioned that conventional approaches for flood risk management are no longer sufficient to address the increasing risk of natural disasters. The integration of nonstructural measures (e.g., community engagement) and structural measures must be promoted to mitigate the impact of future climate change. Research shows that community members must engage in planning and take proactive measures to safeguard themselves during floods, as well as participate in flood control efforts when necessary [3]. Finally, Webber et al. [4] concluded that disaster relief can be significantly improved when community members actively use real-time data with innovative technologies, such as information and communication technology (ICT) and the Internet of Things (IoT).
Wireless sensors have commonly been used to monitor disasters because of their advantages of energy efficiency, low cost, high flexibility, and easy maintenance [5]. The interconnection of multiple sensors, such as those for water levels, rainfall, and flow rates, enables real-time data sharing and remote flood monitoring [6]. These sensors are widely available and easy to deploy, resulting in a growing number of applications not only in flood management [7], but also in agricultural systems and earthquake disaster management [8,9]. The advancements in artificial intelligence (AI) have expanded the potential of the IoT, revolutionizing disaster risk prevention, reduction, and response [10]. For example, a combination of k-NN and naïve Bayes artificial algorithms was developed to process the sent information and produce warning information at three different levels: flood, warning, and no flood [11]. According to the study, combining algorithms could increase flood forecasting accuracy given the limited number of sensors available to monitor flooding and insufficiencies of data storage. However, few details can be found in the paper. In addition, three levels of warning information, which include the source of the warning, the nature, location, and time of the hazard, and recommended action, are not sufficient to meet the requirements of effective flood warning communication [12]. Other studies have also confirmed the demand for low-cost flood sensors in recent years for the better coverage of flood warning systems and longer emergency response lead times [13,14,15,16]. These low-cost sensors may be less accurate than traditional sensors, but their measurements are sufficient for flood forecasting purposes. Rose et al. [16] concluded that compared with traditional sensors, low-cost sensors are more cost-effective for the new generation of the IoT, reporting a benefit–cost ratio of 1.5 to 1. The benefits are likely to increase in future scenarios of climate change.
Large language models (LLMs) are well known for their ability to write coherent text and perform various tasks relevant to question answering or text summarization. Through LLMs, users can receive, interact with, and process disaster-related data intuitively and conservatively. Kumbam and Vejre [17] used LLMs to assist users with limited professional skills in accurately processing inputs such as georeferenced locations via a user interface. During the disaster preparedness phase, efforts were made to improve the public perception of flood risk [18]. The use of LLMs is beneficial for providing general advice and guidance during disaster responses and emergencies [19]. Colverd et al. confirmed that LLMs can excel at generating coherent text and handling tasks like question-answering and summarization, which is especially valuable for making sense of complex, rapidly changing disaster data [20]. While LLMs offer advantages in processing complex information, they are usually not trained with the most current data, which indicates that they lack accuracy in answering specific or real-time questions [21]. Many studies have mentioned that LLMs can produce nonfactual information by “hallucinating” facts [20,22]. In addition, LLMs are good at collecting information, but they cannot monitor what is happening. Therefore, Xue et al. [21] recommended that users exercise discernment when using information from LLMs and verify it with reliable sources.
Although many studies have individually examined IoT sensors and LLMs for disaster-related applications, their integration for community-level flood response has not been explored. This study addresses this gap by proposing a decentralized framework that utilizes both technologies. When IoT sensors detect floods or events that may lead to floods, informing people and encouraging them to take appropriate actions are crucial. This study develops community-friendly flood sensors to measure flood depths and integrates them into LLMs to provide risk warnings tailored to everyone’s needs. This will enhance communication about potential risks, helping to connect flood sensors with people and ensuring that appropriate actions are taken [12,23,24]. A hybrid data-processing framework is proposed to enhance communication and improve the efficiency of responses to flood warning messages for community-level. The LLMs are prompted to expand the user’s query into other relevant search queries. The relevant sources are then processed to extract coherent information for the users. This framework is designed to operate within a serverless environment (web service on HEROKU) to continuously integrate collected sensor data and modeling outputs. It connects to a LLM (OPEN AI ChatGPT-4o-mini), through APIs. The system uses developed prompt engineering techniques to generate optimized disaster warning messages effectively. These messages are then efficiently communicated to the community via a unified messaging platform (messenger, LINE). A module-based approach is adopted, allowing for the independent development of each module, thereby enhancing the flexibility and extensibility of the framework. Additionally, it helps reduce the costs associated with hardware and software maintenance across diverse platforms.

2. Methods

Effective disaster management requires accurate and timely information. However, during crises, excessive passive data often lead to underuse or misinterpretation, highlighting a critical gap in the application of disaster-related information. While LLMs can generate tailored responses, they currently lack real-time monitoring capabilities. As a result, the information provided may not meet the specific needs of the users and could even mislead them regarding disaster warnings. This study introduces an innovative framework that uses portable, edge-ready IoT sensors for real-time monitoring. The framework issues warnings on the basis of publicly available information and employs generative AI to create specific response messages tailored to the observations, geographical data, and flood modeling results. Figure 1 illustrates the structure of the proposed system framework along with the flow of information processing. To reduce the physical burden of setting up a server and reduce maintenance costs, a cloud serverless platform is used as the primary unit for information processing within the system. Further details, along with information about other components, are presented in the following sections.

2.1. Portable Flood Sensors

The sensor functions as a local information collector rather than for long-term monitoring purposes. Additionally, this system emphasizes community users, meaning that efficiency and maintenance are crucial for sustainable operation. The “buckle-up” concept, which refers to a flood sensor designed for easy installation in the field, is introduced. It emphasizes the sensor’s resistance to severe environmental conditions, ensuring that it can withstand extreme environments while operating long enough to cover the entire duration of a disaster event. To achieve these goals, a microcontroller unit (MCU) was utilized as the foundation for developing a portable sensor. The circuit board design is illustrated in Figure 2. For this study, an Arduino Nano 33 IoT was selected because of its compact size (less than 8 cm2), light weight (5 g), and efficient computing capabilities (32-bit low-power processor). It provides outward communication through Wi-Fi and Bluetooth, operating in the 2.4 GHz range, while secure communication is ensured with the use of a cryptographic chip. Since the sensor is deployed outdoors and WiFi and Bluetooth may not be available, a narrowband Internet of Things (NB-IoT) connection through a Sim7020 chip is used. NB-IoT is an emerging technology in IoT sector. It offers advantages such as wireless data connectivity and low power consumption, making it suitable for wide-area networks. This technology can be deployed efficiently in the field, allowing for effective data collection and monitoring [25].
An ultrasonic sensor is connected to the MCU via an I2C connector, as shown in Figure 2. When the sensor receives a command from the MCU, it emits a series of eight consecutive sound waves at a frequency of 40 kHz. The receiving end of the sensor records the time difference between the emitted and reflected sound waves. This time difference is multiplied by the speed of sound, which is typically 343 m per second (m/s) at room temperature (20 °C) to calculate the measured distance H0 between the sensor and the detected water surface. When the water level changes, the same principle applies, and the measured distance is updated to H1. Therefore, the increased flood depth is H0H1, as illustrated in Figure 3 in the bottom right corner. In this study, we compared the performances of ultrasonic sensors and light wave-based sensors for measuring flood depth. The results shown in Figure 3 indicate that the ultrasonic sensor is more effective for detecting water surface levels than the light sensor at three different depths, namely 10 cm, 20 cm, and 30 cm, with the sensor positioned 50 cm above the ground. The ultrasonic sensor performed better because of its superior wave reflectivity when interacting with water. This study applies a Taidacent KS109 ultrasonic sensor, offering a detection range of 3 to 1000 cm with a blind area of 3 cm. According to its device manual, the measuring accuracy is up to 0.1 cm. Figure 3 illustrates the errors compared to the ground truth measurements. When the flood depth was 10 cm, the error was 0.04 cm with the sensor positioned 60 cm above the water surface. At a flood depth of 20 cm, the error increased to 0.195 cm under the same sensor position. However, when the sensor was raised to 100 cm above the water surface, the errors increased further to 0.23 cm for a flood depth of 10 cm and 0.98 cm for a flood depth of 20 cm. Overall, all errors remained within 1 cm. Finally, the sensor is battery-powered so that it can operate in the event of a significant power outage. To increase power efficiency and facilitate long-term observations, the sensor is equipped with a TPL5110 power management chip. This chip effectively regulates the sensor’s power consumption, enabling it to perform continuous observations every 10 min for over 30 days via four 3400 mAh 3.7 V lithium-ion batteries. The installation of the MCU-based flood sensor is shown in Figure 4, and it is suitable for outdoor environmental monitoring and has the advantages of low cost, long observation time, and high observation accuracy.

2.2. Rapid Inundation Model

In this study, the digital elevation model (DEM)-based flood inundation model originally proposed by Yang et al. [26] is adapted to generate a two-dimensional flood map on the basis of observed flood depths. There are two primary reasons for choosing a DEM-based flood model over more complex physics-based models [27]: (1) while complex flood models yield highly accurate results, they require significant computational resources for calculation and time for model development; (2) the DEM-based model provides timely results for operational purposes. Additionally, it demands less computational power, making it an ideal fit for the proposed system in terms of maintenance and compatibility with edge-ready sensors.
The following brief description outlines the DEM-based model utilized in this study. For example, at the location where the portable sensor is installed, the elevation is denoted Z1, and a flood depth of ∆h1 is recorded at time t, as illustrated in Figure 5a. The DEM-based model categorizes this grid as wet, whereas the surrounding grids are classified as dry, as shown in Figure 5b. The grid size can be adjusted on the basis of user preferences. In this study, a DEM resolution of 20 m × 20 m is employed, meaning that the 3 × 3 grids in Figure 5 cover an area of 3600 m2. The model uses Equation (1) to determine whether floodwater (Z1 + ∆h1) spreads to the surrounding dry grids (Z2). Figure 5c shows that the status of the surrounding grid changes from a dry grid to a wet grid, and the elevated flood depth (∆h2) is calculated according to Equation (2).
Z 1 + h 1 > Z 2
h 2 = ( Z 1 + h 1 Z 2 ) × k
( Z 1 + h 1 ) s i m ( Z 1 + h 1 ) o b s
The parameter k represents the fraction of water volume allocated to the surrounding area as described in Equation (2). For this study, it is assumed that the transfer of floodwater occurs in accordance with the D4 method [28], with an equal distribution of water transferred in each of the four directions, set at k = 0.25. The abovementioned iterative process of calculating the flood depths was performed for all wet grids near the installation site. The process is halted, and the flood map is generated once Equation (3) is satisfied to ensure mass conservation. In Equation (3), “obs” refers to the observed flood depth from the sensor, whereas “sim” denotes the simulated flood depths obtained from the DEM-based model.
The purpose of this study is not to demonstrate the improvement of this model but rather to illustrate the integration of IoT sensors, flood simulations, and LLMs. Users can incorporate flood simulation models into this framework. As a result, the specifics of the modified model are not emphasized or discussed in this context.

2.3. Large Language Models (LLMs)

A GPT-BOT messaging system that serves as an information portal between users and the flood sensors and model predictions mentioned earlier is developed (shown as Figure 1). Community-installed sensors situated in high-risk areas transmit real-time data (e.g., observed flood depths or simulated flood extent) to a web service (Webhook), which serves as the central processing hub. As previously mentioned, this study did not establish a physical server device but instead opted for a web service to streamline data ingestion, processing, and integration with external APIs. This choice enables the smooth updates of flood simulation outputs and notification workflows. The processed data are subsequently input or prompted into OpenAI’s ChatGPT API to generate location-specific disaster warning messages. These messages are then delivered via the messaging API (LINE in this study) in short messages (less than 150 words), ensuring timely, relevant updates and constructive warnings.
The workflow for initiating the GPT-BOT messaging system is illustrated in Figure 6. A detailed explanation of Blocks A to E can be found in Table 1. The order numbers indicate the flow of data and processes within the system.
Step 1 and Block A: Using typhoon alerts and the most frequent extreme weather events in Taiwan as examples, the system first dynamically adjusts the notification frequency according to the alert level: six-hour intervals for sea typhoon warnings and ten-minute intervals for land typhoon warnings. At present, the system is manually activated by the user.
Steps 2 and 3, Blocks B and C: Once the system is activated, APIs and serverless functions enable real-time data acquisition and the automation of data cycles, whereas custom scripts prepare proprietary datasets. All code in in Webhook and HEROKU is written using Python 3.10.15, with the pseudocode displayed in Figure 7. The web service also includes an event-trigger mechanism that ensures responsiveness during critical situations, facilitating real-time updates for rapid disaster response. The system emphasizes data privacy and robust error management to maintain reliability.
Steps 4 and 5, Block D: This framework seamlessly integrates open and proprietary datasets with AI-driven text generation, leveraging the web service’s ability to enhance data processing and distribution.
Step 6 and Block E: Automating disaster notifications delivers actionable, context-specific information that improves user preparedness, decision making, and response efficiency, especially during heavy rainfall and flood-related disasters.

3. Study Area and Data

This study focuses on Chunghua village, which is located in the Songshan District of Taipei city, as illustrated in Figure 8. The village is adjacent to Taipei Arena and is situated in the southern part of Taipei city, an area known for its concentration of banking and financial centers, resulting in a high level of economic activity. Covering approximately 0.16 square kilometers, Chunghua village has a population of approximately 7000 residents. The dots displayed in the figure represent the locations of historical flooding incidents that occurred between 2017 and 2018. The Taipei City Government provides the data based on CCTV images, watermarks, and field surveys conducted after events. Topographically, the area is elevated in the northeast and slopes down toward the southwest, with a difference in elevation of approximately 7 m between the highest and lowest points. This geographical variation pattern aligns with historical flood occurrences, which tend to be concentrated in the southwestern region of the village. Some instances of flooding were caused by heavy rainfall that exceeded the capacity of the drainage system. Consequently, the flooding typically receded once the rain stopped, allowing the drainage system to properly function again.

4. Results

4.1. Modeling Results

To demonstrate the function of the proposed system during an extreme event, two events are explored to verify how the sensor and the DEM-based model function. A comparison of the simulated results from 8 September 2018, is presented in Figure 9. The simulation results from this study, particularly in the lower left area, are more conservative. This is because the depth of flooding was not detected by the sensor, leading to the simulation outcomes differing from those of the NTU model [29]. In addition, the flooding in this area may be transmitted from flooding in the lower bottom right area; therefore, the results cannot be observed by the sensors installed in the lower bottom left area. This study revealed overestimations in the central part of the study area. Aside from the southwestern region, the most significant difference when compared to the NTU model results is less than 20 cm, with an average difference of 13.2 cm. The simulated results from this study are based on observed flood depths and generated using a DEM-based model. This DEM-based model is designed to estimate the maximum flood extent, which may result in an overestimation compared to the NTU model, a fully physics-based model. Overall, the simulation results from both models (NTU and this study) align well in identifying critical high-risk flood areas. Figure 10 illustrates the simulation of the inundation event on 22 July 2019, in comparison to the observations provided by the city government. Owing to the limitations of the observed resources, government officials can identify only the flood inundation extent according to the watermark, field interviews, and CCTV images. The model result at the left in the figure is consistent with the observations, indicating that the model can capture the actual flood inundation extent. In addition, the model can provide details such as flood depths.

4.2. LLM Results

After flood observations and simulations are collected, the GPT-BOT messaging system creates customized flood warning messages on the basis of historical data, current observations, and future forecasts. This study categorized flooding conditions on the basis of flood depth: a flood depth of 0 cm indicates “no flooding”, flood depths less than 30 cm denote “slight flooding”, and flood depths above 30 cm represent “severe flooding”. The prompts from the proposed system to the LLM (i.e., Order 4 in Figure 6) are “Read the conditions among {previous status}, {current status}, and {predicted status}. The {previous status} is the status 6 hr before now. The {current status} is the status now. The {predicted status} is the status predicted for 6 hr later. Generate the flood warning regarding to the status before, now and later. Give the message receiver some tasks to do now and later. The format of this warning includes the topic date and time as the header and the status and the actions and/or instructions to perform. The date and time now are {current time}. Complete the message in 150 words”. In the prompt above, the information in {} is updated according to the information retrieved from IoT observations, the model simulation, and other available sources. For example, if only flood depths are considered in the prompt, the {current status} of the above prompts would be “The flooding height is 39 cm, which indicates severe flooding”. This study examines 27 different scenarios, and Table 2 presents nine of these scenarios, each with distinct conditions. For example, Scenario A indicates that there is no flooding at any time during the specified intervals ( t ), which are based on the sea warning period ( t = 6 h) or the land warning period ( t = 10 min). Scenarios B and C illustrate situations where flooding either worsens or subsides, respectively. Similar cases are presented in Scenarios D to F and G to I, where the former starts with slight flooding and the latter begins with severe flooding. Details of the response messages associated with each scenario are listed in Table 3. The goal is to show how the combination of IoT sensors and LLMs can adapt to varying conditions via real-time and predictive data.
Importantly, in addition to assessing flood severity on the basis of flood depth, this study did not predefine or pretrain LLMs with any prior information (e.g., evacuation guidelines). The results presented in Table 3 consist of general information generated by the LLMs. Although the past conditions differ, the immediate actions are all based on present conditions so that the user can respond to immediate threats. For example, the immediate actions for Scenario B are for users to move to higher ground, avoid flooded areas, and prepare for worsening conditions. In contrast, for Scenario C, since the present condition is severe flooding, the immediate actions are presented in an urgent tone and include words such as “evacuate”, “avoid contact”, etc. If the present conditions are “no flooding”, the response messages usually have a suggestive tone. For example, for Scenarios E and I, despite the past conditions being slight and severe flooding, respectively, the immediate actions use a similar tone and include phrases such as “stay alert”, “monitor weather updates”, and “prepare essentials and ensure functioning”. According to all testing scenarios, the immediate actions taken when there is “no flooding” (Scenarios A, E, and I) include remaining alert and implementing precautionary measures, such as monitoring and preparing. In cases of “slight flooding” (Scenarios B, G, and H), the recommended immediate actions are to avoid high-risk areas and, if possible, move to higher ground. The messaging regarding immediate actions remains similar in severity for both “no flooding” and “slight flooding” situations. However, when the situation is “severe flooding”, the immediate actions become more aggressive and imperative (Scenarios C, D, and F).
The system also accounted for forecasts and assessed how the LLM responds to uncertain information. Importantly, the messages are tailored to the current conditions, despite the future forecasts being the same. For example, in Scenarios B and E, the future forecasts indicate “severe flooding”, whereas the present conditions are “slight flooding” and “no flooding”, respectively. In Scenario B, the messages advise individuals to stay updated and prepare for possible evacuation. In contrast, for Scenario E, the messages encourage preparation and planning, advising evacuation only if instructed. The messages for Scenario H are similar to those for Scenario B since they share the same present “slight flooding” and future “severe flooding” conditions. Consequently, given that the current condition is “no flooding”, future actions are less urgent. Similar considerations apply to Scenarios F and G. Since the future conditions indicate “no flooding”, the recommended future actions differ due to the variations in present conditions. The recommendations for the future actions of Scenario F remain conservative, including “avoid”, “prepare”, and “follow instructions”, due to the present condition of “severe flooding”. In contrast, Scenario G advises a less stringent approach, suggesting that users “be cautious”.
Finally, a comparison with other system frameworks is presented in Table 4. The proposed integration and framework can generate specific actions based on both currently observed data and future forecasted data, resulting in efficient personalized alerts and easy updates. Other existing systems mentioned in Table 4 also have their own advantages, such as reliable real-time observed data, immediate responses under defined protocols, and a low risk of Internet dependency. However, in contrast to these existing systems, the proposed system framework operates within an unsupervised framework, meaning that no predefined guidelines or data are provided to the language models in advance. For example, certain recommendations, such as “Keep important documents in a waterproof container or in digital form”, are quite uncommon in Taiwan during flood events. The response message format is now dynamic, providing more personal, informative, and insightful suggestions. The proposed system and framework offer an innovative way to process multiple sources of disaster-related information.

5. Conclusions

The advancements in LLMs have broadened the world’s expectations for AI. However, only a few studies have examined LLMs in disaster-related applications. Therefore, this study explores the integration of portable flood sensors and LLMs to create a community-level flood response framework, leveraging real-time sensor data and AI-driven messaging for personalized flood alerts. The specially designed MCU-based flood sensor is energy efficient, cost effective, and easy to maintain, allowing for effective monitoring of flood depth. Moreover, the rapid DEM-based model can translate flood depth data into a comprehensive flood map. The proposed GPT-BOT messaging system can provide actionable flood warnings by integrating real-time observed flood depth, predictive flood extent, and generative AI. This system effectively uses Python, Webhook, the messaging API, and the GPT API to automate and enhance the delivery of location-specific flood notifications. By addressing varying flood scenarios with dynamic and actionable messages, the system helps users prepare, stay safe, and make informed decisions. Additionally, all the systems built on a cloud host (Webhook) not only increase usability but also reduce equipment maintenance costs while improving reliability. Its scalability and potential for automation make it a valuable tool for broader disaster management applications.
Several challenges must be addressed before the full-scale implementation of this system. Despite their advanced text generation, LLMs lack real-time training and may produce inappropriate emergency messages. Integrating real-time web data feeds and government APIs could enhance accuracy. The system’s grid-based flood depth information personalizes response messages, but expanding custom risk factors (e.g., mobility restrictions, household vulnerabilities) would further improve emergency instructions. Local geography, infrastructure, climate, and urban–rural conditions should also be factored into prompt commands for more precise warnings. With continued refinement, this hybrid framework has the potential to significantly enhance flood preparedness, reduce disaster risk, and improve emergency response strategies on a global scale.
Overall, the proposed system integrates IoT flood sensors and LLMs to provide timely, localized flood warnings, improving emergency response efficiency. However, building user trust in AI-generated warnings is the biggest challenge, especially in disaster warning systems. To improve user trust and acceptance of these warnings, several measures can be taken in the future research: (1) Enhancing transparency and explainability: It is essential to clearly communicate the rationale behind AI-generated warnings. (2) Integration of trusted third-party sources: Incorporating authoritative or expert sources can enhance the credibility of the warnings. (3) Validation of prediction accuracy: Continuously validating the accuracy of predictions is crucial for improving the warnings. (4) User feedback and contextualized messaging: Public outreach and community training sessions are necessary. Encouraging user feedback will help improve the system, and providing customized messages tailored to user contexts will facilitate better acceptance. (5) Enhancing sensor accuracy: Improving sensor accuracy and exploring the application of edge computing can enhance the system’s reliability, especially in environments with disrupted networks.

Author Contributions

Conceptualization, T.-H.O. and T.-H.Y.; Methodology, T.-H.O. and T.-H.Y.; Software, T.-H.O. and T.-H.Y.; Data curation, T.-H.O. and T.-H.Y.; Writing—original draft, T.-H.O. and T.-H.Y.; Writing—review & editing, T.-H.Y.; Supervision, P.-Z.C. All authors have read and agreed to the published version of the manuscript.

Funding

This study was supported by the National Science and Technology Council, Taiwan, under research grant NSTC 113-2625-M-A49-003-.

Data Availability Statement

The raw data supporting the conclusions of this article will be made available by the authors upon request.

Acknowledgments

The authors would like to thank the Taipei city government for providing observational records and National Taiwan University for providing benchmark datasets for flood inundation modeling.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Centre for Research on the Epidemiology of Disasters (CRED). 2021 Disasters in Numbers; CRED: Brussels, Belgium, 2022. [Google Scholar]
  2. Togawa, T.; Morita, H.; Tsuji, T. Applying the functional resonance analysis method (FRAM) to flood risk management at a community level: Koriyama city’s emergency-response process during Typhoon Hagibis. Prog. Disaster Sci. 2023, 19, 100291. [Google Scholar] [CrossRef]
  3. Wolff, E. The promise of a “people-centred” approach to floods: Types of participation in the global literature of citizen science and community-based flood risk reduction in the context of the Sendai Framework. Prog. Disaster Sci. 2021, 10, 100171. [Google Scholar] [CrossRef]
  4. Webber, J.L.; Fletcher, T.; Farmani, R.; Butler, D.; Melville-Shreeve, P. Moving to a future of smart stormwater management: A review and framework for terminology, research, and future perspectives. Water Res. 2022, 218, 118409. [Google Scholar] [CrossRef] [PubMed]
  5. Jin, Y.; Kwak, K.S.; Sengoku, M.; Shinoda, S. Wide area sensor network for disaster prevention and monitoring: Concept and service coverage. In Proceedings of the 2014 IEEE Asia Pacific Conference on Circuits and Systems (APCCAS), Ishigaki, Japan, 17–20 November 2014; pp. 391–394. [Google Scholar]
  6. Tao, Y.; Tian, B.; Adhikari, B.R.; Zuo, Q.; Luo, X.; Di, B. A Review of Cutting-Edge Sensor Technologies for Improved Flood Monitoring and Damage Assessment. Sensors 2024, 24, 7090. [Google Scholar] [CrossRef]
  7. Raman, R.; Iqbal, S.M.U. IoT-based Flood Early Warning System for Effective Disaster Management. In Proceedings of the 2024 International Conference on E-Mobility, Power Control and Smart Systems (ICEMPS), Thiruvananthapuram, Kerala, India, 18–20 April 2024; pp. 1–5. [Google Scholar]
  8. Duguma, A.L.; Bai, X. Contribution of Internet of Things (IoT) in improving agricultural systems. Int. J. Environ. Sci. Technol. 2024, 21, 2195–2208. [Google Scholar]
  9. Abdalzaher, M.S.; Krichen, M.; Falcone, F. Leveraging internet of things and emerging technologies for earthquake disaster management: Challenges and future directions. Prog. Disaster Sci. 2024, 23, 100347. [Google Scholar] [CrossRef]
  10. Ouaissa, M.; Ouaissa, M.; El Himer, S.; Boulouard, Z. AI and IoT Integration for Natural Disaster Management: A Comprehensive Review and Future Directions. In AI and IoT for Proactive Disaster Management; IGI Global: Hershey, PA, USA, 2024; pp. 1–16. [Google Scholar]
  11. Wahyono, I.D.; Asfani, K.; Aripriharta; Fadlika, I.; Jong, G.J. New method of artificial intelligence for disaster information floods use distributed wireless sensors. In Proceedings of the 2019 International Seminar on Application for Technology of Information and Communication (iSemantic), Semarang, Indonesia, 21–22 September 2019; pp. 1–5. [Google Scholar]
  12. Kuller, M.; Schoenholzer, K.; Lienert, J. Creating effective flood warnings: A framework from a critical review. J. Hydrol. 2021, 602, 126708. [Google Scholar] [CrossRef]
  13. Mendoza-Cano, O.; Aquino-Santos, R.; López-De La Cruz, J.; Edwards, R.M.; Khouakhi, A.; Pattison, I.; Rangel-Licea, V.; Castellanos-Berjan, E.; Martinez-Preciado, M.A.; Rincón-Avalos, P.; et al. Experiments of an IoT-based wireless sensor network for flood monitoring in Colima, Mexico. J. Hydroinformatics 2021, 23, 385–401. [Google Scholar] [CrossRef]
  14. Al Qundus, J.; Dabbour, K.; Gupta, S.; Meissonier, R.; Paschke, A. Wireless sensor network for AI-based flood disaster detection. Ann. Oper. Res. 2022, 319, 697–719. [Google Scholar] [CrossRef]
  15. Al-Qurabat, A.K.M.; Abdulzahra, S.A. An overview of periodic wireless sensor networks to the internet of things. IOP Conf. Ser. Mater. Sci. Eng. 2020, 928, 032055. [Google Scholar] [CrossRef]
  16. Rose, A.; Wei, D.; Machado, J.; Spencer, K. Benefit–cost analysis of low-cost flood inundation sensors. Nat. Hazards Rev. 2023, 24, 05022011. [Google Scholar] [CrossRef]
  17. Kumbam, P.R.; Vejre, K.M. Floodlense: A framework for chatgpt-based real-time flood detection. arXiv 2024, arXiv:2401.15501. [Google Scholar]
  18. Zhu, J.; Dang, P.; Cao, Y.; Lai, J.; Guo, Y.; Wang, P.; Li, W. A flood knowledge-constrained large language model interactable with GIS: Enhancing public risk perception of floods. Int. J. Geogr. Inf. Sci. 2024, 38, 603–625. [Google Scholar] [CrossRef]
  19. Goecks, V.G.; Waytowich, N.R. Disasterresponsegpt: Large language models for accelerated plan of action development in disaster response scenarios. arXiv 2023, arXiv:2306.17271. [Google Scholar]
  20. Colverd, G.; Darm, P.; Silverberg, L.; Kasmanoff, N. Floodbrain: Flood disaster reporting by web-based retrieval augmented generation with an llm. arXiv 2023, arXiv:2311.02597. [Google Scholar]
  21. Xue, Z.; Xu, C.; Xu, X. Application of ChatGPT in natural disaster prevention and reduction. Nat. Hazards Res. 2023, 3, 556–562. [Google Scholar] [CrossRef]
  22. Chandra, A.; Chakraborty, A. Exploring the role of large language models in radiation emergency response. J. Radiol. Prot. 2024, 44, 011510. [Google Scholar] [CrossRef]
  23. Rollason, E.; Bracken, L.J.; Hardy, R.J.; Large, A.R.G. Rethinking flood risk communication. Nat. Hazards 2018, 92, 1665–1686. [Google Scholar] [CrossRef]
  24. Lechowska, E. What determines flood risk perception? A review of factors of flood risk perception and relations between its basic elements. Nat. Hazards 2018, 94, 1341–1366. [Google Scholar] [CrossRef]
  25. Tang, J.; Zhu, X.; Lin, L.; Dong, C.; Zhang, L. Monitoring routing status of UAV networks with NB-IoT. J. Supercomput. 2023, 79, 19064–19094. [Google Scholar] [CrossRef]
  26. Yang, T.H.; Chen, Y.C.; Chang, Y.C.; Yang, S.C.; Ho, J.Y. Comparison of different grid cell ordering approaches in a simplified inundation model. Water 2015, 7, 438–454. [Google Scholar] [CrossRef]
  27. Wijaya, O.T.; Yang, T.H. A novel hybrid approach based on cellular automata and a digital elevation model for rapid flood assessment. Water 2021, 13, 1311. [Google Scholar] [CrossRef]
  28. O’Callaghan, J.F.; Mark, D.M. The extraction of drainage networks from digital elevation data. In Computer Vision and Image Processing; CRC Press: Boca Raton, FL, USA, 1984; Volume 28, pp. 323–344. [Google Scholar] [CrossRef]
  29. Chang, T.J.; Yu, H.L.; Wang, C.H.; Chen, A.S. Overland-gully-sewer (2D-1D-1D) urban inundation modeling based on cellular automata framework. J. Hydrol. 2021, 603, 127001. [Google Scholar] [CrossRef]
Figure 1. Structure of the proposed flood warning system and user-initiated information collection process.
Figure 1. Structure of the proposed flood warning system and user-initiated information collection process.
Water 17 01055 g001
Figure 2. Design of the circuit board for the flood sensor.
Figure 2. Design of the circuit board for the flood sensor.
Water 17 01055 g002
Figure 3. Comparison of the performances of ultrasonic and light sensors for flood depth detection.
Figure 3. Comparison of the performances of ultrasonic and light sensors for flood depth detection.
Water 17 01055 g003
Figure 4. Schematic diagram of the portable sensor on the left and the installation of a lamp post along the street on the right.
Figure 4. Schematic diagram of the portable sensor on the left and the installation of a lamp post along the street on the right.
Water 17 01055 g004
Figure 5. The water spreading theory of the modified DEM-based model: (a) a flood depth of ∆h1 is recorded at time t (b) water spreading from Z1 to Z2 when Z1 + ∆h1 is higher than Z2 (c) both Z1 and Z2 have the same water surface (modified from Yang et al. [21]).
Figure 5. The water spreading theory of the modified DEM-based model: (a) a flood depth of ∆h1 is recorded at time t (b) water spreading from Z1 to Z2 when Z1 + ∆h1 is higher than Z2 (c) both Z1 and Z2 have the same water surface (modified from Yang et al. [21]).
Water 17 01055 g005
Figure 6. Structure of the proposed GPT-BOT messaging system.
Figure 6. Structure of the proposed GPT-BOT messaging system.
Water 17 01055 g006
Figure 7. Pseudocode of this research written in Webhook.
Figure 7. Pseudocode of this research written in Webhook.
Water 17 01055 g007
Figure 8. Geographical location and DEM of the study area.
Figure 8. Geographical location and DEM of the study area.
Water 17 01055 g008
Figure 9. Comparison of simulated results from the National Taiwan University (NTU) model on the left and this study on the right on 8 September 2018.
Figure 9. Comparison of simulated results from the National Taiwan University (NTU) model on the left and this study on the right on 8 September 2018.
Water 17 01055 g009
Figure 10. Comparison of the simulated results on the left with the observations obtained from the Taipei city government on the right on 22 July 2019.
Figure 10. Comparison of the simulated results on the left with the observations obtained from the Taipei city government on the right on 22 July 2019.
Water 17 01055 g010
Table 1. Description of the components in the GPT-BOT messaging system.
Table 1. Description of the components in the GPT-BOT messaging system.
Block IDDescription
AManual operation or automated program trigger: Represents the initiating source for system activation, which may originate from either manual operation or predefined automated scheduling.
BMain script in web service (Webhook and HEROKU):
A web-service-side script responsible for managing data transmission, reception, API interactions, and data-processing logic. This function is composed by Python and integrates all API interfaces.
CSimulated data from sensors and open weather data:
The environmental data sources, comprising real-time sensor data collected from community deployments, as well as climate information obtained via open access weather services. By using HTTP POST and GET methods in Python, the data required are received by the HTTP responses.
DLLM Model (ChatGPT): A natural language processing component leveraging large language models (e.g., OpenAI’s GPT models) tasked with analyzing input data and generating contextually appropriate alert or informational messages. With the pre-prompt configuration setup, fixed prompt content and iterative validation, a stable input information for GPT is delivered to API side.
EMessaging BOT (LINE) in terminal device:
A messaging interface integrated within a communication platform (e.g., LINE) that disseminates LLM-generated messages directly to end-users, providing timely alerts or updates regarding potential disaster events. The response is checked by keyword validation, pattern recognition, and content filtering, and eventually delivered to user side.
Table 2. Assumptions of flood scenarios used to generate tailored response messages.
Table 2. Assumptions of flood scenarios used to generate tailored response messages.
Scenario Past   Observation   (t − ∆t) Present Observation (t)Future Forecasts
(t + ∆t)
ANo flooding (flood depth = 0 cm)No flooding (flood depth = 0 cm)No flooding (flood depth = 0 cm)
BNo flooding (flood depth = 0 cm)Slight flooding (flood depth = 19 cm)Severe flooding (flood depth = 39 cm)
CNo flooding (flood depth = 0 cm)Severe flooding (flood depth = 38 cm)Slight flooding (flood depth = 9 cm)
DSlight flooding (flood depth = 7 cm)Severe flooding (flood depth = 35 cm)Slight flooding (flood depth = 28 cm)
ESlight flooding (flood depth = 29 cm)No flooding (flood depth = 0 cm)Severe flooding (flood depth = 49 cm)
FSlight flooding (flood depth = 26 cm)Severe flooding (flood depth = 45 cm)No flooding (flood depth = 0 cm)
GSevere flooding (flood depth = 55 cm)Slight flooding (flood depth = 21 cm)No flooding (flood depth = 0 cm)
HSevere flooding (flood depth = 45 cm)Slight flooding (flood depth = 10 cm)Severe flooding (flood depth = 36 cm)
ISevere flooding (flood depth = 55 cm)No flooding (flood depth = 0 cm)No flooding (flood depth = 0 cm)
Table 3. Original response messages from the proposed system according to different scenarios.
Table 3. Original response messages from the proposed system according to different scenarios.
ScenarioImmediate Actions (Now)Future Actions (From Now to the Next Time Interval, e.g., 6 h or 10 min Later)
A“While there is currently no flooding, remain cautious and stay informed about weather updates. Keep an emergency kit accessible, including essential supplies such as food, water, medications, and a flashlight.”“Continue to monitor local weather forecasts and be prepared to evacuate if conditions change. Establish a communication plan with family and friends. Reinforce the importance of safeguarding property as a precaution against unexpected flooding.”
B“Avoid low-lying areas and do not attempt to cross flooded roads. Move to higher ground if you are in a flood-prone area. Ensure your emergency kit is ready, including food, water, medications, and flashlight.”“Stay updated through local news or weather reports for further flooding updates. Prepare to evacuate if the water level rises significantly; follow evacuation orders from authorities. Document any damage for insurance purposes once it is safe to do so.”
C“Evacuate: If you are in a low-lying area or near the affected flood zone, seek higher ground immediately. Stay informed: Monitor local news and weather reports for updates on the flooding situation. Avoid contact: Do not walk or drive through flooded areas. Floodwaters may contain hazardous materials. Prepare: Gather essential items (medications, important documents, food, water) in case of evacuation. ““Assess safety: Once water levels decrease, check your property for damage before re-entering. Stay cautious: Remain vigilant, as conditions may change unexpectedly. Report damage: Contact local authorities for assistance and to report any hazards.
Stay safe and prioritize your well-being.”
D“Evacuate to higher ground if you are in a flooded area. Avoid driving or walking through flooded streets. Stay updated via local news and weather reports.”“Monitor water levels; although flooding is expected to decrease, conditions may still be hazardous. Only return home when local authorities have declared it safe. Inspect your property for damage once it is safe, and report any hazards to local services.”
E“Stay alert, and monitor local weather updates. Ensure all drainage systems are clear and functioning properly. Avoid low-lying areas prone to flooding.”“Prepare an emergency kit with necessary supplies, including food, water, medications, and flashlights. Identify and plan evacuation routes in case of serious flooding. Keep important documents in a waterproof container or digital form. Follow local authorities’ instructions, and evacuate if instructed.”
F“Stay indoors, and avoid flooded areas. Move to higher ground if your location is prone to flooding. Secure important documents and belongings in waterproof containers.”“Monitor local weather updates and flood advisories. Once conditions stabilize, avoid traveling through floodwaters. Check your property for any damages, and report issues to local authorities. Stay safe and prepared. Follow these instructions carefully to protect yourself and your property.”
G“Stay indoors, and avoid unnecessary travel. Keep emergency supplies ready, including food, water, and a flashlight. Monitor local weather reports and advisories for updates.”“Once flooding subsides, remain alert for any sudden changes in water levels. If you must go outside, be cautious of slippery surfaces. Report any visible hazards to local authorities, and check on neighbors, especially the elderly and those with disabilities. Stay safe and prepared!”
H“Remain indoors and avoid all travel unless absolutely necessary. Monitor local news and weather reports for updates on flood conditions. Move valuable possessions and important documents to higher ground. If you are in a flood-prone area, prepare an emergency kit with essentials such as food, water, and medications.”“Be prepared to evacuate if conditions worsen. Stay tuned for alerts from local authorities regarding safety and evacuation routes. Check on neighbors, especially the elderly or those with mobility issues, to ensure their safety.”
I“Monitor local weather reports and flood alerts continuously. Ensure your emergency kit is prepared with essentials such as water, food, and medications.”“Continue to stay vigilant for changes in weather conditions. Avoid low-lying areas, and stay informed about flood-prone zones in your environment. Communicate with family and neighbors to ensure everyone is aware of the situation and prepared.”
Table 4. Framework comparison between the proposed system and other systems.
Table 4. Framework comparison between the proposed system and other systems.
System FrameworkAdvantagesDisadvantages
LLMs + API + Messenger Integration + Portable Sensors (This Study)High accuracy, personalized alerts, real-time data integration, scalable, easily updated.Reliance on stable networks, potential API outages and latency.
Automated Warning SystemsReliable, stable, clearly defined protocols.Limited flexibility, generalized alerts, potential latency, lack of context.
Sensor-Based Alerting SystemsAccurate real-time data, actionable information, immediate response.Poor coverage, high deployment costs, ambiguous data, lacks centralized communication.
Traditional Communication (SMS)Simple, broad coverage, trusted, and Internet-independent.Delays, low detail and personalization, prone to human error and inefficiencies.
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.

Share and Cite

MDPI and ACS Style

Ou, T.-H.; Yang, T.-H.; Chang, P.-Z. Combination of Large Language Models and Portable Flood Sensors for Community Flood Response: A Preliminary Study. Water 2025, 17, 1055. https://doi.org/10.3390/w17071055

AMA Style

Ou T-H, Yang T-H, Chang P-Z. Combination of Large Language Models and Portable Flood Sensors for Community Flood Response: A Preliminary Study. Water. 2025; 17(7):1055. https://doi.org/10.3390/w17071055

Chicago/Turabian Style

Ou, Tsung-Hua, Tsun-Hua Yang, and Pei-Zen Chang. 2025. "Combination of Large Language Models and Portable Flood Sensors for Community Flood Response: A Preliminary Study" Water 17, no. 7: 1055. https://doi.org/10.3390/w17071055

APA Style

Ou, T.-H., Yang, T.-H., & Chang, P.-Z. (2025). Combination of Large Language Models and Portable Flood Sensors for Community Flood Response: A Preliminary Study. Water, 17(7), 1055. https://doi.org/10.3390/w17071055

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop