An improved lightgbm unbalanced classification method and system for plant safety early warning
By combining Deeply Separable Convolutional CNN and FuzzySMOTE to improve the LightGBM model, and optimizing feature extraction and classification algorithms, the problems of low efficiency and insufficient accuracy of traditional methods in factory safety early warning are solved, achieving efficient and accurate safety early warning, which is suitable for industrial environments.
Patent Information
- Application Number
- CN202510078900.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2045-01-17
AI Technical Summary
Existing technologies for plant safety early warning suffer from problems such as long execution time, strong data dependence, high false alarm and false negative rates, high computational resource requirements, complex parameter optimization, and severe noise interference, resulting in low efficiency and poor performance of traditional methods in plant safety early warning.
We employ a depthwise separable convolutional CNN for feature extraction, combine it with FuzzySMOTE for resampling minority class samples, use an improved LightGBM model and introduce EFB and GOSS algorithms to optimize feature binding and sampling strategies, optimize the loss function through Focal Loss, and use the butterfly optimization algorithm to fine-tune key parameters, thus forming an efficient imbalanced classification model.
It significantly improves the accuracy and efficiency of factory safety early warning identification, reduces computational complexity, enhances the ability to resist noise interference, improves the identification ability of minority samples, has strong adaptability, is suitable for industrial environments, and reduces the consumption of computing resources.
Smart Images

