Electric spark machining anomaly classification and identification method and system

By combining multi-dimensional feature extraction and multi-granularity classifiers with a multi-window verification mechanism, the problem of insufficient multi-scale signal fusion in electrical discharge machining is solved, achieving a balance between rapid screening and fine discrimination, and improving the accuracy and reliability of anomaly identification.

CN121786706APending Publication Date: 2026-04-03XIAO PULSE (NANTONG) INTELLIGENT EQUIPMENT CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-04
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing electrical discharge machining anomaly identification methods lack the fusion representation of multi-scale and multi-dimensional signal characteristics, which leads to the submergence of subtle anomaly features. Furthermore, it is difficult to balance response speed and diagnostic accuracy. Single-granularity output cannot achieve rapid screening and fine discrimination, and single-time-window judgment is prone to result jumps due to instantaneous signal fluctuations, lacking a stable decision-making mechanism.

Method used

By extracting multi-dimensional features from voltage and current signals during electrical discharge machining, a multi-granularity anomaly classifier is constructed. A multi-window verification and state preservation mechanism is adopted, and the probability distributions of coarse and fine granularity are combined for calculation, ultimately outputting a stable anomaly category.

Benefits of technology

It significantly improves the accuracy and reliability of electrical discharge machining anomaly identification, can quickly identify serious anomalies and make precise judgments, reduce false alarm and false alarm rates, enhance system robustness, and ensure machining safety and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121786706A_ABST
    Figure CN121786706A_ABST
Patent Text Reader

Abstract

The invention discloses an electric spark machining anomaly classification and recognition method and system, and relates to the technical field of machining anomaly recognition, and the method comprises the following steps: segmenting a continuous signal to obtain discrete signal segments, carrying out the signal extraction of the discrete signal segments to obtain feature data, forming a multi-dimensional feature vector according to the feature data, and carrying out the classification and recognition of machining anomaly. Inputting the multi-dimensional feature vector into a multi-granularity anomaly classifier, outputting coarse-granularity candidate category probability distribution and fine-granularity candidate category probability distribution, and performing calculation based on the coarse-granularity candidate category probability distribution and the fine-granularity candidate category probability distribution to obtain a preliminary anomaly recognition result of the time window; and based on the preliminary anomaly identification result of e time windows, a multi-window verification and state maintenance mechanism is adopted, and a final anomaly category is output, so that the whole process optimization of processing anomaly from rapid early warning and fine classification to reliable decision making is realized, the false alarm and missing report rate is reduced, the system robustness is improved, and the processing safety and quality are finally guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machining anomaly identification technology, and in particular to a method and system for classifying and identifying electrical discharge machining anomalies. Background Technology

[0002] In recent years, electrical discharge machining (EDM) has been increasingly widely used in aerospace, precision mold and complex component manufacturing. The stability of the machining process and the ability to identify abnormal states in real time directly determine the surface quality of the workpiece, machining efficiency and equipment life. Traditional anomaly identification methods mostly rely on single signal threshold judgment or expert systems based on fixed rules, which are difficult to effectively distinguish between a variety of complex and coupled anomaly types. Especially when facing transient, intermittent anomalies and similar anomalies of different severity, there are problems such as coarse identification granularity, high false alarm rate and weak adaptive ability, which limit the improvement of the intelligent monitoring level of the machining process.

[0003] The shortcomings of existing technologies are mainly reflected in the following aspects: feature extraction is often limited to a single level in the time or frequency domain, lacking the fusion representation of the multi-scale and multi-dimensional characteristics of the signal, resulting in the submergence of subtle abnormal features; anomaly classification models usually adopt a single granularity output, which cannot simultaneously achieve rapid screening of large anomaly categories and fine discrimination of specific anomaly types, making it difficult to balance response speed and diagnostic accuracy in practical applications; most methods only make independent judgments based on a single time window, without considering the continuity and persistence of anomalies in time, which can easily lead to jumps in results due to instantaneous fluctuations in the signal, and lack a stable decision-making mechanism. Summary of the Invention

[0004] The technical problem solved by this invention is that the shortcomings of the prior art are mainly reflected in the fact that feature extraction is often limited to a single level in the time domain or frequency domain, lacking the fusion representation of the multi-scale and multi-dimensional characteristics of the signal, resulting in the submergence of subtle abnormal features; the anomaly classification model usually adopts a single granularity output, which cannot simultaneously achieve rapid screening of the major anomaly categories and fine discrimination of specific anomaly types, making it difficult to balance response speed and diagnostic accuracy in practical applications; most methods only make independent judgments based on a single time window, without considering the continuity and state persistence of anomalies in time, which can easily lead to jumps in results due to instantaneous fluctuations in the signal, and lacks a stable decision-making mechanism.

[0005] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a method for classifying and identifying abnormalities in electrical discharge machining, comprising the following steps: Step S1: Segment the continuous signal to obtain discrete signal segments, and extract the signal from the discrete signal segments to obtain feature data; Step S2: Construct a multi-dimensional feature vector based on the feature data; Step S3: Input the multi-dimensional feature vector into the multi-granularity anomaly classifier and output the coarse-grained candidate class probability distribution and the fine-grained candidate class probability distribution. Preliminary anomaly identification results for the time window are obtained by calculating the probability distributions of coarse-grained and fine-grained candidate categories. Step S4: Based on the preliminary anomaly identification results of e time windows, a multi-window verification and state preservation mechanism is adopted to output the final anomaly category.

[0006] As a preferred embodiment of the electrical discharge machining anomaly classification and identification method of the present invention, in step S1, the continuous signal is segmented to obtain discrete signal segments, and the discrete signal segments are extracted to obtain feature data; Step S1 includes steps S101, S102, S103, S104, S105 and S106; Step S101: Synchronously acquire the voltage and current signals of the discharge gap during the electrical discharge machining process; The acquired voltage and current signals are filtered by bandpass filtering to remove high-frequency noise and power frequency interference, resulting in a filtered continuous signal. A continuous signal is divided into discrete signal segments by dividing it into fixed time windows. The fixed time window has a length of 100 milliseconds, and adjacent windows overlap by 50%. The discrete signal segment includes a voltage signal sub-segment and a current signal sub-segment; Step S102: Perform the first extraction on the discrete signal segment to obtain the time-domain features; A second extraction is performed on the discrete signal segment to obtain frequency domain features; A third extraction is performed on the discrete signal segment to obtain time-frequency domain features; Step S103, the first extraction process includes calculating the voltage standard deviation and current standard deviation of the discrete signal segment; The voltage standard deviation and the current standard deviation constitute the time-domain characteristics; Step S104, the second extraction process includes performing fast Fourier transform on the voltage signal segment and the current signal segment respectively to obtain the amplitude spectrum corresponding to the voltage signal segment and the amplitude spectrum corresponding to the current signal segment; The amplitude spectrum corresponding to the voltage signal segment is denoted as the first spectrum, and the amplitude spectrum corresponding to the current signal segment is denoted as the second spectrum. The first frequency spectrum is divided into low-frequency band, mid-frequency band, and high-frequency band; Calculate the ratio of the energy of the low-frequency band, mid-frequency band, and high-frequency band in the first spectrum to the total energy of the first spectrum, and obtain the low-frequency band energy ratio, mid-frequency band energy ratio, and high-frequency band energy ratio of the voltage signal sub-segment; The second spectrum is divided into low-frequency band, mid-frequency band, and high-frequency band; Calculate the ratio of the energy of the low-frequency band, mid-frequency band, and high-frequency band in the second spectrum to the total energy of the second spectrum, and obtain the low-frequency band energy ratio, mid-frequency band energy ratio, and high-frequency band energy ratio of the current signal sub-segment; The low-frequency band energy ratio, mid-frequency band energy ratio, and high-frequency band energy ratio of the voltage signal segment, and the low-frequency band energy ratio, mid-frequency band energy ratio, and high-frequency band energy ratio of the current signal segment constitute the frequency domain characteristics. Step S105, the third extraction process includes using wavelet basis functions to perform N-level wavelet packet decomposition on the voltage signal segment and the current signal segment respectively, to obtain the wavelet packet coefficients corresponding to the voltage signal segment and the current signal segment in each frequency sub-band; Calculate the energy of the wavelet packet coefficients for each frequency sub-band; Arrange the energy values ​​of all frequency sub-bands from low to high according to the frequency of the corresponding frequency sub-band to form an initial time-frequency domain feature set; By setting a frequency division threshold, the initial time-frequency domain feature set is divided into a first group and a second group: The partitioning logic is as follows: the energy of all frequency sub-bands with frequencies greater than the frequency partitioning threshold is divided into the first group and used as the initial channel for high-frequency features; The energy of all frequency sub-bands with frequencies less than or equal to the frequency division threshold is divided into a second group and used as the initial channel for low-frequency features. The number of channels in the initial high-frequency characteristic channel is equal to the number of frequency sub-bands in the first group; The number of channels in the initial low-frequency characteristic channel is equal to the number of frequency sub-bands in the second group.

[0007] As a preferred embodiment of the electrical discharge machining anomaly classification and identification method of the present invention, in step S106, two types of dedicated convolution kernels are used to perform convolution processing on the high-frequency feature initial channel and the low-frequency feature initial channel respectively. The two types of dedicated convolution kernels include high-frequency to low-frequency convolution kernels and low-frequency to high-frequency convolution kernels. Among them, the high-frequency to low-frequency convolution kernel matches the output resolution of the initial high-frequency feature channel to the scale of the low-frequency feature channel while preserving the high-frequency attributes; The low-frequency to high-frequency convolution kernel matches the output resolution of the initial low-frequency feature channel to the scale of the high-frequency feature channel while preserving the low-frequency attributes. After the initial high-frequency feature channel is processed by a 3×3 high-frequency to low-frequency convolution kernel with a stride of 2, the resolution of the high-frequency feature channel is matched with that of the low-frequency feature channel, and the high-frequency features in the time-frequency domain are output. After the initial low-frequency feature channel is processed by a 1×1 low-frequency to high-frequency convolution kernel with a stride of 1, it is then subjected to transposed convolution and bilinear interpolation to achieve resolution matching with the high-frequency feature channel, outputting the time-frequency domain low-frequency features.

