Next Article in Journal
Towards Failure-Aware Inference in Harsh Operating Conditions: Robust Mobile Offloading of Pre-Trained Neural Networks
Previous Article in Journal
Cooperative Service Caching and Task Offloading in Mobile Edge Computing: A Novel Hierarchical Reinforcement Learning Approach
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Intelligent Gas Risk Assessment and Report Generation for Coal Mines: An Innovative Framework Based on GLM Fine-Tuning

College of Communication and Information Engineering, Xi’an University of Science and Technology, Xi’an 710054, China
*
Author to whom correspondence should be addressed.
Electronics 2025, 14(2), 379; https://doi.org/10.3390/electronics14020379
Submission received: 22 December 2024 / Revised: 17 January 2025 / Accepted: 17 January 2025 / Published: 19 January 2025

Abstract

:
Traditional coal mine gas risk assessment relies on manual operations, leading to inefficiencies, incomplete information integration, and insufficient evaluation accuracy, ultimately affecting safety oversight. This paper proposes an intelligent gas risk assessment and report generation framework (IGRARG) based on fine-tuning a Generative Language Model (GLM) to address these challenges. The framework integrates multi-source sensor data with the reasoning capabilities of large language models (LLMs). It constructs a gas risk dataset for coal mine safety scenarios, fine-tuned with GLM. Incorporating industry regulations and a domain-specific knowledge base enhanced with a Retrieval-Augmented Generation (RAG) mechanism, the framework automates alarm judgment, suggestion generation, and report creation via a hierarchical graph structure. Real-time human feedback further refines decision making. Experimental results show an evaluation accuracy of 85–93%, with over 300 field tests achieving a 94.46% alarm judgment accuracy and reducing weekly report generation from 90 min to 2–3 min. This framework significantly enhances the intelligence and efficiency of gas risk assessment, providing robust decision support for coal mine safety management.

1. Introduction

Coal mine risk assessment plays a crucial role in modern coal mine safety management [1], serving as a vital foundation for helping the mining management team identify problems and potential risks throughout the entire lifecycle of coal mine operations [2,3,4]. This ensures compliance with high safety standards and facilitates the timely completion of assessments. By monitoring on-site equipment and generating scientific assessment reports, the mine management team can gain an accurate understanding of the ongoing gas monitoring process and the corresponding mine safety status. In this process, various types of mine sensors, especially those detecting gases such as methane and carbon monoxide, provide essential environmental data, forming the technical basis for the development of mining safety Internet of Things (IoT) and smart mine systems [5]. Intelligent report generation systems, built upon the data collected by these sensors, can swiftly identify quality and safety hazards, thereby reducing the likelihood of accidents. Moreover, these reports can pinpoint potential issues in gas monitoring, helping to mitigate risks related to project delays and cost overruns. This enables smart perception, comprehensive monitoring, autonomous analysis, early warnings, and effective control, thereby enhancing the overall safety management capabilities.
The traditional manual assessment process typically requires trained experts who generate evaluation reports based on data collected from on-site sensors. However, due to the complexity of the mine environment and the vast amount of monitoring data, the assessment process demands substantial human and material resources [6,7]. Moreover, this process heavily relies on the subjective judgment of the personnel, which inevitably leads to the risk of overlooking, insufficiently addressing, or improperly handling certain issues [8]. As a result, with the increasing pursuit of optimal control in coal mines, challenges continue to intensify, highlighting the urgent need for automated analysis and decision-making.
The emergence of large language models (LLMs), especially their applications in natural language processing and intelligent decision-making, has provided effective solutions for complex data analysis and intelligent report generation. LLMs have demonstrated powerful capabilities in processing large-scale textual data and generating natural language reports. However, a standalone LLM is insufficient to address the high complexity and real-time requirements faced in mining safety assessments. Therefore, fine-tuning has become an important method to enhance the adaptability of LLMs [9], allowing them to be optimized based on the specific needs of the mining safety domain, thus improving their judgment capabilities in mining environments. Additionally, by combining knowledge bases and Retrieval-Augmented Generation (RAG) technology [10], LLMs can retrieve relevant background information from a knowledge base in real-time, thereby enhancing their analytical and decision-making abilities. By integrating external data with language models, RAG technology can effectively reduce information gaps during model inference, providing more accurate and contextually relevant assessment results. In this way, intelligent judgment systems can not only improve the accuracy of decision making but also reduce risks and errors caused by insufficient data, thereby playing a greater role in coal mine safety management.
Based on this, this study designs an Intelligent Gas Risk Assessment and Report Generation Framework (IGRARG), which integrates multi-source sensor data from coal mine environments with fine-tuning and a multi-agent collaboration mechanism of LLMs. The framework automates the generation of gas risk assessments and reports, providing real-time alarm judgments, emergency response recommendations, and trend analyses. The goal is to address the inefficiencies and unreliability of traditional manual risk assessments.
Specifically, the main contributions of this paper are as follows:
  • This paper meticulously constructs a high-quality risk assessment (RA) dataset based on the gas alarm data collected by sensors at the coal mine production site, including historical alarm data from various measurement points such as carbon monoxide (CO), laser methane (CH4), oxygen (O2), etc., for fine-tuning a general-purpose LLMs.
  • Based on real-time data collection from various gas sensors and coal mine gas judgment standards, a domain-specific knowledge base for coal mining was constructed. Through the integration of RAG technology, efficient indexing, semantic matching, and intelligent inference analysis of the knowledge base are achieved, forming an efficient workflow covering alarm judgment to emergency measure suggestions, and ultimately achieving automated generation of assessment results and reports.
  • The framework adopts a hierarchical graph structure from LangGraph to optimize the collaborative interaction between LLMs multi-agent systems. Through fine-tuning the parameters of agent models and task scheduling configuration, it ensures the efficient execution of report generation tasks within the predefined workflow. A human-in-the-loop feedback mechanism is introduced to strengthen the model’s decision making through real-time user feedback.
The structure of this paper is as follows: Section 2 reviews the literature in the relevant field. Section 3 provides a detailed explanation of the proposed research framework. Section 4 describes the scene data collection and processing techniques, the technical details of the LLMs, fine-tuning and debugging, as well as the specific processes for gas assessment and report generation within the framework. Section 5 presents the evaluation and validation of the framework to ensure its effectiveness in practical applications. Section 6 summarizes the research findings and outlines future research directions. The vision of this study is to contribute to coal mine safety management and intelligent decision-making technologies.

2. Related Work

In this section, we review the existing literature relevant to our study. Current methods and techniques used for coal mining research are first discussed, emphasizing their limitations and the need for more advanced methods. We then explore recent advances in large language modeling and its application in various domains, providing the basis for our proposed framework. This comprehensive review provides a foundation for understanding the context and significance of our work.

2.1. Current Research on Intelligent Assessment Systems

Gas monitoring in coal mines is a critical phase in ensuring safe production. In recent years, technological advancements have led to significant changes in methods and tools used in this area. Traditional manual detection and analysis methods are often limited by their reliance on human resources and low process efficiency [11,12]. To overcome these limitations, the application of emerging technologies has become a key research direction in this field. Recent studies have focused on using automation technologies and intelligent systems to improve safety monitoring and decision-making processes. For example, some studies have explored the application of drones and IoT technologies in tunnel and mine monitoring [13,14,15], demonstrating how these tools can enhance the efficiency of assessments as part of intelligent monitoring systems. Similarly, other studies have examined the use of big data analytics in intelligent risk assessment [16,17,18]. These studies show that big data analysis and sensor integration can effectively cover gas monitoring areas within mines, reducing the risks to personnel during the risk evaluation process.
With the development of automation and data-driven technologies, the application of methods such as artificial intelligence (AI) and machine learning (ML) has introduced new perspectives for optimizing intelligent monitoring systems [19,20,21]. These methods leverage advanced algorithms and predictive model techniques to automate gas detection and alarm processes, enhancing the accuracy and efficiency of safety monitoring. RAG and rule-based reasoning are also crucial components in the field of intelligent assessment systems. The integration of semantic search and knowledge graph technologies has enabled coal mine safety monitoring systems based on diverse textual data [22], providing novel insights into the relationship between monitoring results and the risks of gas overexposure. At the same time, intelligent monitoring frameworks based on real-time data analysis and machine learning models offer an effective method for identifying and assessing gas risks [23]. AI technologies and data-driven models not only improve the efficiency of risk assessment but also ensure worker safety and project compliance [24,25,26]. The application of these technologies enhances both the efficiency of assessments and the safety of coal mine workers.
Furthermore, the technological development trends in intelligent monitoring systems indicate that enhanced sensor networks and AI-driven analytical capabilities will play a significant role in future gas monitoring and safety management. The use of IoT-based sensing technology in tunnel construction provides real-time on-site inspection capabilities [27], while intelligent predictive analytics highlights its potential to improve the efficiency of safety monitoring [28]. Overall, these studies reveal a shift in traditional coal mine gas monitoring methods toward technology-driven automation and intelligence, bringing both new opportunities and challenges to the coal industry.

2.2. Current Research on LLMs and Multi-Agent Structures

