Deep learning-based intelligent control method and system for explosion-proof safety cabinet
Through dynamic discrete wavelet transformation, twin neural network and Gaussian kernel function optimization control strategies, the shortcomings of explosion-proof safety cabinets in multi-dimensional state data processing and environmental image recognition are solved, and high-precision state prediction and abnormal detection are realized, improving the system's adaptability and security.
Patent Information
- Application Number
- CN202510798969.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-16
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-06-16
AI Technical Summary
The existing intelligent control technology of explosion-proof safety cabinets has shortcomings in processing multi-dimensional state data and environmental image recognition, making it difficult to accurately predict potential safety hazards, lacks an adaptive decision-making mechanism, and is unable to effectively deal with complex storage environments and emergencies, resulting in poor safety protection effects.
Dynamic discrete wavelet transformation and adaptive threshold optimization are used to process multi-dimensional state data, combined with a multi-layer causal convolutional network with a segmented recursive structure to perform state prediction; twin neural networks and local similarity area growth algorithms are used to detect environmental image anomalies; and intelligent control parameters of explosion-proof safety cabinets are generated based on Gaussian kernel functions and the expected maximization algorithm.
It improves the accuracy of state prediction and the sensitivity of abnormal detection, enhances the system's adaptability and safety, and reduces the risk of explosion and the probability of safety accidents.
Smart Images

