Intelligent control method and system for explosion-proof safety cabinets based on deep learning
Through deep learning technology, the multi-dimensional state data and environmental images of explosion-proof safety cabinets are processed, and high-precision state prediction and abnormal target detection of complex environments are realized, the intelligent control capability and emergency response capability of explosion-proof safety cabinets are improved, and the safety and reliability of the system are improved.
Patent Information
- Application Number
- CN202510798969.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-16
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-06-16
AI Technical Summary
The existing intelligent control technology of explosion-proof safety cabinets cannot effectively deal with the complex and changeable storage environment and chemical characteristics, lacks an adaptive decision-making mechanism, and it is difficult to accurately predict potential safety hazards, especially in harsh conditions, low detection accuracy and insufficient emergency response capabilities.
Using a deep learning-based method, multi-dimensional state data in the cabinet is processed through dynamic discrete wavelet transformation and adaptive threshold optimization, and state prediction is performed by combining a multi-layer causal convolutional network with a segmented recursive structure; environmental image analysis is performed using twin neural networks and local similarity region growth algorithms to generate abnormal object detection results; a control strategy optimization framework is built based on Gaussian kernel functions and expectation maximization algorithm to realize intelligent control and emergency response.
The adaptability and accuracy of the explosion-proof safety cabinet to complex environments and state evaluation is improved, the efficiency and accuracy of abnormal target detection is significantly improved, the robustness and safety of the system are enhanced, and the risk of explosion is reduced.
Smart Images