In recent years, the development of LLMs has continually propelled technological advancements in the field of natural language processing. Recent research has demonstrated the potential of these models across various application domains. For instance, GPT-4 [29] has shown greater accuracy in text generation and contextual understanding, further expanding the application scope of pre-trained models. Additionally, InstructGPT [30] has significantly improved the understanding and execution of user instructions by introducing an instruction-following mechanism within generative models. Lang Chain [31] enhances the reasoning capabilities and contextual understanding of models by integrating LLMs with knowledge graphs. Innovations in Transformer architectures, such as T5 [32] and RoBERTa [33], have also greatly improved model performance and application range. Furthermore, LLMs have been applied in specific domains, such as legal text analysis [34], medical diagnosis [35], financial risk assessment [36], and construction inspection [37]. These applications illustrate the deep integration and broad potential of LLMs in specialized fields.
Current research indicates that certain supervisory signals established through natural language processing can continue to train well-transferable visual models. This foundation paves the way for the emergence of multi-agent structures within LLMs [38,39]. The multi-agent structure of LLMs integrates task allocation and collaborative processing capabilities, representing a significant advancement in the field of NLP [40]. These structures can not only handle complex language data but also effectively process multiple tasks or functions through well-coordinated collaboration among agents, thereby enhancing the efficiency and accuracy of task execution. For instance, researchers from Tsinghua University, led by Sha et al., integrated LLMs into autonomous driving systems, leveraging their common-sense reasoning capabilities to enhance decision-making in complex scenarios, thereby improving safety, efficiency, and multi-vehicle coordination [41]. Similarly, Yubin Kim and colleagues demonstrated that by automatically allocating collaborative structures for LLMs, they could simulate real-world medical decision-making processes, achieving outstanding results across multiple medical benchmarks. Their research indicates that Multi-Agent Dynamics (MDAgents) can effectively adjust the number of agents to optimize efficiency and accuracy [42].
Despite significant advancements in LLMs and multi-agent structures across various fields, research and practical applications in specific areas such as coal mine safety monitoring and report generation remain largely insufficient. Currently, gas monitoring and assessment in coal mines primarily rely on manual execution and analysis, which is not only time-consuming and labor-intensive but also limited in processing real-time data in high-risk or complex environments. Furthermore, although there are studies on utilizing IoT technologies to assist with safety monitoring, these technologies often do not incorporate advanced methods using LLMs, multi-agent systems, and RAG techniques to understand and generate detailed assessment reports.
To bridge this gap, our research aims to explore the potential of automatically generating coal mine gas monitoring assessments by integrating the multi-agent architecture of LLMs with real-time sensor data collection. This approach is expected to enhance the efficiency and accuracy of assessments, especially when dealing with complex tasks and data analysis. Existing research demonstrates that LLMs and RAG technologies possess strong capabilities in understanding and generating textual content. However, applying these technologies for automatic interpretation of coal mine monitoring scenarios and generating comprehensive reports remains an underdeveloped area. Therefore, the vision of this paper is to contribute to the advancement of automated coal mine risk assessment processes by establishing an intelligent framework that drives the automation of coal mine gas monitoring and risk assessment.

3. Overall Framework of IGRARG

The designed coal mine gas intelligent assessment and report generation system aims to collect real-time gas alarm data (such as CH4 and CO) from the mining site through various sensors. Based on these data, the system performs intelligent analysis and evaluation of gas concentrations and risk levels. The system focuses on rapidly and accurately completing gas risk assessment and alarm determination, ensuring efficiency and reliability throughout the process while providing intelligent decision-making support for mine safety management.
The research framework presented in Figure 1 integrates cutting-edge technologies and is divided into four main modules: the key scenario data collection and processing module, the fine-tuning module of LLMs, the intelligent assessment report generation module, and the evaluation and review module. It constructs an optimized workflow to enhance the efficiency of coal mine safety management and intelligent assessment capabilities. The framework consists of two parallel processes that jointly support the intelligent analysis of gas concentrations and risks. In the data collection and processing phase, the system monitors the concentrations of gases such as methane and carbon monoxide in real-time through sensors deployed at key locations in the mine, ensuring that the data in the database is up to date and provides a reliable data source for accurate assessments. Meanwhile, the fine-tuning of the LLMs proceeds concurrently, starting with the preparation of a pre-trained model as a foundation and creating a dataset for coal mine gas risk assessment. By cleaning and de-sensitizing the collected sensor data, a high-quality risk assessment dataset is built, which is then used to fine-tune the model, specifically optimizing its performance in coal mine risk assessment scenarios. Additionally, the system uses a vector database for efficient data storage and retrieval, and combining it with a local domain knowledge base that supports assessment, the system can dynamically retrieve historical data and safety standards through RAG technology, providing rich background support for real-time assessment tasks.
In the intelligent assessment process, the system focuses on evaluating the risk levels of gas concentrations and their dynamic changes, automatically generating alarm judgments and response suggestions. The system conducts assessment analysis based on gas alarm standards and historical data, generating risk evaluations and emergency response suggestions for the current environment. At the same time, the assessment results are updated in real-time with data and model optimization to ensure high accuracy and relevance of the output content. The Supervisor module coordinates the entire process, ensuring efficient collaboration at each stage, achieving quick and accurate gas risk intelligent assessment.
Finally, the evaluation and review module supervises and assesses the entire process in real-time to ensure that the system’s output decision suggestions comply with safety standards and practical needs. Through this framework, the system aims to enhance the intelligence level of coal mine gas risk assessment, reduce uncertainty in the decision-making process, and provide strong support for mine safety management.

4. Key Modules

4.1. Data Collection and Processing Module in Coal Mine Scenarios

This section introduces the design and implementation of the coal mine data collection and knowledge base construction module in the IGRARG framework. This module collects real-time data from key areas of the mine through multiple sensors, ensuring comprehensive environmental monitoring. It also integrates coal mine safety regulations and alarm standards to construct a dynamically updated local knowledge base. To enhance model performance, the collected data are cleaned and processed to build a high-quality coal mine risk assessment dataset, which is then used to fine-tune a pre-trained LLMs, optimizing its performance in coal mine gas risk evaluation. This design ensures the real-time nature of data collection and the accuracy of decision support, providing a solid foundation for the system’s intelligent analysis and emergency response.

4.1.1. Data Collection

In the IGRARG framework, the data collection module is a critical component for monitoring coal mine environmental safety. By deploying various sensors, the system can obtain real-time data on gas concentrations, environmental conditions, ventilation status, and geological parameters from key locations within the mine. The efficient layout and coordinated operation of these sensors ensure comprehensive monitoring of the entire mine area, providing the system with a wealth of fundamental data. The process of equipment data collection and transmission is shown in Figure 2.
The data collection frequency is dynamically adjusted based on the characteristics of the gases and monitoring requirements. For instance, high-risk gases such as CH4 and CO are sampled every ten seconds, whereas environmental gases like O2 and carbon dioxide (CO2) are sampled every minute. To explore the temporal variation characteristics of the collected data, we performed a time series analysis on gas sensor data from a specific mining site. By selecting representative sensor data and plotting time series diagrams, as shown in Figure 3, the dynamic changes in gas concentrations over different time periods were visually demonstrated. This analysis provided robust support for understanding sensor data characteristics and identifying potential anomalies. Sensor deployment varies across regions, resulting in diverse data types being collected, as exemplified in Table 1. During the analysis, the “maximum value” detected by each sensor at specific moments served as the key feature representing the sensor’s concentration readings over a given time range, forming a critical basis for subsequent system decision making. To ensure the data’s accuracy and consistency, all sensor data were transmitted in real-time via wireless networks to the central processing system, ensuring continuous updates to the database. For the collected data over a certain period, preprocessing operations were conducted, including data cleaning, noise reduction, and outlier removal. Standardization methods were then applied to generate high-quality datasets. These processed data provided a solid foundation for further analysis, anomaly detection, and intelligent decision-making, significantly enhancing the system’s operational efficiency and reliability.
Based on the sensor data, we further classified the risk levels of various gases to more accurately assess the safety status of the mine environment. Changes in the concentrations of different gases in the mine indicate varying degrees of risk, and reasonable classification and threshold settings enable the system to respond swiftly to potential safety hazards. Table 2 presents the classification of risks and corresponding threshold settings for common mine gases, including CH4, CO, O2, CO2, hydrogen sulfide (H2S), and hydrogen (H2). These gases play a critical role in risk assessment due to their concentration dynamics in the mine environment. Each gas is categorized into four levels—low risk, moderate risk, high risk, and extreme risk—based on its concentration range. Such classifications help the system rapidly identify the risk levels associated with different gases and provide a scientific basis for mine safety management. To enhance the credibility of risk assessment and system performance, we incorporated sensor accuracy ranges into the gas risk classification. These accuracy parameters account for potential sensor errors, providing a reliable technical foundation for dynamic monitoring of gas concentration changes. By combining gas risk classification with sensor accuracy, the system ensures comprehensive monitoring while delivering more efficient and precise safety assessments.
Through the collaborative work of multiple sensors, the IGRARG framework is capable of covering key areas of the mine, ensuring comprehensive data collection and real-time monitoring. These high-quality sensor data not only provide a reliable foundation for subsequent analyses, but also lay a solid groundwork for monitoring judgments and automated report generation.