Figure CN120217172B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of unbalanced classification, and particularly relates to an improved LightGBM unbalanced classification method and system for factory area safety early warning. BACKGROUND
[0002] Factory safety has become the most important part of enterprises today, however, there are still many safety hazards in most modern production environments. Due to the lucky psychology and weak safety awareness of on-site staff, accidents will be directly or indirectly caused, resulting in irreparable consequences. Therefore, while maximizing the safety awareness of staff, it is necessary to reduce safety hazards as much as possible. How to supervise and manage the safety on site and timely early warning of potential accidents is the most concerned problem of enterprises.
[0003] Nowadays, many production plants still use a large number of manual safety supervision, which not only consumes a lot of manpower and financial resources of enterprises, but also the attention of safety supervision personnel will inevitably be not concentrated after a long time of work, and the eyes and spirit will also be tired, which may cause serious accidents. In order to avoid the occurrence of the above situation, it is necessary to make safety supervision achieve the purposes such as accurate and rapid early warning of safety hazards, low cost, high supervision efficiency and the like under the premise of meeting the normal operation of the site.
[0004] With the complication of factory environment, the difficulty of safety supervision increases, and it is usually necessary to use algorithms to simulate and calculate the optimal result. The current solving method of factory safety early warning can be divided into traditional target detection algorithm and detection algorithm based on deep learning. However, with the increase of problem size, the traditional target detection algorithm is helpless, therefore, many domestic and foreign researchers focus on using deep learning or ensemble learning for factory safety early warning research. The current main solving method of factory safety early warning problem and its defects are as follows:
[0005] Through the above analysis, the problems and defects of the prior art are as follows:
[0006] (1) Detection algorithm based on convolutional neural network (CNN) and long short-term memory network (LSTM): long execution time, strong data dependency, false positives and false negatives, therefore, the method consumes a large amount of time in factory safety early warning, and the efficiency is not high;
[0007] (2) Detection algorithm based on autoencoder and generative adversarial network (GAN): sensitive to environmental factors, high demand for computing resources, unable to learn enough features for complex or rare violations, resulting in poor detection effect of abnormal behavior, therefore, the quality of the early warning solved by the method cannot be guaranteed, and the efficiency is not high;
[0008] (3) Reinforcement learning-based detection algorithm: difficult to design reward function, long training process, low sample efficiency, and large computational overhead.
[0009] (4) LightGBM-based detection algorithm: ensemble learning model, parameter tuning is complex, and is easily disturbed by noise, so it is difficult to solve the optimal solution of the factory area safety warning with the original LightGBM model. SUMMARY
[0010] In view of the problems existing in the prior art, the improved LightGBM imbalance classification method for factory area safety warning is provided.
[0011] The improved LightGBM imbalance classification method for factory area safety warning is implemented in the following manner:
[0012] Step 1, using a deep separable convolutional CNN for feature extraction;
[0013] Step 2, using FuzzySMOTE to resample the minority class samples, generating n minority class samples, and initializing the sample weight;
[0014] Step 3, putting the weighted data set into the improved LightGBM model for training, and outputting the bundled feature bundle set through the EFB exclusive feature bundling of LightGBM, the specific algorithm being shown in Algorithm 1.
[0015] The specific algorithm flow of the EFB algorithm is shown in Algorithm 1:
[0016]
[0017] Step 4, the output feature bundle set is obtained through the GOSS sampling strategy of LightGBM, and the specific algorithm is shown in Algorithm 2.
[0018] The specific algorithm flow of the GOSS algorithm is shown in Algorithm 2:
[0019]
[0020]
[0021] Step 5, calculating the split gain of the sampled data subset, and the specific formula is as follows:
[0022]
[0023] where D represents the sample set of the current node; D L , D R respectively represent the sample sets of the left and right child nodes; nD n L n R represents the size of the corresponding sample set; gi is the gradient of the i-th sample.
[0024] Step 6: After the number of iterations T is satisfied, the classifiers in the classifier pool are integrated according to their learning rate and the gradient of their loss function to obtain the final classifier.
[0025] Input: Number of minority class samples n, number of iterations T, initial butterfly population size n_butterflies, optimal butterfly ratio p_ratio, large gradient data retention ratio a, small gradient data sampling ratio b, maximum conflict threshold K;
[0026] Output: Final classifier.
[0027] Furthermore, the feature extraction:
[0028] Separable convolution is introduced to optimize traditional convolution operations. Depthwise separable convolution decomposes the standard convolution into two steps: depthwise convolution and pointwise convolution.
[0029] Furthermore, the improved FuzzySMOTE process is as follows:
[0030] Calculate fuzzy membership degree: for minority class sample x i and its potential nearest neighbor samples x j The fuzzy membership function is defined as follows:
[0031]
[0032] Where x i It is a minority class sample. It is x i The j-th minority class nearest neighbor, It is x i The j-th majority class nearest neighbor, k is the number of nearest neighbors, and d(·,·) is the Euclidean distance between samples;
[0033] Membership normalization: The membership degree is normalized to the [0,1] interval, as shown in the following formula:
[0034]
[0035] The probability of selecting the benchmark sample is calculated by dividing the normalized membership degree of each sample by the sum of the membership degrees of all samples, resulting in a probability distribution. The formula for calculating the probability of selecting each minority class sample is as follows:
[0036]
[0037] in, Sum of all normalized membership degrees;
[0038] Generate new samples: the sample generation formula is as follows:
[0039] x new =x i +λ(x j -x i )
[0040] Wherein, x i is the reference sample selected according to the probability P(x i ), x j is a random selection from the k nearest neighbors of x i , and lambda is a random number between 0 and 1.
[0041] Further, the classification:
[0042] On the basis of the original LightGBM algorithm, the original loss function is introduced into the focal loss, and the formula is as follows:
[0043] FL(p t )=-α t (1-p γ ) t log(p t )
[0044] Where p t represents the prediction probability of the model for the true class, defined as:
[0045]
[0046] Where p is the probability of being predicted as a positive class, y is the true label; alpha L is a balance factor for balancing the importance of positive and negative samples; gamma is an adjustment factor that controls the attention degree of difficult and easy samples; gamma=0 degenerates into ordinary cross entropy loss, gamma>0 improves the attention degree of difficult classification samples, and inhibits the contribution of easy classification samples to the loss; and for key parameters such as learning rate, a butterfly optimization algorithm (BOA) is introduced to optimize.
[0047] Another purpose of the present application is to provide an improved LightGBM imbalance classification system for plant safety warning, comprising:
[0048] The feature extraction module is used for feature extraction using a deep separable convolutional CNN;
[0049] The sampling module is used for resampling the minority class samples using FuzzySMOTE to generate n minority class samples and initialize the sample weight;
[0050] The training module adopts the EFB and GOSS algorithms to bundle the feature vectors after feature extraction to output a feature bundle set, and collects large gradient samples and small gradient samples to form a sampled data subset, and constructs a decision tree by calculating a split gain.
[0051] The iteration module still adopts the above strategy to construct gradient samples and generate a decision tree when the number of iterations T is not satisfied.
[0052] The integration module is used to integrate all classifiers in the classifier pool according to a learning rate and a loss function gradient to obtain a final classifier when the number of iterations T is satisfied.
[0053] Another object of the present application is to provide a computer device comprising a memory and a processor, the memory storing a computer program, the computer program being executed by the processor to enable the processor to perform the steps of the improved LightGBM imbalance classification method for plant safety early warning.
[0054] Another object of the present application is to provide a computer readable storage medium storing a computer program, the computer program being executed by a processor to enable the processor to perform the steps of the improved LightGBM imbalance classification method for plant safety early warning.
[0055] Another object of the present application is to provide an information data processing terminal for implementing the improved LightGBM imbalance classification system for plant safety early warning.
[0056] In combination with the above technical solutions and solved technical problems, the technical solution to be protected by the present application has the following advantages and positive effects:
[0057] Firstly, the present application is an improved method based on LightGBM. The original LightGBM algorithm usually trains balanced positive and negative samples of data. When the data of violation behavior is much less than the data of normal behavior, LightGBM may have a high bias to normal behavior, leading to the problem of missed reports. LightGBM is easily disturbed by noise data when processing low-quality data, which leads to the model being unable to correctly identify violation behavior.
[0058] Inspired by deep learning, the present application proposes an improved LightGBM algorithm applied to the factory safety warning problem. Deep learning has strong feature extraction and pattern recognition ability when dealing with a large amount of data, and can automatically learn complex nonlinear relationships from data. The present application introduces the multi-layer feature extraction capability of deep learning, processes the original data deeply through the neural network, extracts the key features and inputs them into LightGBM, so that LightGBM can learn in a richer feature space, thereby improving the recognition accuracy of complex violation behavior patterns.
[0059] The purpose of the present application is to introduce an unbalanced classification model, improve its sampling method, feature extraction and classification algorithm, to effectively solve the problem of factory safety warning. The present application proposes a method for dynamically monitoring whether employees have violated behavior for safety behaviors in the factory (such as whether to wear a safety helmet, whether to wear work clothes, etc.). By introducing fuzzy logic to improve the original SMOTE method, introducing improved CNN for feature extraction, improving the LightGBM loss function, and introducing the butterfly optimization algorithm to determine the setting of the key parameters, etc., this unbalanced classification model is determined. Because the SMOTE algorithm often has a more sparse distribution of minority class samples when dealing with high-dimensional unbalanced data. Therefore, the present application extracts features from the samples through deep separable convolutional CNN before resampling with the improved FuzzySMOTE (FuzzySMOTE), reducing the sample feature dimension. Then the FuzzySMOTE algorithm and the improved LightGBM algorithm are combined, and the FuzzySMOTE algorithm is used in the process of weak classifier iteration to resample the minority class sample features extracted by the improved CNN, reducing the imbalance ratio of the samples. Experiments show that the method proposed by the present application solves the shortcomings of the original model in the factory safety problem and improves the performance and generalization ability of the classification model.
[0060] The present application is inspired by a variety of advanced technologies, and proposes an improved LightGBM balanced classification model to solve the problem of factory safety warning. Through innovative improvements in the data sampling stage, feature extraction stage and classification algorithm stage, the present application improves the performance of the classification model while significantly enhancing the generalization ability and adaptability of the model. Compared with traditional factory safety warning models, the improved scheme based on the present application has the following significant advantages:
[0061] 1. Improve the anti-interference ability to noise points and enhance the minority class recognition ability
[0062] The improved process of the application has stronger anti-interference ability, especially when dealing with boundary noise points in complex industrial environments. Through optimization in the sampling and feature extraction stage, the improved model can effectively improve the recognition ability of minority class samples, avoiding the problem of early warning failure caused by the neglect or inaccurate classification of minority class samples in traditional models. Compared with some complex deep learning end-to-end models, the process of the application adopts a design of separating feature extraction and classification, extracts high-quality features by using deep separable convolution, and combines a lightweight FuzzyFSSLightGBM class model, so that the model greatly reduces the computational complexity while ensuring the classification accuracy, shortens the training and inference time, and significantly improves the efficiency.
[0063] 2. Comprehensive optimization step, focusing on solving the unbalanced classification problem
[0064] In the case of sample imbalance, the application introduces the FuzzySMOTE algorithm, effectively balances the proportion of samples of each class, improves the generation quality of minority class samples, and thus improves the recognition ability of the classification model for minority class samples. At the same time, deep separable convolution is used in the feature extraction stage to process image data deeply and extract high-quality features with better discrimination, which provides more information for subsequent classification. In addition, the LightGBM algorithm is introduced in the classification stage, and the Focal Loss focusing loss is used in its loss function, further optimizing the model's ability to handle difficult-to-classify samples, especially in the classification of minority class samples, showing stronger robustness and classification accuracy. In order to further improve the performance of the model, the butterfly optimization algorithm (BOA) is also used to fine-tune the key parameters of the model, ensuring that each step can work efficiently and focus on the key pain points of unbalanced classification, thereby improving the overall classification performance.
[0065] 3. Balance between high performance and low cost, adapting to the requirements of industrial environment
[0066] The overall method of the application not only has high performance, but also has low cost, flexibility and easy deployment, which is very suitable for unbalanced image classification tasks in industrial scenarios. Especially in the high-demand application scenario of plant safety monitoring, the model can not only ensure high accuracy of classification, but also balance resource consumption, so that the method can also perform outstanding performance in actual environments with limited computing resources. Compared with traditional methods, the application can efficiently classify complex data at a lower computational cost, ensuring the stability and accuracy of the plant safety warning system. Especially in the case of unbalanced data and many noise points, it can still maintain high classification accuracy and reliability.
[0067] In summary, the present application forms a high-efficiency, accurate and strong adaptability classification model through the improvement of multiple key links, which significantly improves the performance of the plant safety early warning system. By introducing advanced technical means, the model structure is optimized, and the present application can not only solve various problems encountered in traditional methods, but also provide reliable technical support in a variable industrial environment to provide more accurate early warning services for plant safety.
[0068] Second, as the creative evidence of the claims of the present application, it is also reflected in the following important aspects:
[0069] (1) The expected income and commercial value of the technical scheme of the present application after transformation are:
[0070] Expected income: When the employees of the traditional plant have a violation, efficient identification detection and system alarm cannot be performed. If a serious violation exists and there is a missed detection or misdetected situation, a safety accident may occur and even cause huge economic losses. The present application uses the FuzzySMOTE algorithm to process unbalanced data problems, especially to strengthen the identification ability of various violation behaviors. Through the high-quality features extracted by the deep separable convolution network, combined with the improved LightGBM classification algorithm, the violation behavior in the monitoring image can be accurately identified, greatly reducing the missed detection and misdetected situation. At the same time, the system constructed by the model can analyze the violation data from multiple dimensions, including personal dimension, department dimension, time dimension, etc. to generate personalized violation reports. This all-round data analysis capability enables employees to clearly understand their violation situation, greatly improving their safety awareness. Managers can also develop safety education and training according to statistical data to improve training effectiveness. Therefore, through the present application, employee behavior can be effectively regulated, the high incidence of safety accidents can be greatly reduced, unnecessary economic losses can be avoided, and good protection for plant safety can be brought.
[0071] Commercial value: The system constructed by the present method significantly reduces the workload of manual inspection by intelligently identifying violation behaviors in monitoring images. The daily / weekly / monthly violation analysis report automatically generated by the system provides clear and intuitive data support for management. Through the multi-dimensional analysis function of the system, managers can quickly identify high-risk violation areas and time periods and develop targeted improvement measures. Based on the statistical analysis of individual violation data, enterprises can accurately identify employees who need to be trained, avoiding the waste of resources caused by large-scale indiscriminate training. The violation behavior data continuously collected and analyzed by the system will form an important digital asset for the enterprise. These data not only support current safety management, but also can be used to establish a prediction model to provide data support for future management decisions. Through the digital and intelligent management mode of the system, the overall upgrade of the enterprise safety management system is promoted, the modern management level of the enterprise is improved, and the competitiveness of the enterprise is enhanced.
[0072] (2) The technical solution of the application fills the technical gap in the industry:
[0073] This scheme realizes the whole process optimization from data processing, feature extraction to classification decision, and establishes a complete technical solution. This systematic optimization strategy fills the technical gap in the industrial image classification field. The fuzzy logic is introduced into the unbalanced data processing in the industrial scene, which solves the limitations of traditional SMOTE algorithm in processing complex industrial images. The algorithm adaptively adjusts the sample generation strategy through fuzzy rules, significantly improves the quality of synthesized samples, and provides a new technical idea for the industry. The deep separable convolution structure is innovatively introduced on the basis of AlexNet, which not only maintains the original feature extraction ability, but also reduces the model calculation by more than 60%. This improvement enables the system to realize real-time processing on ordinary hardware, reducing the technical application threshold. Focal Loss is introduced into the LightGBM framework in industrial image classification, which creatively solves the sample imbalance problem. This combination fully utilizes the efficiency advantage of LightGBM and the focusing property of Focal Loss, achieving accurate identification of violations. The butterfly optimization algorithm is applied to the system parameter optimization, realizing the automatic tuning of parameters. This mechanism greatly reduces the system debugging difficulty and improves the practicability of the system. The overall scheme realizes intelligent identification and statistical analysis of violations, which provides a new technical means for industrial safety management.
[0074] (3) The technical solution of the application solves the technical problems that people have been eager to solve but have failed to succeed:
[0075] a. The proportion of violation samples in industrial scenes is usually very small, and traditional methods are difficult to effectively process. This scheme innovatively solves this problem through FuzzySMOTE algorithm, enabling the model to accurately identify various violations.
[0076] b. The monitoring images in industrial sites are often affected by factors such as light and occlusion, and traditional methods cannot guarantee the recognition effect. This scheme realizes stable recognition in complex environments through data enhancement, improved feature extraction network and multi-layer optimization strategy.
[0077] c. Previous methods either have insufficient accuracy or cannot meet the real-time processing requirements. This scheme successfully realizes the unification of high accuracy and real-time processing through deep separable convolution and model optimization. Traditional models often overfit to specific scenarios and have poor generalization ability. This scheme significantly improves the environmental adaptability of the system through innovative data enhancement and model design.
[0078] d.The deep learning model is often criticized as a "black box" and difficult to explain. This solution improves the explainability of model decision-making through visualization techniques and decision analysis tools.
[0079] (4) The technical solution of the present application overcomes technical bias:
[0080] a. Sample bias: Through the FuzzySMOTE algorithm, the system overcomes the preference for mainstream samples and can treat all types of violations fairly. Especially for low-frequency but important violations, it maintains high sensitivity.
[0081] b. Feature bias: The improved deep learning model avoids over-reliance on specific features, ensuring comprehensive and fair identification through multi-dimensional feature fusion.
[0082] c. Scene bias: The system overcomes the preference for specific application scenarios through rich data enhancement and model optimization, and can adapt to various industrial environments.
[0083] d. Decision bias: The analysis and decision-making mechanism based on objective data avoids the bias caused by human subjective judgment, ensuring the fairness of management decisions.
[0084] e. Evaluation index bias: The system uses multi-dimensional evaluation indicators to avoid the one-sidedness caused by single indicators, reflecting the system performance comprehensively and objectively.
[0085] f. Effect evaluation bias: Through long-term data accumulation and multi-angle analysis, the objectivity and reliability of the system evaluation results are ensured.
[0086] Third, in the field of factory safety warning, unbalanced data is a common problem, such as the amount of dangerous events or violations is much less than normal data, leading to traditional classification models over-biased to the majority class (normal events) and ignoring the detection of minority classes (abnormal events). The existing methods are usually not ideal when dealing with minority class samples, and it is difficult to balance between high precision and high recall rate.
[0087] Traditional safety warning systems rely on simple statistics or manual feature engineering in feature extraction, which is difficult to capture complex data patterns, especially when dealing with multi-source heterogeneous data (such as sensor data, image data), which limits the performance of the classification model.
[0088] Existing classification models have poor adaptability in dynamic environments, especially in sample weight adjustment and weak classifier integration, which leads to overfitting or performance degradation of the classifier in actual application.
[0089] The application optimizes the distribution of minority class samples by combining the FuzzySMOTE resampling technology and the improved LightGBM model, enables the model to effectively identify minority class events, reduces the influence of majority class samples on the classification result, and significantly improves the classification accuracy and recall rate.
[0090] Deep separable convolutional CNN is used to realize efficient feature extraction of complex data, which can capture deeper pattern information, is suitable for multi-source data such as factory sensor data or image data, and improves the overall performance of the classification model.
[0091] By dynamically adjusting the sample weight and optimizing the integration strategy of weak classifiers, the model is gradually optimized in multiple iterations to ensure the stability and generalization ability of the classifier. At the same time, the sample weight threshold limit and secondary resampling mechanism are added to enhance the detection ability of the classifier to abnormal samples.
[0092] In the classifier integration stage, the parameters such as learning rate are used to fuse multiple weak classifiers into an efficient final classifier, which can adapt to dynamic environment changes and ensure reliability in long-term use.
[0093] Through the above technical progress, the application provides an efficient and reliable solution for factory safety warning, overcomes many bottlenecks in the prior art, and significantly improves the intelligent level of industrial safety management.
[0094] Thirdly, in the factory safety warning, the classification data usually has serious imbalance, and the proportion of minority class samples is low, which leads to insufficient recognition ability of traditional classification methods to minority class samples. At the same time, the feature data has high dimension and redundancy, which is easy to introduce noise and affect the accuracy of the classification model. In addition, in the training process of large-scale data sets, the traditional gradient boosting algorithm (GBDT) has low computational efficiency, which is difficult to meet the real-time requirements. These problems significantly limit the application effect of the prior art in factory safety warning.
[0095] The application combines deep separable convolutional neural network (CNN), fuzzy minority class oversampling technology (FuzzySMOTE) and improved LightGBM algorithm, and proposes an optimization method for unbalanced classification problems. This scheme solves the problems of low feature extraction efficiency, classification performance decline caused by sample imbalance, and insufficient computational efficiency of large-scale data, and significantly improves the recognition ability and running efficiency of the factory safety warning model.
[0096] Compared with the traditional method, the technical scheme of the application realizes technical progress in multiple aspects. The deep separable convolution CNN effectively reduces the model complexity and significantly improves the efficiency of feature extraction. The fuzzy minority class oversampling technology (FuzzySMOTE) balances the distribution of minority class samples and improves the recognition ability of the model to minority class samples. The improved LightGBM model uses exclusive feature binding (EFB) and gradient-aware subsampling strategy (GOSS) to significantly improve the training speed and computing efficiency while ensuring the accuracy of the model.
[0097] The technical scheme of the application is suitable for plant safety early warning systems that need to process unbalanced data and has wide application prospects in many fields such as industry, energy and chemical industry. By improving the recognition ability of minority class samples, optimizing the computing efficiency and enhancing the adaptability of the classification model, the application significantly improves the accuracy and real-time performance of plant safety early warning, thereby providing technical support for industrial safety protection and effectively reducing the risk of safety accidents, which has important economic and social value. BRIEF DESCRIPTION OF DRAWINGS
[0098] Figure 1 is an improved LightGBM unbalanced classification method flowchart for plant safety early warning provided by the embodiment of the application.
[0099] Figure 2 is an improved LightGBM unbalanced classification system structure block diagram for plant safety early warning provided by the embodiment of the application.
[0100] Figure 3 is a feature extraction schematic diagram provided by the embodiment of the application.
[0101] Figure 4 is an improved LightGBM unbalanced classification model flowchart provided by the embodiment of the application.
[0102] Figure 5 is an ablation experiment index performance graph under the SafetyHelmetWearingDataset dataset provided by the embodiment of the application.
[0103] Figure 6 is a comparative experiment index performance graph under the SafetyHelmetWearingDataset dataset provided by the embodiment of the application.
[0104] Figure 7 is an ablation experiment index performance graph under the Safety Helmet andReflective Jacket dataset provided by the embodiment of the application.
[0105] Figure 8is a performance graph of a contrast experiment index under a Safety Helmet and Reflective Jacket dataset provided by an embodiment of the present application.
[0106] Figure 9 is an ablation experiment index performance graph under an ImVisible: Pedestrian Traffic Light Dataset dataset provided by an embodiment of the present application.
[0107] Figure 10 is a performance graph of a contrast experiment index under an ImVisible: Pedestrian Traffic Light Dataset dataset provided by an embodiment of the present application.
[0108] Figure 11 is a system detection effect diagram provided by an embodiment of the present application.
[0109] Figure 12 is a visual analysis effect diagram provided by an embodiment of the present application.
[0110] Figure 13 is a camera capture effect diagram provided by an embodiment of the present application. DETAILED DESCRIPTION
[0111] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application will be further described in detail below in combination with embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0112] As shown in Figure 1 , an improved LightGBM imbalance classification method for factory safety early warning provided by an embodiment of the present application includes the following steps:
[0113] S101, using deep separable convolutional CNN for feature extraction;
[0114] S102, using FuzzySMOTE to resample the minority class samples, generating n minority class samples, and initializing the sample weight;
[0115] S103, putting the weighted dataset into the improved LightGBM model training, and outputting the bundled feature bundle set after the feature extraction feature vector is bundled by the EFB exclusive feature binding of LightGBM;
[0116] Step 1, using deep separable convolutional CNN for feature extraction;
[0117] Step 2, resample the minority class samples using FuzzySMOTE to generate n minority class samples and initialize sample weights;
[0118] Step 3, put the dataset with weights into the improved LightGBM model training, and output the bundled feature bundle set after the EFB exclusive feature bundling of LightGBM, the specific algorithm is shown in Algorithm 1.
[0119] The specific algorithm flow of EFB algorithm is shown in Algorithm 1:
[0120]
[0121] Step 4, the output feature bundle set is obtained by the GOSS sampling strategy of LightGBM, and the specific algorithm is shown in Algorithm 2.
[0122] The specific algorithm flow of GOSS algorithm is shown in Algorithm 2:
[0123]
[0124] Step 5, calculate the split gain for the sampled data subset, the specific formula is as follows:
[0125]
[0126] where D represents the sample set of the current node; D L , D R respectively represent the sample sets of the left and right child nodes; n D , n L , n R respectively represent the sizes of the corresponding sample sets; gi is the gradient of the ith sample.
[0127] Step 6, when the iteration number T is satisfied, integrate all classifiers in the classifier pool according to the learning rate and its loss function gradient to obtain the final classifier;
[0128] Input: the number of generated minority class samples n, the iteration number T, the butterfly initialization population size n_butterflies, the optimal butterfly proportion p_ratio, the large gradient data retention proportion a, the small gradient data sampling proportion b, and the maximum conflict threshold K;
[0129] Output: the final classifier.
[0130] S104, the output feature bundle set is obtained by the GOSS sampling strategy of LightGBM, and the split gain is calculated;
[0131] S105, after the number of iterations T is satisfied, all classifiers in the classifier pool are integrated according to their learning rate and the gradient of their loss function to obtain the final classifier;
[0132] Input: Number of minority class samples n, number of iterations T, initial butterfly population size n_butterflies, optimal butterfly ratio p_ratio, large gradient data retention ratio a, small gradient data sampling ratio b, maximum conflict threshold K;
[0133] Output: Final classifier.
[0134] Feature extraction provided by embodiments of the present invention:
[0135] Separable convolution is introduced to optimize traditional convolution operations. Depthwise separable convolution decomposes the standard convolution into two steps: depthwise convolution and pointwise convolution.
[0136] The present invention provides the following methods for calculating the classification error rate and weights:
[0137] Calculate fuzzy membership degree: for minority class sample x i and its potential nearest neighbor samples x j The fuzzy membership function is defined as follows:
[0138]
[0139] Where x i It is a minority class sample. It is x i The j-th minority class nearest neighbor, It is x i The j-th majority class nearest neighbor, k is the number of nearest neighbors, and d(·,·) is the Euclidean distance between samples;
[0140] Membership normalization: The membership degree is normalized to the [0,1] interval, as shown in the following formula:
[0141]
[0142] The probability of selecting the benchmark sample is calculated by dividing the normalized membership degree of each sample by the sum of the membership degrees of all samples, resulting in a probability distribution. The formula for calculating the probability of selecting each minority class sample is as follows:
[0143]
[0144] in, The sum of all normalized membership degrees;
[0145] Generate new samples: The sample generation formula is as follows:
[0146] x new =xi + lambda (x j -x i )
[0147] where x i is the reference sample selected according to the probability P(x i ), x j is a randomly selected one of the k nearest neighbors of x i , and lambda is a random number in [0,1].
[0148] The classification provided by the embodiments of the present application is:
[0149] On the basis of the original LightGBM algorithm, the original loss function is introduced into the FocalLoss focusing loss, and the formula is as follows:
[0150] FL(p t ) = - alpha t (1-p t ) γ log(p t )
[0151] where p t represents the prediction probability of the model for the true class, and is defined as:
[0152]
[0153] where p is the probability of being predicted as a positive class, y is the true label; alpha t is a balance factor for balancing the importance of positive and negative samples; gamma is an adjustment factor that controls the attention degree of difficult and easy samples; gamma = 0 degenerates into ordinary cross-entropy loss, gamma > 0 improves the attention degree of difficult classification samples, and suppresses the contribution of easy classification samples to the loss; and for key parameters such as learning rate, a butterfly optimization algorithm (BOA) is introduced to optimize.
[0154] 1. Safety warning system for dangerous substance leakage in chemical plant area
[0155] In a chemical plant area, dangerous substance leakage may cause serious accidents. Based on the improved LightGBM imbalance classification method of the present application:
[0156] Data feature extraction: using deep separable convolutional CNN to extract features from plant sensor (such as gas detector, temperature and humidity sensor) data, including leakage gas concentration change, environmental parameters, etc.
[0157] Data balancing processing: using FuzzySMOTE to resample the minority class (such as leakage event) data to generate more minority class samples, avoiding the bias of the model to the majority class (normal operation) data.
[0158] Classifier training: Through the improved LightGBM model, the decision tree is iteratively constructed, and an efficient classifier is trained to identify the feature patterns of leakage events.
[0159] Application: Deploy the final classifier into the plant monitoring system to realize real-time monitoring and early warning of dangerous substance leakage.
[0160] 2. Power plant employee behavior safety monitoring system
[0161] In the power plant, employee violation behaviors (such as not wearing protective equipment, misoperation) are important inducements for safety accidents. Based on the method of the present application:
[0162] Data feature extraction: Use deep separable convolutional CNN to extract behavior features from employee behavior video data captured by the video monitoring system.
[0163] Data balancing processing: FuzzySMOTE resampling is performed on the sample data of the minority class (violation behavior) to enhance the model's ability to identify violation behaviors.
[0164] Classifier training: Through the improved LightGBM model, the unbalanced behavior data set is trained, and weak classifiers are gradually obtained and a classifier pool is constructed.
[0165] Application: Integrate the final classifier into the plant behavior monitoring system to classify and detect employee behavior in real time, automatically mark and record violation behaviors, and timely issue safety warnings.
[0166] As shown in Figure 2 The improved LightGBM unbalanced classification system for plant safety warning provided by the embodiment of the present application comprises:
[0167] The feature extraction module is used for feature extraction using deep separable convolutional CNN;
[0168] The sampling module is used for resampling the minority class samples using FuzzySMOTE to generate n minority class samples and initialize the sample weights;
[0169] The training module adopts EFB and GOSS algorithms to bundle the feature vectors after feature extraction to output a feature bundle set, and collects the large gradient samples and small gradient samples accordingly to form a sampled data subset, and constructs a decision tree by calculating the split gain; the next cycle is performed.
[0170] The iteration module still adopts the above strategy to construct gradient samples and generate decision trees when the number of iterations T is not satisfied.
[0171] An integration module is configured to integrate all weak classifiers in the classifier pool according to the optimized parameters such as learning rate after the number of iterations T is met, to obtain a final classifier.
[0172] In the feature extraction module, the system receives various sensor signals or monitoring data from the factory site (such as temperature and humidity sensors, gas detectors, video surveillance, etc.). The input data is processed using a deep separable convolutional CNN to extract key features. These features can capture deep patterns in the original data, such as abnormal environmental changes or unsafe behavior, providing high-quality input for subsequent classification tasks.
[0173] The sampling module classifies the processed feature data, especially for minority class samples (such as abnormal event data). The FuzzySMOTE method is used to resample the minority class data, generating additional samples to balance the data distribution, while initializing the weight for each sample to ensure that the influence weight of the sample on the model can be dynamically adjusted during the subsequent training process. This step significantly enhances the system's ability to handle imbalanced data.
[0174] In the training module, the resampled dataset is input into the improved LightGBM model for training. The EFB and GOSS algorithms, which are two major advantages of LightGBM, are used to integrate feature subsets and calculate the size of split gain to determine the generation of decision trees.
[0175] When the number of iterations T is not met, the above strategy is still adopted for gradient sample construction and decision tree generation.
[0176] When the number of iterations reaches the set threshold T, the integration module integrates all weak classifiers in the classifier pool according to the learning rate and loss function gradient to form the final classifier. The integration process optimizes the weight distribution between classifiers to ensure that the final classifier has stronger robustness and generalization ability. The final classifier outputs the classification result as the basis for decision-making of the factory site safety warning, which can accurately identify and prompt potential safety hazards, providing technical support for real-time monitoring and management.
[0177] The purpose of the present application is to introduce an unbalanced classification model, improve its sampling method, feature extraction and classification algorithm, so as to effectively solve the problems of factory safety early warning. The present application proposes a method for dynamically monitoring whether the employees have violated the rules, aiming at the safety behaviors in the factory (such as whether to wear a safety helmet, whether to wear work clothes, etc.). The unbalanced classification model is determined by introducing the fuzzy logic idea to improve the original SMOTE method, introducing the improved CNN for feature extraction, improving the LightGBM loss function, and introducing the butterfly optimization algorithm to determine the setting of the key parameters. Since the SMOTE algorithm is used to process high-dimensional unbalanced data, the distribution of the minority class samples is often more sparse. Therefore, the present application performs feature extraction on the samples by using the deep separable convolutional CNN before resampling by using the improved fuzzy SMOTE (FuzzySMOTE), so as to reduce the sample feature dimension. Then, the FuzzySMOTE algorithm and the improved LightGBM algorithm are combined, and the FuzzySMOTE algorithm is used in the process of weak classifier iteration to resample the minority class sample features extracted by the improved CNN, so as to reduce the imbalance ratio of the samples. Experiments prove that the method proposed by the present application can well solve the shortcomings of the original model in the factory safety problem and improve the performance and generalization ability of the classification model.
[0178] Basic steps of the original model:
[0179] Step 1. Data set division: for the factory data set, the normal behavior should account for more quantity, which is called majority class sample; and the violation behavior should account for less quantity, which is called minority class sample;
[0180] Step 2. Feature extraction: for high-dimensional images, the traditional feature extraction method is used for dimension reduction, unnecessary complex features are removed, and all features are assigned the same weight;
[0181] Step 3. Over-sampling: for the minority class samples after feature extraction, since they have higher influence and larger misclassification cost, the original SMOTE method is used to expand the sample quantity.
[0182] Step 4. Traditional LightGBM algorithm classification: for the sample data set after over-sampling, the traditional LightGBM algorithm is used for classification.
[0183] Step 5. Determine the number of iterations: if the number of iterations is insufficient, continue to iterate to obtain a new weak classifier; if the number of iterations is reached, the classification weights and performance of all weak classifiers are integrated to obtain a final classifier;
[0184] In actual use of the original model to solve the plant safety problem, many problems may be caused. For example, the monitoring image may be blurred due to environmental noise, and the resolution is low; the traditional feature extraction method may be difficult to fully capture the complex image features in the plant, etc. Therefore, an improved model is needed to solve the problem in more detail.
[0185] Therefore, the present application is inspired by many things, and the original model is improved. In the sample oversampling stage, the concept of fuzzy logic is introduced, and image enhancement is performed. The clarity of the image is improved, and the newly generated sample is closer to the feature distribution of the original sample, thereby improving the performance and generalization ability of the classification model. In the feature extraction stage, the depth separable convolution can extract more rich high-level semantic features. Through this layer-by-layer extraction, the features of the image can be more effectively expressed. In the classification algorithm level, the original LightGBM algorithm is greatly affected by the key parameters such as the number of weak learners, the learning rate, and the maximum depth of each tree during the training process. Therefore, the butterfly optimization algorithm is introduced to optimize the key parameters; and the Focal Loss focusing loss is introduced for the original loss function. The main purpose is to adjust the sample class weight, easy classification sample weight and difficult classification sample weight by introducing parameters in the loss function to improve the classification accuracy of the model.
[0186] The improved LightGBM classification model (FuzzyFSSLightGBM) proposed by the present application has the following steps:
[0187] Input: the number of generated minority class samples n, the number of iterations T, the butterfly initialization population size n_butterflies, the optimal butterfly ratio p_ratio, the large gradient data retention ratio a, the small gradient data sampling ratio b, and the maximum conflict threshold K;
[0188] Output: final classifier
[0189] 1. Use the depth separable convolution CNN for feature extraction;
[0190] 2. Use FuzzySMOTE to resample the minority class samples, generate n minority class samples, and initialize the sample weight;
[0191] 3. Put the dataset with the weight into the improved LightGBM model for training, and output the bundled feature bundle set through the EFB exclusive feature bundling of LightGBM after the feature vector after feature extraction;
[0192] 4. The output feature bundle set is obtained through the GOSS sampling strategy of LightGBM to obtain the sampled data subset;
[0193] 5. Calculate the split gain for the sampled data subset;
[0194] 6If the number of iterations T is not met, continue as above; when the number of iterations T is met, integrate all classifiers in the classifier pool according to the learning rate and its loss function gradient to obtain the final classifier.
[0195] Next, the technical solution will be described in detail, and the implementation method and each key step of the proposed improvement scheme will be specifically explained. Through step-by-step analysis and explanation of the operation process of each link, the working principle, innovation points and implementation mode of the scheme are fully demonstrated. In particular, when explaining the improvement scheme, the technical breakthrough and optimization in different links will be discussed in depth to ensure that each part of the design and implementation can be highly efficient and coordinated, so as to achieve the expected performance improvement. At the same time, by listing the implementation steps in detail, it is ensured that the scheme can be effectively landed in practical application and has operability and generalizability. This process not only covers the theoretical level of explanation, but also demonstrates how the improvement scheme solves problems, improves performance and promotes the development of related technical fields through specific technical details and step-by-step instructions.
[0196] Step 1, initialization parameter setting
[0197] In the present application, the number of generated minority class samples n, the number of iterations T, the size of the butterfly initialization population n_butterflies, the optimal butterfly ratio p_ratio, the large gradient data retention ratio a, the small gradient data sampling ratio b, and the maximum conflict threshold K need to be set. The initialization parameter setting and sample number are as follows:
[0198] Table 1 Initialization parameter setting and sample number table
[0199]
[0200] Step 2, deep separable convolution feature extraction
[0201] The separable convolution is introduced to optimize the traditional convolution operation. Deep separable convolution decomposes the standard convolution into two steps: depth convolution and point-by-point convolution, which significantly reduces the parameter size of the model. Specifically, traditional convolution needs to be calculated in both spatial and channel dimensions of the convolution kernel, while deep separable convolution separates these two steps, greatly reducing the computational complexity of each step, thereby significantly reducing the computational overhead. This optimization method not only maintains the high-efficiency feature extraction capability of the model, but also significantly improves the efficiency of feature extraction.
[0202] More importantly, although the parameter size and computational complexity are reduced, deep separable convolution can still effectively capture the feature information of the input data, ensuring that the performance of the model in the classification task is not affected.
[0203] Through these improvements, the model's computational performance has been further enhanced, while its adaptability to different computing environments has been strengthened. For example, it can achieve efficient and stable performance output when running on resource-constrained embedded devices or mobile devices.
[0204] Figure 3 Feature extraction diagram
[0205] Step 3: Membership degree calculation formula and sample generation formula
[0206] Calculate fuzzy membership degree: for minority class sample x i and its potential nearest neighbor samples x j The fuzzy membership function is defined as follows:
[0207]
[0208] Where x i It is a minority class sample. It is x i The j-th minority class nearest neighbor, It is x i The j-th majority class nearest neighbor, k is the number of nearest neighbors, and d(·,·) is the Euclidean distance between samples.
[0209] Membership normalization: The membership degree is normalized to the [0,1] interval, as shown in the following formula:
[0210]
[0211] The probability of selecting the benchmark sample is calculated by dividing the normalized membership degree of each sample by the sum of the membership degrees of all samples, resulting in a probability distribution. The probability of selecting each minority class sample is calculated using the following formula:
[0212]
[0213] in, It is the sum of all normalized membership degrees.
[0214] Generate new samples: The sample generation formula is as follows:
[0215] x new =x i +λ(x j -x i )
[0216] Where, x i It is based on P(x) i The baseline sample selected by probability, x j It is x i λ is a random number between [0,1], which is randomly selected from k nearest neighbors.
[0217] Step 4, FuzzyFSSLightGBM classification
[0218] On the basis of the original LightGBM algorithm, the Focal Loss focusing loss is introduced to its original loss function, and the formula is as follows:
[0219] FL(p t )=-α t (1-p t ) γ log(p t )
[0220] Where p t represents the prediction probability of the model for the true class, defined as:
[0221]
[0222] Where p t is the probability of being predicted as a positive class, y is the true label. α t is a balance factor to balance the importance of positive and negative samples. γ is an adjustment factor to control the attention degree of difficult and easy samples. γ = 0 degenerates to ordinary cross-entropy loss, γ > 0 improves the attention degree of difficult samples, and suppresses the contribution of easy samples to loss. As for the learning rate and other key parameters, the butterfly optimization algorithm (BOA) is introduced for optimization.
[0223] The process of the improved LightGBM-based imbalanced classification model is as follows:
[0224] Figure 4 Flow chart of improved LightGBM-based imbalanced classification model
[0225] Finally, the improved LightGBM algorithm is experimentally verified to have significant performance advantages in plant safety warning problems. Specifically, based on the comparative analysis of three representative data sets designed in the experiment, the improved LightGBM algorithm shows obvious superiority in classification accuracy, unbalanced sample processing ability and model stability and other key performance indicators. The experimental results show that whether in dealing with data sets with extremely unbalanced sample class distribution or in the face of high-dimensional sample features and complex sample features, the improved model can effectively improve the accuracy and robustness of classification. Especially in the recognition rate of minority class samples, compared with other common unbalanced classification models, the method proposed in the present application shows strong adaptability and generalization performance. In addition, since LightGBM is a relatively lightweight model, the improved LightGBM algorithm has feasibility and high efficiency in practical industrial scenarios. Therefore, the present application not only outperforms traditional models in comprehensive performance, but also provides an efficient and reliable solution for plant safety warning tasks. The experimental indicators of the three data sets are shown in the following table and figure.
[0226] Table 2 Index performance under Safety Helmet Wearing Dataset
[0227]
[0228]
[0229] Table 3 Index performance under Safety Helmet and Reflective Jacket
[0230]
[0231] Table 4 Index performance under ImVisible:Pedestrian Traffic Light Dataset
[0232]
[0233] The present application provides an improved LightGBM plant safety warning system, which is specially designed for the safety management needs of high-risk industries such as industrial plants, chemical plants and power plants. Traditional safety warning systems often rely on manual monitoring and simple rule systems, which have poor data processing ability, low recognition accuracy and slow response speed, and are difficult to cope with data imbalance challenges.
[0234] The application improves the LightGBM classification algorithm through effective processing of unbalanced data, significantly improving the recognition ability of the safety warning system for minority accidents (such as not wearing safety helmets and not wearing warning clothes). Since safety accidents in actual industrial environments are often few and unevenly distributed, how to effectively identify these potential safety risks from massive monitoring data has become the core problem solved by the application. Traditional classification algorithms are prone to ignore minority classes when dealing with unbalanced data, thus reducing the accuracy and effectiveness of safety warnings. By combining the FuzzySMOTE algorithm and the improved LightGBM algorithm, the FuzzySMOTE algorithm is used to resample the minority class sample features extracted by the improved CNN in the iteration process of the weak classifier, the application can effectively identify minority class samples and improve the accuracy of the overall system.
[0235] In addition, the improved safety warning system can analyze the information extracted from the video monitoring data stream in real time, combine historical accident data, and predict potential risks through a machine learning model to provide accurate warnings. For industries such as industrial plants, the application has obvious advantages. Through the technical solution of the application, the system can identify these low-frequency, high-risk events in advance, ensuring that management personnel can receive alerts in the first time and take timely measures to prevent major safety accidents.
[0236] More importantly, the plant safety warning system of the application not only effectively reduces accidents, but also significantly improves the intelligent level of plant management. Through integrated real-time data analysis and intelligent decision support, the system can automatically adjust the warning strategy and dynamically optimize the classification model to adapt to different plant operating conditions. This intelligent upgrade makes safety management more efficient and reliable, and saves enterprises a lot of accident prevention and emergency response costs.
[0237] The present scheme designs 7 groups of comparative experiments and ablation experiments to verify the effectiveness of the method. The ablation experiments are respectively completed from the original model, the model improved after data sampling, the model after data sampling and deep separable convolution (DSP), and the model after data sampling, deep separable convolution and classification algorithm improvement. The comparative experiments are completed for different classification algorithms and different optimization algorithms. First, the improved LightGBM model is used for key parameter optimization and comparison with the current new DSPCNNNGBoost, DSPCNNCatBoost, DSPCNNSMOTEBoost, DSPCNNRUSBoost classification algorithms; on the basis of selecting the improved LightGBM model, particle swarm optimization algorithm (PSO), grey wolf optimization algorithm (GWO), firefly algorithm (FA) and butterfly optimization algorithm (BOA) are compared. The overall technical scheme has theoretical support, and it can be proved that the effect of the present scheme is improved and has feasibility. As shown in the ablation experiment of SafetyHelmetWearingDataset Figure 5 , the AUC value of the model improved by using FuzzySMOTE algorithm is increased by 0.045, the AUC value of the model combined with FuzzySMOTE algorithm and DSP is increased by 0.07, and the AUC value of the LightGBM model improved by using FuzzySMOTE algorithm and DSP is increased by 0.084, which shows that the present method has good classification performance. As shown in the comparative experiment of SafetyHelmetWearingDataset Figure 6 , compared with DSPCNNNGBoost, DSPCNNCatBoost, DSPCNNSMOTEBoost, DSPCNNRUSBoost, the AUC value of the present method is increased by 0.017, 0.007, 0.384 and 0.049 respectively, which shows that the classification effect of the present method is optimal. As shown in the ablation experiment of Safety Helmet andReflective Jacket Figure 7 , the AUC value of the model improved by using FuzzySMOTE algorithm is 0.849, the AUC value of the model combined with FuzzySMOTE algorithm and DSP is 0.854, and the AUC value of the LightGBM model improved by using FuzzySMOTE algorithm and DSP is 0.895, the whole improvement effect shows an upward trend, which shows that the present method has good classification performance. As shown in the comparative experiment of Safety Helmet andReflective Jacket Figure 8As shown, compared with DSPCNNNGBoost, DSPCNNCatBoost, DSPCNNSMOTEBoost, and DSPCNNRUSBoost, the AUC values of this method are improved by 0.045, 0.01, 0.178, and 0.134, respectively, indicating that this method has significant advantages and better classification performance compared with existing methods. The ablation experiment of the ImVisible: Pedestrian Traffic Light Dataset is shown below. Figure 9 As shown, the AUC value of the model improved using the FuzzySMOTE algorithm is 0.825, the AUC value of the model combining the FuzzySMOTE algorithm and DSP is 0.873, and the AUC value of the LightGBM model improved using the fusion of the FuzzySMOTE algorithm and DSP is 0.911, indicating that this method has better classification performance. The comparative experiment of ImVisible: Pedestrian Traffic Light Dataset is shown below. Figure 10 As shown, compared with DSPCNNNGBoost, DSPCNNCatBoost, DSPCNNSMOTEBoost, and DSPCNNRUSBoost, the AUC values of this method are improved by 0.021, 0.003, 0.033, and 0.04 respectively, indicating that the classification effect of this method is optimal and has good classification performance. The detection, visualization analysis, and camera capture of the system designed in this scheme are as follows: Figure 11 , 12 As shown in Figure 13.
[0238] It should be noted that embodiments of the present invention can be implemented using hardware, software, or a combination of both. The hardware portion can be implemented using dedicated logic; the software portion can be stored in memory and executed by a suitable instruction execution system, such as a microprocessor or dedicated-design hardware. Those skilled in the art will understand that the above-described devices and methods can be implemented using computer-executable instructions and / or included in processor control code, for example, such code provided on a carrier medium such as a disk, CD, or DVD-ROM, a programmable memory such as read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. The devices and modules of the present invention can be implemented using hardware circuitry such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, or programmable hardware devices such as field-programmable gate arrays, programmable logic devices, etc., or using software executed by various types of processors, or using a combination of the above-described hardware circuitry and software, such as firmware.
[0239] The above merely illustrates the specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any modification, equivalent replacement and improvement within the technical range disclosed by the present application and within the spirit and principle of the present application should be covered within the protection scope of the present application.
Claims
1. An improved LightGBM unbalanced classification method for plant safety early warning, characterized in that, Comprising the following steps: (1) using a deep separable convolutional neural network for feature extraction, extracting behavior features from employee behavior video data captured by a video monitoring system; (2) using fuzzy minority class oversampling technology (FuzzySMOTE) to resample the minority class samples, generate a preset number of minority class samples, and initialize the sample weight; (3) Feature bundling processing is performed on the resampled dataset, and the exclusive feature bundling (EFB) algorithm is used to generate a bundled feature set, the bundling process including calculating feature conflict, feature sorting, feature assignment and feature weight encoding; (4) The bundled feature set is input into the LightGBM model, and the gradient-aware subsampling strategy (GOSS) is used to generate large gradient and small gradient sample subsets, and a sampling dataset is constructed based on the weighting method; (5) Calculate the split gain of the split point according to the node sample gradient and split gain formula; (6) Multiple iterations are performed, all classifiers are integrated according to the learning rate and loss function gradient, and the final classifier is output; integrate the final classifier into the plant behavior monitoring system, classify and detect employee behavior in real time, automatically mark and record violations, and timely issue safety warnings; Calculate its classification error rate and weight: Compute fuzzy membership: for minority class samples and their potential nearest neighbors ; define fuzzy membership function as: ; wherein is a minority class sample, is is the jth minority class neighbor of is is the jth majority class neighbor of k is the number of neighbors, and d(·, ·) is the Euclidean distance between samples. Membership normalization: process it to [0, 1] interval, the formula is as follows: ; The probability of selecting a reference sample: divide the normalized membership of each sample by the sum of the membership of all samples to obtain a probability distribution; that is, calculate the probability of selecting each minority class sample, the formula is as follows: ; wherein, is the sum of all normalized membership degrees; Generate new samples: the sample generation formula is as follows: ; wherein, is according to a reference sample selected at random, is a random selection from the k-nearest neighbors of is a random number between [0, 1].
2. The method of claim 1, wherein, The feature extraction step of the deep separable convolutional neural network includes: decomposing the standard convolution operation into a depth convolution operation and a point-by-point convolution operation, wherein the depth convolution only performs convolution in the spatial dimension, and the point-by-point convolution uses a 1×1 convolution kernel to complete the integration between channels.
3. The method of claim 1, wherein, In the exclusive feature bundling algorithm, the conflict degree between features is calculated, and the features are assigned to existing bundled sets based on the criterion that the conflict degree does not exceed a preset threshold. If there is no set that meets the condition, a new bundled set is created.
4. The method of claim 1, wherein, The gradient-aware subsampling strategy includes: sorting the sample gradient absolute value in descending order, retaining a preset proportion of large gradient samples, and randomly sampling a preset proportion of small gradient samples from the remaining samples, and constructing a sampling dataset after assigning corresponding weights to different gradient samples.
5. The improved LightGBM imbalanced classification method for plant safety early warning of claim 1, wherein, The classification: On the basis of the original LightGBM algorithm, the Focal Loss focusing loss is introduced into the original loss function, and the formula is as follows: ; where, The predicted probability of the true class by the representative model is defined as: ; where p is the probability of being predicted as positive class, is the true label; is the balance factor, used to balance the importance of positive and negative samples; is the adjustment factor, which controls the degree of attention to difficult samples; degenerates into the ordinary cross-entropy loss, increases the attention to difficult classification samples and suppresses the contribution of easy classification samples to the loss; and for the key parameter of learning rate, the butterfly optimization algorithm (BOA) is introduced for optimization.
6. A plant safety early warning oriented improved LightGBM imbalanced classification system for implementing the plant safety early warning oriented improved LightGBM imbalanced classification method according to any one of claims 1-5, characterized in that, The improved LightGBM imbalance classification system for plant safety warning comprises: A feature extraction module for using a deep separable convolutional CNN for feature extraction; A sampling module for using FuzzySMOTE to resample the minority class samples, generate n minority class samples, and initialize the sample weight; The training module adopts the EFB and GOSS algorithms to bundle the feature vectors after feature extraction to output a feature bundle set, collects large gradient samples and small gradient samples, forms a sampled data subset, and constructs a decision tree by calculating a split gain; and the next round of circulation is performed; The iteration module still adopts the above strategy to construct gradient samples and generate a decision tree when the iteration number T is not satisfied; The integration module is configured to integrate all classifiers in the classifier pool according to a learning rate and a loss function gradient to obtain a final classifier when the iteration number T is satisfied.
7. A computer device, comprising: The computer device includes a memory and a processor, the memory stores a computer program, and the computer program is executed by the processor to make the processor execute the steps of the improved LightGBM imbalance classification method for factory safety warning in any one of claims 1-5.
8. A computer readable storage medium storing a computer program, the computer program being executed by a processor to make the processor execute the steps of the improved LightGBM imbalance classification method for factory safety warning in any one of claims 1-5.
9. An information data processing terminal, characterized by The information data processing terminal is used to implement the improved LightGBM imbalance classification system for factory safety warning in claim 6.
Citation Information
Patent Citations
Bearing fault diagnosis method, system, device and terminal
CN113834656A
Intrusion detection method based on convolutional neural network and lightweight gradient elevator
CN113901448A