[0008] As a preferred embodiment of the electrical discharge machining anomaly classification and identification method of the present invention, step S2 involves constructing a multi-dimensional feature vector based on feature data. The construction process includes splicing time-domain features, frequency-domain features, high-frequency features in the time-frequency domain, and low-frequency features in the time-frequency domain according to the scale fusion logic; The scale fusion logic specifically includes using time-domain features as shallow low-frequency features, frequency-domain features and time-frequency domain high-frequency features as deep features, and time-frequency domain low-frequency features as shallow high-frequency supplementary features. These features are then concatenated in a preset order: time-domain features, time-frequency domain low-frequency features, frequency-domain features, and time-frequency domain high-frequency features, to form a multi-dimensional feature vector.

[0009] As a preferred embodiment of the electrical discharge machining anomaly classification and identification method of the present invention, in step S3, the multi-dimensional feature vector is input into the multi-granularity anomaly classifier to obtain the coarse-grained candidate category probability distribution and the fine-grained candidate category probability distribution. Step S301: Normalize the multi-dimensional feature vectors to obtain normalized feature vectors; The normalized eigenvectors are activated by the ReLU function, and nonlinear transformation and feature enhancement are performed to obtain a high-dimensional feature set. The high-dimensional feature set is divided into a coarse-grained feature subset and a fine-grained feature subset. The logic of the division is as follows: the dimensions of time-domain features and frequency-domain features in the high-dimensional feature set are assigned to the feature subset of coarse-grained classification, and the dimensions of high-frequency features and low-frequency features in the time-frequency domain are assigned to the feature subset of fine-grained classification. Step S302: The feature subset of coarse-grained classification is processed through the coarse-grained classification branch of the multi-grained parallel output layer to obtain a coarse-grained classification probability distribution. The coarse-grained candidate categories corresponding to the coarse-grained classification probability distribution specifically include normal processing, slight fluctuation, moderate abnormality, severe abnormality, gap abnormality, short circuit abnormality, arc abnormality and system failure. The expression for the coarse-grained classification probability distribution is: ; in, This represents the probability distribution for coarse-grained classification. This represents the activation function. This represents a subset of features for coarse-grained classification. This represents the weight of the coarse-grained classification branch. This represents the bias vector corresponding to the coarse-grained classification branch. The feature subset of fine-grained classification is processed through the fine-grained classification branch of the multi-granularity parallel output layer to obtain a fine-grained classification probability distribution. The fine-grained candidate categories corresponding to the fine-grained classification probability distribution specifically include normal arc discharge, weak arc anomaly, strong arc anomaly, intermittent short circuit, continuous short circuit, slight open circuit, severe open circuit, voltage fluctuation anomaly, current fluctuation anomaly, resonance anomaly, electrode wear anomaly, and working fluid anomaly. The expression for the fine-grained classification probability distribution is as follows: ; in, This represents the probability distribution for fine-grained classification. This represents the activation function. A subset of features representing fine-grained classification. This represents the weight of the fine-grained classification branch. This represents the bias vector corresponding to the fine-grained classification branch.

[0010] As a preferred embodiment of the electrical discharge machining anomaly classification and identification method described in this invention, step S303 involves, based on a coarse-grained classification probability distribution... Select the coarse-grained candidate category corresponding to the highest probability value as the optimal coarse-grained candidate category. ; Set the weighting coefficients for the coarse-grained classification probability distribution as follows: Weighting coefficients are set for the fine-grained classification probability distribution. ,and ; and The value is selected according to the adaptive adjustment rule, specifically, when the optimal coarse-grained candidate category is... When it is a serious abnormality, Take 0.6, Take 0.4; When the optimal coarse-grained candidate category When there are slight fluctuations, Take 0.3, Take 0.7; When the optimal coarse-grained candidate category When it is not a serious abnormality or a slight fluctuation, Take 0.5, Take 0.5; When the optimal coarse-grained candidate category When the system fails, Take 0, Select 1 and output the optimal coarse-grained candidate category. No fusion computing is performed; When the optimal coarse-grained candidate category When the problem is not a system fault, the probability distribution is determined by fine-grained classification. Selecting the optimal coarse-grained candidate categories A fine-grained subset of candidate categories with a mapping relationship; Construct an extended coarse-grained probability distribution with the same dimension as the fine-grained classification probability distribution, denoted as . And the optimal coarse-grained candidate category In coarse-grained classification probability distribution The corresponding probability value is assigned to all coarse-grained candidate categories in the extended coarse-grained probability distribution. The dimensions corresponding to fine-grained candidate categories that have a mapping relationship; Among them, the extended coarse-grained probability distribution All other dimensions that have not been assigned a value are set to 0; A fusion calculation is performed on the extended coarse-grained probability distribution and the fine-grained classification probability distribution to obtain the fused probability distribution; The expression for fusion computation is, ; in, Represents the fusion probability distribution; Selecting the fusion probability distribution The fine-grained candidate category with the highest probability value is used as the preliminary anomaly identification result for the current time window.

[0011] As a preferred embodiment of the electrical discharge machining anomaly classification and identification method described in this invention, in step S4, based on the preliminary anomaly identification results of e time windows, a multi-window continuous verification and state preservation mechanism is adopted to output the final anomaly category. Step S4 includes steps S401, S402, S403, S404, S405 and S406. Step S401: Calculate the confidence level of the preliminary anomaly identification results for the current time window. The evaluation logic is to calculate the maximum confidence level corresponding to the coarse-grained classification probability distribution and the maximum confidence level corresponding to the fine-grained classification probability distribution. The expression for the maximum confidence level corresponding to the coarse-grained classification probability distribution is: ; in, This represents the maximum confidence level corresponding to the coarse-grained classification probability distribution. The expression for the maximum confidence level corresponding to the fine-grained classification probability distribution is: ; in, This represents the maximum confidence level corresponding to the fine-grained classification probability distribution. If the optimal coarse-grained candidate category If the system is faulty, then the maximum confidence level corresponding to the coarse-grained classification probability distribution is... Calculate the maximum confidence level corresponding to the fine-grained classification probability distribution. No calculations are performed; Step S402: Determine the maximum confidence level corresponding to the coarse-grained classification probability distribution and the maximum confidence level corresponding to the fine-grained classification probability distribution; The judgment logic is as follows: if the first condition or the second condition is met, the exception category is output as the first judgment result. Otherwise, if the third condition is met, it is marked as pending confirmation and multi-window continuity verification is initiated; The first condition is that the optimal coarse-grained candidate category is not a system fault, and the maximum confidence level corresponding to the coarse-grained classification probability distribution is greater than or equal to the first decision threshold, while the maximum confidence level corresponding to the fine-grained classification probability distribution is greater than or equal to the first decision threshold. The second condition is that the optimal coarse-grained candidate category is system fault and the maximum confidence level corresponding to the coarse-grained classification probability distribution is greater than or equal to the first judgment threshold. The third condition is that the maximum confidence level corresponding to the coarse-grained classification probability distribution is greater than or equal to the second decision threshold and less than the first decision threshold, and the maximum confidence level corresponding to the fine-grained classification probability distribution is greater than or equal to the second decision threshold and less than the first decision threshold.

[0012] As a preferred embodiment of the electrical discharge machining anomaly classification and identification method of the present invention, in step S403, the basic parameters of multi-window continuous verification include: the first verification threshold is a first proportion range of the first judgment threshold, the second verification threshold is a second proportion range of the first judgment threshold, and the fine-grained confidence preset threshold is a verification proportion of the first judgment threshold. The logic of multi-window continuous verification is as follows: if the same coarse-grained candidate category is detected in three consecutive time windows, and the maximum confidence level corresponding to the coarse-grained classification probability distribution of each window is greater than the first verification threshold, then it is confirmed as a real anomaly and the second judgment result is output. If the same coarse-grained candidate category is detected in two consecutive time windows, and the average of the maximum confidence scores corresponding to the coarse-grained classification probability distributions of the two windows is greater than the second verification threshold, then it is confirmed as a real anomaly, and the second judgment result is output. If the maximum confidence level corresponding to the coarse-grained classification probability distribution satisfies the logic of multi-window continuity verification, but the maximum confidence level corresponding to the fine-grained classification probability distribution is lower than the preset threshold of fine-grained confidence, then the coarse-grained candidate category that passes the multi-window continuity verification is marked as a type to be refined, and the top three categories in terms of probability value among the coarse-grained candidate category and the fine-grained candidate category that has a mapping relationship with the coarse-grained candidate category in the fine-grained classification probability distribution are output as the third judgment result; If the maximum confidence level corresponding to the coarse-grained classification probability distribution satisfies the logic of multi-window continuous verification, and the maximum confidence level corresponding to the fine-grained classification probability distribution is greater than or equal to the preset threshold of fine-grained confidence level, then the coarse-grained candidate category and the corresponding fine-grained candidate category are output, and the third judgment result is output.

[0013] As a preferred embodiment of the electrical discharge machining anomaly classification and identification method of the present invention, in step S404, the multi-window verification mechanism further includes an anomaly severity grading response strategy: When the coarse-grained candidate category is a severe anomaly or a system failure, the number of verification windows is reduced to 2, and the confidence threshold is lowered to the first confidence adjustment threshold, and the fifth judgment result is output. When the coarse-grained candidate category has slight fluctuations, the number of validation windows is increased to 4, and the confidence threshold is raised to the second confidence adjustment threshold, and the fifth judgment result is output. If the fine-grained candidate category of the preliminary anomaly identification result is a persistent short circuit or a severe open circuit, and the maximum confidence level corresponding to the coarse-grained classification probability distribution of the preliminary anomaly identification result is greater than or equal to the emergency threshold, an emergency shutdown signal is immediately triggered, and the fifth judgment result is output without waiting for the multi-window verification to be completed. Step S405, the state preservation mechanism specifically includes, for the first determination result output in step S402 and the second or third determination result output in step S403, activating the abnormal state preservation mechanism; The abnormal state retention mechanism is as follows: if the first judgment result, the second judgment result, or the third judgment result is continuously output for more than or equal to 5 time windows, then a fourth judgment result is generated and output. If, within 5 consecutive time windows, a fifth, third, second, first, or fourth judgment result, different from the currently maintained result, appears, the abnormal state maintenance mechanism is interrupted, and the newly appearing judgment result is output according to the priority rule of step S406. Step S406: The first judgment result, the second judgment result, the third judgment result, the fourth judgment result, and the fifth judgment result are summarized according to the preset priority rules to generate the final anomaly category output data; The preset priority rule is as follows, from high to low: fifth judgment result, third judgment result, second judgment result, first judgment result, and fourth judgment result.