4.1.2. Knowledge Base Construction and Retrieval

In the IGRARG framework, the construction of the knowledge base is primarily achieved through the systematic processing and organization of the data collected by sensors, along with the integration of coal mine safety regulations, industry standards, and other relevant guidelines. This results in the formation of a multi-layered and comprehensive data support system. This process is fundamental to ensuring the system’s ability to accurately assess the safety status of the mine, respond quickly to alarms, and formulate appropriate safety measures. It guarantees the accuracy and consistency of the data, providing strong support for the generation of subsequent intelligent judgment reports.
First, the real-time data collected by sensors undergo a series of preprocessing steps, including denoising, outlier removal, and standardization, to ensure the quality and reliability of the data. The processed data are then structured and stored in a database for subsequent retrieval and analysis. In contrast, content such as coal mine safety regulations and industry standards is stored as unstructured data. Since these data are typically in textual form and contain complex, diverse content, they require text analysis and processing to effectively extract key information. To integrate these unstructured data into the knowledge base, the system employs vector database technology. Through vectorization, the unstructured text data such as coal mine safety regulations and industry standards are converted into high-dimensional vector representations and stored alongside the structured data collected from sensors. This approach enables the system to quickly retrieve regulations, standards, or historical events related to the current monitoring data, thereby providing necessary support for real-time decision making.
In addition, the system incorporates RAG technology, enabling real-time dynamic retrieval of relevant information from the knowledge base. When sensors detect data, the system utilizes RAG technology to retrieve coal mine safety regulations and judgment standards related to the current situation from the knowledge base. Based on this information, the system generates intelligent judgment reports and provides emergency response recommendations. This mechanism ensures that the system can make decisions in real time using the most up-to-date knowledge base data, while ensuring that its responses are always in line with current safety regulations and industry standards. In this way, safety regulations, industry standards, and sensor monitoring data in the coal mining domain are effectively integrated into the knowledge base, providing comprehensive data support for the system and enhancing its intelligent decision-making capabilities in complex environments. Figure 4 illustrates the specific flow of knowledge retrieval.
The specific operations are as follows:
  • Retrieval Phase
When the monitoring system detects changes in gas concentration, it invokes the vector database to quickly match relevant safety standards, regulations, or historical event records through the RAG retrieval module. This retrieved information provides a basis for subsequent analysis and judgments.
  • Generation Phase
The retrieved data are sent to the generation model, which, combined with existing real-time data and historical records, automatically generates alarm judgments and recommended response measures. RAG technology ensures that the generated results not only comply with standards and regulations but also make adaptive adjustments based on actual conditions.
In practical applications, the system integrates real-time sensor data, regulatory standards, and historical event records to assess the state of gas in the coal mine using RAG technology, generating corresponding response measures. Because RAG technology enhances the accuracy of model reasoning based on the retrieved relevant data, the reports generated by the system not only comply with current standards but can also be adjusted according to the actual conditions on-site. Finally, the system produces concise and clear reports in natural language, ensuring that coal mine operators can quickly understand and implement the necessary actions.
The design, which combines vector databases, RAG technology, and a knowledge base with real-time information updates, significantly enhances the system’s response speed and reasoning accuracy. This ensures that the coal mine gas monitoring system can provide timely and accurate alerts and recommendations for handling issues in complex environments.

4.2. Fine-Tuning of the Large Language Model Phase

In the final stage of the coal mine gas intelligent monitoring report generation module, the gas alarm data and related information collected on-site are uploaded to the local database. Utilizing the multi-agent structure of LLMs and a hierarchical management mechanism, detailed judgment reports are generated rapidly. This process involves not only basic analysis of gas data but also in-depth interpretation of coal mine safety conditions and identification of potential risks. The generated reports are subsequently submitted to an expert team for rigorous review to ensure their accuracy, depth, and reliability.

4.2.1. Selection of the Base Large Language Model

The base model LLMs chosen is Generative Language Model 4 Vision (GLM-4v) from the Generative Language Model (GLM) series, which has strong capabilities in Chinese text understanding and generation. The GLM model itself utilizes the Transformer architecture and is pre-trained on a large-scale multilingual corpus. To adapt the model for coal mine risk assessment and alarm generation tasks, fine-tuning on domain-specific data are necessary to enhance its ability to process coal mine gas monitoring data. The choice of the GLM series is based on its excellent performance in generation and reasoning tasks, as well as its good scalability, support for multi-task learning, and capability to handle high-dimensional text data.

4.2.2. Dataset Construction

To effectively fine-tune the GLM, it is first necessary to prepare a high-quality coal mine gas risk assessment dataset. This dataset contains a total of 10,000 entries, covering gas concentration data collected by various sensors, such as methane and carbon monoxide, in conjunction with relevant coal mine safety regulations and alarm determination standards. After data collection, the data undergo cleaning and labeling to eliminate invalid or erroneous entries and to anonymize sensitive information. Subsequently, each data point is annotated based on coal mine safety standards and alarm determination rules, generating corresponding risk level classifications and recommended emergency response measures. These labeled data will serve as key inputs for model training. In terms of the final dataset format, JSON is adopted to ensure structured storage and efficient retrieval of data. Each data record consists of instructions (task description), inputs (sensor data), and outputs (alarm level and emergency response recommendations). An example of the dataset is shown in Table 3. The key objective is to ensure the dataset’s high quality and relevance, enabling it to effectively support the fine-tuning process of the GLM, thereby enhancing the model’s performance in coal mine gas risk assessment.

4.2.3. Fine-Tuning

LoRA (Low-Rank Adaptation) [43] introduces additional training parameters to enhance the task adaptability of models without significantly increasing computational overhead. In LoRA, the weight matrix of the original LLMs is decomposed into two smaller matrices, and the parameters of these low-rank matrices are adjusted through training. Specifically, let the weight matrix of the base model be W R d × h , where d represents the input feature dimension and h denotes the hidden layer dimension. LoRA decomposes it as follows:
W = W 0 + Δ W = W 0 + A B ,
Let W 0 represent the original weight matrix of the base model. A R d × r and B R r × h denote the adaptation matrices introduced by LoRA, and r is the rank. By fine-tuning these low-rank matrices, LoRA can effectively improve the model’s performance on specific tasks without the need to retrain the entire LLMs. Therefore, the introduction of LoRA significantly enhances the model’s accuracy in gas risk assessment, particularly in the integrated analysis of multi-dimensional data such as carbon monoxide and carbon dioxide concentrations. QloRA [44] further extends LoRA by employing quantization techniques to reduce memory and computational overhead. In QloRA, the low-rank matrices A and B are quantized, reducing the required storage space and computational resources. The quantization process compresses the parameter values into lower-precision representations, thereby enabling more efficient model training and inference. The mathematical representation of QloRA is:
A q = Q A , B q = Q B ,
Here, Q denotes the quantization operation, which typically uses 8-bit or lower bit-width integer representations. Through this approach, QloRA not only reduces the model’s storage requirements but also accelerates the inference process, enabling the model to run efficiently on resource-constrained edge computing devices.

4.2.4. Testing and Optimization

The fine-tuned GLM model will be evaluated using a validation set to assess its performance. To ensure its accuracy in coal mine gas monitoring, the model will be evaluated across multiple metrics, particularly accuracy, recall, and F1-score. During the testing process, special attention will be given to the model’s accuracy in determining different alarm levels, ensuring its ability to correctly distinguish between normal and alarm states.
Furthermore, the model will be optimized through data augmentation techniques. By generating synthetic data (e.g., simulating sensor outputs under varying gas concentrations), the training dataset size will be increased, thereby further enhancing the model’s robustness and adaptability.

4.3. Intelligent Assessment and Report Generation Module

In the final stage of the coal mine gas intelligent monitoring report generation module, the gas alarm data collected on-site and relevant information from the coal mining domain are uploaded to the local knowledge base. Combined with the fine-tuned LLM’s multi-agent structure and hierarchical management mechanism, a detailed analysis report is rapidly generated. This process involves not only the basic analysis of gas data, but also an in-depth interpretation of the coal mine’s safety status and the identification of potential risks. The system, through real-time processing and analysis of various data, is able to provide decision makers with comprehensive and accurate safety reports, offering strong decision support for mine safety management.

4.3.1. Hierarchical Management Mechanism

The intelligent judgment report generation is achieved through the multi-agent structure of the fine-tuned LLMs, ensuring an efficient and automated report generation process. This module consists of three main levels: the alarm judgment layer, the action suggestion layer, and the weekly report generation layer. Each level is composed of several key agents, which work together to execute different tasks, ensuring the efficiency and accuracy of the judgment and report generation process. The alarm judgment layer is responsible for the preliminary analysis of gas alarm data and determining if it meets the alarm standards; the action suggestion layer proposes corresponding emergency response measures based on the alarm information; the weekly report generation layer generates the final judgment report based on the results from the previous two layers, summarizing and synthesizing the findings. Figure 5 shows the main roadmap of the intelligent judgment report generation module, clearly illustrating the workflow between the different levels and agents. Throughout the report generation process, each level relies not only on data analysis and model inference but also integrates expert feedback and real-time updated information, ensuring that the judgment results and report content are highly accurate and practically actionable.