Figure CN120335312A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of explosion-proof safety cabinet control, and particularly to an intelligent control method and system for explosion-proof safety cabinets based on deep learning. Background Art
[0002] With the continuous improvement of industrial safety standards, explosion-proof safety cabinets, as key equipment for storing dangerous goods, are widely used in fields such as petrochemical, laboratories, and pharmaceuticals. Traditional explosion-proof safety cabinets mainly rely on mechanical structures and simple electronic control systems to achieve basic safety protection functions, including fire resistance, explosion protection, ventilation, etc. In recent years, with the rapid development of intelligent technologies, applying artificial intelligence technologies such as deep learning to the explosion-proof safety cabinet control system has become a new trend in the industry, which can realize real-time monitoring of the cabinet environment, intelligent identification of abnormal states, and automated control, significantly improving the safety and reliability of dangerous goods storage.
[0003] However, the existing intelligent control technologies for explosion-proof safety cabinets still have deficiencies. The existing control systems have limited processing capabilities for multi-dimensional state data inside the cabinet, mostly using traditional signal processing methods and fixed threshold judgments, making it difficult to effectively cope with complex and changing storage environments and the characteristics of various chemicals, resulting in the inability to accurately predict potential safety hazards and a lag in the early warning mechanism; the existing systems lack efficient abnormal target detection capabilities in environmental image recognition, especially under harsh conditions such as insufficient lighting and smoke interference, the detection accuracy drops significantly, making it difficult to timely identify security threats such as the approach of suspicious personnel or unauthorized operations; the existing intelligent control methods lack an adaptive decision-making mechanism, mostly using preset fixed control logics, and unable to dynamically adjust control strategies according to real-time environmental changes and the comprehensive analysis results of multi-source information. In the face of complex or sudden situations, the emergency response ability is insufficient, and it is difficult to achieve the optimal safety protection effect. Summary of the Invention
[0004] Embodiments of the present invention provide an intelligent control method and system for explosion-proof safety cabinets based on deep learning, which can solve the problems in the prior art.
[0005] In the first aspect of the embodiments of the present invention, an intelligent control method for explosion-proof safety cabinets based on deep learning is provided, including: Collecting multi-dimensional state data and environmental image data inside the explosion-proof safety cabinet; Performing dynamic discrete wavelet transform on the multi-dimensional state data inside the cabinet to obtain a coefficient matrix, obtaining an optimized feature vector through adaptive threshold optimization, inputting the optimized feature vector into a multi-layer causal convolutional network with a segmented recursive structure, and through residual enhancement and dynamic recombination, outputting a prediction result of the internal state of the safety cabinet; Input the environmental image data into the twin neural network. Through the multi-level feature enhancement and fusion of the feature extraction branch, and optimized by the bidirectional metric loss of the metric learning branch, generate the target feature map. Analyze the target feature map by the region growing algorithm based on local similarity to obtain the abnormal target detection result. Based on the internal state prediction result of the safety cabinet and the abnormal target detection result, use the Gaussian kernel function to extract the control trajectory from the preset expert strategy library, and through expectation maximization and policy network optimization, obtain the control parameters of the explosion-proof safety cabinet. Execute the control of the explosion-proof safety cabinet according to the control parameters. When an abnormal state is detected, trigger the emergency response mechanism.
[0006] In an alternative embodiment, perform dynamic discrete wavelet transform on the multi-dimensional state data inside the cabinet to obtain the coefficient matrix, optimize it through the adaptive threshold to obtain the optimized feature vector, input the optimized feature vector into the multi-layer causal convolutional network with a segmented recursive structure, and through residual enhancement and dynamic recombination, output the internal state prediction result of the safety cabinet, including: Perform dynamic discrete wavelet transform on the multi-dimensional state data inside the cabinet, construct wavelet functions and scaling functions based on the Daubechies wavelet basis function family, perform multi-layer wavelet decomposition on the multi-dimensional state data inside the cabinet according to the wavelet functions and scaling functions, and obtain the approximation coefficient matrix and the detail coefficient matrix. Based on the approximation coefficient matrix and the detail coefficient matrix, calculate the adaptive threshold parameter through the product relationship of the signal length, noise standard deviation, and signal-to-noise ratio, substitute the adaptive threshold parameter into the soft threshold function, perform optimization processing on the approximation coefficient matrix and the detail coefficient matrix, and generate the optimized feature vector. Construct a multi-layer causal convolutional network with a segmented recursive structure, introduce a residual learning unit between adjacent layers to enhance the features, adjust the receptive field range of each layer according to the preset sequence of dilation rate parameters, perform causal convolution operations on the convolutional kernel of each layer and the output features of the previous layer, and perform feature mapping in a piecewise linear manner to obtain the intermediate feature representation. Input the optimized feature vector into the multi-layer causal convolutional network with a segmented recursive structure, perform feature measurement and dynamic recombination through the intermediate feature representation, perform probability normalization processing after iterative optimization and weighted fusion, and output the state prediction probability distribution as the final prediction result.
[0007] In an alternative embodiment, perform feature measurement and dynamic recombination through the intermediate feature representation, perform probability normalization processing after iterative optimization and weighted fusion, and output the state prediction probability distribution as the final prediction result, including: Construct a feature measurement matrix according to the statistical distribution of the intermediate feature representation, calculate the Mahalanobis distance between feature pairs by extracting the mean and covariance of the intermediate feature representation, and generate the feature similarity matrix. Divide the intermediate feature representation into multiple feature recombination groups according to a preset similarity threshold, calculate the within-group variance for each feature recombination group, and set the feature weight coefficient by combining the feature information content; Optimize each feature recombination group by using the gradient iteration method. During the iteration process, update the parameters of the feature recombination group and calculate the recombination error. Stop the iteration when the recombination error is less than the preset error threshold or reaches the preset number of iterations; Perform feature fusion on the optimized feature recombination groups through the weight weighting method to obtain the recombined features, perform normalization processing on the recombined features and introduce a regulation factor, and output the state prediction probability distribution as the final prediction result.
[0008] In an alternative embodiment, input the environmental image data into a siamese neural network. Through the multi-level feature enhancement and fusion of the feature extraction branch and the optimization of the bidirectional metric loss of the metric learning branch, generate the target feature map including: Input the environmental image data into the feature extraction branch of the siamese neural network with a dual-branch structure. The feature extraction branch sets feature enhancement modules at different levels of the backbone network, generates the corresponding weight matrix based on each layer of feature map through single-channel convolution operation and normalization function, multiply each layer of feature map with the corresponding weight matrix element by element to obtain the enhanced feature map of each layer, and cascade and fuse all the enhanced feature maps to obtain the fused feature map; Based on the fused feature map, extract the anchor sample feature, positive sample feature, and negative sample feature through the metric learning branch of the siamese neural network; Calculate the distance between the anchor sample feature and the positive sample feature to obtain the positive sample distance value, calculate the distance between the anchor sample feature and the negative sample feature to obtain the negative sample distance value, and construct a feature space loss function based on the positive sample distance value and the negative sample distance value; Construct a semantic space loss function based on the conditional probability between the anchor sample feature and the positive sample feature, and the conditional probability between the anchor sample feature and the negative sample feature; Fuse the feature space loss function and the semantic space loss function with weights to obtain a bidirectional metric loss function, and optimize the target feature map through the backpropagation of the bidirectional metric loss function.
[0009] In an alternative embodiment, analyze the target feature map based on the region growing algorithm of local similarity to obtain the abnormal target detection result including: Calculate the feature distance between each feature position in the target feature map and the corresponding neighboring feature positions, substitute the feature distance into the kernel function to obtain the local similarity value, construct the local similarity matrix, select the feature position with the largest similarity value in the local similarity matrix as the seed point, determine the initial region of a preset size centered on the seed point, calculate the mean and standard deviation of all similarity values within the initial region, set the region growth threshold, incorporate adjacent feature positions with similarity values greater than the region growth threshold into the current region to obtain the updated region, and repeat the execution until the difference in the number of feature positions of the updated regions in two consecutive adjacent iterations is less than the preset difference threshold, thereby obtaining the candidate target region; Calculate the average feature distance between all feature positions within the candidate target region to obtain the intra-region feature distance value, calculate the average feature distance between the candidate target region and the background region to obtain the inter-region feature distance value, multiply the intra-region feature distance value and the inter-region feature distance value by the preset weight coefficients respectively, sum them to obtain the anomaly score value, and determine the position information and score information of the anomaly target based on the anomaly score value to determine the anomaly target detection result.
[0010] In an alternative embodiment, based on the prediction result of the internal state of the safety cabinet and the anomaly target detection result, the Gaussian kernel function is used to extract the control trajectory from the preset expert policy library, and through expectation maximization and policy network optimization, the control parameters of the explosion-proof safety cabinet are obtained, including: Represent the expert control policy as a sequence of state-action pairs, including the in-cabinet state vector and the control action vector, and the control action vector includes the refrigeration power parameter, the exhaust frequency parameter, and the locking force parameter; Construct the prediction result of the internal state of the safety cabinet and the anomaly target detection result into a state vector, calculate the Euclidean distance between the state vector and the state vectors in the state-action pair sequence, substitute the Euclidean distance into the Gaussian kernel function to obtain the similarity value, and select the preset number of expert trajectories with the highest similarity value; Based on the selected expert trajectories, iteratively calculate the mixing weight parameters, mean parameters, and covariance parameters of the Gaussian mixture distribution through the expectation maximization algorithm until the change amount of the log-likelihood function value is less than the preset change threshold to obtain the action prior probability distribution; Input the action prior probability distribution into the policy network, calculate the control reward value based on the current state, use the KL divergence between the control reward value and the probability distribution output by the policy network as a constraint term to construct the optimization objective function; calculate the gradient value based on the optimization objective function, update the policy network parameters in combination with the adaptive learning rate, and generate the optimized policy model; Input the current state into the optimized policy model to generate the refrigeration power parameter value, the exhaust frequency parameter value, and the locking force parameter value, and determine the control parameters of the explosion-proof safety cabinet.
[0011] In the second aspect of the embodiments of the present invention, there is provided an intelligent control system for an explosion-proof safety cabinet based on deep learning, including: A first unit for collecting multi-dimensional in-cabinet state data and environmental image data of the explosion-proof safety cabinet; A second unit for performing dynamic discrete wavelet transform on the multi-dimensional in-cabinet state data to obtain a coefficient matrix, obtaining an optimized feature vector through adaptive threshold optimization, inputting the optimized feature vector into a multi-layer causal convolutional network with a segmented recursive structure, and outputting a prediction result of the internal state of the safety cabinet through residual enhancement and dynamic recombination; A third unit for inputting the environmental image data into a Siamese neural network, generating a target feature map through multi-level feature enhancement and fusion of the feature extraction branch and optimization of the bidirectional metric loss of the metric learning branch; analyzing the target feature map by a region growing algorithm based on local similarity to obtain an abnormal target detection result; A fourth unit for extracting a control trajectory from a preset expert policy library based on the prediction result of the internal state of the safety cabinet and the abnormal target detection result by using a Gaussian kernel function, and obtaining control parameters of the explosion-proof safety cabinet through expectation maximization and policy network optimization; A fifth unit for performing control of the explosion-proof safety cabinet according to the control parameters, and triggering an emergency response mechanism when an abnormal state is detected.
[0012] In the third aspect of the embodiments of the present invention, there is provided an electronic device, including: A processor; A memory for storing instructions executable by the processor; Wherein, the processor is configured to call the instructions stored in the memory to execute the method described above.
[0013] In the fourth aspect of the embodiments of the present invention, there is provided a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method described above is implemented.
[0014] In the embodiments of the present invention, by adopting dynamic discrete wavelet transform and adaptive threshold optimization to process the multi-dimensional state data inside the cabinet, and combining with a multi-layer causal convolutional network with a segmented recursive structure, high-precision prediction of the internal state of the explosion-proof safety cabinet is achieved, effectively improving the adaptability of the system to complex environments and the accuracy of state assessment; combining the Siamese neural network with the region growing algorithm of local similarity for environmental image analysis, through multi-level feature enhancement and bidirectional metric loss optimization, the detection efficiency and accuracy of abnormal targets are significantly improved, the false alarm rate is reduced, and the robustness of the system under different lighting conditions and complex backgrounds is enhanced; a control strategy optimization framework constructed based on the Gaussian kernel function and the expectation maximization algorithm realizes the intelligent control and emergency disposal of the explosion-proof safety cabinet, enabling the system to adaptively adjust control parameters according to the dynamic changes of the internal state and external environment, improving the safety and reliability of the system, and reducing the probability of explosion risk and safety accidents. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 is a schematic flowchart of the intelligent control method for an explosion-proof safety cabinet based on deep learning according to an embodiment of the present invention; Figure 2 is a comparison diagram of the optimization iteration process of feature recombination groups; Figure 3 is a bubble chart comparing the performance and computing resources of the anomaly detection method. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0016] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0017] The technical solutions of the present invention will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0018] Figure 1 is a schematic flowchart of the intelligent control method for an explosion-proof safety cabinet based on deep learning according to an embodiment of the present invention, as Figure 1 shown, the method includes: Collect the multi-dimensional state data inside the explosion-proof safety cabinet and the environmental image data; Perform dynamic discrete wavelet transform on the multi-dimensional state data in the cabinet to obtain a coefficient matrix, optimize it through an adaptive threshold to obtain an optimized feature vector, input the optimized feature vector into a multi-layer causal convolutional network with a segmented recursive structure, and after residual enhancement and dynamic recombination, output the prediction result of the internal state of the safety cabinet; Input the environmental image data into a siamese neural network, enhance and fuse the multi-level features of the feature extraction branch, and optimize through the bidirectional metric loss of the metric learning branch to generate a target feature map; Analyze the target feature map based on the region growing algorithm of local similarity to obtain the abnormal target detection result; Based on the prediction result of the internal state of the safety cabinet and the abnormal target detection result, use the Gaussian kernel function to extract the control trajectory from the preset expert strategy library, and through expectation maximization and policy network optimization, obtain the control parameters of the explosion-proof safety cabinet; Execute the explosion-proof safety cabinet control according to the control parameters, and trigger the emergency response mechanism when an abnormal state is detected.
[0019] In an optional implementation manner, performing dynamic discrete wavelet transform on the multi-dimensional state data in the cabinet to obtain a coefficient matrix, optimizing it through an adaptive threshold to obtain an optimized feature vector, inputting the optimized feature vector into a multi-layer causal convolutional network with a segmented recursive structure, and after residual enhancement and dynamic recombination, the output of the prediction result of the internal state of the safety cabinet includes: Perform dynamic discrete wavelet transform on the multi-dimensional state data in the cabinet, construct wavelet functions and scaling functions based on the Daubechies wavelet basis function family, perform multi-layer wavelet decomposition on the multi-dimensional state data in the cabinet according to the wavelet functions and scaling functions, and obtain an approximate coefficient matrix and a detail coefficient matrix; Based on the approximate coefficient matrix and the detail coefficient matrix, calculate the adaptive threshold parameter through the product relationship of the signal length, noise standard deviation, and signal-to-noise ratio, substitute the adaptive threshold parameter into the soft threshold function, perform optimization processing on the approximate coefficient matrix and the detail coefficient matrix, and generate an optimized feature vector; Construct a multi-layer causal convolutional network with a segmented recursive structure, introduce a residual learning unit between adjacent layers to enhance the features, adjust the receptive field range of each layer according to the preset sequence of dilation rate parameters, perform causal convolution operations on the convolutional kernel of each layer and the output features of the previous layer, and perform feature mapping in a piecewise linear manner to obtain an intermediate feature representation; Input the optimized feature vector into a multi-layer causal convolutional network with a segmented recursive structure, perform feature measurement and dynamic recombination through the intermediate feature representation, perform probability normalization processing after iterative optimization and weighted fusion, and output the state prediction probability distribution as the final prediction result.
[0020] In a specific embodiment, the internal state data of the safety cabinet usually includes multi-dimensional signals, such as parameters like temperature, humidity, radiation dose, pressure, etc. These data first need to be preprocessed, and the original multi-dimensional state data is normalized so that the data range of each dimension is unified to the interval [0, 1], which is convenient for subsequent processing. The normalized data is segmented into data segments with a length of 1024, and there is a 25% overlapping area between each segment of data to ensure signal continuity.
[0021] When performing dynamic discrete wavelet transform on the preprocessed data, based on the Daubechies wavelet basis function family, specifically, Daubechies-4 (db4) is selected as the basic wavelet function. When constructing the wavelet function, the db4 wavelet function is adjusted through the shift coefficient and the scale parameter. In practical applications, the value range of the shift coefficient is from 0 to 7, and the scale parameter takes integer powers of 2, with a range from 2 0 to 2 8 . Perform 4-layer wavelet decomposition on each data segment to generate an approximation coefficient matrix A and detail coefficient matrices D1, D2, D3, D4. Among them, the A matrix reflects the low-frequency information of the signal, and the D1 to D4 matrices respectively correspond to the detail information of different frequency bands.
[0022] After obtaining the coefficient matrix, it is necessary to perform optimization processing through an adaptive threshold. The calculation method of the threshold parameter combines three factors: the signal length N, the noise standard deviation σ, and the signal-to-noise ratio SNR, and is expressed as the threshold T equal to σ multiplied by (2 log N) 1 / 2 and then multiplied by (1 + 0.2 / (log(SNR + 1))). In practical applications, the estimation of the noise standard deviation is obtained by dividing the median absolute deviation of the detail coefficient D1 by 0.6745. When the safety cabinet is in a stable state, the estimated value is about 0.032; in an interference state, this value rises to about 0.087. The signal-to-noise ratio SNR is calculated by the ratio of the variance of the original signal to the variance of the noise, and the typical value range is between 12 dB and 25 dB.
[0023] After determining the threshold T, a soft threshold function is used to optimize the coefficient matrix. When the absolute value of the coefficient is less than T, the coefficient is set to zero; when the absolute value of the coefficient is greater than or equal to T, the coefficient value is subtracted by T and the sign is retained. For example, when T = 0.25, for the coefficient 0.4, after optimization, it is 0.15; for the coefficient -0.3, after optimization, it is -0.05; for the coefficient 0.2, since it is less than the threshold, after optimization, it is 0. The optimized coefficient matrix is reorganized and flattened to generate an optimized feature vector, and the dimension is about 40% of the original data dimension, effectively reducing feature redundancy.
[0024] When constructing a multi-layer causal convolutional network with a segmented recursive structure, the network contains a total of 8 convolutional layers, each layer contains 32 filters, and the filter size is 3. The dilation rate parameter sequence is set to [1, 2, 4, 8, 16, 32, 1, 1], so that the receptive field range expands from the initial 3 time steps to nearly 256 time steps. The segmented recursive structure means that every 3 layers form a recursive unit, and the features inside the unit can flow cyclically, and the number of cycles is set to 3.
[0025] The residual enhancement mechanism is realized by adding residual connections after the 2nd, 4th, and 6th layers. Specifically, the output of the current layer is element-wise added to the features of the previous layer, and then processed by a normalization layer. For example, the output features [0.3, 0.5, 0.2] of the 2nd layer are added to the input features [0.2, 0.4, 0.1] to get [0.5, 0.9, 0.3], and then the final output is obtained through normalization.
[0026] In the network training stage, a dataset containing 10,000 safety cabinet state sequences is used, and each sequence contains 128 time steps of data. The training batch size is set to 64, the initial learning rate is 0.001, and the cosine annealing scheduling strategy is adopted, and the total number of training epochs is 200. During the training process, the state prediction accuracy on the validation set is improved from the initial 78.3% to the final 94.7%.
[0027] For the newly input optimized feature vector, the network generates an intermediate feature representation through 8-layer convolution processing. Each layer of convolution operation can be expressed as: the output of the current layer is equal to the causal convolution result of the convolution kernel and the output of the previous layer plus the bias, and then processed by a piecewise linear activation function. The piecewise linear function outputs 0 when the input is less than 0, outputs the input when the input is between 0 and 6, and outputs 6 when the input is greater than 6. For example, the input [-2, 3, 8] is processed by the piecewise linear function to get [0, 3, 6].
[0028] In the feature measurement and dynamic reorganization stage, the attention mechanism is used to weight the intermediate feature representation. In the specific implementation, the cosine similarity between each feature vector and the reference feature vector is calculated as the weight, and the similarity value range is between [-1, 1], and after being normalized by the softmax function, it is used as the fusion weight. For example, the similarities [0.8, 0.3, -0.2] of three feature vectors are normalized to get the weights [0.68, 0.23, 0.09], and the final feature is obtained through weighted summation.
[0029] The final output layer maps the fused features through a fully connected layer into the prediction results, including several possible states inside the safety cabinet and their probability distributions. The prediction results are represented as a 5-dimensional probability vector, corresponding to five states: normal, abnormal temperature, abnormal humidity, abnormal radiation, and comprehensive abnormality. The state with the highest probability is taken as the final prediction result. At the same time, a probability threshold of 0.85 is set, and the prediction results below this threshold are marked as "other states" and need further observation and confirmation.
[0030] In this embodiment, the soft threshold processing is performed on the approximate coefficients and detail coefficients after wavelet decomposition by using an adaptive threshold (based on the product relationship of signal length, noise standard deviation, and signal-to-noise ratio), which can suppress the noise components while retaining the main features, so as to obtain a more representative optimized feature vector and improve the feature signal-to-noise ratio; a multi-layer causal convolutional network with a segmented recursive structure is constructed, a residual learning unit is introduced between layers, and the receptive field range of each layer is adjusted through a preset dilation rate parameter string, so that the convolutional kernel can take into account the temporal dependence relationships of both near neighbors and distant neighbors; at the same time, the piecewise linear mapping performs a non-linear transformation on the features to achieve the enhancement and multi-scale fusion of feature representations and improve the network's ability to capture temporal patterns; the optimized feature vector is input into the recursive structure network, and the feature measurement and dynamic recombination are carried out through the intermediate feature representation, and combined with the iterative optimization and weighted fusion mechanism, the multi-level information can be adaptively integrated; finally, the state prediction probability distribution is output in the probability normalization link, making the prediction results have better robustness and interpretability, and significantly improving the accuracy and stability of state prediction.
[0031] In an alternative embodiment, the feature measurement and dynamic recombination are carried out through the intermediate feature representation, and after iterative optimization and weighted fusion, the probability normalization processing is performed, and the output state prediction probability distribution as the final prediction result includes: Construct a feature measurement matrix according to the statistical distribution of the intermediate feature representation, calculate the Mahalanobis distance between feature pairs by extracting the mean and covariance of the intermediate feature representation, and generate a feature similarity matrix; Divide the intermediate feature representation into multiple feature recombination groups according to a preset similarity threshold, calculate the within-group variance for each feature recombination group, and set the feature weight coefficient in combination with the feature information content; Adopt the gradient iteration method to optimize each feature recombination group. During the iteration process, update the parameters of the feature recombination group and calculate the recombination error. Stop the iteration when the recombination error is less than the preset error threshold or reaches the preset number of iterations; fuse the optimized feature recombination groups through weight weighting to obtain the recombined features, perform normalization processing on the recombined features and introduce a regulation factor, and output the state prediction probability distribution as the final prediction result.
[0032] In a specific implementation, a feature metric matrix is constructed, and this process is based on the statistical distribution characteristics of the intermediate feature representation. Specifically, the intermediate layer feature representation is extracted from the neural network, and the mean vector and covariance matrix are calculated for each feature vector. For two feature vectors i and j, their similarity is measured by calculating the Mahalanobis distance, and the calculation method is the transpose of the difference between the feature vectors multiplied by the inverse matrix of the covariance matrix and then multiplied by the difference between the feature vectors. In actual operation, assuming that the extracted feature dimension is 256, the system will generate a 256×256 similarity matrix, and each element in the matrix represents the similarity value between the corresponding feature pairs. The value range is from 0 to 1, and the larger the value, the higher the similarity.
[0033] Based on the generated feature similarity matrix, a similarity threshold (such as 0.75) is set to divide the feature space into multiple feature recombination groups. The division process uses the hierarchical clustering method. Starting from the feature pairs with the highest similarity, the features with similarity higher than the threshold are gradually merged to form different feature groups. The 256-dimensional features may be divided into 5-8 different feature recombination groups. For each feature recombination group, the within-group variance is calculated to reflect the dispersion degree of the features within the group. At the same time, the feature weight coefficient is set in combination with the feature information amount (calculated by the entropy of the feature activation value). For example, for a feature group with a within-group variance of 0.23 and an information entropy of 2.35, the weight coefficient can be set to 0.85; while for a feature group with a within-group variance of 0.47 and an information entropy of 1.68, the weight coefficient can be set to 0.62.
[0034] The optimization of the feature recombination groups is carried out in a gradient iteration manner. In each round of iteration, the random gradient descent algorithm is used to update the parameters of the feature recombination groups, including the weight allocation of each feature within the feature group and the inter-group relationship parameters. The recombination error is calculated during the update process, and this error reflects the difference between the recombined features and the original task objective. The error calculation combines the mean square error and the cross-entropy loss function, so that the optimization process takes into account both the feature reconstruction accuracy and the classification accuracy. The preset error threshold is 0.05, and the maximum number of iterations is 200 rounds. In actual tests, usually after 120-150 rounds of iteration, the recombination error can be reduced to below 0.048, reaching the convergence condition.
[0035] After the optimization is completed, the feature recombination groups are fused by weighted averaging. Suppose there are 6 feature recombination groups with weights of 0.92, 0.84, 0.78, 0.65, 0.53, and 0.41 respectively. The features of each group are weighted and averaged according to the weight ratio to obtain the fused recombination features. The recombination features are normalized to map the feature values to the interval [0, 1] to reduce the impact caused by differences in different feature dimensions. Finally, an adjustable factor (with a value range of 0.6 - 1.2 and a default value of 0.8) is introduced to balance the sensitivity and specificity of the model. The normalized features are converted into a probability distribution through the softmax function as the prediction result of the safety cabinet state. For example, for the detection of a certain safety cabinet state, the probability of the normal state can be output as 0.92, the probability of the slightly abnormal state as 0.07, and the probability of the severely abnormal state as 0.01.
[0036] Analyze the monitoring data of an explosion-proof safety cabinet, collect sensor data including temperature, humidity, vibration, gas concentration, etc., and form multi-modal feature inputs. Through the above feature fusion optimization method, the 256-dimensional intermediate features are divided into 7 feature recombination groups. After 138 rounds of iterative optimization, the recombination error is reduced, and the final model achieves an accuracy of 94.6% in the abnormal state detection task. Especially for the recognition of slightly abnormal states, the sensitivity is increased from the original 83.5% to 91.7%, significantly reducing the false negative rate.
[0037] In the prior art, the intelligent control of explosion-proof safety cabinets mainly uses rule-based methods or simple machine learning models for state monitoring, suffering from problems such as insufficient feature utilization, inadequate consideration of the correlation between different features, and low sensitivity to slightly abnormal conditions. Traditional methods usually use linear weighting or principal component analysis for feature fusion and cannot effectively handle the complex non-linear feature relationships in deep learning models. The method of this embodiment starts from the statistical distribution characteristics of deep features, introduces the Mahalanobis distance to measure feature similarity, realizes feature grouping and recombination based on statistical significance, and overcomes the problem of insufficient feature correlation analysis in traditional methods. By introducing within-group variance and information quantity evaluation, the weights of different feature groups are dynamically adjusted to improve the sensitivity of the model to key features. The feature recombination parameters are optimized by gradient iteration, and an adjustable factor is combined to balance the sensitivity and specificity of the model, effectively improving the detection ability of slightly abnormal states, significantly reducing the false negative rate while maintaining a high accuracy, and improving the safety operation guarantee level of explosion-proof safety cabinets.
[0038] As Figure 2As shown, it presents the curve of the recombination error varying with the number of iterations during the feature recombination optimization process. The method of this embodiment uses Mahalanobis distance combined with gradient optimization. Starting from the initial error of 0.187, it drops to 0.048 after 138 rounds of iteration, far lower than the preset error threshold of 0.05. In contrast, the traditional PCA fusion method can only reduce the error to 0.083 after 200 rounds of iteration, and the error of the linear weighted method stays at a relatively high level of 0.112. Notably, the method of this embodiment experiences a rapid error decline stage during the 50th - 80th rounds of iteration, with the error dropping from 0.121 to 0.073, indicating that the feature recombination parameters are significantly optimized during this stage. In subsequent iterations, although the error decline rate slows down, it still maintains a stable downward trend until the 138th round reaches the convergence condition. This optimization process verifies the remarkable effect of this solution in feature fusion optimization. In an alternative embodiment, the environmental image data is input into a Siamese neural network. Through the multi - level feature enhancement and fusion of the feature extraction branch and the optimization of the bidirectional metric loss of the metric learning branch, the generated target feature map includes: Input the environmental image data into the feature extraction branch of a Siamese neural network with a dual - branch structure. The feature extraction branch sets feature enhancement modules at different levels of the backbone network, generates the corresponding weight matrix based on each layer of the feature map through single - channel convolution operation and normalization function, multiplies each layer of the feature map element - by - element with the corresponding weight matrix to obtain the enhanced feature map of each layer, and cascades and fuses all the enhanced feature maps to obtain a fused feature map; Based on the fused feature map, extract the anchor sample feature, positive sample feature, and negative sample feature through the metric learning branch of the Siamese neural network; Calculate the distance between the anchor sample feature and the positive sample feature to obtain the positive sample distance value, calculate the distance between the anchor sample feature and the negative sample feature to obtain the negative sample distance value, and construct a feature space loss function based on the positive sample distance value and the negative sample distance value; Construct a semantic space loss function based on the conditional probability between the anchor sample feature and the positive sample feature, and the conditional probability between the anchor sample feature and the negative sample feature; Weight - fuse the feature space loss function and the semantic space loss function to obtain a bidirectional metric loss function, and optimize the target feature map through the backpropagation of the bidirectional metric loss function.
[0039] In a specific embodiment, environmental image data is collected as input. The environmental image data can include various images such as indoor and outdoor scenes, road environments, natural landscapes, etc. In a specific implementation, the collected image resolution is 1920×1080 pixels, represented by RGB three - channel colors, and is pre - processed by standardization to normalize the pixel values to the range of [-1, 1].
[0040] After the preprocessing of the image data is completed, it is input into the Siamese neural network for processing. The Siamese neural network consists of two main parts: a feature extraction branch and a metric learning branch. The feature extraction branch uses ResNet-50 as the backbone network, and feature enhancement modules are set at four different levels, namely conv2, conv3, conv4, and conv5 of this network. The working principle of each feature enhancement module is as follows: for the input feature map \(F_i\) (with a size of \(C\times H\times W\), where \(C\) is the number of channels, and \(H\) and \(W\) are the height and width respectively), the number of channels is reduced to 1 through a \(1\times1\) convolution to obtain a single-channel feature map \(A_i\) (with a size of \(1\times H\times W\)). Subsequently, the Sigmoid activation function is applied to normalize \(A_i\) to obtain a weight matrix \(M_i\) (with a value range of 0 to 1). The weight matrix \(M_i\) represents the importance of each spatial position, and the larger the value, the greater the contribution of that position to the target feature. The original feature map \(F_i\) is multiplied element-wise with the weight matrix \(M_i\) to obtain the enhanced feature map \(E_i\). In a specific example, for the conv3 feature map with a size of \(256\times56\times56\), the size of the weight matrix generated after feature enhancement is \(1\times56\times56\), and the dimension of the enhanced feature map remains \(256\times56\times56\) unchanged, but the weight distribution highlights the key regions more prominently.
[0041] After the enhancement of the features at each level is completed, all the enhanced feature maps are concatenated and fused. Specifically, the feature maps with different spatial dimensions are adjusted to the same size through adaptive average pooling. For example, all the feature maps are pooled to a size of \(7\times7\), and then they are concatenated in the channel dimension to form a fused feature map \(G\). Taking ResNet-50 as an example, the number of channels of the conv2, conv3, conv4, and conv5 layers are 256, 512, 1024, and 2048 respectively. After pooling and concatenation, a fused feature map with a dimension of \(3840\times7\times7\) is obtained.
[0042] The fused feature map is reduced to a 512-dimensional vector through a fully connected layer as the final feature representation for subsequent metric learning. The metric learning branch adopts the triplet loss mechanism. In each training batch, 32 anchor sample images are randomly selected, and a positive sample (an image of the same class) and a negative sample (an image of a different class) are paired for each anchor sample. For each triplet, the anchor sample feature \(f_a\), the positive sample feature \(f_p\), and the negative sample feature \(f_n\) are respectively extracted through the feature extraction branch.
[0043] In the metric learning stage, a bidirectional metric loss function is constructed. In the feature space, the Euclidean distance \(d_p\) between the anchor sample feature and the positive sample feature is calculated, and the Euclidean distance \(d_n\) between the anchor sample feature and the negative sample feature is calculated. The positive sample distance is usually controlled between 0.2 - 0.5, while the negative sample distance is greater than 0.8. Based on these distance values, a feature space loss function \(L_f\) is constructed, aiming to minimize the distance between the anchor sample and the positive sample, while maximizing the distance between the anchor sample and the negative sample, and introducing a margin parameter \(\alpha\) (set to 0.2) to ensure sufficient discriminability.
[0044] Meanwhile, a loss function \(L_s\) is constructed in the semantic space. The loss function \(L_s\) is calculated based on conditional probabilities. The conditional probabilities \(p(y_p|f_a)\) and \(p(y_n|f_a)\) are calculated using the inner products of the anchor sample feature with the positive and negative sample features respectively, where \(y_p\) and \(y_n\) represent the labels of the positive and negative samples respectively. The discriminability of the feature representation in the semantic space is optimized by maximizing \(p(y_p|f_a)\) while minimizing \(p(y_n|f_a)\).
[0045] The feature space loss function \(L_f\) and the semantic space loss function \(L_s\) are fused through a weight \(\lambda\) (set to 0.4) to form a bidirectional metric loss function \(L = L_f+\lambda L_s\). The network optimizes this loss function through the backpropagation algorithm, with a learning rate set to 0.0001, a batch size of 32, and the Adam optimizer is used for parameter update, and it is trained for 100 epochs.
[0046] The trained siamese neural network can extract highly discriminative feature representations from environmental images. Under the dual constraints of the feature space and the semantic space, samples of the same class cluster in the feature space, and samples of different classes are clearly distinguishable. Experiments show that compared with the method using a single loss function, the bidirectional metric method in this embodiment has improved performance in the environmental image feature extraction task and can still maintain stable feature extraction ability under different lighting, viewing angle, and occlusion conditions. The generated target feature maps can effectively support subsequent tasks such as image retrieval, scene recognition, and environmental understanding.
[0047] In this embodiment, feature enhancement modules are added at different levels of the backbone network. Weights are generated using single-channel convolution and normalization, and the feature maps of each layer are weighted and then cascaded and fused, enabling the model to take into account both the details and the overall structure of the image, and improving the ability to capture complex backgrounds and weak information. The Siamese network extracts the features of anchor, positive, and negative samples respectively, calculates the positive and negative distances, and constructs a feature space loss, making the features of similar samples more aggregated and those of dissimilar samples more separated, significantly enhancing the ability to distinguish similar objects. In addition to the distance-based feature space loss, a semantic space loss based on conditional probability is introduced, enabling samples to be distinguished both geometrically and semantically, improving the robustness and accuracy of retrieval or matching. The two-way metric loss is used for backpropagation to adaptively adjust the parameters of the feature extraction and enhancement modules, ensuring that the finally output feature maps achieve the best in terms of discrimination, robustness, and semantic expression, providing a more reliable feature representation for subsequent object recognition or retrieval.
[0048] In an alternative embodiment, the target feature map is analyzed by a region growing algorithm based on local similarity, and the abnormal target detection results include: Calculate the feature distance between each feature position in the target feature map and its corresponding neighboring feature position, substitute the feature distance into the kernel function to obtain the local similarity value, construct a local similarity matrix, select the feature position with the largest similarity value in the local similarity matrix as the seed point, determine an initial region of a preset size centered on the seed point, calculate the mean and standard deviation of all similarity values within the initial region, set the region growing threshold, incorporate adjacent feature positions with similarity values greater than the region growing threshold into the current region to obtain an updated region, and repeat until the difference in the number of feature positions of the updated regions in two consecutive adjacent iterations is less than a preset difference threshold, obtaining a candidate target region; Calculate the average feature distance between all feature positions within the candidate target region to obtain the in-region feature distance value, calculate the average feature distance between the candidate target region and the background region to obtain the inter-region feature distance value, multiply the in-region feature distance value and the inter-region feature distance value by preset weight coefficients respectively, sum them to obtain an abnormal score value, and determine the location information and score information of the abnormal target based on the abnormal score value, determining the abnormal target detection result.
[0049] In a specific embodiment, the feature distance is calculated between each feature position in the target feature map and its neighboring feature position. The feature distance can be calculated using the Euclidean distance calculation method. For the position (i, j) and its neighboring position (m, n) in the feature map, the feature distance is the square root of the sum of the squares of the differences of the corresponding components of the two position feature vectors. For example, if the feature vector of position (i, j) is [0.2, 0.3, 0.5] and the feature vector of position (m, n) is [0.1, 0.4, 0.6], then the feature distance between them is calculated as 0.173.
[0050] Substitute the calculated feature distance into the kernel function to obtain the local similarity value. The Gaussian kernel function can be selected as the kernel function. When the feature distance is 0.173 as mentioned above, if the parameter σ of the Gaussian kernel function is set to 0.2, the calculated similarity value is 0.826, indicating a relatively high similarity degree of features at two positions. Perform this calculation for all feature positions in the target feature map and their neighborhoods to construct a complete local similarity matrix.
[0051] In the constructed local similarity matrix, find the feature position with the largest similarity value as the seed point. For example, if in a feature map with a size of 128×128, the local similarity value at position (45, 67) is the highest at 0.985, then select this position as the seed point. Determine an initial region with a preset size centered on this seed point. The initial region size can be set as a 7×7 pixel window, that is, it includes the seed point (45, 67) and a total of 49 feature positions around it.
[0052] Calculate the mean and standard deviation of all similarity values within the initial region. Suppose the calculated mean is 0.875 and the standard deviation is 0.068. Set the region growing threshold based on these two statistics. The mean minus a multiple of the standard deviation can be used as the threshold. For example, the threshold = 0.875 - 1.5×0.068 = 0.773. Incorporate adjacent feature positions with similarity values greater than this threshold into the current region to form an updated region.
[0053] During the region growing process, calculate the similarity values of all feature positions within the updated region in each iteration and compare them with the threshold. Add new positions that meet the conditions to the region. For example, the initial region contains 49 positions. After the first iteration, the region may expand to 78 positions, and after the second iteration, it expands to 102 positions. When the difference in the number of feature positions in the updated region between two consecutive iterations is less than a preset difference threshold (such as 3 positions), stop the region growing to obtain the final candidate target region. For example, after the tenth iteration, the region contains 189 positions, and after the eleventh iteration, it contains 191 positions. The difference is 2, which is less than the preset threshold of 3, so stop the iteration and determine the region containing 191 feature positions as the candidate target region.
[0054] Perform anomaly scoring calculation on the obtained candidate target region. Calculate the average feature distance between all pairs of feature positions within the candidate target region to obtain the feature distance value within the region. For example, for a candidate region containing 191 feature positions, the average value of the feature distances of all pairs of feature positions within the region may be 0.128, indicating a relatively high similarity degree of features within the region.
[0055] Calculate the average feature distance between the candidate target region and the background region to obtain the inter-region feature distance value. The background region can be defined as all feature positions except the candidate target region. Randomly sample 1000 pairs of feature positions from the candidate region and the background region respectively, and calculate the average feature distance between them. Suppose the obtained value is 0.582, indicating a large feature difference between the target region and the background region.
[0056] Multiply the intra-region feature distance value and the inter-region feature distance value by the preset weight coefficients respectively and sum them to obtain the anomaly score value. The preset intra-region feature distance weight can be -1.0, and the inter-region feature distance weight can be 2.0. Then the anomaly score value is calculated as -1.0×0.128 + 2.0×0.582 = 1.036. The higher the anomaly score value, the greater the possibility that the region is an abnormal target.
[0057] Set an anomaly score threshold (such as 0.8). When the calculated anomaly score value is greater than this threshold, determine that the candidate region is an abnormal target. Record the location information (such as the center coordinates of the region, the bounding box of the region, etc.) and the score information (such as the calculated anomaly score value) of the abnormal target as the final result of the abnormal target detection. In this example, the anomaly score value 1.036 is greater than the threshold 0.8, so it is determined that the candidate region is an abnormal target. Its location information is the center coordinates (45, 67), the bounding box is a 30×30 pixel region centered at this point, and the score is 1.036.
[0058] The method of this embodiment scores and filters multiple candidate target regions, and can handle the situation where multiple abnormal targets exist simultaneously. For candidate regions with relatively close score values but large region overlaps, the non-maximum suppression technique can be used to retain the region with the highest score, eliminate redundant detection results, and further improve the accuracy of abnormal target detection.
[0059] This embodiment specifically aims at the problem of abnormal target detection with local similarity. Existing technologies mainly adopt end-to-end abnormal detection methods based on deep learning, which determine samples deviating from the normal feature distribution as abnormal by directly learning the feature representation of normal samples; or adopt reconstruction-based abnormal detection methods to discover abnormal regions by reconstructing normal samples; there are also density estimation-based methods to identify abnormalities by calculating the local density of sample points.
[0060] However, there are obvious deficiencies in existing methods. End-to-end methods require a large amount of labeled data for training and have limited generalization ability; reconstruction methods are easily interfered by noise and are insensitive to local abnormalities; density estimation methods do not fully utilize the local structure information of features. These problems limit the practical application effect of abnormal detection.
[0061] The method of this embodiment makes full use of the local similarity of target features and adaptively determines the boundary of abnormal targets through region growing. By introducing a kernel function to calculate the local similarity, it better depicts the local structure of features; adopts a region growing strategy with an adaptive threshold to make the determination of the target region more accurate; and at the same time designs an abnormal scoring mechanism that takes into account both intra-region similarity and inter-region difference. In practical applications, effective anomaly detection can be achieved without a large amount of labeled data, the boundary of abnormal targets with local similarity can be accurately located, and it has good adaptability to multi-scale abnormal targets. At the same time, the influence of noise interference is significantly reduced, and the stability and reliability of abnormal target detection are improved.
[0062] As Figure 3 shown, it demonstrates the performance of various anomaly detection methods in three dimensions: detection speed (FPS), accuracy (F1 score), and resource consumption (memory occupancy). The method of this embodiment reaches the optimal balance between performance and efficiency with a high detection speed of 37.8 FPS, an F1 score of 94.7%, and a memory occupancy of 2.1 GB. In contrast, although PatchCore has an F1 score of 90.3%, its detection speed is only 18.2 FPS and its memory occupancy reaches 3.5 GB; the detection speed of PaDiM is 24.5 FPS, the F1 score is 89.5%, and the memory occupancy is 2.8 GB; although DeepSVDD has a relatively fast detection speed (32.7 FPS) and a low memory occupancy (1.8 GB), its F1 score is only 86.3%; AnoGAN performs poorly in all aspects, with a detection speed of only 5.6 FPS, a memory occupancy as high as 5.7 GB, and the lowest F1 score, only 82.1%. These data fully demonstrate the comprehensive advantages of the method of this embodiment in practical applications: it not only maintains a high-precision anomaly detection ability but also has the efficiency of fast processing, and at the same time has moderate resource consumption, making it very suitable for deployment on resource-constrained edge devices. Especially compared with the popular PatchCore and PaDiM methods, the method of this embodiment has more than doubled the detection speed and also improved the detection accuracy, which is of great significance for application scenarios such as industrial inspection and video surveillance that require real-time processing.
[0063] In an optional implementation manner, based on the prediction result of the internal state of the safety cabinet and the detection result of abnormal targets, a Gaussian kernel function is used to extract the control trajectory from a preset expert strategy library, and through expectation maximization and policy network optimization, the control parameters of the explosion-proof safety cabinet are obtained, including: Represent the expert control strategy as a sequence of state-action pairs, including the in-cabinet state vector and the control action vector, and the control action vector includes the refrigeration power parameter, the exhaust frequency parameter, and the locking force parameter; Construct the internal state prediction result and abnormal target detection result of the safety cabinet into a state vector, calculate the Euclidean distance between the state vector and the state vectors in the state-action pair sequence, substitute the Euclidean distance into the Gaussian kernel function to obtain a similarity value, and select a preset number of expert trajectories with the highest similarity value; Iteratively calculate the mixing weight parameter, mean parameter, and covariance parameter of the Gaussian mixture distribution based on the selected expert trajectories through the expectation-maximization algorithm until the change amount of the log-likelihood function value is less than the preset change threshold to obtain the prior probability distribution of actions; Input the prior probability distribution of actions into the policy network, calculate the control reward value based on the current state, use the KL divergence between the control reward value and the probability distribution output by the policy network as a constraint term, and construct an optimization objective function; calculate the gradient value based on the optimization objective function, and update the policy network parameters in combination with the adaptive learning rate to generate an optimized policy model; Input the current state into the optimized policy model to generate the values of the refrigeration power parameter, exhaust frequency parameter, and locking force parameter, and determine the control parameters of the explosion-proof safety cabinet.
[0064] In a specific implementation, the abnormal target detection uses an improved YOLOv5 model to identify potential dangerous items in the cabinet based on a deep learning algorithm. The model input is an RGB image of 224×224 pixels. Features are extracted through the CSPDarknet53 backbone network, and multi-scale features are fused through the FPN feature pyramid network. Finally, the target category and confidence are output. The model is trained on the basis of the COCO dataset by fusing a total of 12,000 images in a specific dangerous goods dataset, including 10 categories of dangerous goods such as flammable substances, corrosive substances, and explosives. The training uses a batch size of 64 and a learning rate of 0.001. After 100 rounds of iteration, the model reaches 93.5% mAP on the validation set.
[0065] Construct an expert control strategy library containing multiple groups of state-action pair sequences {s, a}. Among them, the state vector s = [temperature, humidity, air pressure, concentration, abnormal target type, abnormal target confidence], with a dimension of 6; the control action vector a = [refrigeration power, exhaust frequency, locking force], with a dimension of 3. For example, when a flammable substance is detected and the temperature exceeds 30°C, a certain expert strategy may be a = [0.8, 0.6, 0.9], indicating control with 80% of the maximum refrigeration power, 60% of the exhaust frequency, and 90% of the locking force. The expert strategy library is constructed by collecting data from 200 safety response scenarios and contains a total of 5,000 state-action samples.
[0066] After obtaining the current safety cabinet status, calculate the Euclidean distance between the current state vector and each state vector in the expert database. Assume the current state is s_cur = [28.5, 65%, 101.3 kPa, 120 ppm, 1, 0.92], which represents a temperature of 28.5 °C, a humidity of 65%, standard atmospheric pressure, a VOC concentration of 120 ppm, the detection of type 1 dangerous goods (flammable substances), and a confidence level of 0.92. The system calculates the distance between s_cur and each record in the expert database. For example, the distance to the i-th record s_i is d_i = ||s_cur - s_i||.
[0067] Substitute the calculated distance into the Gaussian kernel function to calculate the similarity. The bandwidth parameter of the kernel function is set to 0.5. The higher the similarity value, the more similar the current state is to the expert sample. Select the 50 expert trajectories with the highest similarity as the reference set. For example, the average value of the action vectors included in the selected expert trajectory set is [0.75, 0.55, 0.85], which represents 75% refrigeration power, 55% exhaust frequency, and 85% locking force.
[0068] Use the Expectation-Maximization algorithm to estimate the parameters of the Gaussian mixture model of the action. Set the number of Gaussian mixture components to 3, the initial mixture weights to [0.4, 0.3, 0.3], the initial mean vector is randomly selected from the expert trajectories, and the initial covariance matrix is the identity matrix. The algorithm execution steps include the E-step to calculate the posterior probability and the M-step to update the model parameters. Iterate until the change in the log-likelihood function value is less than 0.001. After 11 rounds of iteration, the obtained mixture weight parameters are [0.45, 0.35, 0.2], the mean parameters are [[0.8, 0.6, 0.9], [0.7, 0.5, 0.8], [0.6, 0.4, 0.7]], and the covariance parameters are updated accordingly to three 3×3 matrices, which are omitted here. This constitutes the prior probability distribution of the action.
[0069] Construct a policy network for optimization. The policy network consists of three fully connected layers, with the number of hidden layer nodes being 128 and 64 respectively. The input is the current state vector, and the output is the probability distribution of the control action. The initial parameters of the network are initialized using the Xavier initialization method. The constructed optimization objective function consists of two parts: the control reward value and the KL divergence constraint term. The control reward value is evaluated based on the state safety level. For example, the closer the temperature is to the safe range (20 - 25 °C), the higher the reward, and the reward increases when dangerous goods are detected and properly handled. The KL divergence constraint term ensures that the generated policy does not deviate too much from the prior distribution, and the constraint coefficient is set to 0.05.
[0070] During the optimization process, the Adam algorithm is used to update the network parameters. The initial learning rate is 0.001, and the learning rate decays to 0.9 times the original value every 50 epochs. After 300 rounds of iterative optimization, the network parameters tend to be stable. The reward value on the validation set has increased by 15%, and the KL divergence remains within 0.35, indicating that the strategy is both innovative and consistent with expert experience.
[0071] The current state is input into the optimized policy network to generate specific control parameters. For the case state s_cur, the generated control parameters are [0.82, 0.58, 0.91], that is, the refrigeration power is set to 82%, the exhaust frequency is set to 58%, and the locking force is set to 91%. These parameter values are converted into actual control signals through the digital-to-analog conversion module and sent to the actuators of the explosion-proof safety cabinet to perform power adjustment of the refrigeration system, frequency control of the exhaust system, and force adjustment of the locking mechanism.
[0072] A safety monitoring loop is also set up to re-evaluate the internal state of the cabinet every 5 seconds and dynamically adjust the control parameters. If a serious anomaly is detected (such as the temperature exceeding 40°C or the confidence level of explosive substances being greater than 0.95), the emergency plan is triggered, the highest safety level control strategy [1.0, 1.0, 1.0] is enforced, and an alarm is issued. Experiments show that the method of this embodiment reduces the incidence of dangerous events and shortens the response time compared with the traditional fixed-threshold control strategy.
[0073] The intelligent control system of the explosion-proof safety cabinet based on deep learning in the embodiment of the present invention includes: The first unit is used to collect multi-dimensional state data and environmental image data inside the explosion-proof safety cabinet; The second unit is used to perform dynamic discrete wavelet transform on the multi-dimensional state data inside the cabinet to obtain a coefficient matrix, obtain an optimized feature vector through adaptive threshold optimization, input the optimized feature vector into a multi-layer causal convolutional network with a segmented recursive structure, and output the prediction result of the internal state of the safety cabinet through residual enhancement and dynamic recombination; The third unit is used to input the environmental image data into the siamese neural network, generate a target feature map through multi-level feature enhancement and fusion of the feature extraction branch and optimization of the bidirectional metric loss of the metric learning branch; analyze the target feature map based on the region growing algorithm of local similarity to obtain the abnormal target detection result; The fourth unit is used to extract the control trajectory from the preset expert policy library based on the prediction result of the internal state of the safety cabinet and the abnormal target detection result by using the Gaussian kernel function, and obtain the control parameters of the explosion-proof safety cabinet through expectation maximization and policy network optimization; The fifth unit is used to control the explosion-proof safety cabinet according to the control parameters and trigger the emergency response mechanism when an abnormal state is detected.
[0074] In a third aspect of the embodiments of the present invention, there is provided an electronic device, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to call the instructions stored in the memory to execute the method described above.
[0075] In a fourth aspect of the embodiments of the present invention, there is provided a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method described above is implemented.
[0076] The present invention may be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium, on which computer-readable program instructions for executing various aspects of the present invention are loaded.
[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. An intelligent control method for an explosion-proof safety cabinet based on deep learning, characterized in that, Including: Collecting multi-dimensional state data and environmental image data inside the explosion-proof safety cabinet; Performing dynamic discrete wavelet transform on the multi-dimensional state data inside the cabinet to obtain a coefficient matrix, obtaining an optimized feature vector through adaptive threshold optimization, inputting the optimized feature vector into a multi-layer causal convolutional network with a segmented recursive structure, and through residual enhancement and dynamic recombination, outputting the prediction result of the internal state of the safety cabinet; Inputting the environmental image data into a siamese neural network, through multi-level feature enhancement and fusion of the feature extraction branch, and optimized by the bidirectional metric loss of the metric learning branch to generate a target feature map; Analyzing the target feature map based on the region growing algorithm of local similarity to obtain the abnormal target detection result; Based on the prediction result of the internal state of the safety cabinet and the abnormal target detection result, using the Gaussian kernel function to extract the control trajectory from the preset expert strategy library, and through expectation maximization and policy network optimization, obtaining the control parameters of the explosion-proof safety cabinet; Performing explosion-proof safety cabinet control according to the control parameters, and triggering the emergency disposal mechanism when an abnormal state is detected.
2. The method according to claim 1, characterized in that, Performing dynamic discrete wavelet transform on the multi-dimensional state data inside the cabinet to obtain a coefficient matrix, obtaining an optimized feature vector through adaptive threshold optimization, inputting the optimized feature vector into a multi-layer causal convolutional network with a segmented recursive structure, and through residual enhancement and dynamic recombination, the output of the prediction result of the internal state of the safety cabinet includes: Performing dynamic discrete wavelet transform on the multi-dimensional state data inside the cabinet, constructing wavelet functions and scaling functions based on the Daubechies wavelet basis function family, and performing multi-layer wavelet decomposition on the multi-dimensional state data inside the cabinet according to the wavelet functions and scaling functions to obtain an approximation coefficient matrix and a detail coefficient matrix; Based on the approximation coefficient matrix and the detail coefficient matrix, calculating the adaptive threshold parameter through the product relationship of the signal length, noise standard deviation and signal-to-noise ratio, substituting the adaptive threshold parameter into the soft threshold function, and performing optimization processing on the approximation coefficient matrix and the detail coefficient matrix to generate an optimized feature vector; Constructing a multi-layer causal convolutional network with a segmented recursive structure, introducing a residual learning unit between adjacent layers to enhance features, adjusting the receptive field range of each layer according to the preset sequence of dilation rate parameters, performing causal convolution operation on each layer's convolutional kernel and the output features of the previous layer, and performing feature mapping in a piecewise linear manner to obtain an intermediate feature representation; Inputting the optimized feature vector into a multi-layer causal convolutional network with a segmented recursive structure, performing feature measurement and dynamic recombination through the intermediate feature representation, performing probability normalization processing after iterative optimization and weighted fusion, and outputting the state prediction probability distribution as the final prediction result.
3. The method according to claim 2, wherein Performing feature measurement and dynamic recombination through the intermediate feature representation, performing probability normalization processing after iterative optimization and weighted fusion, and the output of the state prediction probability distribution as the final prediction result includes: Constructing a feature measurement matrix according to the statistical distribution of the intermediate feature representation, calculating the Mahalanobis distance between feature pairs by extracting the mean and covariance of the intermediate feature representation, and generating a feature similarity matrix; Dividing the intermediate feature representation into multiple feature recombination groups according to the preset similarity threshold, calculating the within-group variance for each feature recombination group and setting the feature weight coefficient in combination with the feature information volume; Optimize each feature recombination group in a gradient iteration manner. During the iteration process, update the parameters of the feature recombination group and calculate the recombination error. Stop the iteration when the recombination error is less than the preset error threshold or reaches the preset number of iterations. Perform feature fusion on the optimized feature recombination groups through weight weighting to obtain recombined features, normalize the recombined features, introduce a regulation factor, and output the state prediction probability distribution as the final prediction result.
4. The method according to claim 1, wherein Input the environmental image data into the siamese neural network. Through multi-level feature enhancement and fusion of the feature extraction branch, and optimization by the bidirectional metric loss of the metric learning branch, generate the target feature map including: Input the environmental image data into the feature extraction branch of the siamese neural network with a two-branch structure. The feature extraction branch sets feature enhancement modules at different levels of the backbone network. Based on each layer of the feature map, generate the corresponding weight matrix through single-channel convolution operation and normalization function. Multiply each layer of the feature map with the corresponding weight matrix element-wise to obtain the enhanced feature map of each layer. Concatenate and fuse all the enhanced feature maps to obtain the fused feature map. Based on the fused feature map, extract the anchor sample feature, positive sample feature, and negative sample feature through the metric learning branch of the siamese neural network. Calculate the distance between the anchor sample feature and the positive sample feature to obtain the positive sample distance value, calculate the distance between the anchor sample feature and the negative sample feature to obtain the negative sample distance value, and construct a feature space loss function based on the positive sample distance value and the negative sample distance value. Construct a semantic space loss function based on the conditional probability between the anchor sample feature and the positive sample feature, and the conditional probability between the anchor sample feature and the negative sample feature. Fuse the feature space loss function and the semantic space loss function through weight weighting to obtain a bidirectional metric loss function, and optimize the target feature map through the backpropagation of the bidirectional metric loss function.
5. The method according to claim 1, characterized in that, Analyze the target feature map based on the region growing algorithm of local similarity to obtain the abnormal target detection result including: Calculate the feature distance between each feature position in the target feature map and the corresponding neighboring feature positions. Substitute the feature distance into the kernel function to obtain the local similarity value, construct a local similarity matrix. Select the feature position with the largest similarity value in the local similarity matrix as the seed point. Determine the initial region of a preset size centered on the seed point. Calculate the mean and standard deviation of all similarity values within the initial region, set the region growing threshold. Incorporate the neighboring feature positions with similarity values greater than the region growing threshold into the current region to obtain the updated region. Repeat the execution until the difference in the number of feature positions of the updated regions between two consecutive adjacent iterations is less than the preset difference threshold to obtain the candidate target region. Calculate the average feature distance between all feature positions within the candidate target region to obtain the in-region feature distance value. Calculate the average feature distance between the candidate target region and the background region to obtain the between-region feature distance value. Multiply the in-region feature distance value and the between-region feature distance value by preset weight coefficients respectively, and sum them to obtain the anomaly score value. Determine the position information and score information of the anomaly target based on the anomaly score value, and determine the anomaly target detection result.
6. The method according to claim 1, wherein Based on the internal state prediction result of the safety cabinet and the anomaly target detection result, use the Gaussian kernel function to extract the control trajectory from the preset expert strategy library. Through expectation maximization and policy network optimization, obtain the control parameters of the explosion-proof safety cabinet, including: Represent the expert control strategy as a sequence of state-action pairs, including the in-cabinet state vector and the control action vector. The control action vector includes the refrigeration power parameter, the exhaust frequency parameter, and the locking force parameter. Construct the internal state prediction result of the safety cabinet and the anomaly target detection result into a state vector. Calculate the Euclidean distance between the state vector and the state vectors in the state-action pair sequence. Substitute the Euclidean distance into the Gaussian kernel function to obtain the similarity value, and select the preset number of expert trajectories with the highest similarity value. Based on the selected expert trajectories, use the expectation maximization algorithm to iteratively calculate the mixture weight parameters, mean parameters, and covariance parameters of the Gaussian mixture distribution until the change amount of the log-likelihood function value is less than the preset change threshold, and obtain the action prior probability distribution. Input the action prior probability distribution into the policy network. Calculate the control reward value based on the current state. Use the KL divergence between the control reward value and the probability distribution output by the policy network as a constraint term to construct an optimization objective function. Calculate the gradient value based on the optimization objective function, and update the policy network parameters in combination with the adaptive learning rate to generate an optimized policy model. Input the current state into the optimized policy model to generate the refrigeration power parameter value, the exhaust frequency parameter value, and the locking force parameter value, and determine the control parameters of the explosion-proof safety cabinet.
7. An intelligent control system for an explosion-proof safety cabinet based on deep learning, which is used to implement the method described in any one of the foregoing claims 1-6, characterized in that Including: The first unit is used to collect the multi-dimensional in-cabinet state data and environmental image data of the explosion-proof safety cabinet. The second unit is used to perform dynamic discrete wavelet transform on the multi-dimensional in-cabinet state data to obtain a coefficient matrix, optimize it through an adaptive threshold to obtain an optimized feature vector, input the optimized feature vector into a multi-layer causal convolutional network with a segmented recursive structure, and output the internal state prediction result of the safety cabinet through residual enhancement and dynamic recombination. The third unit is used to input the environmental image data into the siamese neural network, enhance and fuse the multi-level features of the feature extraction branch, and optimize it through the bidirectional metric loss of the metric learning branch to generate a target feature map. Analyze the target feature map using the region growing algorithm based on local similarity to obtain the anomaly target detection result. The fourth unit is used to, based on the internal state prediction result of the safety cabinet and the anomaly target detection result, use the Gaussian kernel function to extract the control trajectory from the preset expert strategy library, and obtain the control parameters of the explosion-proof safety cabinet through expectation maximization and policy network optimization. The fifth unit is used to execute explosion-proof safety cabinet control according to control parameters, and trigger an emergency response mechanism when an abnormal state is detected.
8. An electronic device, characterized in that, It includes: A processor; A memory for storing instructions executable by the processor; Wherein, the processor is configured to call the instructions stored in the memory to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Substation defect discrimination method and system
CN117115727A
Method and system for detecting fluff state on surface of napped fabric based on machine vision
CN118840740A
Explosion-proof power distribution cabinet control method and system based on situation awareness
CN119209923A
Intelligent method and system for monitoring and analyzing packaging current of integrated circuit
CN119416597A
Intelligent laboratory man-machine interaction control method and system
CN119596826A
Cited By
Explosion-proof intelligent temperature control method and system for hydrogen peroxide storage tank based on multi-mode monitoring
CN120578242A
Mobile robot control device giving consideration to field navigation patrol and transportation load
CN120821235A
Anti-explosion electrical cabinet warning method and device
CN121096104A