[0014] An electrical discharge machining anomaly classification and identification system includes a processing module, a construction module, a classification module, and an identification module; The processing module segments the continuous signal into discrete signal segments, and extracts the signal from the discrete signal segments to obtain feature data. The module constructs multi-dimensional feature vectors based on feature data. The classification module inputs multi-dimensional feature vectors into a multi-granularity anomaly classifier and outputs coarse-grained candidate class probability distributions and fine-grained candidate class probability distributions. Preliminary anomaly identification results for the time window are obtained by calculating the probability distributions of coarse-grained and fine-grained candidate categories. The identification module, based on the preliminary anomaly identification results of e time windows, adopts a multi-window verification and state preservation mechanism to output the final anomaly category.

[0015] The beneficial effects of this invention are as follows: By constructing a hierarchical and adaptive intelligent diagnostic framework, the accuracy, reliability, and practicality of electrical discharge machining (EDM) anomaly identification are significantly improved. Existing algorithms typically use a single model for end-to-end anomaly type judgment, which suffers from fixed identification granularity, inability to balance rapid screening and fine diagnosis, and sensitivity to transient interference leading to unstable results. The core design of this solution lies in the classifier design, which proposes a multi-granularity parallel output layer. A shared feature extraction network simultaneously generates coarse and fine granularity candidate category probability distributions, and an adaptive weight fusion strategy based on the coarse granularity results is designed. This improvement can quickly identify the coarse granularity corresponding to major risk categories such as severe anomalies and system failures, and can also handle weak arcs and intermittent short circuits. The system precisely identifies specific anomalies at a fine-grained level, solving the problem of balancing diagnostic speed and depth that a single model cannot solve. In terms of the decision-making mechanism, a multi-window continuous verification and state-preservation mechanism is introduced. By integrating preliminary results from multiple consecutive time windows and combining confidence assessment and tiered response strategies, a final decision is made. This improvement effectively filters out accidental misjudgments caused by instantaneous signal fluctuations, enhances the continuity and stability of the output results, and solves the inherent defects of traditional single-window decision methods, such as result jumps and low reliability. In summary, through the synergistic effect of the above core designs, this solution achieves full-process optimization of processing anomalies, from rapid early warning and fine classification to reliable decision-making, thereby reducing false alarm and false negative rates, improving system robustness, and ultimately ensuring processing safety and quality. Attached Figure Description

[0016] Figure 1This is a flowchart illustrating the steps of an electrical discharge machining anomaly classification and identification method according to an embodiment of the present invention.

[0017] Figure 2 This is a basic flowchart of an electrical discharge machining anomaly classification and identification system provided in one embodiment of the present invention. Detailed Implementation

[0018] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0019] Example 1, referring to Figure 1 As an embodiment of the present invention, a method for classifying and identifying abnormalities in electrical discharge machining is provided, comprising the following steps: Step S1: Segment the continuous signal to obtain discrete signal segments, and extract the signal from the discrete signal segments to obtain feature data; Step S2: Construct a multi-dimensional feature vector based on the feature data; Step S3: Input the multi-dimensional feature vector into the multi-granularity anomaly classifier and output the coarse-grained candidate class probability distribution and the fine-grained candidate class probability distribution. Preliminary anomaly identification results for the time window are obtained by calculating the probability distributions of coarse-grained and fine-grained candidate categories. Step S4: Based on the preliminary anomaly identification results of e time windows, a multi-window verification and state preservation mechanism is adopted to output the final anomaly category.

[0020] In one embodiment, a systematic, interconnected process is used to accurately identify and reliably classify the voltage and current signals of the discharge gap during electrical discharge machining. The discharge gap voltage and current signals are filtered, segmented, and multi-dimensional feature extracted to obtain feature data, including time-domain, frequency-domain, and time-frequency-domain features. A feature vector is constructed based on this feature data. This feature vector is then input into a multi-granularity classifier to obtain coarse-grained and fine-grained probability distributions in parallel. Preliminary results are generated through adaptive fusion based on category mapping. A multi-window verification and state-preservation mechanism is introduced, using confidence assessment, continuity verification, and a hierarchical response strategy to smooth and confirm the preliminary results, outputting a stable and reliable final anomaly category. The core design of this framework lies in constructing a horizontally and vertically integrated two-layer intelligent system. Horizontally, a multi-granularity classification structure decomposes complex tasks into collaborative sub-tasks of macroscopic judgment and microscopic positioning to improve the precision and interpretability of the judgment. Vertically, a multi-window decision-making time sequence mechanism simulates the expert observation-confirmation-judgment reasoning process, using temporal continuity to filter out instantaneous interference and ensure robust output. This design directly addresses the core pain points of false alarms, missed alarms, and result fluctuations in anomaly detection in industrial settings. It boasts high recognition accuracy and interpretability, capable of determining both the anomaly level and pinpointing the specific cause. It exhibits strong anti-interference and decision robustness, effectively suppressing single-point misjudgments and result fluctuations caused by noise. It also demonstrates outstanding engineering practicality and safety, with adaptive fusion, graded response, and emergency shutdown logic closely aligning with the stringent requirements of the field for reliability, response speed, and risk control.

[0021] Step S1: Segment the continuous signal to obtain discrete signal segments, and extract the signal from the discrete signal segments to obtain feature data; Step S1 includes steps S101, S102, S103, S104, S105 and S106; Step S101: Synchronously acquire the voltage and current signals of the discharge gap during the electrical discharge machining process; The acquired voltage and current signals are filtered by bandpass filtering to remove high-frequency noise and power frequency interference, resulting in a filtered continuous signal. A continuous signal is divided into discrete signal segments by dividing it into fixed time windows. The fixed time window length is 100 milliseconds, and adjacent windows overlap by 50%. Discrete signal segments include voltage signal sub-segments and current signal sub-segments; Step S102: Perform the first extraction on the discrete signal segment to obtain the time-domain features; A second extraction is performed on the discrete signal segment to obtain frequency domain features; A third extraction is performed on the discrete signal segment to obtain time-frequency domain features; Step S103, the first extraction process includes calculating the voltage standard deviation and current standard deviation of the discrete signal segment; The standard deviation of voltage and the standard deviation of current constitute the time-domain characteristics; Step S104, the second extraction process includes performing fast Fourier transform on the voltage signal segment and the current signal segment respectively to obtain the amplitude spectrum corresponding to the voltage signal segment and the amplitude spectrum corresponding to the current signal segment. The amplitude spectrum corresponding to the voltage signal segment is denoted as the first spectrum, and the amplitude spectrum corresponding to the current signal segment is denoted as the second spectrum. The first frequency spectrum is divided into low-frequency band, mid-frequency band, and high-frequency band; Calculate the ratio of the energy of the low-frequency band, mid-frequency band, and high-frequency band in the first spectrum to the total energy of the first spectrum, and obtain the low-frequency band energy ratio, mid-frequency band energy ratio, and high-frequency band energy ratio of the voltage signal sub-segment; The second spectrum is divided into low-frequency band, mid-frequency band, and high-frequency band; Calculate the ratio of the energy of the low-frequency band, mid-frequency band, and high-frequency band in the second spectrum to the total energy of the second spectrum, and obtain the low-frequency band energy ratio, mid-frequency band energy ratio, and high-frequency band energy ratio of the current signal sub-segment; The low-frequency band energy ratio, mid-frequency band energy ratio, and high-frequency band energy ratio of the voltage signal segment, and the low-frequency band energy ratio, mid-frequency band energy ratio, and high-frequency band energy ratio of the current signal segment constitute the frequency domain characteristics. Step S105, the third extraction process includes using wavelet basis functions to perform N-level wavelet packet decomposition on the voltage signal segment and the current signal segment respectively, to obtain the wavelet packet coefficients corresponding to the voltage signal segment and the current signal segment on each frequency sub-band; Calculate the energy of the wavelet packet coefficients for each frequency sub-band; Arrange the energy values ​​of all frequency sub-bands from low to high according to the frequency of the corresponding frequency sub-band to form an initial time-frequency domain feature set; By setting a frequency partitioning threshold, the initial time-frequency domain feature set is divided into a first group and a second group: The partitioning logic is as follows: the energy of all frequency sub-bands with frequencies greater than the frequency partitioning threshold is divided into the first group and used as the initial channel for high-frequency features; The energy of all frequency sub-bands with frequencies less than or equal to the frequency division threshold is divided into a second group and used as the initial channel for low-frequency features. The number of channels in the initial high-frequency characteristic channel is equal to the number of frequency sub-bands in the first group; The number of channels in the initial low-frequency characteristic channel is equal to the number of frequency sub-bands in the second group.

[0022] Step S106: Two types of dedicated convolution kernels are used to perform convolution processing on the initial channels of high-frequency features and the initial channels of low-frequency features respectively. The two types of dedicated convolution kernels include high-frequency to low-frequency convolution kernels and low-frequency to high-frequency convolution kernels. Among them, the high-frequency to low-frequency convolution kernel matches the output resolution of the initial high-frequency feature channel to the scale of the low-frequency feature channel while preserving the high-frequency attributes; The low-frequency to high-frequency convolution kernel matches the output resolution of the initial low-frequency feature channel to the scale of the high-frequency feature channel while preserving the low-frequency attributes. After the initial high-frequency feature channel is processed by a 3×3 high-frequency to low-frequency convolution kernel with a stride of 2, the resolution of the high-frequency feature channel is matched with that of the low-frequency feature channel, and the high-frequency features in the time-frequency domain are output. After the initial low-frequency feature channel is processed by a 1×1 low-frequency to high-frequency convolution kernel with a stride of 1, it is then subjected to transposed convolution and bilinear interpolation to achieve resolution matching with the high-frequency feature channel, outputting the time-frequency domain low-frequency features.