4.3.2. Hierarchical Agent Structure Explanation

The efficient operation of the intelligent judgment report generation module relies on a carefully designed multi-agent structure and layered management mechanism. Each level consists of several key agents, each of which is responsible for different tasks and works in collaboration to ensure the smooth execution of the report generation process. Below is a detailed introduction to each level and its corresponding agents.
  • Alarm Assessment Layer
In the coal mine gas monitoring system, the primary responsibility of the alarm judgment layer is to analyze the real-time gas concentration data collected from the sensors and determine if the concentrations exceed the safety standards, triggering the alarm mechanism based on the risk level assessment results. This layer includes two key agents:
  • Gas Standard Retrieval Agent
This agent retrieves the current gas concentration standards for coal mine safety from the vector database, extracting the safety thresholds and corresponding risk levels to provide a reference for the alarm judgment process.
  • Alarm Judgment Agent
This agent receives the safety standards and risk levels provided by the Gas Standard Retrieval Agent and combines them with real-time monitoring data to assess whether any thresholds are exceeded. If the gas concentration exceeds the safety threshold and the risk level is high, the Alarm Judgment Agent will immediately trigger the alarm and record the relevant information for further processing and review.
Through the collaborative work of two agents, the alarm assessment layer can quickly assess whether there are any safety hazards in the mining environment based on real-time sensor data and risk level evaluations, and trigger the appropriate emergency response mechanisms.
2.
Recommendation Layer
The core objective of the recommendation layer is to provide effective emergency response solutions to on-site staff in the event of abnormal sensor status detection, ensuring that the correct actions are taken promptly to reduce the likelihood of accidents and potential losses. This layer operates through the collaboration of two key agents:
  • Alarm Response Method Retrieval Agent
Upon receiving an alarm signal, this agent quickly retrieves solutions related to the current alarm situation by accessing the knowledge base, which includes gas handling protocols and safety operation procedures from the vector database.
  • Solution Measures Agent
This agent generates personalized solution recommendations based on the information provided by the alarm response method retrieval agent, in conjunction with real-time data from the site. These recommendations may include specific actions such as adjusting the ventilation system, evacuating personnel, or initiating emergency rescue operations.
Through the collaborative efforts of these two agents, the measures suggestion layer can provide precise and timely operational guidance to coal mine personnel. This design significantly enhances the system’s emergency response capability, providing technical support for the stable operation of coal mine safety and helping to reduce the risk of accidents caused by gas exceedance.
3.
Weekly Report Generation Layer
The primary function of the weekly report generation layer is to convert coal mine safety monitoring data into structured weekly report information, assisting management in timely understanding the monitoring status of gas concentrations and making informed decisions. This layer consists of four key agents:
  • Historical Alarm Data Retrieval Agent
This agent focuses on retrieving historical alarm data related to gas exceedances from the relational database. By executing SQL queries, it extracts records associated with specific gas exceedance events from structured data tables. This approach efficiently processes large volumes of structured data, ensuring the accuracy and consistency of query results.
  • Exceedance and Major Safety Risk Trend Data Retrieval Agent
This agent is responsible for retrieving trend data on exceedances and significant safety risks from the vector database over the past year. Utilizing the vector database’s efficient similarity search capabilities, it extracts changes related to gas exceedances and safety risks from a large set of multidimensional data. This agent can identify and analyze long-term trends and anomalies, providing deeper insights and forecasts.
  • Chart Generation Agent
This agent utilizes data visualization tools to process the data extracted by the data retrieval agents and generate corresponding statistical charts. In particular, the chart generation agent presents the concentration trends of methane and carbon monoxide as line graphs, helping management visually understand the dynamic changes in gas exceedances.
  • Weekly Report Generation Agent
This agent is the core module of this layer. It integrates data obtained from the retrieval agents and charts produced by the chart generation agent, along with other relevant information, to automatically generate a weekly report formatted to include the date, statistical data, alarm records, and trend charts. This agent achieves a high level of automation and standardization in the report generation process, significantly enhancing the efficiency of coal mine management and the standardization of reports.
The weekly report generation layer achieves the fully automated transformation of monitoring data into report information through the close collaboration of four agents: historical alarm data retrieval, exceedance and major safety risk trend data retrieval, chart generation, and weekly report generation. This design ensures effective analysis and timely presentation of coal mine safety production data, enabling management to make informed decisions based on accurate and detailed monitoring data.
Through the hierarchical design of the alarm judgment layer, measures suggestion layer, and weekly report generation layer, the system realizes end-to-end automated report generation for coal mine safety monitoring. This multi-layer structure ensures a comprehensive processing flow from data collection, alarm judgment, and emergency measures suggestions to weekly report generation, significantly enhancing the response speed, quality of response, and decision-making efficiency of coal mine managers regarding gas exceedance events. This process allows management to regularly receive detailed and visualized safety monitoring reports, providing reliable data support and a decision-making basis for safe coal mine operations.

4.4. Evaluation and Review

In this section, we evaluate and review the intelligent assessment process within the constructed IGRARG framework. The evaluation and review module serves as the core component of the intelligent assessment system, aiming to ensure the quality of the assessment results and generated reports. By conducting a comprehensive evaluation of the system’s outputs, this module guarantees the reliability and effectiveness of the framework in practical applications. It primarily consists of three components: assessment result evaluation, report evaluation, and expert review. These components ensure that the system’s decision-making process aligns with coal mine safety management requirements while continuously optimizing its performance.

4.4.1. Assessment Result Evaluation

Assessment result evaluation involves testing the accuracy and effectiveness of the risk assessments and emergency response recommendations generated by the intelligent assessment system. This evaluation is primarily conducted by comparing the system’s outputs with actual measurement data, ensuring that the risk level judgments and emergency response suggestions provided by the system are correct in practical applications.
For risk assessment, the system analyzes changes in gas concentration and determines the current environment’s risk level based on historical data and existing standards. The system’s accuracy is evaluated by calculating the error between the predicted and actual risk levels. The formula for calculating the risk level error (RE) is:
Risk   Error   = i = 1 n Predicted   Risk i Actual   Risk i n ,
where n is the number of samples, Predicted   Risk i is the predicted risk level for the i -th instance, and Actual   Risk i is the actual measured risk level for the i -th instance. By calculating this error, the system can assess the accuracy of its risk predictions and make adjustments accordingly.
In the evaluation of the effectiveness of emergency response recommendations, the system assesses whether the generated recommendations are practically actionable and targeted. The formula for calculating the effectiveness is as follows:
Effectiveness   = Number   of   Correct   Actions Total   Number   of   Suggested   Actions ,
where “ C o r r e c t   A c t i o n s ” refers to the correct and effective emergency response actions, and “ S u g g e s t e d   A c t i o n s ” refers to all the emergency measures recommended by the system. Using this formula, the system can assess the success rate of the generated emergency response recommendations in practical operations.

4.4.2. Report Evaluation

To evaluate the output quality of the text generation model, we introduce checks for grammatical accuracy and text diversity. The former focuses on assessing sentence structure, part-of-speech pairing, punctuation, tense, etc., which form the foundation for ensuring readability and accuracy. The latter reflects the lexical richness of the generated text and is typically measured by calculating the proportion of unique words or the distribution of vocabulary within the text. It helps assess whether the generation model avoids repetitive or simplistic word choices and produces diverse and expressive language.
Grammatical Accuracy (GA) is evaluated by counting the number of errors and calculating the error rate. A commonly used formula is:
G A = 1 N u m b e r   o f   E r r o r s T o t a l   N u m b e r   o f   W o r d s   o r   S e n t e n c e s ,
Text diversity is measured by the proportion of different words in the text, which can be expressed using the Type-Token Ratio (TTR) in Equation (6).
T T R = N u m b e r   o f   U n i q u e   W o r d s ( T y p e s ) T o t a l   N u m b e r   o f   W o r d s ( T o k e n s ) ,
Shannon Entropy is a measure based on information theory that is used to assess the distribution of words in a text. A higher entropy value indicates a more even usage of words and greater lexical richness. The formula is:
H ( X ) = i = 1 n p ( x i ) l o g p ( x i ) ,
Here, H ( X ) represents the entropy value of the text, p ( x i ) represents the probability of the word x i appearing in the text, which is the number of occurrences of the word divided by the total number of words, and n denotes the total number of distinct words in the text.
To achieve a more comprehensive evaluation, we reference the text automatic evaluation framework BERT Score proposed by Tianyi Zhang et al. [45]. Unlike traditional metrics like BLEU and ROUGE, BERTScore evaluates by calculating the similarity score between each token in the candidate sentence and each token in the reference sentence. It leverages contextual embeddings to compute token similarity rather than relying on exact matches. Additionally, BERT Score introduces the F 1 score as a core metric. The F 1 score is the harmonic mean of Context Recall and Context Precision, integrating accuracy and recall into the system’s performance. The formula for calculating the F1 score is as follows:
F 1 = 2 × C o n t e x t   R e c a l l × C o n t e x t   P r e c i s i o n C o n t e x t   R e c a l l + C o n t e x t   P r e c i s i o n ,