Figure CN120335312B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of explosion-proof safety cabinet control technology, and in particular to an explosion-proof safety cabinet intelligent control method and system based on deep learning. Background Art
[0002] As industrial safety standards continue to improve, explosion-proof safety cabinets, as key equipment for hazardous materials storage, are widely used in fields such as petrochemicals, laboratories, and medicine. Traditional explosion-proof safety cabinets rely primarily on mechanical structures and simple electronic control systems to achieve basic safety protection functions, including fire resistance, explosion protection, and ventilation. In recent years, with the rapid development of intelligent technology, the application of artificial intelligence technologies such as deep learning to explosion-proof safety cabinet control systems has become a new industry trend. These technologies enable real-time monitoring of the cabinet environment, intelligent identification of abnormal conditions, and automated control, significantly improving the safety and reliability of hazardous materials storage.
[0003] However, the existing intelligent control technology for explosion-proof safety cabinets still has shortcomings. The existing control system has limited processing capabilities for multi-dimensional status data inside the cabinet, and mostly uses traditional signal processing methods and fixed threshold judgments, which makes it difficult to effectively cope with complex and changeable storage environments and the characteristics of various chemicals, resulting in the inability to accurately predict potential safety hazards and a lagging early warning mechanism; the existing system lacks 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, and it is difficult to timely identify security threats such as suspicious persons approaching or unauthorized operations; the existing intelligent control method lacks an adaptive decision-making mechanism, and mostly uses preset fixed control logic. It is unable to dynamically adjust the control strategy according to real-time environmental changes and the results of comprehensive analysis of multi-source information. When faced with complex or sudden situations, the emergency response capability is insufficient, and it is difficult to achieve the optimal safety protection effect. Summary of the Invention
[0004] The embodiments of the present invention provide a deep learning-based intelligent control method and system for explosion-proof safety cabinets, which can solve the problems in the prior art.
[0005] A first aspect of an embodiment of the present invention provides an intelligent control method for an explosion-proof safety cabinet based on deep learning, comprising:
[0006] Collect multi-dimensional status data and environmental image data inside the explosion-proof safety cabinet;
[0007] A dynamic discrete wavelet transform is performed on the multi-dimensional state data inside the cabinet to obtain a coefficient matrix. The optimized feature vector is obtained through adaptive threshold optimization. The optimized feature vector is input into a multi-layer causal convolutional network with a piecewise recursive structure. After residual enhancement and dynamic reorganization, the prediction result of the internal state of the safe cabinet is output;
[0008] The environmental image data is input into the twin neural network. Through multi-level feature enhancement and fusion in the feature extraction branch and bidirectional metric loss optimization in the metric learning branch, a target feature map is generated. The target feature map is analyzed by the region growing algorithm based on local similarity to obtain the abnormal target detection result.
[0009] Based on the prediction results of the internal state of the safety cabinet and the abnormal target detection results, the Gaussian kernel function is used to extract the control trajectory from the preset expert strategy library. Through expectation maximization and strategy network optimization, the control parameters of the explosion-proof safety cabinet are obtained.
[0010] The explosion-proof safety cabinet is controlled according to the control parameters, and the emergency response mechanism is triggered when an abnormal state is detected.
[0011] In an optional embodiment, a dynamic discrete wavelet transform is performed on the multi-dimensional state data in the cabinet to obtain a coefficient matrix, and an optimized feature vector is obtained through adaptive threshold optimization. The optimized feature vector is input into a multi-layer causal convolutional network with a piecewise recursive structure. After residual enhancement and dynamic reorganization, the output of the safety cabinet internal state prediction result includes:
[0012] Perform dynamic discrete wavelet transform on the multidimensional 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 multidimensional state data in the cabinet based on the wavelet functions and scaling functions, and obtain the approximate coefficient matrix and detail coefficient matrix;
[0013] Based on the approximate coefficient matrix and the detail coefficient matrix, the adaptive threshold parameters are calculated by the product relationship of signal length, noise standard deviation and signal-to-noise ratio. The adaptive threshold parameters are substituted into the soft threshold function, and the approximate coefficient matrix and the detail coefficient matrix are optimized to generate the optimized eigenvector.
[0014] A multi-layer causal convolutional network with a piecewise recursive structure is constructed. Residual learning units are introduced between adjacent layers to enhance features. The receptive field range of each layer is adjusted according to a preset dilation rate parameter sequence. The convolution kernel of each layer is causally convolved with the output features of the previous layer, and feature mapping is performed in a piecewise linear manner to obtain intermediate feature representations.
[0015] The optimized feature vector is input into a multi-layer causal convolutional network with a piecewise recursive structure. Feature measurement and dynamic reorganization are performed through intermediate feature representation. After iterative optimization and weighted fusion, probability normalization is performed, and the state prediction probability distribution is output as the final prediction result.
[0016] In an optional embodiment, feature measurement and dynamic reorganization are performed through intermediate feature representation, and probability normalization is performed after iterative optimization and weighted fusion. The state prediction probability distribution is output as the final prediction result, including:
[0017] A feature metric matrix is constructed based on the statistical distribution of the intermediate feature representations. The Mahalanobis distance between feature pairs is calculated by extracting the mean and covariance of the intermediate feature representations to generate a feature similarity matrix.
[0018] The intermediate feature representation is divided into multiple feature reorganization groups according to the preset similarity threshold, the intra-group variance of each feature reorganization group is calculated, and the feature weight coefficient is set based on the feature information amount;
[0019] A gradient iteration method is used to optimize each feature recombination group. During the iteration process, the parameters of the feature recombination group are updated and the recombination error is calculated. The iteration is stopped when the recombination error is less than the preset error threshold or the preset number of iterations is reached. The optimized feature recombination groups are fused using a weighted method to obtain the recombination features. The recombination features are normalized and an adjustment factor is introduced. The state prediction probability distribution is output as the final prediction result.
[0020] In an optional embodiment, the environmental image data is input into the Siamese neural network, and the target feature map is generated through multi-level feature enhancement and fusion in the feature extraction branch and bidirectional metric loss optimization in the metric learning branch. The method includes:
[0021] The environmental image data is input into the feature extraction branch of the twin neural network with a dual-branch structure. The feature extraction branch sets feature enhancement modules at different levels of the backbone network, generates a corresponding weight matrix based on the feature map of each layer through single-channel convolution operation and normalization function, multiplies the feature map of each layer by the corresponding weight matrix element by element to obtain an enhanced feature map of each layer, and cascades and fuses all the enhanced feature maps to obtain a fused feature map;
[0022] Based on the fused feature map, extracting anchor sample features, positive sample features, and negative sample features through the metric learning branch of the twin neural network;
[0023] 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 the feature space loss function based on the positive sample distance value and the negative sample distance value;
[0024] Construct a semantic space loss function based on the conditional probabilities of the anchor sample features and the positive sample features, as well as the conditional probabilities of the anchor sample features and the negative sample features;
[0025] The feature space loss function and the semantic space loss function are weightedly fused to obtain a bidirectional metric loss function, and a target feature map is obtained through back-propagation optimization of the bidirectional metric loss function.
[0026] In an optional embodiment, the target feature map is analyzed using a region growing algorithm based on local similarity to obtain abnormal target detection results including:
[0027] Calculate the feature distance between each feature position in the target feature map and the corresponding neighboring feature position, substitute the feature distance into the kernel function to obtain a 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 with the seed point as the center, calculate the mean and standard deviation of all similarity values in the initial region, set a region growing threshold, merge adjacent feature positions with similarity values greater than the region growing threshold into the current region to obtain an updated region, and repeat the process until the difference in the number of feature positions in the updated regions of two consecutive adjacent iterations is less than the preset difference threshold, thereby obtaining a candidate target region;
[0028] Calculate the average feature distance between all feature positions in the candidate target area to obtain the feature distance value within the area, calculate the average feature distance between the candidate target area and the background area to obtain the feature distance value between the areas, multiply the feature distance value within the area and the feature distance value between the areas by the preset weight coefficient respectively, and sum them to obtain the abnormal score value. Determine the location information and score information of the abnormal target based on the abnormal score value, and determine the abnormal target detection result.
[0029] In an optional embodiment, based on the prediction results of the internal state of the safety cabinet and the abnormal target detection results, a Gaussian kernel function is used to extract the control trajectory from the preset expert strategy library. Through expectation maximization and strategy network optimization, the control parameters of the explosion-proof safety cabinet are obtained, including:
[0030] The expert control strategy is represented as a sequence of state-action pairs, including a cabinet state vector and a control action vector, wherein the control action vector includes a cooling power parameter, an exhaust frequency parameter, and a locking force parameter;
[0031] Constructing the safe internal state prediction result and the abnormal target detection result into a state vector, calculating the Euclidean distance between the state vector and the state vector in the state-action pair sequence, substituting the Euclidean distance into the Gaussian kernel function to obtain a similarity value, and selecting a preset number of expert trajectories with the highest similarity values;
[0032] Based on the selected expert trajectory, the mixture weight parameter, mean parameter and covariance parameter of the Gaussian mixture distribution are iteratively calculated through the expectation maximization algorithm until the change in the log-likelihood function value is less than the preset change threshold, and the action prior probability distribution is obtained;
[0033] 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, and construct an 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 an optimization policy model;
[0034] The current state is input into the optimization strategy model to generate a refrigeration power parameter value, an exhaust frequency parameter value, and a locking force parameter value, and determine the control parameters of the explosion-proof safety cabinet.
[0035] A second aspect of an embodiment of the present invention provides an intelligent control system for explosion-proof safety cabinets based on deep learning, comprising:
[0036] The first unit is used to collect multi-dimensional status data and environmental image data inside the explosion-proof safety cabinet;
[0037] 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 piecewise recursive structure, and output the prediction result of the internal state of the safe after residual enhancement and dynamic reorganization;
[0038] The third unit is used to input environmental image data into the twin neural network, generate a target feature map through multi-level feature enhancement and fusion in the feature extraction branch, and optimize the bidirectional metric loss in the metric learning branch. The target feature map is analyzed by the region growing algorithm based on local similarity to obtain the abnormal target detection result.
[0039] The fourth unit is used to extract the control trajectory from the preset expert strategy library using the Gaussian kernel function based on the internal state prediction results of the safety cabinet and the abnormal target detection results. The control parameters of the explosion-proof safety cabinet are obtained through expectation maximization and strategy network optimization.
[0040] The fifth unit is used to execute explosion-proof safety cabinet control according to control parameters and trigger the emergency response mechanism when an abnormal state is detected.
[0041] According to a third aspect of an embodiment of the present invention, an electronic device is provided, including:
[0042] processor;
[0043] a memory for storing processor-executable instructions;
[0044] The processor is configured to call the instructions stored in the memory to execute the aforementioned method.
[0045] According to a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method described above is implemented.
[0046] In an embodiment of the present invention, by adopting dynamic discrete wavelet transform and adaptive threshold optimization to process the multi-dimensional state data in the cabinet, combined with a multi-layer causal convolutional network with a piecewise recursive structure, high-precision prediction of the internal state of the explosion-proof safety cabinet is achieved, effectively improving the system's adaptability to complex environments and the accuracy of state assessment; the twin neural network is combined with the regional growing algorithm of local similarity for environmental image analysis, and 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; the control strategy optimization framework constructed based on Gaussian kernel function and expectation maximization algorithm realizes intelligent control and emergency response of the explosion-proof safety cabinet, enabling the system to adaptively adjust control parameters according to the dynamic changes of internal state and external environment, improving the safety and reliability of the system, and reducing the risk of explosion and the probability of safety accidents. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 This is a flow chart of an intelligent control method for explosion-proof safety cabinets based on deep learning according to an embodiment of the present invention;
[0048] Figure 2 Comparison chart of the iterative process of feature grouping optimization;
[0049] Figure 3 A bubble chart comparing the performance of anomaly detection methods and computing resources. DETAILED DESCRIPTION
[0050] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0051] The following specific embodiments are used to describe the technical solution of the present invention in detail. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0052] Figure 1 This is a flow chart of an intelligent control method for explosion-proof safety cabinets based on deep learning according to an embodiment of the present invention. Figure 1 As shown, the method includes:
[0053] Collect multi-dimensional status data and environmental image data inside the explosion-proof safety cabinet;
[0054] A dynamic discrete wavelet transform is performed on the multi-dimensional state data inside the cabinet to obtain a coefficient matrix. The optimized feature vector is obtained through adaptive threshold optimization. The optimized feature vector is input into a multi-layer causal convolutional network with a piecewise recursive structure. After residual enhancement and dynamic reorganization, the prediction result of the internal state of the safe cabinet is output;
[0055] The environmental image data is input into the twin neural network. Through multi-level feature enhancement and fusion in the feature extraction branch and bidirectional metric loss optimization in the metric learning branch, a target feature map is generated. The target feature map is analyzed by the region growing algorithm based on local similarity to obtain the abnormal target detection result.
[0056] Based on the prediction results of the internal state of the safety cabinet and the abnormal target detection results, the Gaussian kernel function is used to extract the control trajectory from the preset expert strategy library. Through expectation maximization and strategy network optimization, the control parameters of the explosion-proof safety cabinet are obtained.
[0057] The explosion-proof safety cabinet is controlled according to the control parameters, and the emergency response mechanism is triggered when an abnormal state is detected.
[0058] In an optional embodiment, dynamic discrete wavelet transform is performed on the multi-dimensional state data in the cabinet to obtain a coefficient matrix, and an optimized feature vector is obtained through adaptive threshold optimization. The optimized feature vector is input into a multi-layer causal convolutional network with a piecewise recursive structure. After residual enhancement and dynamic reorganization, the output of the safety cabinet internal state prediction result includes:
[0059] Perform dynamic discrete wavelet transform on the multidimensional 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 multidimensional state data in the cabinet based on the wavelet functions and scaling functions, and obtain the approximate coefficient matrix and detail coefficient matrix;
[0060] Based on the approximate coefficient matrix and the detail coefficient matrix, the adaptive threshold parameters are calculated by the product relationship of signal length, noise standard deviation and signal-to-noise ratio. The adaptive threshold parameters are substituted into the soft threshold function, and the approximate coefficient matrix and the detail coefficient matrix are optimized to generate the optimized eigenvector.
[0061] A multi-layer causal convolutional network with a piecewise recursive structure is constructed. Residual learning units are introduced between adjacent layers to enhance features. The receptive field range of each layer is adjusted according to a preset dilation rate parameter sequence. The convolution kernel of each layer is causally convolved with the output features of the previous layer, and feature mapping is performed in a piecewise linear manner to obtain intermediate feature representations.
[0062] The optimized feature vector is input into a multi-layer causal convolutional network with a piecewise recursive structure. Feature measurement and dynamic reorganization are performed through intermediate feature representation. After iterative optimization and weighted fusion, probability normalization is performed, and the state prediction probability distribution is output as the final prediction result.
[0063] In one specific embodiment, the internal state data of a safety cabinet typically includes multidimensional signals, such as temperature, humidity, radiation level, and pressure. This data first requires preprocessing. Normalization is performed on the raw multidimensional state data, aligning the range of each dimension to the [0, 1] interval for ease of subsequent processing. The normalized data is then segmented into 1024 segments, with a 25% overlap between each segment to ensure signal continuity.
[0064] When performing dynamic discrete wavelet transform on preprocessed data, Daubechies-4 (db4) is selected as the basic wavelet function based on the Daubechies wavelet basis function family. When constructing the wavelet function, the db4 wavelet function is adjusted by the shift coefficient and scale parameter. In practical applications, the shift coefficient ranges from 0 to 7, and the scale parameter ranges from an integer power of 2, ranging from 2 0 to 2 8 A 4-layer wavelet decomposition is performed on each data segment to generate an approximate coefficient matrix A and detail coefficient matrices D1, D2, D3, and D4. The A matrix reflects the low-frequency information of the signal, and the D1 to D4 matrices correspond to the detail information of different frequency bands.
[0065] After the coefficient matrix is obtained, it needs to be optimized through adaptive threshold. The threshold parameter calculation method combines the three factors of signal length N, noise standard deviation σ and signal-to-noise ratio SNR, which is expressed as threshold T equal to σ multiplied by (2logN) 1 / 2 Then multiply by (1 + 0.2 / (log (SNR + 1))). In practice, the noise standard deviation is estimated by dividing the median absolute deviation of the detail coefficient D1 by 0.6745. When the cabinet is in a stable state, the estimated value is approximately 0.032; under interference, this value rises to approximately 0.087. The signal-to-noise ratio (SNR) is calculated as the ratio of the original signal variance to the noise variance, with typical values ranging from 12 dB to 25 dB.
[0066] After the threshold T is determined, the coefficient matrix is optimized using a soft threshold function. When the absolute value of a coefficient is less than T, the coefficient is set to zero. When the absolute value of a coefficient is greater than or equal to T, T is subtracted from the coefficient value and the sign is retained. For example, when T = 0.25, a coefficient of 0.4 is optimized to 0.15; a coefficient of -0.3 is optimized to -0.05; and a coefficient of 0.2, which is less than the threshold, is optimized to 0. The optimized coefficient matrix is then reorganized and flattened to generate an optimized feature vector with a dimension of approximately 40% of the original data, effectively reducing feature redundancy.
[0067] When constructing a multi-layer causal convolutional network with a piecewise recursive structure, the network contains a total of 8 convolutional layers, each with 32 filters of filter size 3. The dilation rate parameter sequence is set to [1, 2, 4, 8, 16, 32, 1, 1], which expands the receptive field from the initial 3 time steps to nearly 256 time steps. The piecewise recursive structure means that every 3 layers form a recursive unit, and the features within the unit can flow cyclically, with the number of cycles set to 3.
[0068] The residual enhancement mechanism is implemented by adding residual connections after layers 2, 4, and 6. Specifically, the output of the current layer is element-wise added to the features of the forward layer, and then processed through a normalization layer. For example, the output feature of layer 2 [0.3, 0.5, 0.2] is added to the input feature [0.2, 0.4, 0.1] to obtain [0.5, 0.9, 0.3], which is then normalized to obtain the final output.
[0069] During the network training phase, a dataset consisting of 10,000 safe state sequences was used, with each sequence consisting of 128 time steps. The training batch size was set to 64, the initial learning rate was 0.001, a cosine annealing scheduling strategy was used, and a total of 200 training rounds were used. During training, the state prediction accuracy on the validation set increased from an initial 78.3% to a final 94.7%.
[0070] For the newly input optimized feature vector, the network generates an intermediate feature representation through eight layers of convolution. Each convolution operation can be described as follows: the output of the current layer is equal to the causal convolution of the convolution kernel and the output of the previous layer plus a bias, and then processed through a piecewise linear activation function. The piecewise linear function outputs 0 for inputs less than 0, the same output for inputs between 0 and 6, and 6 for inputs greater than 6. For example, the input [-2, 3, 8] is processed by the piecewise linear function to obtain [0, 3, 6].
[0071] During the feature measurement and dynamic reorganization phases, an attention mechanism is used to weight intermediate feature representations. Specifically, the cosine similarity between each feature vector and the reference feature vector is calculated as the weight. Similarity values range from [-1, 1] and are normalized using the softmax function to serve as the fusion weight. For example, the similarities of three feature vectors [0.8, 0.3, -0.2] are normalized to obtain weights [0.68, 0.23, 0.09]. The final feature is obtained through weighted summation.
[0072] The final output layer maps the fused features through a fully connected layer into a prediction result, including several possible states within the safe and their probability distribution. The prediction result is represented as a 5-dimensional probability vector, corresponding to the five states: normal, abnormal temperature, abnormal humidity, abnormal radiation, and combined abnormality. The state with the highest probability is selected as the final prediction result, and a probability threshold of 0.85 is set. Predictions below this threshold are marked as "other states" and require further observation and confirmation.
[0073] In this embodiment, soft thresholding is performed on the approximate coefficients and detail coefficients after wavelet decomposition using an adaptive threshold (based on the product of signal length, noise standard deviation, and signal-to-noise ratio). This can suppress noise components while retaining the main features, thereby obtaining a more representative optimized feature vector and improving the feature signal-to-noise ratio. A multi-layer causal convolutional network with a piecewise recursive structure is constructed. Residual learning units are introduced between layers, and the receptive field range of each layer is adjusted using a preset hole rate parameter string, so that the convolution kernel can take into account the temporal dependencies of both near and distant neighbors. At the same time, piecewise linear mapping is used to perform nonlinear transformation on the features, achieving enhanced feature representation and multi-scale fusion, improving the network's ability to capture temporal patterns. The optimized feature vector is input into the recursive structure network, and feature measurement and dynamic reorganization are performed through the intermediate feature representation. Combined with iterative optimization and weighted fusion mechanisms, it can adaptively integrate multi-level information. Finally, in the probability normalization step, a state prediction probability distribution is output, making the prediction result more robust and interpretable, significantly improving the accuracy and stability of state prediction.
[0074] In an optional embodiment, feature measurement and dynamic reorganization are performed through intermediate feature representation, and probability normalization is performed after iterative optimization and weighted fusion. The state prediction probability distribution is output as the final prediction result, including:
[0075] A feature metric matrix is constructed based on the statistical distribution of the intermediate feature representations. The Mahalanobis distance between feature pairs is calculated by extracting the mean and covariance of the intermediate feature representations to generate a feature similarity matrix.
[0076] The intermediate feature representation is divided into multiple feature reorganization groups according to the preset similarity threshold, the intra-group variance of each feature reorganization group is calculated, and the feature weight coefficient is set based on the feature information amount;
[0077] A gradient iteration method is used to optimize each feature recombination group. During the iteration process, the parameters of the feature recombination group are updated and the recombination error is calculated. The iteration is stopped when the recombination error is less than the preset error threshold or the preset number of iterations is reached. The optimized feature recombination groups are fused using a weighted method to obtain the recombination features. The recombination features are normalized and an adjustment factor is introduced. The state prediction probability distribution is output as the final prediction result.
[0078] In a specific embodiment, a feature measurement matrix is constructed, and the 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 eigenvector. For two eigenvectors i and j, the similarity is measured by calculating the Mahalanobis distance between them, which is the transpose of the difference between the eigenvectors multiplied by the inverse matrix of the covariance matrix and then multiplied by the difference between the eigenvectors. 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, and the numerical value range is 0 to 1. The larger the value, the higher the similarity.
[0079] Based on the generated feature similarity matrix, a similarity threshold (e.g., 0.75) is set to partition the feature space into multiple feature regroups. This partitioning process utilizes a hierarchical clustering approach, starting with the most similar feature pairs and gradually merging features with similarities above the threshold to form distinct feature groups. A 256-dimensional feature set can be divided into 5-8 distinct feature regroups. For each feature regroup, the intra-group variance is calculated to reflect the dispersion of features within the group. Feature weights are also set based on the amount of feature information (calculated using the entropy of feature activation values). For example, for a feature group with an intra-group variance of 0.23 and an information entropy of 2.35, a weight of 0.85 is appropriate; for a feature group with an intra-group variance of 0.47 and an information entropy of 1.68, a weight of 0.62 is appropriate.
[0080] The feature reconstruction group is optimized using a gradient iteration approach. In each iteration, a stochastic gradient descent algorithm is used to update the parameters of the feature reconstruction group, including the weight assignments for each feature within the group and the inter-group relationship parameters. During this update process, the reconstruction error is calculated, reflecting the difference between the reconstructed features and the original task objectives. This error calculation combines the mean squared error and the cross-entropy loss function, allowing the optimization process to simultaneously consider both feature reconstruction accuracy and classification accuracy. The default error threshold is 0.05, and the maximum number of iterations is 200. In actual testing, the reconstruction error typically drops below 0.048 after 120-150 iterations, reaching convergence.
[0081] After optimization, each feature group is weighted and fused. Assuming there are six feature groups with weights of 0.92, 0.84, 0.78, 0.65, 0.53, and 0.41, the weighted average of each group is calculated according to the weight ratio to obtain the fused recombined features. The recombined features are normalized, with feature values mapped to the range [0, 1] to reduce the impact of dimensional differences between features. Finally, an adjustable factor (ranging from 0.6 to 1.2, with a default of 0.8) is introduced to balance the model's sensitivity and specificity. The normalized features are converted to a probability distribution using the softmax function, which serves as the safe's status prediction. For example, for a specific safe's status detection, the output may be a probability of 0.92 for a normal state, 0.07 for a slightly abnormal state, and 0.01 for a severely abnormal state.
[0082] Monitoring data from an explosion-proof safety cabinet was analyzed, collecting sensor data including temperature, humidity, vibration, and gas concentration to generate multimodal feature inputs. Using the aforementioned feature fusion optimization method, the 256-dimensional intermediate features were divided into seven feature recombination groups. After 138 rounds of iterative optimization, the recombination error was reduced, and the final model achieved 94.6% accuracy in abnormal state detection. In particular, the sensitivity for identifying minor abnormalities increased from 83.5% to 91.7%, significantly reducing the false negative rate.
[0083] In the prior art, the intelligent control of explosion-proof safety cabinets mainly adopts rule-based methods or simple machine learning models for status monitoring, which has problems such as insufficient feature utilization, insufficient consideration of the correlation between different features, and low sensitivity to minor anomalies. Traditional methods usually use linear weighting or principal component analysis to perform feature fusion, which cannot effectively handle the complex nonlinear 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 reorganization based on statistical significance, and overcomes the problem of insufficient feature correlation analysis in traditional methods. By introducing intra-group variance and information evaluation, the weights of different feature groups are dynamically adjusted, and the sensitivity of the model to key features is improved. Gradient iteration is used to optimize the feature reorganization parameters, and combined with adjustable factors to balance the sensitivity and specificity of the model, the detection ability of minor abnormal states is effectively improved. While maintaining a high accuracy rate, the false negative rate is significantly reduced, and the safe operation guarantee level of the explosion-proof safety cabinet is improved.
[0084] like Figure 2As shown, the curve of the change of the recombination error with the number of iterations in the feature recombination optimization process is shown. The method of this embodiment uses Mahalanobis distance combined with gradient optimization to start from an initial error of 0.187, and after 138 rounds of iterations, it is reduced to 0.048, which is far below 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 remains at a high level of 0.112. It is particularly noteworthy that the method of this embodiment experienced a rapid error decline stage during the 50th to 80th rounds of iteration, and the error dropped from 0.121 to 0.073, indicating that the feature recombination parameters were significantly optimized at this stage. In subsequent iterations, although the error decline rate slowed down, it still maintained a steady downward trend until the convergence condition was reached in the 138th round. This optimization process verifies the significant effect of this scheme in feature fusion optimization.
[0085] In an optional embodiment, the environmental image data is input into the Siamese neural network, and the target feature map is generated through multi-level feature enhancement and fusion in the feature extraction branch and bidirectional metric loss optimization in the metric learning branch, including:
[0086] The environmental image data is input into the feature extraction branch of the twin neural network with a dual-branch structure. The feature extraction branch sets feature enhancement modules at different levels of the backbone network, generates a corresponding weight matrix based on the feature map of each layer through single-channel convolution operation and normalization function, multiplies the feature map of each layer by the corresponding weight matrix element by element to obtain an enhanced feature map of each layer, and cascades and fuses all the enhanced feature maps to obtain a fused feature map;
[0087] Based on the fused feature map, extracting anchor sample features, positive sample features, and negative sample features through the metric learning branch of the twin neural network;
[0088] 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 the feature space loss function based on the positive sample distance value and the negative sample distance value;
[0089] Construct a semantic space loss function based on the conditional probabilities of the anchor sample features and the positive sample features, as well as the conditional probabilities of the anchor sample features and the negative sample features;
[0090] The feature space loss function and the semantic space loss function are weightedly fused to obtain a bidirectional metric loss function, and a target feature map is obtained through back-propagation optimization of the bidirectional metric loss function.
[0091] In one specific embodiment, environmental image data is collected as input. The environmental image data may include various images of indoor and outdoor scenes, road environments, natural landscapes, etc. In a specific implementation, the collected images have a resolution of 1920×1080 pixels, are represented using RGB three-channel color, and are pre-processed to normalize pixel values to the range of [-1, 1].
[0092] After image data preprocessing, it is input into a twin neural network for processing. This twin neural network consists of two main components: 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 installed at four different layers of the network: conv2, conv3, conv4, and conv5. Each feature enhancement module operates as follows: the input feature map F_i (size C×H×W, where C is the number of channels, H and W are height and width, respectively) is reduced to 1 through a 1×1 convolution to obtain a single-channel feature map A_i (size 1×H×W). The Sigmoid activation function is then applied to normalize A_i to obtain a weight matrix M_i (ranging from 0 to 1). The weight matrix M_i represents the importance of each spatial location; a larger value indicates a greater contribution of the location to the target feature. The original feature map F_i is element-wise multiplied by the weight matrix M_i to obtain the enhanced feature map E_i. In the specific example, for a conv3 feature map of size 256×56×56, the weight matrix generated after feature enhancement is of size 1×56×56. The dimension of the enhanced feature map remains unchanged at 256×56×56, but the weight distribution highlights the key areas more.
[0093] After enhancing features at each level, all enhanced feature maps are cascaded and fused. Specifically, adaptive average pooling is used to resize feature maps of different spatial dimensions to the same size. For example, all feature maps are pooled to a size of 7×7. They are then concatenated along the channel dimension to form a fused feature map G. Taking ResNet-50 as an example, the number of channels in the conv2, conv3, conv4, and conv5 layers are 256, 512, 1024, and 2048, respectively. After pooling and concatenation, a fused feature map of size 3840×7×7 is obtained.
[0094] The fused feature map is then reduced to a 512-dimensional vector via a fully connected layer, serving as the final feature representation for subsequent metric learning. The metric learning branch employs a triplet loss mechanism. 32 anchor images are randomly selected for each training batch, and each anchor image is paired with a positive sample (an image of the same category) and a negative sample (an image of a different category). For each triplet, the feature extraction branch extracts the anchor feature f_a, the positive feature f_p, and the negative feature f_n.
[0095] During the metric learning phase, a bidirectional metric loss function is constructed. In 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 typically kept between 0.2 and 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. A margin parameter α (set to 0.2) is introduced to ensure sufficient discrimination.
[0096] At the same time, a loss function L_s is constructed in the semantic space. This loss function is based on conditional probability calculations. It uses the inner product of the anchor sample features with the positive and negative sample features to calculate the conditional probabilities p(y_p|f_a) and p(y_n|f_a), respectively, where y_p and y_n represent the labels of the positive and negative samples, respectively. By maximizing p(y_p|f_a) while minimizing p(y_n|f_a), the discriminativeness of the feature representation in the semantic space is optimized.
[0097] The feature space loss function L_f and the semantic space loss function L_s are fused with a weight λ (set to 0.4) to form a bidirectional metric loss function L = L_f + λL_s. The network optimizes this loss function using the backpropagation algorithm, with a learning rate of 0.0001, a batch size of 32, and parameter updates using the Adam optimizer. Training is performed for 100 epochs.
[0098] The trained twin neural network can extract highly discriminative feature representations from environmental images. Under the dual constraints of feature space and semantic space, samples of the same category are clustered in the feature space, and samples of different categories are clearly distinguished. Experiments show that compared with the method of a single loss function, the bidirectional measurement method of this embodiment has improved performance in the task of environmental image feature extraction, and can still maintain stable feature extraction capabilities under different lighting, viewing angles and occlusion conditions. The generated target feature map can effectively support subsequent tasks such as image retrieval, scene recognition, and environmental understanding.
[0099] In this embodiment, feature enhancement modules are added to different layers of the backbone network, and weights are generated by single-channel convolution and normalization. The feature maps of each layer are weighted and then cascaded and fused, so that the model can take into account both the details and the overall structure of the image, and improve the ability to capture complex backgrounds and weak information; the twin network extracts anchor, positive, and negative sample features respectively, and by calculating positive and negative distances and constructing feature space losses, the features of similar samples are more aggregated and the features of different samples are more separated, which significantly enhances the ability to distinguish similar targets; in addition to the distance-based feature space loss, the conditional probability-based semantic space loss is also introduced, so that samples can be distinguished at both the geometric distance and semantic levels, thereby improving the robustness and accuracy of retrieval or matching; using bidirectional metric loss backpropagation, the parameters of the feature extraction and enhancement modules are adaptively adjusted to ensure that the final output feature map is optimal in terms of discrimination, robustness, and semantic expression, providing a more reliable feature representation for subsequent target recognition or retrieval.
[0100] In an optional embodiment, the target feature map is analyzed using a region growing algorithm based on local similarity to obtain an abnormal target detection result including:
[0101] Calculate the feature distance between each feature position in the target feature map and the corresponding neighboring feature position, substitute the feature distance into the kernel function to obtain a 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 with the seed point as the center, calculate the mean and standard deviation of all similarity values in the initial region, set a region growing threshold, merge adjacent feature positions with similarity values greater than the region growing threshold into the current region to obtain an updated region, and repeat the process until the difference in the number of feature positions in the updated regions of two consecutive adjacent iterations is less than the preset difference threshold, thereby obtaining a candidate target region;
[0102] Calculate the average feature distance between all feature positions in the candidate target area to obtain the feature distance value within the area, calculate the average feature distance between the candidate target area and the background area to obtain the feature distance value between the areas, multiply the feature distance value within the area and the feature distance value between the areas by the preset weight coefficient respectively, and sum them to obtain the abnormal score value. Determine the location information and score information of the abnormal target based on the abnormal score value, and determine the abnormal target detection result.
[0103] In a specific embodiment, a characteristic distance is calculated for each feature position in the target feature map and its neighboring feature positions. The characteristic distance can be calculated using the Euclidean distance method. For the position (i, j) in the feature map and its neighboring position (m, n), the characteristic distance is the square root of the sum of the squares of the differences between the components of the corresponding feature vectors of the two positions. 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 characteristic distance between them is calculated to be 0.173.
[0104] Substitute the calculated feature distance into the kernel function to obtain the local similarity value. A Gaussian kernel function can be used as the kernel function. When the feature distance is 0.173 as mentioned above, if the Gaussian kernel function parameter σ is set to 0.2, the calculated similarity value is 0.826, indicating that the features of the two locations are highly similar. This calculation is performed for all feature locations in the target feature map and their neighborhoods to construct a complete local similarity matrix.
[0105] In the constructed local similarity matrix, find the feature position with the highest similarity value as the seed point. For example, if the local similarity value of position (45, 67) in the 128×128 feature map is the highest, 0.985, then select this position as the seed point. Determine an initial region of a preset size centered around this seed point. The initial region size can be set to a 7×7 pixel window, encompassing the seed point (45, 67) and its surrounding 49 feature positions, for a total of 49.
[0106] Calculate the mean and standard deviation of all similarity values within the initial region. Assume the calculated mean is 0.875 and the standard deviation is 0.068. Set the region growing threshold based on these two statistics. Use the mean minus the standard deviation multiple as the threshold, for example, threshold = 0.875 - 1.5 × 0.068 = 0.773. Merge adjacent feature locations with similarity values greater than this threshold into the current region to form the updated region.
[0107] During the region growing process, each iteration calculates the similarity value of all feature positions in the updated region and compares it with the threshold, and adds new positions that meet the conditions to the region. For example, the initial region contains 49 positions, and the region may expand to 78 positions after the first iteration and to 102 positions after the second iteration. When the difference in the number of feature positions in the updated region of two consecutive iterations is less than the preset difference threshold (such as 3 positions), the region growing is stopped and the final candidate target region is obtained. For example, if the region contains 189 positions after the tenth iteration and 191 positions after the eleventh iteration, and the difference is 2, which is less than the preset threshold 3, the iteration is stopped and the region containing 191 feature positions is determined to be the candidate target region.
[0108] Calculate anomaly scores for the candidate target regions. Calculate the average feature distance between all pairs of feature locations within the candidate target region to obtain the feature distance value within the region. For example, for a candidate region containing 191 feature locations, the average feature distance for all pairs of feature locations within the region might be 0.128, indicating a high degree of feature similarity within the region.
[0109] 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 locations outside the candidate target region. Randomly sample 1000 feature location pairs from the candidate region and the background region respectively, and calculate the average feature distance between them. Assume that the obtained value is 0.582, indicating that the features of the target region and the background region are significantly different.
[0110] The anomaly score is calculated by multiplying the intra-region feature distance value and the inter-region feature distance value by the preset weight coefficients. The preset intra-region feature distance weight can be -1.0, and the inter-region feature distance weight can be 2.0. The anomaly score is calculated as -1.0 × 0.128 + 2.0 × 0.582 = 1.036. The higher the anomaly score, the more likely the region is an anomaly.
[0111] Set an anomaly score threshold (e.g., 0.8). When the calculated anomaly score is greater than the threshold, the candidate region is determined to be an anomaly. Record the location information (e.g., region center coordinates, region bounding box, etc.) and score information (e.g., the calculated anomaly score) of the anomaly target as the final result of anomaly detection. In this example, the anomaly score of 1.036 is greater than the threshold of 0.8, so the candidate region is determined to be an anomaly. Its location information is the center coordinates (45, 67), the bounding box is a 30×30 pixel area centered on this point, and the score is 1.036.
[0112] The method of this embodiment scores and screens multiple candidate target regions, allowing for the simultaneous presence of multiple anomaly targets. For candidate regions with similar scores but significant overlap, non-maximum suppression techniques can be used to retain the highest-scoring regions, eliminating redundant detection results and further improving the accuracy of anomaly detection.
[0113] This embodiment specifically addresses the problem of detecting abnormal objects with local similarity. Existing technologies primarily employ end-to-end anomaly detection methods based on deep learning, which directly learn the feature representations of normal samples and classify samples that deviate from the normal feature distribution as abnormal. Alternatively, reconstruction-based anomaly detection methods discover abnormal regions by reconstructing normal samples. Density estimation-based methods also identify anomalies by calculating the local density of sample points.
[0114] However, existing methods have significant shortcomings. End-to-end methods require large amounts of labeled data for training and have limited generalization capabilities; reconstruction methods are susceptible to noise and insensitive to local anomalies; and density estimation methods fail to fully utilize the local structural information of features. These issues limit the practical application of anomaly detection.
[0115] The method of this embodiment fully utilizes the local similarity of target features and adaptively determines the boundaries of abnormal targets through region growing. By introducing a kernel function to calculate local similarity, the local structure of the feature is better characterized; a region growing strategy with an adaptive threshold is adopted to more accurately determine the target region; and an anomaly scoring mechanism is designed that considers both intra-regional similarity and inter-regional differences. In practical applications, effective anomaly detection can be achieved without a large amount of labeled data, and the boundaries of abnormal targets with local similarity can be accurately located, showing good adaptability to multi-scale abnormal targets. At the same time, the impact of noise interference is significantly reduced, improving the stability and reliability of abnormal target detection.
[0116] like Figure 3 The figure shows the performance of various anomaly detection methods in three dimensions: detection speed (FPS), accuracy (F1 score), and resource consumption (memory usage). The method in this example achieves the best balance between performance and efficiency, with a high detection speed of 37.8 FPS, an F1 score of 94.7%, and a memory usage of 2.1 GB. In comparison, PatchCore, while achieving an F1 score of 90.3%, has a detection speed of only 18.2 FPS and a memory usage of 3.5 GB. PaDiM has a detection speed of 24.5 FPS, an F1 score of 89.5%, and a memory usage of 2.8 GB. DeepSVDD, while having a faster detection speed (32.7 FPS) and a lower memory usage (1.8 GB), has an F1 score of only 86.3%. AnoGAN performs poorly in all aspects, with a detection speed of only 5.6 FPS, a memory usage of 5.7 GB, and the lowest F1 score of only 82.1%. These data fully demonstrate the comprehensive advantages of the method in this embodiment in practical applications: it maintains high-precision anomaly detection capabilities while offering fast processing efficiency and moderate resource consumption, making it ideal for deployment on resource-constrained edge devices. In particular, compared to the popular PatchCore and PaDiM methods, the method in this embodiment more than doubles detection speed while also improving detection accuracy. This is of great significance for applications requiring real-time processing, such as industrial inspection and video surveillance.
[0117] In an optional embodiment, based on the prediction results of the internal state of the safety cabinet and the abnormal target detection results, a Gaussian kernel function is used to extract the control trajectory from the preset expert strategy library. Through expectation maximization and strategy network optimization, the control parameters of the explosion-proof safety cabinet are obtained, including:
[0118] The expert control strategy is represented as a sequence of state-action pairs, including a cabinet state vector and a control action vector, wherein the control action vector includes a cooling power parameter, an exhaust frequency parameter, and a locking force parameter;
[0119] Constructing the safe internal state prediction result and the abnormal target detection result into a state vector, calculating the Euclidean distance between the state vector and the state vector in the state-action pair sequence, substituting the Euclidean distance into the Gaussian kernel function to obtain a similarity value, and selecting a preset number of expert trajectories with the highest similarity values;
[0120] Based on the selected expert trajectory, the mixture weight parameter, mean parameter and covariance parameter of the Gaussian mixture distribution are iteratively calculated through the expectation maximization algorithm until the change in the log-likelihood function value is less than the preset change threshold, and the action prior probability distribution is obtained;
[0121] 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, and construct an 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 an optimization policy model;
[0122] The current state is input into the optimization strategy model to generate a refrigeration power parameter value, an exhaust frequency parameter value, and a locking force parameter value, and determine the control parameters of the explosion-proof safety cabinet.
[0123] In one specific embodiment, abnormal object detection utilizes a modified YOLOv5 model, based on a deep learning algorithm, to identify potentially hazardous items within cabinets. The model input is a 224×224 pixel RGB image. Features are extracted using the CSPDarknet53 backbone network, and multi-scale features are fused using an FPN feature pyramid network to ultimately output the target category and confidence score. The model is trained on the COCO dataset and a dataset of 12,000 images from a specific hazardous materials dataset, including 10 categories of hazardous materials, including flammables, corrosives, and explosives. Training is performed with a batch size of 64 and a learning rate of 0.001. After 100 iterations, the model achieves a mean average performance (MAP) of 93.5% on the validation set.
[0124] An expert control strategy library was constructed, consisting of multiple state-action pair sequences {s, a}. 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 = [cooling power, exhaust frequency, locking force], with a dimension of 3. For example, when flammable materials are detected and the temperature exceeds 30°C, an expert strategy might be a = [0.8, 0.6, 0.9], indicating control at 80% maximum cooling power, 60% exhaust frequency, and 90% locking force. The expert strategy library was constructed using data collected from 200 safety response scenarios and contains a total of 5,000 state-action samples.
[0125] After obtaining the current cabinet state, the Euclidean distance between the current state vector and each state vector in the expert database is calculated. For example, suppose the current state is s_cur = [28.5, 65%, 101.3 kPa, 120 ppm, 1, 0.92], indicating a temperature of 28.5°C, humidity of 65%, standard atmospheric pressure, a VOC concentration of 120 ppm, and a Type 1 hazardous material (flammable) detected with 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||.
[0126] The calculated distance is applied to a Gaussian kernel function to calculate similarity, with the kernel bandwidth parameter set to 0.5. A higher similarity value indicates a greater similarity between the current state and the expert sample. The 50 expert trajectories with the highest similarity are selected as the reference set. For example, the average value of the action vectors in the selected expert trajectory set is [0.75, 0.55, 0.85], representing 75% cooling power, 55% exhaust frequency, and 85% locking force.
[0127] The expectation-maximization algorithm is used to estimate the parameters of the Gaussian mixture model for the action. The number of Gaussian mixture components is set to 3, the initial mixture weights are set 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. Iteration is performed 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 to three 3×3 matrices (omitted here). This constitutes the prior probability distribution of the action.
[0128] A policy network was constructed for optimization. The policy network consists of three fully connected layers with 128 and 64 hidden nodes, respectively. The input is the current state vector, and the output is the probability distribution of control actions. The network's initial parameters are initialized using the Xavier method. The optimization objective function consists of two parts: a control reward and a KL divergence constraint. The control reward is assessed based on the safety of the state. For example, the closer the temperature is to the safe range (20-25°C), the higher the reward. The reward increases when dangerous objects are detected and handled properly. The KL divergence constraint ensures that the generated policy does not deviate excessively from the prior distribution, and the constraint coefficient is set to 0.05.
[0129] During the optimization process, the Adam algorithm was used to update network parameters, with an initial learning rate of 0.001, which was decayed by a factor of 0.9 every 50 rounds. After 300 rounds of iterative optimization, the network parameters stabilized, the reward on the validation set increased by 15%, and the KL divergence remained below 0.35, demonstrating that the strategy was both innovative and consistent with expert experience.
[0130] 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], which sets the cooling power to 82%, the exhaust frequency to 58%, and the locking force to 91%. These parameter values are converted into actual control signals by the digital-to-analog conversion module and sent to the actuators of the explosion-proof safety cabinet to adjust the cooling system power, control the exhaust frequency, and adjust the locking mechanism force.
[0131] A safety monitoring loop is also implemented to reassess the cabinet's internal conditions every 5 seconds and dynamically adjust control parameters. If a serious anomaly is detected (such as a temperature exceeding 40°C or an explosive confidence level greater than 0.95), an emergency plan is triggered, enforcing the highest safety level control strategy [1.0, 1.0, 1.0] and issuing an alarm. Experiments have shown that this method reduces the incidence of dangerous events and shortens response time compared to traditional fixed-threshold control strategies.
[0132] The deep learning-based intelligent control system for explosion-proof safety cabinets according to an embodiment of the present invention includes:
[0133] The first unit is used to collect multi-dimensional status data and environmental image data inside the explosion-proof safety cabinet;
[0134] 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 piecewise recursive structure, and output the prediction result of the internal state of the safe after residual enhancement and dynamic reorganization;
[0135] The third unit is used to input environmental image data into the twin neural network, generate a target feature map through multi-level feature enhancement and fusion in the feature extraction branch, and optimize the bidirectional metric loss in the metric learning branch. The target feature map is analyzed by the region growing algorithm based on local similarity to obtain the abnormal target detection result.
[0136] The fourth unit is used to extract the control trajectory from the preset expert strategy library using the Gaussian kernel function based on the internal state prediction results of the safety cabinet and the abnormal target detection results. The control parameters of the explosion-proof safety cabinet are obtained through expectation maximization and strategy network optimization.
[0137] The fifth unit is used to execute explosion-proof safety cabinet control according to control parameters and trigger the emergency response mechanism when an abnormal state is detected.
[0138] According to a third aspect of an embodiment of the present invention, an electronic device is provided, including:
[0139] processor;
[0140] a memory for storing processor-executable instructions;
[0141] The processor is configured to call the instructions stored in the memory to execute the aforementioned method.
[0142] According to a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method described above is implemented.
[0143] The present invention may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present invention.
[0144] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, 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 explosion-proof safety cabinets based on deep learning, characterized in that: include: Collect multi-dimensional status data and environmental image data inside the explosion-proof safety cabinet; A dynamic discrete wavelet transform is performed on the multi-dimensional state data inside the cabinet to obtain a coefficient matrix. The optimized feature vector is obtained through adaptive threshold optimization. The optimized feature vector is input into a multi-layer causal convolutional network with a piecewise recursive structure. After residual enhancement and dynamic reorganization, the prediction result of the internal state of the safe cabinet is output; The environmental image data is input into the twin neural network. Through multi-level feature enhancement and fusion in the feature extraction branch and bidirectional metric loss optimization in the metric learning branch, a target feature map is generated. The target feature map is analyzed by the region growing algorithm based on local similarity to obtain the abnormal target detection result. Based on the prediction results of the internal state of the safety cabinet and the abnormal target detection results, the Gaussian kernel function is used to extract the control trajectory from the preset expert strategy library. Through expectation maximization and strategy network optimization, the control parameters of the explosion-proof safety cabinet are obtained, including: The expert control strategy is represented as a sequence of state-action pairs, including a cabinet state vector and a control action vector, wherein the control action vector includes a cooling power parameter, an exhaust frequency parameter, and a locking force parameter; Constructing the safe internal state prediction result and the abnormal target detection result into a state vector, calculating the Euclidean distance between the state vector and the state vector in the state-action pair sequence, substituting the Euclidean distance into the Gaussian kernel function to obtain a similarity value, and selecting a preset number of expert trajectories with the highest similarity values; Based on the selected expert trajectory, the mixture weight parameter, mean parameter and covariance parameter of the Gaussian mixture distribution are iteratively calculated through the expectation maximization algorithm until the change in the log-likelihood function value is less than the preset change threshold, and the action prior probability distribution is obtained; 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, and construct an 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 an optimization policy model; Input the current state into the optimization strategy model to generate a cooling power parameter value, an exhaust frequency parameter value, and a locking force parameter value, and determine the control parameters of the explosion-proof safety cabinet; The explosion-proof safety cabinet is controlled according to the control parameters, and the emergency response mechanism is triggered when an abnormal state is detected.
2. The method according to claim 1, characterized in that Dynamic discrete wavelet transform is performed on the multi-dimensional state data inside the cabinet to obtain a coefficient matrix. The optimized feature vector is obtained through adaptive threshold optimization. The optimized feature vector is input into a multi-layer causal convolutional network with a piecewise recursive structure. After residual enhancement and dynamic reorganization, the output of the safety cabinet internal state prediction results includes: Perform dynamic discrete wavelet transform on the multidimensional 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 multidimensional state data in the cabinet based on the wavelet functions and scaling functions, and obtain the approximate coefficient matrix and detail coefficient matrix; Based on the approximate coefficient matrix and the detail coefficient matrix, the adaptive threshold parameters are calculated by the product relationship of signal length, noise standard deviation and signal-to-noise ratio. The adaptive threshold parameters are substituted into the soft threshold function, and the approximate coefficient matrix and the detail coefficient matrix are optimized to generate the optimized eigenvector. A multi-layer causal convolutional network with a piecewise recursive structure is constructed. Residual learning units are introduced between adjacent layers to enhance features. The receptive field range of each layer is adjusted according to a preset dilation rate parameter sequence. The convolution kernel of each layer is causally convolved with the output features of the previous layer, and feature mapping is performed in a piecewise linear manner to obtain intermediate feature representations. The optimized feature vector is input into a multi-layer causal convolutional network with a piecewise recursive structure. Feature measurement and dynamic reorganization are performed through intermediate feature representation. After iterative optimization and weighted fusion, probability normalization is performed, and the state prediction probability distribution is output as the final prediction result.
3. The method according to claim 2, characterized in that Feature measurement and dynamic reorganization are performed through intermediate feature representation, and probability normalization is performed after iterative optimization and weighted fusion. The output state prediction probability distribution as the final prediction result includes: A feature metric matrix is constructed based on the statistical distribution of the intermediate feature representations. The Mahalanobis distance between feature pairs is calculated by extracting the mean and covariance of the intermediate feature representations to generate a feature similarity matrix. The intermediate feature representation is divided into multiple feature reorganization groups according to the preset similarity threshold, the intra-group variance of each feature reorganization group is calculated, and the feature weight coefficient is set based on the feature information amount; A gradient iteration method is used to optimize each feature recombination group. During the iteration process, the parameters of the feature recombination group are updated and the recombination error is calculated. The iteration is stopped when the recombination error is less than the preset error threshold or the preset number of iterations is reached. The optimized feature recombination groups are fused using a weighted method to obtain the recombination features. The recombination features are normalized and an adjustment factor is introduced. The state prediction probability distribution is output as the final prediction result.
4. The method according to claim 1, wherein The environmental image data is input into the twin neural network. Through the multi-level feature enhancement and fusion of the feature extraction branch and the bidirectional metric loss optimization of the metric learning branch, the target feature map is generated, including: The environmental image data is input into the feature extraction branch of the twin neural network with a dual-branch structure. The feature extraction branch sets feature enhancement modules at different levels of the backbone network, generates a corresponding weight matrix based on the feature map of each layer through single-channel convolution operation and normalization function, multiplies the feature map of each layer by the corresponding weight matrix element by element to obtain an 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, extracting anchor sample features, positive sample features, and negative sample features through the metric learning branch of the twin 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 the 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 probabilities of the anchor sample features and the positive sample features, as well as the conditional probabilities of the anchor sample features and the negative sample features; The feature space loss function and the semantic space loss function are weightedly fused to obtain a bidirectional metric loss function, and a target feature map is obtained through back-propagation optimization of the bidirectional metric loss function.
5. The method according to claim 1, characterized in that The region growing algorithm based on local similarity analyzes the target feature map and obtains the abnormal target detection results including: Calculate the feature distance between each feature position in the target feature map and the corresponding neighboring feature position, substitute the feature distance into the kernel function to obtain a 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 with the seed point as the center, calculate the mean and standard deviation of all similarity values in the initial region, set a region growing threshold, merge adjacent feature positions with similarity values greater than the region growing threshold into the current region to obtain an updated region, and repeat the process until the difference in the number of feature positions in the updated regions of two consecutive adjacent iterations is less than the preset difference threshold, thereby obtaining a candidate target region; Calculate the average feature distance between all feature positions in the candidate target area to obtain the feature distance value within the area, calculate the average feature distance between the candidate target area and the background area to obtain the feature distance value between the areas, multiply the feature distance value within the area and the feature distance value between the areas by the preset weight coefficient respectively, and sum them to obtain the abnormal score value. Determine the location information and score information of the abnormal target based on the abnormal score value, and determine the abnormal target detection result.
6. An intelligent control system for explosion-proof safety cabinets based on deep learning, used to implement the method according to any one of claims 1 to 5, characterized in that: include: The first unit is used to collect multi-dimensional status 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 piecewise recursive structure, and output the prediction result of the internal state of the safe after residual enhancement and dynamic reorganization; The third unit is used to input environmental image data into the twin neural network, generate a target feature map through multi-level feature enhancement and fusion in the feature extraction branch, and optimize the bidirectional metric loss in the metric learning branch. The target feature map is analyzed by the region growing algorithm based on local similarity to obtain the abnormal target detection result. The fourth unit is used to extract the control trajectory from the preset expert strategy library using the Gaussian kernel function based on the internal state prediction results of the safety cabinet and the abnormal target detection results. The control parameters of the explosion-proof safety cabinet are obtained through expectation maximization and strategy network optimization. The fifth unit is used to execute explosion-proof safety cabinet control according to control parameters and trigger the emergency response mechanism when an abnormal state is detected.
7. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Substation defect discrimination method and system
CN117115727A
Explosion-proof power distribution cabinet control method and system based on situation awareness
CN119209923A