[0023] In one embodiment, voltage and current signals during the electrical discharge gap are acquired synchronously. After bandpass filtering to remove high-frequency noise and 50Hz power frequency interference, a sliding time window with a fixed length of 100 milliseconds and 50% overlap is used to segment the continuous signal. This design is used to balance real-time response and signal segment continuity, ensuring that any discharge event can be completely captured within at least one window. Subsequently, multi-dimensional feature extraction is performed in parallel on the voltage and current signal segments within each window. Specifically, this includes time-domain feature extraction, which directly calculates the standard deviation of voltage and current for each signal segment to quantify the overall fluctuation level of discharge energy within the time window. The standard deviation of voltage and the standard deviation of current are used together as time-domain features. Frequency domain feature extraction involves performing a Fast Fourier Transform on the signal segments and, based on the conducted interference measurement frequency framework established by the IEC CISPR 11 (GB4824) standard (which uses a 9kHz starting frequency for conducted interference measurement), dividing the obtained amplitude spectrum into three characteristic frequency bands: a low-frequency band of [0,1)kHz, a mid-frequency band of [1,10]kHz, and a high-frequency band of (10,+∞)kHz. The ratio of energy in each frequency band to the total energy is calculated, resulting in six characteristic values: the low-frequency band energy ratio, mid-frequency band energy ratio, and high-frequency band energy ratio for the voltage signal segment; and the low-frequency band energy ratio, mid-frequency band energy ratio, and high-frequency band energy ratio for the current signal segment. The core of this step is to map the signal energy distribution to frequency bands with clear engineering standards and electromagnetic compatibility significance. For example, an abnormal increase in the high-frequency band energy ratio may be directly related to specific discharge interference or insulation degradation. These six characteristic values ​​constitute the frequency domain features. Time-frequency domain feature extraction is used to obtain more refined joint time-frequency information. Specifically, the db4 wavelet basis function is used to perform 4-level wavelet packet decomposition on the signal segments, i.e., N=4 wavelet packet decomposition. The number of decomposition levels is determined by a trade-off between the analysis of the spectral characteristics of typical anomalous signals and real-time requirements: 4-level decomposition can generate 16 frequency sub-bands at the sampling frequency, ensuring sufficient frequency resolution to distinguish different anomalous mode features while effectively controlling computational complexity and meeting the timeliness requirements of online processing. The energy sequences of the 16 frequency sub-bands are obtained and arranged in ascending order of frequency to form the initial feature set. The frequency division threshold is set to 2.5kHz, based on the aforementioned IECCISPR standard for wavelet packet sub-band division. The fixed frequency band analysis performed by the 11 standard, especially the mid-frequency band of [1,10] kHz, forms a complementary and connecting relationship. The 2.5 kHz threshold is close to and slightly higher than the lower limit of this mid-frequency band, which allows the features extracted by the low-frequency channel to more finely characterize the energy structure within the standard mid-frequency band. The high-frequency channel focuses on capturing higher-frequency transient information outside the standard high-frequency band (above 10 kHz). The sub-band is divided into a low-frequency group (frequency less than or equal to 2.5 kHz) and a high-frequency group (frequency greater than 2.5 kHz), which serve as the initial channels for low-frequency and high-frequency features, respectively. This division is to distinguish the low-frequency components in the signal that characterize the stable discharge process from the high-frequency components that may characterize transient anomalies.

[0024] To achieve effective multi-scale feature fusion, a dedicated convolutional kernel was introduced for channel resolution alignment and attribute preservation. For the high-frequency initial channel, a 3×3 convolutional kernel with a stride of 2 (high-frequency to low-frequency convolutional kernel) was used, with the same number of input and output channels as the high-frequency initial channel. Downsampling was used to match the scale of the high-resolution high-frequency feature map to the low-frequency channel scale. Simultaneously, the receptive field of the 3×3 convolution was used to preserve the contextual relevance of high-frequency details. For the low-frequency initial channel, a 1×1 convolutional kernel with a stride of 1 (low-frequency to high-frequency convolutional kernel) was used to transform the number of channels. The number of input channels is the same as the number of initial channels for low-frequency features, and the number of output channels is the same as the number of initial channels for high-frequency features. Then, upsampling is performed through transposed convolution and bilinear interpolation to match to a high-resolution scale. The 1×1 convolution is used to first reorganize and refine the features between channels to avoid the redundancy introduced by direct upsampling. The two steps of 3×3 convolution processing of high-frequency initial channels and 1×1 convolution processing and upsampling of low-frequency initial channels are not simple scale transformations, but rather perform attribute enhancement and purification of high-frequency and low-frequency features respectively through convolution operations for subsequent classification tasks. This ensures that when stitching at a unified scale, both high-frequency and low-frequency features retain their most essential and classification-beneficial attributes.

[0025] In summary, the feature extraction process constructs a feature set that is comprehensive, physically meaningful, and easy to integrate with the model from different dimensions and granularities through time-domain statistics, standardized frequency band energy ratios, and attribute-preserving time-frequency multi-scale decomposition and alignment. Time-domain features provide an overall state baseline, standardized frequency-domain features enhance the model's ability to identify specific interference patterns, and carefully designed time-frequency domain features provide key joint discriminative information for distinguishing complex anomaly patterns that are similar in the time or frequency domains.

[0026] Step S2: Construct a multi-dimensional feature vector based on the feature data; The construction process includes splicing time-domain features, frequency-domain features, high-frequency features in the time-frequency domain, and low-frequency features in the time-frequency domain according to the scale fusion logic; The scale fusion logic specifically includes using time-domain features as shallow low-frequency features, frequency-domain features and time-frequency domain high-frequency features as deep features, and time-frequency domain low-frequency features as shallow high-frequency supplementary features. These features are then concatenated in a preset order: time-domain features, time-frequency domain low-frequency features, frequency-domain features, and time-frequency domain high-frequency features, to form a multi-dimensional feature vector.

[0027] In one embodiment, the feature vector construction process performed in step S2 is based on a scale fusion logic, which involves orderly concatenating the four sets of features extracted in step S1: time-domain features, frequency-domain features, high-frequency features in the time-frequency domain, and low-frequency features in the time-frequency domain, in order to form the multi-dimensional feature vector that is finally input into the classifier. Specifically, based on the physical meaning and computational complexity of the features themselves, the four groups of features are classified and ranked. Among them, time-domain features are directly derived from the original signal statistics, are simple to calculate and physically intuitive, and reflect the overall fluctuation of the signal amplitude. Therefore, they are defined as shallow low-frequency features, serving as the basic baseline for characterizing the processing state. The frequency range of time-frequency domain low-frequency features focuses on the core frequency bands characterizing the stable discharge process. As a shallow high-frequency supplement to the basic time-domain statistics, it enhances the details of the basic state with a slightly higher frequency resolution. Frequency domain features and time-frequency domain high-frequency features are classified as deep features. Frequency domain features are based on a clear engineering standard framework, revealing the distribution pattern of signal energy in different electromagnetic compatibility key frequency bands, and have a more abstract diagnostic significance. The time-frequency domain high-frequency features are specifically extracted and concentrated to preserve the attributes of high-frequency components that may characterize transient anomalies. During construction, vectors are concatenated strictly according to the preset order of time-domain features, low-frequency features in the time-frequency domain, frequency-domain features, and high-frequency features in the time-frequency domain. The underlying purpose of this order design is to simulate a feature progression from basic to refined, from steady state to transient, and from physical intuition to abstract diagnosis. From the core design of the scheme, this orderly hierarchical arrangement provides structurally convenient and information-rich input for the parallel branches of the multi-granularity classifier in the subsequent step S3: the coarse-grained branches of the classifier can focus more on the relatively stable and generalized features at the front end, such as the low-frequency parts of the time and time-frequency domains, while the fine-grained branches can make deeper use of the more discriminative deep features at the back end, such as the high-frequency parts of the frequency and time-frequency domains, thereby forming an efficient feature utilization division of labor within the model.

[0028] By using this scale fusion logic based on physical meaning and abstraction levels, features from different sources and at different granularities are organized into a single vector with a clear structure and complementary information. This not only avoids information redundancy and model confusion that may result from simple stacking, but more importantly, it injects domain prior knowledge, such as the hierarchy of features, which enables a faster and more accurate mapping relationship from macroscopic state judgment to microscopic fault location. This lays a solid foundation for achieving high-precision and highly interpretable anomaly classification.

[0029] Step S3: Input the multi-dimensional feature vector into the multi-granularity anomaly classifier to obtain the coarse-grained candidate class probability distribution and the fine-grained candidate class probability distribution; Step S301: Normalize the multi-dimensional feature vectors to obtain normalized feature vectors; The normalized eigenvectors are activated by the ReLU function, and nonlinear transformation and feature enhancement are performed to obtain a high-dimensional feature set. The high-dimensional feature set is divided into a coarse-grained feature subset and a fine-grained feature subset. The logic of the division is as follows: the dimensions of time-domain features and frequency-domain features in the high-dimensional feature set are assigned to the feature subset of coarse-grained classification, and the dimensions of high-frequency features and low-frequency features in the time-frequency domain are assigned to the feature subset of fine-grained classification. Step S302: The feature subset of coarse-grained classification is processed through the coarse-grained classification branch of the multi-grained parallel output layer to obtain the coarse-grained classification probability distribution. The coarse-grained candidate categories corresponding to the coarse-grained classification probability distribution specifically include normal processing, slight fluctuation, moderate abnormality, severe abnormality, gap abnormality, short circuit abnormality, arc abnormality and system failure. The expression for the coarse-grained classification probability distribution is: ; in, This represents the probability distribution for coarse-grained classification. This represents the activation function. This represents a subset of features for coarse-grained classification. This represents the weight of the coarse-grained classification branch. This represents the bias vector corresponding to the coarse-grained classification branch. The feature subset of fine-grained classification is processed through the fine-grained classification branch of the multi-granularity parallel output layer to obtain the fine-grained classification probability distribution. The fine-grained candidate categories corresponding to the fine-grained classification probability distribution specifically include normal arc discharge, weak arc anomaly, strong arc anomaly, intermittent short circuit, continuous short circuit, slight open circuit, severe open circuit, voltage fluctuation anomaly, current fluctuation anomaly, resonance anomaly, electrode wear anomaly, and working fluid anomaly. The expression for the fine-grained classification probability distribution is as follows: ; in, This represents the probability distribution for fine-grained classification. This represents the activation function. A subset of features representing fine-grained classification. This represents the weight of the fine-grained classification branch. This represents the bias vector corresponding to the fine-grained classification branch.