4.4.3. Expert Evaluation

In addition to automated evaluation metrics, expert evaluation serves as a key component of manual review, combining expertise from the coal mine safety management field to validate the system’s outputs of risk assessments and emergency response recommendations. Expert evaluation primarily focuses on the applicability and scientific validity of the assessment results. Experts will verify whether the risk assessment aligns with actual safety standards and ensure the feasibility and effectiveness of the emergency response recommendations, particularly in handling emergencies. Additionally, experts will review the automatically generated reports to ensure their accuracy, completeness, and alignment with coal mine safety management requirements. Feedback from expert evaluations will serve as an important basis for system optimization, driving continuous improvements in the model.
To ensure the rigor of the evaluation process, assessment results will be submitted to a panel of coal mine safety and big data analysis experts for scoring and review. Evaluation criteria include data accuracy, analysis depth, readability, and completeness. Only reports scoring over 80% will be considered qualified and recommended to the coal mine management team. To enhance the fairness of the review process, a cross-review mechanism has been implemented. Reports will be blindly reviewed by multiple review panels, with scores weighted according to their expertise. The final result will be an objective evaluation, with all access records saved for later auditing and tracking.
To ensure the overall quality of the assessment results and reports, a comprehensive evaluation mechanism will combine the results of report evaluation, assessment result evaluation, and expert evaluation for a thorough review. The formula for the comprehensive evaluation is as follows:
O v e r a l l   E v a l u a t i o n = w 1 R i s k   A s s e s s m e n t   A c c u r a c y + w 2 R e p o r t   A c c u r a c y + w 3 E x p e r t   S c o r e s .
where w 1 , w 2 , w 3 are the weights for each evaluation metric. The final comprehensive evaluation score provides feedback for the optimization of the system, helping it to better adapt to the needs of coal mine safety management. In this process, expert evaluation serves as an important supplement, offering professional review to ensure the rationality of the assessment results and the effectiveness of the reports in practical applications. By continuously adjusting the evaluation mechanism, the intelligent assessment system can maintain efficient decision-support capabilities in dynamic environments.
In summary, the evaluation and review module provides comprehensive quality assurance for the intelligent assessment system, ensuring the high accuracy and applicability of both the reports and assessment results. Through the comprehensive evaluation mechanism, the system can continuously improve its performance and adapt to the complex needs of coal mine safety management.

5. Experiment Results and Analysis

5.1. Experimental Platform and Model Configuration

This study validated the proposed framework using Python 3.11.5 on the vs. Code platform, relying on open-source libraries for data processing and experiment management to ensure compatibility and version consistency, managed through Anaconda. All tests and verifications were conducted in a Chinese semantic environment. Data processing and storage were completed locally, with efficient vector database retrieval implemented using the Chroma library. Inference results were generated by calling the fine-tuned GLM model API over a stable network connection.
In the experiment, the LangChain library was used to manage API calls and vector database retrievals. Text embedding utilized OpenAI’s text embedding-ada-002 model. Reports were split into 500-character blocks with a 20-character overlap to optimize retrieval performance. The retrieval process extracted the top 20 relevant blocks from the RE module and adjusted them based on prompt length to fit the context window.
In the LangGraph framework, multiple agents handled different tasks, such as gas standard retrieval, alarm judgments, and processing recommendations, enhancing the efficiency and accuracy of report generation. The framework integrates LLMs with databases, processing real-time coal mine gas monitoring data to generate reports, while continuously optimizing the system and report generation process through performance monitoring and feedback collection.
In the risk assessment analysis, the experiment used a validation set containing 1000 gas samples. The specific samples include 390 methane samples, 260 carbon monoxide samples, 162 oxygen samples, 97 carbon dioxide samples, 58 hydrogen samples, and 32 hydrogen sulfide samples. Based on the gas concentrations, the samples were categorized into four risk levels: low risk, medium risk, high risk, and extremely high risk. The concentration ranges for each gas and the corresponding risk level classification are detailed in Table 2 of Section 4.1.1. In the report analysis, we compared expert-generated judgment reports with those generated by the fine-tuned GLM and the non-fine-tuned GLM to assess the models’ performance in terms of risk judgment and report accuracy.

5.2. Experimental Results Analysis

5.2.1. Risk Assessment Result Analysis

In coal mine gas risk assessment, gas concentration is closely related to mine safety. To achieve more accurate risk judgment, the experiment used validation set samples, focusing on evaluating the framework’s response to changes in the concentrations of different gases, particularly its ability to distinguish between high-risk gases and environmental gases. According to the risk assessment results, Figure 6 illustrates the distribution of risks within the validation set samples as determined by the proposed IGRARG framework. The results indicate that the model can accurately classify samples into corresponding risk levels for all types of gases, particularly excelling in the risk assessment accuracy for high-risk gases such as methane and carbon monoxide. Conversely, samples of low-risk gases such as hydrogen and carbon dioxide are predominantly classified within the low risk level. These findings align with expectations regarding gas concentrations and risk assessments in coal mines, further validating the effectiveness of the framework in coal mine gas risk assessment.
Table 4 summarizes the accuracy of risk assessment for each type of gas. Overall, the accuracy of the framework ranges from 0.85 to 0.93, demonstrating strong performance. For high-risk gases such as methane and carbon monoxide, the model achieves higher accuracy, which facilitates timely identification and response to potential mining safety hazards. For low-risk gases such as hydrogen and hydrogen sulfide, the model’s accuracy is slightly lower but remains within an acceptable range, effectively supporting the monitoring of low-risk gases.
Table 5 presents a comparison between the proposed method and traditional evaluation methods. Traditional methods typically rely on predefined rules and thresholds for classification, which may introduce errors, especially under complex gas concentration variations. In contrast, the fine-tuned model, leveraging extensive historical data and integrating with domain-specific knowledge bases, reduces false positives and false negatives commonly observed in traditional methods. The proposed method achieves an accuracy of 85–93% in gas risk assessment, slightly lower than traditional neural network methods and mathematical prediction models but significantly outperforming manual experience-based approaches and fixed-threshold monitoring methods.
Although its accuracy is comparable to that of traditional neural network methods, the proposed method demonstrates notable advantages in dynamic adaptability and scalability. By integrating expert knowledge bases and fine-tuning techniques, the method quickly adapts to new data and environments, minimizing retraining time and cost while meeting real-time requirements. Overall, the method excels in dynamic risk assessment under complex conditions, offering an innovative solution that balances accuracy, efficiency, and adaptability.

5.2.2. Analysis of Evaluation Report Results

To conduct an in-depth analysis of the reports, we selected typical coal mine alarm judgments, focusing on three aspects: the different sensor installation positions, the maximum concentration values, and the processing results. We then compared the expert-generated judgment reports for these alarm events with those generated by the fine-tuned GLM and the non-fine-tuned GLM. As shown in Figure 7 and Figure 8, when generating automated judgment reports using the fine-tuned GLM and the non-fine-tuned GLM, we highlighted the key information in the detection data using bold font.
To evaluate the quality of the automatically generated judgment reports, we annotated the key information within the reports. Correct information was highlighted in green, while incorrect information was marked in orange. Table 6 compares the report generation results of alarm evaluation and recommended measures for the two models under different evaluation metrics. In the case of weekly reports, due to their larger volume and more complex content that requires integration, it typically takes professionals around 90 min to complete. However, the report generation speed using the LLM-based framework is significantly faster. As verified, our framework can generate weekly reports within 2–3 min. The results show that the reports generated by the LLMs are more comprehensive than those manually written, although they exhibit some shortcomings in terms of details. The fine-tuned GLM slightly outperformed the non-fine-tuned GLM in terms of text generation accuracy and overall performance, though it had a slower processing speed. The non-fine-tuned GLM processed faster and was more efficient, making it suitable for scenarios that require rapid results, but it scored slightly lower on text similarity metrics. The comparison of reports generated by both GLMs indicates that, even with fine-tuning, the GLM did not show a significant advantage over the non-fine-tuned version in terms of output quality, but it demonstrated better logical organization and answer structuring. This analysis suggests that, in more complex scenarios, general LLMs exhibit similar performance regardless of fine-tuning.

5.2.3. Evaluation of Experimental Results

Through reviewing the output of the fine-tuned GLM model, we conducted a comprehensive evaluation of the accuracy of the evaluation results and the generated reports. Specifically, the accuracy of the evaluation results was scored by three assessment teams, labeled A, B, and C, with experience weight indices of 45%, 35%, and 20%, respectively. Each review team consisted of five auditors, who scored each evaluation result and report based on five key criteria. These criteria included the accuracy of risk level assessment, the scientific nature of emergency measure recommendations, the completeness of report content, the depth of analysis, and readability. The evaluation results were aggregated and weighted by the experience indices to yield a final score, comprehensively reflecting the performance of the intelligent evaluation system.
Figure 9 displays the score distribution for the evaluation results and generated reports from the three review teams. By applying the experience weight indices to the scores of each team, the overall weighted scores for the five evaluation criteria were obtained. The gas intelligent evaluation result scored 81.14 points, while the report generation scored 81.83 points, both exceeding the 80-point threshold for qualification. This demonstrates that the system performs excellently in terms of evaluation accuracy and report generation quality, meeting the fundamental requirements for coal mine safety management.
To ensure the overall quality of the evaluation results and reports, a comprehensive evaluation mechanism combined the results of report evaluation, evaluation results assessment, and expert evaluation for thorough review. Table 7 shows the weighted contributions of different evaluation types to the overall quality, providing data support for subsequent model optimization and improvement.
Nevertheless, compared to reports written by professional coal mine safety engineers, the reports generated by the model still show certain gaps in specific domain knowledge details. This limitation may stem from the model’s limited understanding of rare scenarios in the specific domain during the fine-tuning process. However, these results strongly support the potential application of the intelligent judgment framework. The automated intelligent judgment framework not only effectively meets the preset safety report writing standards, but also demonstrates significant advantages in judgment efficiency and overall accuracy. This highlights the vast potential of applying intelligent judgment systems in coal mine safety management, providing an important basis for improving mining safety management efficiency and reducing safety risks.
Therefore, it can be reasonably inferred that the integration of data-processing methods such as RAG technology with advanced LLMs multi-agent systems like GLM represents a significant advancement in the field of mine safety management. Our experimental study emphasizes the feasibility of using such technologies to optimize the efficiency and effectiveness of the judgment process, marking a major improvement over traditional manual methods.

5.3. Discussion

This study demonstrates the significant advantages of the IGRARG framework in coal mine gas risk assessment. Compared with traditional methods, its automated processes not only significantly improve work efficiency and reduce the time and labor required for human intervention, but also effectively lower the occurrence rate of human errors. While traditional methods have played a vital role in improving gas concentration detection accuracy, enhancing potential risk identification capabilities, and safeguarding workers’ lives, IGRARG builds on these key strengths by integrating domain knowledge and fine-tuning techniques to achieve superior performance. Specifically, IGRARG exhibits a high accuracy rate of 85% to 93% in the detection and classification of high-risk gases such as methane and carbon monoxide. Particularly in complex coal mine environments, it effectively integrates data from multiple sensors and adapts to dynamically changing conditions, providing a more comprehensive and precise risk assessment. Moreover, the real-time response capability of IGRARG significantly enhances the efficiency of early warnings for potential risks, making safety decisions more timely and comprehensive. This not only provides workers with a higher level of safety assurance but also reduces the economic loss risks caused by accidents, thereby improving the stability and sustainability of coal mine operations.
The significant performance improvements can be attributed to the fine-tuned GLM model employed by the IGRARG framework, which demonstrates exceptional effectiveness in coal mine gas risk assessment. Compared to expert judgment, the fine-tuned GLM is capable of processing complex data in a shorter time, providing accurate and timely assessment results, and avoiding the delays and incomplete decision-making that may arise from expert judgment. In contrast, the base GLM lacks domain-specific knowledge for coal mining, which may prevent it from fully understanding the intricacies of coal mine gas risks, leading to increased assessment bias. In contrast, the IGRARG framework, trained with domain-specific data, better adapts to the coal mine safety monitoring requirements, offering more accurate and reliable risk assessments. Although there are some limitations in classifying low-risk gases, the overall performance still meets the safety monitoring needs of mines.
At the same time, the IGRARG framework also faces some challenges, particularly in terms of data quality and model adaptability. High-quality training data are crucial for model performance, and flaws or inconsistencies in the data may lead to biases in the training results, thereby affecting the accuracy of risk assessments. Additionally, the limitations of a single model may cause it to miss certain critical data points. Therefore, introducing a multi-model parallel strategy can further improve the robustness of the model and enhance the comprehensiveness and precision of risk assessments. Although the fine-tuned GLM has made significant improvements in coal mine risk assessment, the collaborative work of multiple models remains key to improving overall performance when facing the complex and dynamic coal mine environment. Future optimization efforts should focus on ensuring the system’s adaptability and accuracy across different scenarios to tackle more complex coal mine safety risk assessment challenges.

6. Conclusions

The IGRARG framework proposed in this study offers an innovative solution for coal mine gas risk assessment and automated report generation, significantly improving the efficiency and accuracy of coal mine safety management. The framework integrates modules for coal mine scenario data collection and processing, LLMs fine-tuning, intelligent judgment report generation, and risk assessment, relying on high-quality real-time data collected from sensors. It accurately evaluates gas concentration risk levels based on the latest field information and generates corresponding emergency response recommendations. Compared to traditional manual judgment methods, the IGRARG framework demonstrates clear advantages in improving risk assessment efficiency, accuracy, and automation levels; reducing human errors; and ensuring consistency and reliability of results. The fine-tuned LLMs perform excellently on specific coal mine gas monitoring datasets, efficiently handling tasks such as alarm judgment, risk level assessment, recommendation of measures, and report generation, effectively meeting the needs of coal mine safety management.
Future research will focus on further optimizing the framework, conducting domain-specific fine-tuning, and evaluating its performance in different coal mine scenarios through real-world applications, particularly exploring the adaptability and performance of LLMs in complex operational environments. By continuously improving the framework and enhancing its robustness and flexibility, we aim to fully leverage the potential of LLMs in coal mine safety monitoring, risk assessment, and report generation, providing more precise and efficient technical support for coal mine safety management.

Author Contributions

Conceptualization, Y.S.; methodology, Y.S. and Y.H.; software, Y.H. and X.L.; validation, Y.H.; formal analysis, Y.H.; investigation, Y.H.; resources, Y.S. and X.L.; data curation, Y.S., Y.H. and X.L.; writing—original draft preparation, Y.H.; writing—review and editing, Y.H. and X.L.; visualization, Y.H.; supervision, Y.S.; project administration, Y.S; funding acquisition, Y.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Due to data privacy, the data provided in this study can be obtained upon request from the corresponding author.

Acknowledgments