[0030] Step S303, based on coarse-grained classification probability distribution Select the coarse-grained candidate category corresponding to the highest probability value as the optimal coarse-grained candidate category. ; Set the weighting coefficients for the coarse-grained classification probability distribution as follows: Weighting coefficients are set for the fine-grained classification probability distribution. ,and ; and The value is selected according to the adaptive adjustment rule, specifically, when the optimal coarse-grained candidate category is... When it is a serious abnormality, Take 0.6, Take 0.4; When the optimal coarse-grained candidate category When there are slight fluctuations, Take 0.3, Take 0.7; When the optimal coarse-grained candidate category When it is not a serious abnormality or a slight fluctuation, Take 0.5, Take 0.5; When the optimal coarse-grained candidate category When the system fails, Take 0, Select 1 and output the optimal coarse-grained candidate category. No fusion computing is performed; When the optimal coarse-grained candidate category When the problem is not a system fault, the probability distribution is determined by fine-grained classification. Selecting the optimal coarse-grained candidate categories A fine-grained subset of candidate categories with a mapping relationship; Construct an extended coarse-grained probability distribution with the same dimension as the fine-grained classification probability distribution, denoted as . And the optimal coarse-grained candidate category In coarse-grained classification probability distribution The corresponding probability value is assigned to all coarse-grained candidate categories in the extended coarse-grained probability distribution. The dimensions corresponding to fine-grained candidate categories that have a mapping relationship; Among them, the extended coarse-grained probability distribution All other dimensions that have not been assigned a value are set to 0; A fusion calculation is performed on the extended coarse-grained probability distribution and the fine-grained classification probability distribution to obtain the fused probability distribution; The expression for fusion computation is, ; in, Represents the fusion probability distribution; Selecting the fusion probability distribution The fine-grained candidate category with the highest probability value is used as the preliminary anomaly identification result for the current time window.

[0031] In one embodiment, the multi-granularity anomaly classification and fusion process in step S3 is specifically implemented as follows: the multi-dimensional feature vector constructed in step S2 is normalized to eliminate differences in different feature scales. Then, a ReLU activation function is used for nonlinear transformation to obtain a high-dimensional feature set. Crucially, based on the physical source and abstraction level of the features themselves, the high-dimensional feature set is divided according to the source of the dimensions. Dimensions originating from time-domain features and frequency-domain features are assigned to the feature subset of coarse-grained classification; dimensions originating from high-frequency features and low-frequency features in the time-frequency domain are assigned to the feature subset of fine-grained classification. This division aims to enable different classification branches to focus on processing their most relevant information. The coarse-grained branch processes features with strong generalization, direct physical meaning, and association with electromagnetic compatibility standards to perform macroscopic state and severity judgment; the fine-grained branch processes features refined through time-frequency analysis that better characterize transient and complex mode details to perform micro-fault characterization. The feature subsets for coarse-grained and fine-grained classification are processed through independent classification branches, namely fully connected layers and the Softmax activation function, outputting coarse-grained and fine-grained probability distributions, respectively. The principle behind this step is to map high-dimensional features to a predefined class space using two parallel linear transformations and nonlinear normalization. The weights... , and bias vector , It is learned through backpropagation during the completed model training process.

[0032] After obtaining the coarse-grained and fine-grained probability distributions, an adaptive decision fusion based on mapping rules is performed. Specifically, firstly, the category with the highest probability from the coarse-grained probability distribution is selected as the optimal coarse-grained candidate category. The core here lies in a pre-defined, tree-like category mapping relationship. The specific rules are as follows: normal processing is mapped to normal arc discharge; arc anomaly is mapped to weak arc anomaly and strong arc anomaly; short circuit anomaly is mapped to intermittent short circuit and continuous short circuit; gap anomaly is mapped to slight open circuit and severe open circuit; slight fluctuation is mapped to voltage fluctuation anomaly and current fluctuation anomaly; moderate anomaly is mapped to resonance anomaly and working fluid anomaly; severe anomaly is mapped to electrode wear anomaly; system fault has no mapping. This mapping relationship constitutes the logical basis of the fusion. For example, if the optimal coarse-grained candidate category is short circuit anomaly, then its mapped fine-grained candidate subset is {intermittent short circuit, continuous short circuit}. During fusion, instead of directly weighting the coarse-grained and fine-grained probability distributions, an extended coarse-grained probability distribution is constructed. Specifically, a zero vector with the same dimensions as the fine-grained probability distribution is created, and the coarse-grained probability distribution is only inserted into the dimensions corresponding to the fine-grained categories that have a mapping relationship with the optimal coarse-grained candidate categories. The optimal coarse-grained candidate category The corresponding probability value, for example, if =The probability of a short-circuit anomaly is 0.8, then The dimension values ​​corresponding to intermittent short circuits and persistent short circuits are both 0.8, and the rest are 0. The step itself is designed to broadcast the coarse-grained confidence to all its corresponding fine-grained categories, providing a prior distribution that is aligned with the scale of the fine-grained classification probability distribution and semantically consistent for fusion. The principle is that, given that the coarse-grained category is determined, the total confidence of its subordinate fine-grained categories should be equivalent to the coarse-grained confidence. Based on the optimal coarse-grained candidate category The category is used to apply adaptive adjustment rules as weight coefficients. and Assignment, the specific rule is as follows: if If it is a serious abnormality, then =0.6, =0.4; if For slight fluctuations, =0.3, =0.7; if If it is a system fault, then =1, =0, and output directly Terminate the fusion; if For other categories, then =0.5, =0.5. The purpose of this rule is to achieve dynamic decision-making emphasis. For anomalies with serious consequences, the overall severity judgment is relied upon more, so the coarse-grained weight is high; for slight fluctuations, fine features are relied upon more to accurately locate the cause, so the fine-grained weight is high; for system failures, the simplest decision path is adopted.

[0033] Finally, the fusion computation is performed using the expression for fusion computation, and... The category with the largest P-value in the corresponding fine-grained candidate subset is selected as the preliminary identification result. If the system is experiencing a fault, it will not have fine-grained mapping and will output directly. This design ensures the simplicity and certainty of the decision-making path in extreme situations.

[0034] Feature segmentation provides structured input for branching; the probability distribution generated by branching is the raw material for fusion; and the mapping rule and adaptive weight rule are the control logic and fusion calculation expression of the fusion process, organically unifying the outputs of the two branches at the semantic and confidence levels.

[0035] By employing feature segmentation and parallel branching, information from different levels of abstraction can be utilized simultaneously, avoiding the feature confusion that may exist in a single model. The decision logic is clear and interpretable, and fusion is based on specific and explicit mapping relationships, ensuring that the final fine-grained results are always constrained by the coarse-grained categories, conforming to the cognitive logic of qualitative analysis followed by quantitative analysis, making the results easy to understand and trace. Risk is adaptive, and the complete adaptive weighting mechanism can dynamically adjust the caution and precision of the decision based on the severity of the anomaly initially judged, ensuring a rapid response to serious faults while improving the classification accuracy of minor anomalies.

[0036] Step S4: Based on the preliminary anomaly identification results of e time windows, a multi-window continuity verification and state preservation mechanism is adopted to output the final anomaly category; Step S4 includes steps S401, S402, S403, S404, S405 and S406. Step S401: Calculate the confidence level of the preliminary anomaly identification results for the current time window. The evaluation logic is to calculate the maximum confidence level corresponding to the coarse-grained classification probability distribution and the maximum confidence level corresponding to the fine-grained classification probability distribution. The expression for the maximum confidence level corresponding to the coarse-grained classification probability distribution is: ; in, This represents the maximum confidence level corresponding to the coarse-grained classification probability distribution. The expression for the maximum confidence level corresponding to the fine-grained classification probability distribution is: ; in, This represents the maximum confidence level corresponding to the fine-grained classification probability distribution. If the optimal coarse-grained candidate category If the system is faulty, then the maximum confidence level corresponding to the coarse-grained classification probability distribution is... Calculate the maximum confidence level corresponding to the fine-grained classification probability distribution. No calculations are performed; Step S402: Determine the maximum confidence level corresponding to the coarse-grained classification probability distribution and the maximum confidence level corresponding to the fine-grained classification probability distribution; The judgment logic is as follows: if the first condition or the second condition is met, the exception category is output as the first judgment result. Otherwise, if the third condition is met, it is marked as pending confirmation and multi-window continuity verification is initiated; The first condition is that the optimal coarse-grained candidate category is not a system fault, and the maximum confidence level corresponding to the coarse-grained classification probability distribution is greater than or equal to the first decision threshold, while the maximum confidence level corresponding to the fine-grained classification probability distribution is greater than or equal to the first decision threshold. The second condition is that the optimal coarse-grained candidate category is system fault and the maximum confidence level corresponding to the coarse-grained classification probability distribution is greater than or equal to the first judgment threshold. The third condition is that the maximum confidence level corresponding to the coarse-grained classification probability distribution is greater than or equal to the second decision threshold and less than the first decision threshold, and the maximum confidence level corresponding to the fine-grained classification probability distribution is greater than or equal to the second decision threshold and less than the first decision threshold.

[0037] Step S403, the basic parameters of multi-window continuous verification include: the first verification threshold is a first proportion range of the first judgment threshold, the second verification threshold is a second proportion range of the first judgment threshold, and the fine-grained confidence preset threshold is a verification proportion of the first judgment threshold. The logic of multi-window continuous verification is as follows: if the same coarse-grained candidate category is detected in three consecutive time windows, and the maximum confidence level corresponding to the coarse-grained classification probability distribution of each window is greater than the first verification threshold, then it is confirmed as a real anomaly and the second judgment result is output. If the same coarse-grained candidate category is detected in two consecutive time windows, and the average of the maximum confidence scores corresponding to the coarse-grained classification probability distributions of the two windows is greater than the second verification threshold, then it is confirmed as a real anomaly, and the second judgment result is output. If the maximum confidence level corresponding to the coarse-grained classification probability distribution satisfies the logic of multi-window continuity verification, but the maximum confidence level corresponding to the fine-grained classification probability distribution is lower than the preset threshold of fine-grained confidence, then the coarse-grained candidate category that passes the multi-window continuity verification is marked as a type to be refined, and the top three categories in terms of probability value among the coarse-grained candidate category and the fine-grained candidate category that has a mapping relationship with the coarse-grained candidate category in the fine-grained classification probability distribution are output as the third judgment result; If the maximum confidence level corresponding to the coarse-grained classification probability distribution satisfies the logic of multi-window continuous verification, and the maximum confidence level corresponding to the fine-grained classification probability distribution is greater than or equal to the preset threshold of fine-grained confidence level, then the coarse-grained candidate category and the corresponding fine-grained candidate category are output, and the third judgment result is output.