The authors wish to thank the reviewers for their valuable comments and suggestions concerning this manuscript.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Wang, J.; Huang, Y.; Zhai, W.; Li, J.; Ouyang, S.; Gao, H.; Liu, Y.; Wang, G. Research on Coal Mine Safety Management Based on Digital Twin. Heliyon 2023, 9, e13608. [Google Scholar] [CrossRef] [PubMed]
  2. Wang, E.; Li, Z.; Li, B.; Qin, B.; Xu, J.; Li, N.; Liu, X. Big data monitoring and early warning cloud platform for coal mine gas disaster risk and potential danger and its application. Coal Sci. Technol. 2022, 50, 142–150. [Google Scholar]
  3. You, M.; Li, S.; Li, D.; Xu, S. Applications of Artificial Intelligence for Coal Mine Gas Risk Assessment. Saf. Sci. 2021, 143, 105420. [Google Scholar] [CrossRef]
  4. Zhang, G.; Wang, E.; Zhang, C.; Li, Z.; Wang, D. A Comprehensive Risk Assessment Method for Coal and Gas Outburst in Underground Coal Mines Based on Variable Weight Theory and Uncertainty Analysis. Process Saf. Environ. Prot. 2022, 167, 97–111. [Google Scholar] [CrossRef]
  5. Gong, W.; Hu, J.; Wang, Z.; Wei, Y.; Li, Y.; Zhang, T.; Zhang, Q.; Liu, T.; Ning, Y.; Zhang, W.; et al. Recent Advances in Laser Gas Sensors for Applications to Safety Monitoring in Intelligent Coal Mines. Front. Phys. 2022, 10, 1058475. [Google Scholar] [CrossRef]
  6. Jia, Q.; Fu, G.; Xie, X.; Hu, S.; Wu, Y.; Li, J. LPG Leakage and Explosion Accident Analysis Based on a New SAA Method. J. Loss Prevent. Process Ind. 2021, 71, 104467. [Google Scholar] [CrossRef]
  7. Yan, K.; Wang, Y.; Jia, L.; Wang, W.; Liu, S.; Geng, Y. A Content-Aware Corpus-Based Model for Analysis of Marine Accidents. Accid. Anal. Prev. 2023, 184, 106991. [Google Scholar] [CrossRef] [PubMed]
  8. Shekhar, H.; Agarwal, S. Automated Analysis through Natural Language Processing of DGMS Fatality Reports on Indian Non-Coal Mines. In Proceedings of the 2021 5th International Conference on Information Systems and Computer Networks (ISCON), Mathura, India, 22–23 October 2021; pp. 1–6. [Google Scholar]
  9. Han, Z.; Gao, C.; Liu, J.; Zhang, J.; Zhang, S.Q. Parameter-efficient Fine-tuning for Large Models: A Comprehensive Survey. arXiv 2024, arXiv:2403.14608. [Google Scholar]
  10. Gao, Y.; Xiong, Y.; Gao, X.; Jia, K.; Pan, J.; Bi, Y.; Dai, Y.; Sun, J.; Wang, M.; Wang, H. Retrieval-augmented Generation for Large Language Models: A Survey. arXiv 2023, arXiv:2312.10997. [Google Scholar]
  11. Zhao, Z.; Yang, Y.; Wang, Y.; Zhang, J.; Wang, D.; Luo, X. Summarization of Coal Mine Accident Reports: A Natural-Language-Processing-Based Approach. In Proceedings of the International 2020 Cyberspace Congress on Cyberspace Data and Intelligence, and Cyber-Living, Syndrome, and Health (CyberDI/CyberLife 2020), Beijing, China, 10–12 December 2020; pp. 103–115. [Google Scholar]
  12. Jia, Q.; Fu, G.; Xie, X.; Xue, Y.; Hu, S. Enhancing Accident Cause Analysis through Text Classification and Accident Causation Theory: A Case Study of Coal Mine Gas Explosion Accidents. Process Saf. Environ. Prot. 2024, 185, 989–1002. [Google Scholar] [CrossRef]
  13. Andersen, T.; Vinkovic, K.; de Vries, M.; Kers, B.; Necki, J.; Swolkien, J.; Roiger, A.; Peters, W.; Chen, H. Quantifying Methane Emissions from Coal Mining Ventilation Shafts Using an Unmanned Aerial Vehicle (UAV)-Based Active AirCore System. Atmos. Environ. X 2021, 12, 100135. [Google Scholar] [CrossRef]
  14. Cai, Y.; Jin, Y.; Wang, Z.; Chen, T.; Wang, Y.; Kong, W.; Hu, H. A Review of Monitoring, Calculation, and Simulation Methods for Ground Subsidence Induced by Coal Mining. Int. J. Coal Sci. Technol. 2023, 10, 32. [Google Scholar] [CrossRef]
  15. Zhang, H.; Li, B.; Karimi, M.; Saydam, S.; Hassan, M. Recent Advancements in IoT Implementation for Environmental, Safety, and Production Monitoring in Underground Mines. IEEE Internet Things J. 2023, 10, 14507–14526. [Google Scholar] [CrossRef]
  16. Liang, Y. Research Progress on Risk Identification, Assessment, Monitoring and Early Warning Technologies of Typical Dynamic Hazards in Coal Mines. J. China Coal Soc. 2020, 45. [Google Scholar] [CrossRef]
  17. Xie, X.; Shen, S.; Fu, G.; Shu, X.; Hu, J.; Jia, Q.; Shi, Z. Accident Case Data–Accident Cause Model Hybrid-Driven Coal and Gas Outburst Accident Analysis: Evidence from 84 Accidents in China during 2008–2018. Process Saf. Environ. Prot. 2022, 164, 67–90. [Google Scholar] [CrossRef]
  18. Shu, L.; Zhu, N.; Chen, J.; An, S.; Zhang, H. Theoretical Method and Technology of Precision Identification for Coal and Gas Outburst Hazard. J. China Coal Soc. 2020, 45. [Google Scholar] [CrossRef]
  19. Matloob, S.; Li, Y.; Khan, K.Z. Safety Measurements and Risk Assessment of Coal Mining Industry Using Artificial Intelligence and Machine Learning. Open J. Bus. Manag. 2021, 9, 1198–1209. [Google Scholar] [CrossRef]
  20. Anani, A.; Adewuyi, S.O.; Risso, N.; Nyaaba, W. Advancements in Machine Learning Techniques for Coal and Gas Outburst Prediction in Underground Mines. Int. J. Coal Geol. 2024, 285, 104471. [Google Scholar] [CrossRef]
  21. Sharma, M.; Maity, T. Review on Machine Learning-Based Underground Coal Mines Gas Hazard Identification and Estimation Techniques. Arch. Comput. Methods Eng. 2024, 31, 371–388. [Google Scholar] [CrossRef]
  22. Cao, X.; Xu, W.; Zhao, J.; Duan, Y.; Yang, X. Research on Large Language Model for Coal Mine Equipment Maintenance Based on Multi-Source Text. Appl. Sci. 2024, 14, 2946. [Google Scholar] [CrossRef]
  23. Wang, R.; Chen, S.; Li, X.; Tian, G.; Zhao, T. AdaBoost-Driven Multi-Parameter Real-Time Warning of Rock Burst Risk in Coal Mines. Eng. Appl. Artif. Intell. 2023, 125, 106591. [Google Scholar] [CrossRef]
  24. Xie, X.; Shu, X.; Fu, G.; Shen, S.; Jia, Q.; Hu, J.; Wu, Z. Accident Causes Data-Driven Coal and Gas Outburst Accidents Prevention: Application of Data Mining and Machine Learning in Accident Path Mining and Accident Case-Based Deduction. Process Saf. Environ. Prot. 2022, 162, 891–913. [Google Scholar] [CrossRef]
  25. Wang, G.; Ren, H.; Zhao, G.; Zhang, D.; Wen, Z.; Meng, L.; Gong, S. Research and Practice of Intelligent Coal Mine Technology Systems in China. Int. J. Coal Sci. Technol. 2022, 9, 24. [Google Scholar] [CrossRef]
  26. Onifade, M.; Adebisi, J.A.; Shivute, A.P.; Genc, B. Challenges and Applications of Digital Technology in the Mineral Industry. Resour. Policy 2023, 85, 103978. [Google Scholar] [CrossRef]
  27. Hao, Y.; Wu, Y.; Ranjith, P.G.; Zhang, K.; Zhang, H.; Chen, Y.; Li, P. New Insights on Ground Control in Intelligent Mining with Internet of Things. Comput. Commun. 2020, 150, 788–798. [Google Scholar] [CrossRef]
  28. Deng, J.; Li, X.; Wang, K.; Wang, W.; Yan, J.; Tang, Z.; Ren, S. Research Progress and Prospect of Mine Fire Intelligent Monitoring and Early Warning Technology in Recent 20 Years. Coal Sci. Technol. 2024, 52, 154–177. [Google Scholar]
  29. Achiam, J.; Adler, S.; Agarwal, S.; Ahmad, L.; Akkaya, I.; Aleman, F.L.; McGrew, B. GPT-4 Technical Report. arXiv 2023, arXiv:2303.08774. [Google Scholar]
  30. Ouyang, L.; Wu, J.; Jiang, X.; Almeida, D.; Wainwright, C.; Mishkin, P.; Lowe, R. Training Language Models to Follow Instructions with Human Feedback. Adv. Neural Inf. Process. Syst. 2022, 35, 27730–27744. [Google Scholar]
  31. Chen, Z.; Mao, H.; Li, H.; Jin, W.; Wen, H.; Wei, X.; Tang, J. Exploring the Potential of Large Language Models (LLMs) in Learning on Graphs. ACM SIGKDD Explor. Newsl. 2024, 25, 42–61. [Google Scholar] [CrossRef]
  32. Raffel, C.; Shazeer, N.; Roberts, A.; Lee, K.; Narang, S.; Matena, M.; Liu, P.J. Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer. J. Mach. Learn. Res. 2020, 21, 1–67. [Google Scholar]
  33. Liu, Y. RoBERTa: A Robustly Optimized BERT Pretraining Approach. arXiv 2019, arXiv:1907.11692. [Google Scholar]
  34. Xiao, C.; Hu, X.; Liu, Z.; Tu, C.; Sun, M. LawFormer: A Pre-trained Language Model for Chinese Legal Long Documents. AI Open 2021, 2, 79–84. [Google Scholar] [CrossRef]
  35. Thirunavukarasu, A.J.; Ting, D.S.J.; Elangovan, K.; Gutierrez, L.; Tan, T.F.; Ting, D.S.W. Large Language Models in Medicine. Nat. Med. 2023, 29, 1930–1940. [Google Scholar] [CrossRef] [PubMed]
  36. Huang, A.H.; Wang, H.; Yang, Y. FinBERT: A Large Language Model for Extracting Information from Financial Text. Contemp. Account. Res. 2023, 40, 806–841. [Google Scholar] [CrossRef]
  37. Pu, H.; Yang, X.; Li, J.; Guo, R. AutoRepo: A General Framework for Multimodal LLM-Based Automated Construction Reporting. Expert Syst. Appl. 2024, 255, 124601. [Google Scholar] [CrossRef]
  38. Guo, T.; Chen, X.; Wang, Y.; Chang, R.; Pei, S.; Chawla, N.V.; Zhang, X. Large Language Model Based Multi-Agents: A Survey of Progress and Challenges. arXiv 2024, arXiv:2402.01680. [Google Scholar]
  39. Cheng, Y.; Zhang, C.; Zhang, Z.; Meng, X.; Hong, S.; Li, W.; He, X. Exploring Large Language Model Based Intelligent Agents: Definitions, Methods, and Prospects. arXiv 2024, arXiv:2401.03428. [Google Scholar]
  40. Barua, S. Exploring Autonomous Agents through the Lens of Large Language Models: A Review. arXiv 2024, arXiv:2404.04442. [Google Scholar]
  41. Sha, H.; Mu, Y.; Jiang, Y.; Chen, L.; Xu, C.; Luo, P.; Li, S.E.; Tomizuka, M.; Zhan, W.; Ding, M. LanguageMPC: Large Language Models as Decision Makers for Autonomous Driving. arXiv 2023, arXiv:2310.03026. [Google Scholar]
  42. Kim, Y.; Park, C.; Jeong, H.; Chan, Y.S.; Xu, X.; McDuff, D.; Breazeal, C.; Park, H.W. Adaptive Collaboration Strategy for LLMs in Medical Decision Making. arXiv 2024, arXiv:2404.15155. [Google Scholar]
  43. Hu, E.J.; Shen, Y.; Wallis, P.; Allen-Zhu, Z.; Li, Y.; Wang, S.; Wang, L.; Chen, W. LoRA: Low-rank adaptation of large language models. arXiv 2021, arXiv:2106.09685. [Google Scholar]
  44. Dettmers, T.; Pagnoni, A.; Holtzman, A.; Zettlemoyer, L. QLoRA: Efficient finetuning of quantized LLMs. Adv. Neural Inf. Process. Syst. 2024, 36. [Google Scholar]
  45. Zhang, T.; Kishore, V.; Wu, F.; Weinberger, K.Q.; Artzi, Y. BERTScore: Evaluating Text Generation with BERT. arXiv 2019, arXiv:1904.09675. [Google Scholar]