[0038] Step S404, the multi-window verification mechanism also includes an anomaly severity tiered response strategy: When the coarse-grained candidate category is a severe anomaly or a system failure, the number of verification windows is reduced to 2, and the confidence threshold is lowered to the first confidence adjustment threshold, and the fifth judgment result is output. When the coarse-grained candidate category has slight fluctuations, the number of validation windows is increased to 4, and the confidence threshold is raised to the second confidence adjustment threshold, and the fifth judgment result is output. If the fine-grained candidate category of the preliminary anomaly identification result is a persistent short circuit or a severe open circuit, and the maximum confidence level corresponding to the coarse-grained classification probability distribution of the preliminary anomaly identification result is greater than or equal to the emergency threshold, an emergency shutdown signal is immediately triggered, and the fifth judgment result is output without waiting for the multi-window verification to be completed. Step S405, the state preservation mechanism specifically includes, for the first determination result output in step S402 and the second or third determination result output in step S403, activating the abnormal state preservation mechanism; The abnormal state retention mechanism is as follows: if the first, second, or third judgment result is continuously output for more than or equal to 5 time windows, then the fourth judgment result is generated and output. If, within 5 consecutive time windows, a fifth, third, second, first, or fourth judgment result, different from the currently maintained result, appears, the abnormal state maintenance mechanism is interrupted, and the newly appearing judgment result is output according to the priority rule of step S406. Step S406: The first judgment result, the second judgment result, the third judgment result, the fourth judgment result, and the fifth judgment result are summarized according to the preset priority rules to generate the final anomaly category output data; The preset priority rule is as follows, from high to low: fifth judgment result, third judgment result, second judgment result, first judgment result, and fourth judgment result.

[0039] In one embodiment, the multi-window verification and final decision-making process executed in step S4 constitutes the final guarantee for outputting stable and reliable results. Its basic architecture parameter is set to e=5, meaning a historical queue containing the preliminary identification results of the most recent 5 time windows is maintained. The parameter e is set based on the premise that, while considering the system's real-time response performance, the time span of the 5 windows (corresponding to 500 milliseconds, considering 50% overlap) can effectively cover the establishment and evolution of most abnormal patterns, providing sufficient time-series samples for continuous verification and state maintenance, while avoiding decision lag due to an excessively long queue. Specifically, the confidence level of the preliminary identification results of the current time window is evaluated. This is done by calculating the maximum values ​​of the coarse-grained probability distribution and the fine-grained probability distribution respectively, obtaining the maximum confidence level corresponding to the coarse-grained classification probability distribution. The maximum confidence level corresponding to the fine-grained classification probability distribution The purpose of this step is to quantify the confidence level of the classification model in this judgment, and to provide an objective quantitative basis for subsequent decisions. The principle is that the maximum probability value output by Softmax directly reflects the model's confidence in the optimal class. Based on the maximum confidence scores corresponding to the coarse-grained and fine-grained classification probability distributions, a single-window real-time decision is performed. The core of the decision logic lies in the comparison with preset thresholds. The first decision threshold is set to 0.85, and the second decision threshold is set to 0.7. The basis for these values ​​is that, through statistical analysis of classification results from a large number of historical samples, the maximum probability value of the model's output for typical anomalies with obvious features usually falls above 0.85; therefore, 0.85 is set as the high-confidence threshold. 0.7, on the other hand, is an empirical dividing point for the model to distinguish between normal fluctuations and clear anomalies in the validation set. Probability values ​​below this value are usually associated with strong interference or feature confusion. The handling method is as follows: if... and All are greater than or equal to 0.85 (first condition), or For system failure and If the value is greater than or equal to 0.85 (second condition), then the anomaly category is directly output as the first judgment result. This design aims to achieve a zero-delay response to highly deterministic anomalies. and If all values ​​are within the range of [0.7, 0.85) (the third condition), they are marked as pending confirmation and multi-window continuity verification is triggered. This demonstrates that single-window judgment is a fast channel, while multi-window verification is a fine-grained verification channel used to handle uncertain situations.

[0040] The specific processing method for multi-window continuous validation is as follows: A first validation threshold of 0.68 (i.e., 80% of the first decision threshold of 0.85) and a second validation threshold of 0.595 (i.e., 70% of the first decision threshold of 0.85) are set. The fine-grained confidence preset threshold is 0.6. The first validation threshold of 0.68 and the second validation threshold of 0.595 are based on the first decision threshold (0.85) and are proportionally reduced. This reflects the design idea that in multi-window validation scenarios, the single-point confidence requirement can be appropriately relaxed to obtain more evidence support in the time dimension. These proportions of 80% and 70% are determined after engineering trade-offs between false positive rate and false negative rate. The fine-grained confidence preset threshold of 0.6 is set because this value is the minimum confidence empirical value required for the model to reliably distinguish fine-grained categories during training. The validation logic includes a first path and a second path. The first path is based on the aforementioned historical window queue of length e=5. If three consecutive windows predict the same coarse-grained category and each... If the value is greater than 0.68, an anomaly is confirmed; the second path is, based on the aforementioned historical window queue of length e=5, if two consecutive windows predict the same coarse-grained category and the average... A value greater than 0.595 confirms an anomaly. The design aims to leverage prior knowledge of the temporal persistence of genuine anomalies, using cross-validation of multiple window results to filter out transient interference or random misjudgments. The principle is to increase the number of consecutive windows required for evidence in the time dimension in exchange for a moderate relaxation of the single-point confidence requirement, thus lowering the threshold. This maintains a low false alarm rate while increasing the detection rate of hidden or early-stage anomalies. After successful validation, fine-grained confidence levels must also be checked. :like If the value is greater than or equal to 0.6, then a clear, fine-grained category is output (third determination result); if... If the value is less than 0.6, the coarse-grained category and the top three fine-grained candidates are output as the third judgment result for the type to be refined. The purpose of this processing is to provide valuable diagnostic guidance when the macro-anomaly type is very certain but the micro-level subdivision is uncertain, rather than forcibly giving a potentially wrong sub-class. This enhances practicality and interpretability. Furthermore, an anomaly severity grading response strategy is integrated, which involves dynamically adjusting validation parameters. Specifically, when... In cases of severe anomalies or system failures, reduce the number of validation windows to two and lower the confidence threshold to the first confidence adjustment threshold, for example, 0.65, to accelerate the response; when For minor fluctuations, the number of verification windows is increased to four, and the confidence threshold is raised to the second confidence adjustment threshold, for example, 0.75. The adjustment of the number of windows (2 or 4) and the confidence threshold (0.65 or 0.75) in this strategy is based on the following: for high-risk severe anomalies, to shorten the response time, a shorter time window (2 windows) and a more lenient confidence condition (0.65) are allowed to be used for judgment; for low-risk minor fluctuations, to minimize false alarms interfering with normal production, a longer observation window (4 windows) and a more stringent confidence condition are adopted. The confidence condition (0.75) is defined by the specific values ​​of the two thresholds, 0.65 and 0.75. These values ​​are optimized based on independent testing and false alarm tolerance analysis of two typical scenarios: severe anomalies and slight fluctuations, within the confidence interval formed by the first judgment threshold (0.85) and the multi-window verification thresholds (0.68, 0.595). The design intent of this strategy is to achieve a balance between risk-adaptive decision-making speed and strictness, reflecting key safety engineering principles. Furthermore, if the preliminary result is a persistent short circuit or a severe open circuit, and... If the value is greater than or equal to the emergency threshold, such as 0.9, an emergency shutdown signal will be triggered immediately (the fifth judgment result). The emergency threshold is set to 0.9 because this value is an extremely high confidence threshold for the model to output the probability of the most dangerous operating conditions (persistent short circuit, severe open circuit). It is designed to ensure that the highest priority emergency response is only executed when the confidence level is extremely high and the risk of false triggering is extremely low. This design is intended to provide an extremely fast response path that exceeds the conventional verification process for the highest risk operating conditions. To ensure output stability, a state holding mechanism was designed. The method is as follows: once an abnormal result (first judgment result, second judgment result, or third judgment result) is continuously output for 5 consecutive time windows, holding is initiated, locking and continuously outputting this result as the fourth judgment result, until different results appear within 5 consecutive windows. The number of state holding windows (5) is set based on the fact that this value can cover typical short-term disturbances or fluctuation cycles, ensuring that only persistent abnormal states are locked, thereby achieving a balance between output stability and state update sensitivity. The purpose of this mechanism is to prevent the output from frequently jumping between normal and abnormal boundaries or between different abnormal types due to noise, ensuring that the instructions received by the human-machine interface or downstream control system are stable and consistent.

[0041] All possible outcomes (first, second, third, fourth, and fifth outcomes) are arranged according to a preset priority rule, with the priority from highest to lowest as follows: fifth outcome > third outcome > second outcome > first outcome > fourth outcome. The method of this rule is to output only the one with the highest priority when multiple outcomes may be satisfied at the same time. Its core design purpose is to ensure the determinism and security of behavior in complex situations. The highest priority is always the most urgent or the most rigorously verified conclusion. Step S4 achieves multi-level, adaptive, and robust decision-making through the organic combination of confidence assessment, multi-window verification, hierarchical response, state preservation, and priority ranking. This significantly improves anti-interference capability and reliability, and effectively suppresses single-point false alarms. Through risk-level response, it optimizes the balance between safety and production efficiency. The state preservation mechanism provides stable and reliable output, avoiding control command oscillations. The complete logic chain ensures the predictability of behavior and engineering practicality.

[0042] Example 2, refer to Figure 2 In another embodiment of the present invention, which differs from the first embodiment, an electrical discharge machining anomaly classification and identification system is provided, including a processing module, a construction module, a classification module and an identification module; The processing module segments the continuous signal into discrete signal segments, and extracts the signal from the discrete signal segments to obtain feature data. The module constructs multi-dimensional feature vectors based on feature data. The classification module inputs multi-dimensional feature vectors into a multi-granularity anomaly classifier and outputs coarse-grained candidate class probability distributions and fine-grained candidate class probability distributions. Preliminary anomaly identification results for the time window are obtained by calculating the probability distributions of coarse-grained and fine-grained candidate categories. The identification module, based on the preliminary anomaly identification results of e time windows, adopts a multi-window verification and state preservation mechanism to output the final anomaly category.