Figure 1. Overall framework of IGRARG.
Figure 1. Overall framework of IGRARG.
Electronics 14 00379 g001
Figure 2. Data collection and transmission process flowchart.
Figure 2. Data collection and transmission process flowchart.
Electronics 14 00379 g002
Figure 3. Time series diagram of sensor monitoring data. (a) Time series data collected by the carbon monoxide sensor over a period of time; (b) Time series data collected by the laser methane sensor over a period of time.
Figure 3. Time series diagram of sensor monitoring data. (a) Time series data collected by the carbon monoxide sensor over a period of time; (b) Time series data collected by the laser methane sensor over a period of time.
Electronics 14 00379 g003
Figure 4. Flowchart of knowledge retrieval process.
Figure 4. Flowchart of knowledge retrieval process.
Electronics 14 00379 g004
Figure 5. Main roadmap of the intelligent assessment report generation module.
Figure 5. Main roadmap of the intelligent assessment report generation module.
Electronics 14 00379 g005
Figure 6. Risk assessment distribution of different gases under the IGRARG framework.
Figure 6. Risk assessment distribution of different gases under the IGRARG framework.
Electronics 14 00379 g006
Figure 7. Comparison of evaluation reports for different sections of the coal mine (taking methane as an example).
Figure 7. Comparison of evaluation reports for different sections of the coal mine (taking methane as an example).
Electronics 14 00379 g007
Figure 8. Comparison of evaluation reports for different sections of the coal mine (taking carbon monoxide as an example).
Figure 8. Comparison of evaluation reports for different sections of the coal mine (taking carbon monoxide as an example).
Electronics 14 00379 g008
Figure 9. Distribution of expert evaluation results. (a) Multidimensional evaluation distribution of the alarm assessment results by experts; (b) Multidimensional evaluation distribution of the assessment report by experts.
Figure 9. Distribution of expert evaluation results. (a) Multidimensional evaluation distribution of the alarm assessment results by experts; (b) Multidimensional evaluation distribution of the assessment report by experts.
Electronics 14 00379 g009
Table 1. Example of sensor deployment in various areas and the types of data collected.
Table 1. Example of sensor deployment in various areas and the types of data collected.
Mine NameInstallation LocationMeasurement TypeMaximum ValueUnitTime
Mine AMain Return Airway CH40%CH413 December 2024, 10:43:47
Longwall Face Spontaneous Combustion Monitoring PointCO29ppm14 December 2024, 12:23:03
Upper Corner of Coal FaceO218%14 December 2024, 11:34:03
Return Air RoadwayCO22.06%7 December 2024, 22:56:17
Table 2. Gas risk classification and thresholds.
Table 2. Gas risk classification and thresholds.
Gas TypeLow RiskModerate RiskHigh RiskExtreme Risk Alarm Threshold
CH4x ≤ 0.5%0.5% < x ≤ 0.8%0.8% < x ≤ 1.0%>1.0%1.0%
COx ≤ 12.0 ppm12.0 ppm < x ≤ 18.0 ppm18.0 ppm < x ≤ 24.0 ppm>24.0 ppm24.0 ppm
O2x ≤ 9.0%9.0% < x ≤ 14.0%14.0% < x ≤ 18.0%>18.0%18.0%
CO2x ≤ 0.5%0.5% < x ≤ 0.8%0.8% < x ≤ 1.0%>1.0%1.0%
H2Sx ≤ 6.6 ppm6.6 ppm < x ≤ 10 ppm10 ppm < x ≤ 13.2 ppm>13.2 ppm13.2 ppm
H2x ≤ 0.2%0.2% < x ≤ 0.35%0.35% < x ≤ 0.5%>0.5%0.5%
Table 3. An example of instruction data.
Table 3. An example of instruction data.
Dataset Example
InstructionYou are an expert in coal mine gas risk assessment. Please conduct a risk evaluation of the input laser methane data based on coal mine safety regulations.
InputThe coal mine is named xxx, and the specific installation location is at the upper mouth of the No. 2 coal bin underground; the measurement type at this point is laser methane, with a maximum concentration reading of 2.01% CH4; Please output the current gas concentration alarm status, corresponding response measures, and classify the current gas concentration into a risk level.
OutputThe current alarm type is calibration; the potential cause of the alarm is gas electrical interlock testing; the response measure for this alarm type is to follow standard operating procedures. Additionally, based on the measured value of 2.01% CH4, the concentration is classified as an extremely high risk. The current gas concentration poses a severe threat to the safety of the mine and requires immediate emergency measures to reduce the methane concentration to a safe range.
Table 4. Accuracy of risk level classification for different gases.
Table 4. Accuracy of risk level classification for different gases.
Gas TypeLow Risk
Accuracy
Moderate Risk
Accuracy
High Risk
Accuracy
Extreme Risk
Accuracy
Overall
Accuracy
CH40.900.880.920.910.91
CO0.850.870.890.900.88
O20.860.840.870.890.86
CO20.870.850.880.860.86
H20.880.850.860.840.85
H2S0.860.830.850.870.85
Overall Average Accuracy0.870.850.880.880.87
Table 5. Comparison of gas risk assessment methods.
Table 5. Comparison of gas risk assessment methods.
MethodAccuracy (%)EfficiencyApplication Scenarios
Expert Experience Method60% to 70%within minutesData scarcity or emergency situations
Fixed Threshold Monitoring Method70% to 80%within secondsSimple gas concentration monitoring
Mathematical Model Prediction85% to 95%minutes to hoursShort- to medium-term gas concentration prediction
Expert System Method80% to 90%seconds to minutesRisk assessment in complex environments
Traditional Neural Network Method85% to 95%seconds to minutesMulti-factor, nonlinear risk prediction
IGRARG framework85% to 93%seconds to minutes for inferenceDynamic risk assessment in complex environments
Table 6. Analysis of the effectiveness of evaluation reports for two models under different evaluation metrics.
Table 6. Analysis of the effectiveness of evaluation reports for two models under different evaluation metrics.
ModelFrequencyBERTScore PrecisionBERTScore RecallBERTScore F1Grammar ErrorsDiversity ScoreGeneration Time (s)
Base GLM3000.92640.92620.92630.0310.833.4
Fine-tuned GLM3000.94350.94580.94460.0270.794.2
Table 7. Comprehensive evaluation score of the IGRARG framework.
Table 7. Comprehensive evaluation score of the IGRARG framework.
Evaluation CategoryScore (Out of 100)WeightWeighted Score
Report Generation94.460.328.338
Risk Judgment87.000.434.800
Expert Evaluation81.490.324.447
Overall Weighted Score--87.585 *
* The bold values represent the weighted sum of the scores for all evaluation methods.
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

Sun, Y.; Han, Y.; Liu, X. Intelligent Gas Risk Assessment and Report Generation for Coal Mines: An Innovative Framework Based on GLM Fine-Tuning. Electronics 2025, 14, 379. https://doi.org/10.3390/electronics14020379

AMA Style

Sun Y, Han Y, Liu X. Intelligent Gas Risk Assessment and Report Generation for Coal Mines: An Innovative Framework Based on GLM Fine-Tuning. Electronics. 2025; 14(2):379. https://doi.org/10.3390/electronics14020379

Chicago/Turabian Style

Sun, Yi, Ying Han, and Xinke Liu. 2025. "Intelligent Gas Risk Assessment and Report Generation for Coal Mines: An Innovative Framework Based on GLM Fine-Tuning" Electronics 14, no. 2: 379. https://doi.org/10.3390/electronics14020379

APA Style

Sun, Y., Han, Y., & Liu, X. (2025). Intelligent Gas Risk Assessment and Report Generation for Coal Mines: An Innovative Framework Based on GLM Fine-Tuning. Electronics, 14(2), 379. https://doi.org/10.3390/electronics14020379

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