[0043] In one embodiment, a systematic, interconnected process is used to accurately identify and reliably classify the voltage and current signals of the discharge gap during electrical discharge machining. The discharge gap voltage and current signals are filtered, segmented, and multi-dimensional feature extracted to obtain feature data, including time-domain, frequency-domain, and time-frequency-domain features. A feature vector is constructed based on this feature data. This feature vector is then input into a multi-granularity classifier to obtain coarse-grained and fine-grained probability distributions in parallel. Preliminary results are generated through adaptive fusion based on category mapping. A multi-window verification and state-preservation mechanism is introduced, using confidence assessment, continuity verification, and a hierarchical response strategy to smooth and confirm the preliminary results, outputting a stable and reliable final anomaly category. The core design of this framework lies in constructing a horizontally and vertically integrated two-layer intelligent system. Horizontally, a multi-granularity classification structure decomposes complex tasks into collaborative sub-tasks of macroscopic judgment and microscopic positioning to improve the precision and interpretability of the judgment. Vertically, a multi-window decision-making time sequence mechanism simulates the expert observation-confirmation-judgment reasoning process, using temporal continuity to filter out instantaneous interference and ensure robust output. This design directly addresses the core pain points of false alarms, missed alarms, and result fluctuations in anomaly detection in industrial settings. It boasts high recognition accuracy and interpretability, capable of determining both the anomaly level and pinpointing the specific cause. It exhibits strong anti-interference and decision robustness, effectively suppressing single-point misjudgments and result fluctuations caused by noise. It also demonstrates outstanding engineering practicality and safety, with adaptive fusion, graded response, and emergency shutdown logic closely aligning with the stringent requirements of the field for reliability, response speed, and risk control.

[0044] This invention significantly improves the accuracy, reliability, and practicality of electrical discharge machining (EDM) anomaly identification by constructing a hierarchical and adaptive intelligent diagnostic framework. Existing algorithms typically use a single model for end-to-end anomaly type judgment, which suffers from fixed identification granularity, inability to balance rapid screening and fine diagnosis, and sensitivity to transient interference leading to unstable results. The core design of this solution lies in the classifier design, which proposes a multi-granularity parallel output layer. A shared feature extraction network simultaneously generates coarse and fine granularity candidate category probability distributions, and designs an adaptive weight fusion strategy based on the coarse granularity results. This improvement can quickly identify the coarse granularity corresponding to major risk categories such as severe anomalies and system failures, while also addressing minor anomalies and intermittent short circuits. The system accurately identifies anomalies at a fine-grained level, solving the problem of balancing diagnostic speed and depth that a single model cannot solve. In terms of the decision-making mechanism, a multi-window continuous verification and state-preservation mechanism is introduced. By integrating preliminary results from multiple consecutive time windows and combining confidence assessment and tiered response strategies, a final decision is made. This improvement effectively filters out accidental misjudgments caused by instantaneous signal fluctuations, enhances the continuity and stability of the output results, and solves the inherent defects of traditional single-window decision methods, such as result jumps and low reliability. In summary, through the synergistic effect of the above core designs, this solution achieves full-process optimization of processing anomalies, from rapid early warning and fine classification to reliable decision-making, thereby reducing false alarm and false negative rates, improving system robustness, and ultimately ensuring processing safety and quality.

[0045] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0046] 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 it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the protection scope of the present invention.

Claims

1. A method for classifying and identifying abnormalities in electrical discharge machining, characterized in that, Includes the following steps, Step S1: Segment the continuous signal to obtain discrete signal segments, and extract the signal from the discrete signal segments to obtain feature data; Step S2: Construct a multi-dimensional feature vector based on the feature data; Step S3: Input the multi-dimensional feature vector into the multi-granularity anomaly classifier and output the coarse-grained candidate class probability distribution and the fine-grained candidate class probability distribution. Preliminary anomaly identification results for the time window are obtained by calculating the probability distributions of coarse-grained and fine-grained candidate categories. Step S4: Based on the preliminary anomaly identification results of e time windows, a multi-window verification and state preservation mechanism is adopted to output the final anomaly category.

2. The electrical discharge machining anomaly classification and identification method as described in claim 1, characterized in that, Step S1: Segment the continuous signal to obtain discrete signal segments, and extract the signal from the discrete signal segments to obtain feature data; Step S1 includes steps S101, S102, S103, S104, S105 and S106; Step S101: Synchronously acquire the voltage and current signals of the discharge gap during the electrical discharge machining process; The acquired voltage and current signals are filtered by bandpass filtering to remove high-frequency noise and power frequency interference, resulting in a filtered continuous signal. A continuous signal is divided into discrete signal segments by dividing it into fixed time windows; The fixed time window has a length of 100 milliseconds, and adjacent windows overlap by 50%. The discrete signal segment includes a voltage signal sub-segment and a current signal sub-segment; Step S102: Perform the first extraction on the discrete signal segment to obtain the time-domain features; A second extraction is performed on the discrete signal segment to obtain frequency domain features; A third extraction is performed on the discrete signal segment to obtain time-frequency domain features; Step S103, the first extraction process includes calculating the voltage standard deviation and current standard deviation of the discrete signal segment; The voltage standard deviation and the current standard deviation constitute the time-domain characteristics; Step S104, the second extraction process includes performing fast Fourier transform on the voltage signal segment and the current signal segment respectively to obtain the amplitude spectrum corresponding to the voltage signal segment and the amplitude spectrum corresponding to the current signal segment. The amplitude spectrum corresponding to the voltage signal sub-segment is denoted as the first spectrum, and the amplitude spectrum corresponding to the current signal sub-segment is denoted as the second spectrum. The first frequency spectrum is divided into low-frequency band, mid-frequency band, and high-frequency band; Calculate the ratio of the energy of the low-frequency band, mid-frequency band, and high-frequency band in the first spectrum to the total energy of the first spectrum, and obtain the low-frequency band energy ratio, mid-frequency band energy ratio, and high-frequency band energy ratio of the voltage signal sub-segment; The second spectrum is divided into low-frequency band, mid-frequency band, and high-frequency band; Calculate the ratio of the energy of the low-frequency band, mid-frequency band, and high-frequency band in the second spectrum to the total energy of the second spectrum, and obtain the low-frequency band energy ratio, mid-frequency band energy ratio, and high-frequency band energy ratio of the current signal sub-segment; The low-frequency band energy ratio, mid-frequency band energy ratio, and high-frequency band energy ratio of the voltage signal segment, and the low-frequency band energy ratio, mid-frequency band energy ratio, and high-frequency band energy ratio of the current signal segment constitute the frequency domain characteristics. Step S105, the third extraction process includes using wavelet basis functions to perform N-level wavelet packet decomposition on the voltage signal segment and the current signal segment respectively, to obtain the wavelet packet coefficients corresponding to the voltage signal segment and the current signal segment in each frequency sub-band; Calculate the energy of the wavelet packet coefficients for each frequency sub-band; Arrange the energy values ​​of all frequency sub-bands from low to high according to the frequency of the corresponding frequency sub-band to form an initial time-frequency domain feature set; By setting a frequency division threshold, the initial time-frequency domain feature set is divided into a first group and a second group: The partitioning logic is as follows: the energy of all frequency sub-bands with frequencies greater than the frequency partitioning threshold is divided into the first group and used as the initial channel for high-frequency features. The energy of all frequency sub-bands with frequencies less than or equal to the frequency division threshold is divided into a second group and used as the initial channel for low-frequency features. The number of channels in the initial high-frequency characteristic channel is equal to the number of frequency sub-bands in the first group; The number of channels in the initial low-frequency characteristic channel is equal to the number of frequency sub-bands in the second group.

3. The method for classifying and identifying electrical discharge machining anomalies as described in claim 1, characterized in that, Step S106: Two types of dedicated convolution kernels are used to perform convolution processing on the high-frequency feature initial channel and the low-frequency feature initial channel respectively. The two types of dedicated convolution kernels include high-frequency to low-frequency convolution kernels and low-frequency to high-frequency convolution kernels. Among them, the high-frequency to low-frequency convolution kernel matches the output resolution of the initial high-frequency feature channel to the scale of the low-frequency feature channel while preserving the high-frequency attributes; The low-frequency to high-frequency convolution kernel matches the output resolution of the initial low-frequency feature channel to the scale of the high-frequency feature channel while preserving the low-frequency attributes. After the initial high-frequency feature channel is processed by a 3×3 high-frequency to low-frequency convolution kernel with a stride of 2, the resolution of the high-frequency feature channel is matched with that of the low-frequency feature channel, and the high-frequency features in the time-frequency domain are output. After the initial low-frequency feature channel is processed by a 1×1 low-frequency to high-frequency convolution kernel with a stride of 1, it is then subjected to transposed convolution and bilinear interpolation to achieve resolution matching with the high-frequency feature channel, outputting the time-frequency domain low-frequency features.

4. The method for classifying and identifying electrical discharge machining anomalies as described in claim 1, characterized in that, Step S2: Construct a multi-dimensional feature vector based on the feature data; The construction process includes splicing time-domain features, frequency-domain features, high-frequency features in the time-frequency domain, and low-frequency features in the time-frequency domain according to the scale fusion logic; The scale fusion logic specifically includes using time-domain features as shallow low-frequency features, frequency-domain features and time-frequency domain high-frequency features as deep features, and time-frequency domain low-frequency features as shallow high-frequency supplementary features. These features are then concatenated in a preset order: time-domain features, time-frequency domain low-frequency features, frequency-domain features, and time-frequency domain high-frequency features, to form a multi-dimensional feature vector.

5. The method for classifying and identifying abnormalities in electrical discharge machining as described in claim 1, characterized in that, Step S3: Input the multi-dimensional feature vector into the multi-granularity anomaly classifier to obtain the coarse-grained candidate class probability distribution and the fine-grained candidate class probability distribution; Step S301: Normalize the multi-dimensional feature vectors to obtain normalized feature vectors; The normalized eigenvectors are activated by the ReLU function, and nonlinear transformation and feature enhancement are performed to obtain a high-dimensional feature set. The high-dimensional feature set is divided into a coarse-grained feature subset and a fine-grained feature subset. The logic of the division is as follows: the dimensions of time-domain features and frequency-domain features in the high-dimensional feature set are assigned to the feature subset of coarse-grained classification, and the dimensions of high-frequency features and low-frequency features in the time-frequency domain are assigned to the feature subset of fine-grained classification. Step S302: The feature subset of coarse-grained classification is processed through the coarse-grained classification branch of the multi-grained parallel output layer to obtain a coarse-grained classification probability distribution. The coarse-grained candidate categories corresponding to the coarse-grained classification probability distribution specifically include normal processing, slight fluctuation, moderate abnormality, severe abnormality, gap abnormality, short circuit abnormality, arc abnormality and system failure. The expression for the coarse-grained classification probability distribution is: ; in, This represents the probability distribution for coarse-grained classification. This represents the activation function. This represents a subset of features for coarse-grained classification. This represents the weight of the coarse-grained classification branch. This represents the bias vector corresponding to the coarse-grained classification branch. The feature subset of fine-grained classification is processed through the fine-grained classification branch of the multi-granularity parallel output layer to obtain a fine-grained classification probability distribution. The fine-grained candidate categories corresponding to the fine-grained classification probability distribution specifically include normal arc discharge, weak arc anomaly, strong arc anomaly, intermittent short circuit, continuous short circuit, slight open circuit, severe open circuit, voltage fluctuation anomaly, current fluctuation anomaly, resonance anomaly, electrode wear anomaly, and working fluid anomaly. The expression for the fine-grained classification probability distribution is as follows: ; in, This represents the probability distribution for fine-grained classification. This represents the activation function. A subset of features representing fine-grained classification. This represents the weight of the fine-grained classification branch. This represents the bias vector corresponding to the fine-grained classification branch.

6. The method for classifying and identifying abnormalities in electrical discharge machining as described in claim 1, characterized in that, Step S303, based on coarse-grained classification probability distribution Select the coarse-grained candidate category corresponding to the highest probability value as the optimal coarse-grained candidate category. ; Set the weighting coefficients for the coarse-grained classification probability distribution as follows: Weighting coefficients are set for the fine-grained classification probability distribution. ,and ; and The value is selected according to the adaptive adjustment rule, specifically, when the optimal coarse-grained candidate category is... When it is a serious abnormality, Take 0.6, Take 0.4; When the optimal coarse-grained candidate category When there are slight fluctuations, Take 0.3, Take 0.7; When the optimal coarse-grained candidate category When it is not a serious abnormality or a slight fluctuation, Take 0.5, Take 0.5; When the optimal coarse-grained candidate category When the system fails, Take 0, Select 1 and output the optimal coarse-grained candidate category. No fusion computing is performed; When the optimal coarse-grained candidate category When the problem is not a system fault, the probability distribution is determined by fine-grained classification. Selecting the optimal coarse-grained candidate categories A fine-grained subset of candidate categories with a mapping relationship; Construct an extended coarse-grained probability distribution with the same dimension as the fine-grained classification probability distribution, denoted as . And the optimal coarse-grained candidate category In coarse-grained classification probability distribution The corresponding probability value is assigned to all coarse-grained candidate categories in the extended coarse-grained probability distribution. The dimensions corresponding to fine-grained candidate categories that have a mapping relationship; Among them, the extended coarse-grained probability distribution All other dimensions that have not been assigned a value are set to 0; A fusion calculation is performed on the extended coarse-grained probability distribution and the fine-grained classification probability distribution to obtain the fused probability distribution; The expression for fusion computation is, ; in, Represents the fusion probability distribution; Selecting the fusion probability distribution The fine-grained candidate category with the highest probability value is used as the preliminary anomaly identification result for the current time window.

7. The method for classifying and identifying electrical discharge machining anomalies as described in claim 1, characterized in that, Step S4: Based on the preliminary anomaly identification results of e time windows, a multi-window continuity verification and state preservation mechanism is adopted to output the final anomaly category; Step S4 includes steps S401, S402, S403, S404, S405 and S406. Step S401: Calculate the confidence level of the preliminary anomaly identification results for the current time window. The evaluation logic is to calculate the maximum confidence level corresponding to the coarse-grained classification probability distribution and the maximum confidence level corresponding to the fine-grained classification probability distribution. The expression for the maximum confidence level corresponding to the coarse-grained classification probability distribution is: ; in, This represents the maximum confidence level corresponding to the coarse-grained classification probability distribution. The expression for the maximum confidence level corresponding to the fine-grained classification probability distribution is: ; in, This represents the maximum confidence level corresponding to the fine-grained classification probability distribution. If the optimal coarse-grained candidate category If the system is faulty, then the maximum confidence level corresponding to the coarse-grained classification probability distribution is... Calculate the maximum confidence level corresponding to the fine-grained classification probability distribution. No calculations are performed; Step S402: Determine the maximum confidence level corresponding to the coarse-grained classification probability distribution and the maximum confidence level corresponding to the fine-grained classification probability distribution; The judgment logic is as follows: if the first condition or the second condition is met, the exception category is output as the first judgment result. Otherwise, if the third condition is met, it is marked as pending confirmation and multi-window continuity verification is initiated; The first condition is that the optimal coarse-grained candidate category is not a system fault, and the maximum confidence level corresponding to the coarse-grained classification probability distribution is greater than or equal to the first decision threshold, while the maximum confidence level corresponding to the fine-grained classification probability distribution is greater than or equal to the first decision threshold. The second condition is that the optimal coarse-grained candidate category is system fault and the maximum confidence level corresponding to the coarse-grained classification probability distribution is greater than or equal to the first judgment threshold. The third condition is that the maximum confidence level corresponding to the coarse-grained classification probability distribution is greater than or equal to the second decision threshold and less than the first decision threshold, and the maximum confidence level corresponding to the fine-grained classification probability distribution is greater than or equal to the second decision threshold and less than the first decision threshold.

8. The method for classifying and identifying electrical discharge machining anomalies as described in claim 1, characterized in that, Step S403, the basic parameters of multi-window continuous verification include: the first verification threshold is a first proportion range of the first judgment threshold, the second verification threshold is a second proportion range of the first judgment threshold, and the fine-grained confidence preset threshold is a verification proportion of the first judgment threshold. The logic of multi-window continuous verification is as follows: if the same coarse-grained candidate category is detected in three consecutive time windows, and the maximum confidence level corresponding to the coarse-grained classification probability distribution of each window is greater than the first verification threshold, then it is confirmed as a real anomaly and the second judgment result is output. If the same coarse-grained candidate category is detected in two consecutive time windows, and the average of the maximum confidence scores corresponding to the coarse-grained classification probability distributions of the two windows is greater than the second verification threshold, then it is confirmed as a real anomaly, and the second judgment result is output. If the maximum confidence level corresponding to the coarse-grained classification probability distribution satisfies the logic of multi-window continuity verification, but the maximum confidence level corresponding to the fine-grained classification probability distribution is lower than the preset threshold of fine-grained confidence, then the coarse-grained candidate category that passes the multi-window continuity verification is marked as a type to be refined, and the top three categories in terms of probability value among the coarse-grained candidate category and the fine-grained candidate categories that have a mapping relationship with the coarse-grained candidate category in the fine-grained classification probability distribution are output as the third judgment result; If the maximum confidence level corresponding to the coarse-grained classification probability distribution satisfies the logic of multi-window continuous verification, and the maximum confidence level corresponding to the fine-grained classification probability distribution is greater than or equal to the preset threshold of fine-grained confidence level, then the coarse-grained candidate category and the corresponding fine-grained candidate category are output, and the third judgment result is output.

9. The method for classifying and identifying abnormalities in electrical discharge machining as described in claim 1, characterized in that, Step S404, the multi-window verification mechanism further includes an anomaly severity tiered response strategy: When the coarse-grained candidate category is a severe anomaly or a system failure, the number of verification windows is reduced to 2, and the confidence threshold is lowered to the first confidence adjustment threshold, and the fifth judgment result is output. When the coarse-grained candidate category has slight fluctuations, the number of validation windows is increased to 4, and the confidence threshold is raised to the second confidence adjustment threshold, and the fifth judgment result is output. If the fine-grained candidate category of the preliminary anomaly identification result is a persistent short circuit or a severe open circuit, and the maximum confidence level corresponding to the coarse-grained classification probability distribution of the preliminary anomaly identification result is greater than or equal to the emergency threshold, an emergency shutdown signal is immediately triggered, and the fifth judgment result is output without waiting for the multi-window verification to be completed. Step S405, the state preservation mechanism specifically includes, for the first determination result output in step S402 and the second or third determination result output in step S403, activating the abnormal state preservation mechanism; The abnormal state retention mechanism is as follows: if the first judgment result, the second judgment result, or the third judgment result is continuously output for more than or equal to 5 time windows, then a fourth judgment result is generated and output. If, within 5 consecutive time windows, a fifth, third, second, first, or fourth judgment result, different from the currently maintained result, appears, the abnormal state maintenance mechanism is interrupted, and the newly appearing judgment result is output according to the priority rule of step S406. Step S406: The first judgment result, the second judgment result, the third judgment result, the fourth judgment result, and the fifth judgment result are summarized according to the preset priority rules to generate the final anomaly category output data; The preset priority rule is as follows, from high to low: fifth judgment result, third judgment result, second judgment result, first judgment result, and fourth judgment result.

10. An electrical discharge machining (EDM) anomaly classification and identification system, applied to an EDM anomaly classification and identification method as described in any one of claims 1-9, characterized in that, It includes a processing module, a construction module, a classification module, and a recognition module; The processing module segments the continuous signal into discrete signal segments, and extracts the signal from the discrete signal segments to obtain feature data. The module constructs multi-dimensional feature vectors based on feature data. The classification module inputs multi-dimensional feature vectors into a multi-granularity anomaly classifier and outputs coarse-grained candidate class probability distributions and fine-grained candidate class probability distributions. Preliminary anomaly identification results for the time window are obtained by calculating the probability distributions of coarse-grained and fine-grained candidate categories. The identification module, based on the preliminary anomaly identification results of e time windows, adopts a multi-window verification and state preservation mechanism to output the final anomaly category.

Citation Information

Patent Citations

  • Power equipment anomaly detection method and system and medium

    CN121211306A

  • Intelligent diagnosis method for machining process of electric spark machine

    CN121432102A

  • Method and system to analyse pipeline condition

    WO2020102846A1