Disclosure of Invention
The invention provides a multi-dimensional feature-based defect positioning method and related equipment for a numerical control machine tool part, which are used for solving the problems of low accuracy and stability of the numerical control machine tool part defect positioning method in the prior art.
The invention provides a method for positioning defects of a numerical control machine tool part based on multidimensional characteristics, which comprises the following steps:
Acquiring working audio and converting the working audio into an audio map;
extracting the characteristics of the working audio to obtain time-frequency characteristics, frequency components and local characteristics;
generating a multi-dimensional feature vector based on the audio map, the time-frequency feature, the frequency component, and the local feature;
inputting the multi-dimensional feature vector into a pre-trained defect detection model, and controlling the defect detection model to conduct type identification on the multi-dimensional feature vector to obtain a defect type;
And determining the defect component information according to the defect category.
According to the method for positioning defects of the numerical control machine tool component based on the multidimensional features, the feature extraction is carried out on the working audio, and the time-frequency features, the frequency components and the local features are obtained, wherein the method comprises the following steps:
preprocessing the working audio to obtain processed audio;
performing wavelet decomposition on the processed audio to obtain a plurality of time-frequency characteristics;
Analyzing the processing audio to obtain frequency components corresponding to the working audio;
And carrying out wavelet decomposition on each frequency component to obtain a plurality of local features corresponding to each frequency component.
According to the method for positioning the defects of the numerical control machine tool parts based on the multidimensional characteristics, the training process of the defect detection model comprises the following steps:
Acquiring training audio and labeling information, and converting the training audio into a training chart;
Extracting features of the training audio to obtain training features;
splitting and splicing the training images according to the working period and the training characteristics to obtain a two-dimensional matrix;
Inputting the two-dimensional matrix into a multi-dimensional cyclic network according to the time sequence corresponding to the two-dimensional matrix, and controlling the multi-dimensional cyclic network to classify the two-dimensional matrix to obtain training classification codes;
and based on the training classification codes and the labeling information, carrying out parameter adjustment on the multi-dimensional circulation network until the multi-dimensional circulation network converges to obtain a defect detection model.
According to the method for positioning defects of the numerical control machine tool component based on the multidimensional features, the parameter adjustment is performed on the multidimensional circulation network based on the training classification codes and the labeling information until the multidimensional circulation network converges, and the defect detection model is obtained, which comprises the following steps:
Calculating a loss value based on the training classification code and the labeling information;
Reversely inputting the loss value into the multidimensional circulation network, and calculating adjustment parameters corresponding to an output layer and a hidden layer in the multidimensional circulation network;
And according to the adjustment parameters, carrying out parameter adjustment on the multi-dimensional circulation network until the multi-dimensional circulation network converges to obtain a defect detection model.
According to the method for positioning defects of the numerical control machine tool component based on the multidimensional features, the splitting and splicing of the training graphs according to the working period and the training features to obtain the two-dimensional matrix comprises the following steps:
Splitting the training diagram according to the working period to obtain a sub-training diagram;
Aiming at each sub-training diagram, splitting the sub-training diagram according to the training characteristics to obtain a plurality of corresponding audio cycle diagrams;
And splicing the audio frequency periodic diagrams according to the time sequence corresponding to the audio frequency periodic diagrams to obtain a two-dimensional matrix.
According to the method for positioning defects of the numerical control machine tool component based on the multidimensional features, the generating of the multidimensional feature vector based on the audio map, the time-frequency features, the frequency components and the local features comprises the following steps:
Respectively carrying out standardization processing on the audio map, the time-frequency characteristic, the frequency component and the local characteristic to obtain corresponding standard parameters;
calculating parameter distances between the standard parameters;
according to the parameter distance, determining the parameter weight corresponding to each standard parameter;
and calculating a multidimensional feature vector according to the parameter weight and the standard parameter.
According to the defect positioning method of the numerical control machine tool part based on the multidimensional characteristics, the determining of the defect part information according to the defect category comprises the following steps:
Determining a defective component name in the defective component information according to the defect category;
and determining the coordinates of the defective component in the defective component information based on the equipment component distribution information, the defective component name and the defect category.
The invention also provides a defect positioning device of the numerical control machine tool part based on the multidimensional characteristics, which comprises:
The acquisition module is used for acquiring working audio and converting the working audio into an audio map;
The feature extraction module is used for extracting features of the working audio to obtain time-frequency features, frequency components and local features;
a vector generation module for generating a multidimensional feature vector based on the audio map, the time-frequency feature, the frequency component and the local feature;
the detection module is used for inputting the multi-dimensional feature vector into a pre-trained defect detection model and controlling the defect detection model to conduct type identification on the multi-dimensional feature vector to obtain a defect type;
and the information determining module is used for determining the defect part information according to the defect type.
The invention also provides electronic equipment, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes any of the defect positioning methods of the numerical control machine tool parts based on the multidimensional characteristics when executing the computer program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements any of the multi-dimensional feature based numerically controlled machine tool component defect localization methods described above.
The invention provides a method for positioning defects of a numerical control machine tool part based on multidimensional characteristics and related equipment. Then, the working audio is subjected to audio conversion and feature extraction to obtain an audio map, time-frequency features, frequency components and local features. The audio map reflects specific details of working audio, and the last three features respectively reflect the change condition of the audio on different time and frequency scales, distinguish different sound sources and harmonic components in the audio, capture the detail characteristics of the audio, reflect statistics such as energy, entropy, variance and the like of the audio in a local area, and depict the local abnormal characteristics of the audio. Next, a multi-dimensional feature vector is generated based on the audio map, the time-frequency features, the frequency components, and the local features. The multidimensional feature vector combines a detailed audio map and various features with abnormal performance, is fully combined with key features in detail, can better represent different types of defects of parts, and provides more feature information for a subsequent neural network. And finally, inputting the multi-dimensional feature vector into a pre-trained defect detection model, and controlling the defect detection model to perform type recognition on the multi-dimensional feature vector to obtain a defect type. And determining the defect component information according to the defect category. Thus, the rapid, accurate and intelligent defect detection of the parts can be realized.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention. For convenience of explanation, the defect positioning method of the numerical control machine tool part based on the multidimensional characteristic is installed in a numerical control device in a software mode. The defect positioning method of the numerical control machine tool part based on the multidimensional characteristics in the invention is described below with reference to fig. 1-3.
As shown in fig. 1, the method for positioning defects of a numerically-controlled machine tool component based on multidimensional features provided by the invention comprises the following steps:
s100, acquiring working audio and converting the working audio into an audio map;
s200, extracting features of the working audio to obtain time-frequency features, frequency components and local features;
s300, generating a multidimensional feature vector based on the audio map, the time-frequency feature, the frequency component and the local feature;
S400, inputting the multi-dimensional feature vector into a pre-trained defect detection model, and controlling the defect detection model to conduct type identification on the multi-dimensional feature vector to obtain a defect type;
s500, determining defect component information according to the defect type.
Specifically, firstly, a sound signal, i.e., working audio, emitted by the device during operation is acquired, so that defect detection can be performed subsequently. Sound sensors, such as microphones, vibration sensors, etc., are installed in the key parts of the device in advance, and the type and position of the sensors are selected appropriately according to the structure and working principle of the device. The sound sensor is connected with the numerical control device, and the numerical control device acquires working audio acquired by the sound sensor so as to carry out subsequent analysis and processing.
One common algorithm for converting audio to an audio map is time-frequency transformation, which converts the time-domain features of an audio signal to frequency-domain features, thereby graphically representing information such as frequency, amplitude, phase, etc. of the audio signal. One specific implementation of the time-frequency transformation is short-time fourier transformation, which can divide an audio signal into several short-time windows, and then fourier transform the signal in each window to obtain a complex matrix representing the frequency spectrum of the signal in each window. This complex matrix can be further converted into different types of audio maps of amplitude spectrum, phase spectrum, power spectrum, etc. In addition to time-frequency transforms, there are other algorithms that can transform audio into an audio map, such as wavelet transforms, constant Q transforms, mel-frequency cepstral coefficients. The algorithms have respective advantages and disadvantages and applicable scenes, and can be selected according to your needs and targets.
And then carrying out multi-dimensional information extraction capable of reflecting the equipment state and defect characteristics on the working audio so as to carry out defect detection subsequently. The working audio is preprocessed, such as denoising, filtering, segmentation and normalization, and a proper preprocessing method and parameters are selected according to the quality and characteristics of the working audio so as to reduce the interference of noise and obtain the processed audio. The processed audio is subjected to time-frequency analysis, such as short-time Fourier transform, and then time-frequency characteristics, such as time-frequency images, energy spectrums, spectrum entropy and spectrum peaks, are extracted from the time-frequency analysis results. And meanwhile, frequency analysis, such as fast Fourier transformation, is carried out on the preprocessed working audio, and frequency components, such as fundamental frequency, harmonic wave, subharmonic wave and sidebands, are extracted from the frequency analysis result. In addition, local analysis such as entropy coding and empirical mode decomposition can be performed on the processed audio, and local features such as entropy values, mode energy ratios and singular value ratios can be extracted from the local analysis results.
The extracted various features and information are then combined into a multi-dimensional feature vector capable of representing the working audio for subsequent defect detection. In this embodiment, various extracted features may be normalized, standardized, and reduced in dimension to obtain standardized features. And then splicing the standardized features into a multidimensional feature vector according to a certain sequence and rule. And performing operations such as verification after the multidimensional feature vector so as to ensure the normalization of the multidimensional vector. And classifying the multidimensional feature vectors and the audio map by using a defect detection model constructed by machine learning or deep learning and other methods, and judging whether defects exist and the types of the defects.
A part of the existing working audio database is selected as a training set, and working audio in the training set is called training audio. And marking information on the training audio to give out whether the training audio has defects and the types of the defects. And executing steps S100 to S300 on the training audio to obtain corresponding multidimensional feature vectors and audio graphs, wherein the multidimensional feature vectors for training are called training vectors and training graphs. According to the labeling information, training vectors and training diagrams of the training audio, an audio type recognition model such as a support vector machine, a random forest, a convolutional neural network and the like is designed and trained. And optimizing, adjusting or retraining the audio type recognition model based on the labeling information, the training vector and the training diagram until the expected performance level is reached, and obtaining the defect detection model until the audio type recognition model is converged.
In one implementation, a multi-feature fusion and defect detection model may be trained through a neural network. The training vectors and training graphs are first processed separately by two different branches. Training graph branches may use convolutional neural networks to extract local features from the spectrogram representation. Feature vector branching uses fully connected network learning to nonlinear mapping of digital features in the form of training vectors to potential space. And then connecting the outputs of the two branches, conveying the outputs to another full-connection layer, and performing multi-mode fusion and dimension reduction to obtain a multi-dimensional feature vector. The multidimensional feature vector is then passed to a recurrent neural network that captures the time dependence between sound events. The output of the recurrent neural network is then fed into an activation layer provided with an activation function, which predicts whether a defect exists in each time frame. The prediction is then compared to the tag and optimized using the loss function. And iterating the model through the training set to finally obtain a defect detection model. The method extracts the audio features in the training diagram, and then fuses the features in the training diagram and the training vectors, so that the training speed and the training efficiency can be improved.
In another implementation, the training vectors and training graphs are multimodal fused. A fusion algorithm is preset, and fusion between the training diagram and the training vector is achieved through the fusion algorithm, so that the vector to be identified is obtained. First, the training graph is converted into a matrix, where each row corresponds to a node in the graph and each column corresponds to an edge in the graph. The values in the matrix represent whether an edge exists between two nodes and, if so, the weight or strength of the edge. The training vectors are then connected to the rows of the matrix to form a new matrix containing the numerical and graphical information for each node in the graph. And (3) taking the new matrix as a multidimensional feature vector, inputting the multidimensional feature vector into an initial model such as a support vector machine, a random forest algorithm and the like, and then carrying out parameter adjustment on the initial model through labeling information and the multidimensional feature vector until the initial model converges to obtain a defect detection model. Compared with the first implementation mode, the second implementation mode directly fuses the training images and the training vectors, low-dimensional features in the training images are not reduced, more features of the training images are reserved, the training images are more sensitive to fine changes, and recognition accuracy can be improved. Inputting the multidimensional feature vector generated in the step S300 into a deployed defect detection model, and controlling the defect detection model to perform type recognition on the multidimensional feature vector to obtain a defect type.
Finally, determining that defect information exists in the equipment according to the defect type given by the defect detection model, wherein the defect information can comprise the name, the coordinates and the number of the defective part, so that the defect can be positioned and repaired later. The device information inquiry index, such as the component name, the component coordinates, the component functions and the like, is established in advance, and a proper reading method and an index mode are selected according to the content and the structure of the device information database file. And searching the corresponding part name in the equipment information inquiry index according to the defect type given by the defect detection model. And searching the corresponding part coordinates in the equipment information inquiry index according to the searched part names. And combining the searched part name and part coordinates into defect part information, outputting, displaying or storing, and selecting a proper combination method and format according to the requirement of outputting, displaying or storing.
According to the scheme, various different characteristics including an audio frequency image, a time-frequency characteristic, a frequency component and a local characteristic are extracted, and the characteristics can reflect the working state and defect characteristics of equipment from different angles and levels, so that the expression capacity and the distinguishing capacity of the characteristics are improved. In addition, the detection and recognition of defects are also carried out based on various features, and the various features are spliced into a multidimensional feature vector and are input into a pre-trained defect detection model, so that the powerful classification capability and generalization capability of methods such as machine learning or deep learning can be utilized, and the detection accuracy and recognition efficiency of the defects are improved. Therefore, the method and the device can effectively avoid the limitation and instability of a single feature by extracting various different features and detecting and identifying the defects based on the various features, and enhance the robustness and complementarity of the features, thereby realizing the accurate positioning of the defective parts of the equipment.
In one implementation manner, the feature extraction of the working audio to obtain a time-frequency feature, a frequency component and a local feature includes:
preprocessing the working audio to obtain processed audio;
performing wavelet decomposition on the processed audio to obtain a plurality of time-frequency characteristics;
Analyzing the processing audio to obtain frequency components corresponding to the working audio;
And carrying out wavelet decomposition on each frequency component to obtain a plurality of local features corresponding to each frequency component.
Specifically, the purpose of the preprocessing is to remove noise in the audio, improve the signal quality, and facilitate subsequent analysis and processing. The working audio is preprocessed, which may include denoising, filtering, segmentation, normalization, etc. Denoising is to denoise the working audio by using a wavelet thresholding method, such as a soft thresholding method, to obtain denoised audio. Then, the band-pass filter is used to filter the noise-removed frequency, and the butterworth filter is selected in this embodiment to obtain the filtered audio. Dividing the filtered audio into a plurality of equal-length segments to obtain a plurality of segmented audio, normalizing each segmented audio, for example, normalizing the amplitude range of each segmented audio to be between [ -1,1] to obtain normalized audio, and finally obtaining a matrix formed by a plurality of normalized audio segments, namely processing the audio. Compared with the working audio, the processing audio removes noise and irrelevant frequency components, enhances signal-to-noise ratio and signal quality, and facilitates subsequent feature extraction. The preprocessing process may also be adjusted based on the characteristics of the working audio.
The purpose of wavelet decomposition is to extract time-frequency features in the audio, reflecting the structure and content of the audio. Wavelet decomposition is of various types, such as continuous wavelet transform, discrete wavelet transform, wavelet packet transform, and the like. In this embodiment, the signal is continuously decomposed in multiple stages by a plurality of low-pass filters and high-pass filters, so as to obtain wavelet coefficients with different levels and resolutions, and reflect the energy distribution of the signal on different scales and frequencies.
The purpose of parsing the processed audio is to obtain frequency components in the audio, such as fundamental and harmonic frequencies, reflecting the pitch and timbre of the audio. There are various methods for analysis, such as fourier transform, autocorrelation method, VMD (Variational mode decomposition, decomposition of variation mode), and the like. Fourier transform is a tool that converts a signal from the time domain to the frequency domain, and can represent the signal as a sum of sinusoidal functions of different frequencies and amplitudes, reflecting which frequency components and respective duty cycles the signal contains.
And carrying out wavelet decomposition on each frequency component to obtain a plurality of local features corresponding to each frequency component. The purpose of this step is to further refine the time-frequency characteristics in the audio, reflecting the local variations and details of the audio over the different frequency components. The wavelet decomposition method can be repeatedly used in this step, and the wavelet coefficients with different scales and frequencies are obtained by carrying out multistage decomposition on each frequency component.
Through preprocessing, noise in the audio can be removed, the signal quality is improved, and subsequent analysis and processing are facilitated. By wavelet decomposition, time-frequency characteristics in the audio can be extracted, reflecting the structure and content of the audio. And the analysis can acquire the fundamental frequency and harmonic frequency in the audio, reflecting the pitch and tone of the audio. The wavelet decomposition is carried out on each frequency component, so that the time-frequency characteristics in the audio can be further refined, and the local change and details of the audio on different frequency components are reflected.
In another implementation, the generating a multi-dimensional feature vector based on the frequency map, the time-frequency feature, the frequency component, and the local feature includes:
Respectively carrying out standardization processing on the audio map, the time-frequency characteristic, the frequency component and the local characteristic to obtain corresponding standard parameters;
calculating parameter distances between the standard parameters;
according to the parameter distance, determining the parameter weight corresponding to each standard parameter;
and calculating a multidimensional feature vector according to the parameter weight and the standard parameter.
Specifically, the purpose of the normalization process is to eliminate dimensional and scale differences between different features, so that each feature has similar mean and variance, and standard parameters facilitate subsequent calculation and comparison. There are various methods of normalization, such as maximum and minimum normalization and mean normalization. In the embodiment, the mean value of each feature is subtracted from the standard deviation of each feature to obtain the standard parameter, so that each feature has 0 mean value and 1 variance, offset and scale influence among the features can be eliminated, and the method is suitable for the condition that the features are subjected to normal distribution or approximate normal distribution. For the audio map, the standardized processing can convert the two-dimensional image into one-dimensional data, so that the data in different modes can be fused conveniently.
The purpose of the parameter distance is to measure the similarity or difference between different features and reflect the relevance or independence between the features. There are various methods for parameter distance, such as euclidean distance, manhattan distance, cosine distance, correlation coefficient, and the like. One common parametric distance method is euclidean distance. The euclidean distance is the linear distance between two feature vectors, reflecting the degree of absolute difference between features. The smaller the Euclidean distance, the more similar the two features are represented; the larger the euclidean distance, the more dissimilar the two features are represented.
The purpose of the parameter weights is to reflect the importance or contribution of the different features to the target task, so that more useful or more discriminative features can be more focused or considered, such as for example information gain, chi-square test. In this embodiment, a new set of orthogonal basis vectors is searched to maximize the projection variance of the original standard parameters on the set of basis vectors, where the basis vectors are parameter weights, so as to highlight the main variation trend and features of the data. The method can eliminate the linear correlation between the features and simultaneously give the variance contribution rate of each principal component as the basis of the parameter weight.
The purpose of the multi-dimensional feature vector is to combine different features to form a more complete or representative representation of the features, improving the performance or effectiveness of the target task. There are various methods of multidimensional feature vectors, such as stitching and kernel functions. Splicing is to connect different features according to a certain sequence or rule to form a longer feature vector. And the standard parameters can be spliced according to different parameter weights through the parameter weights, so that the multidimensional feature vector is obtained.
Through the standardization process, the dimension and scale difference between different features can be eliminated, so that each feature has similar mean and variance, and subsequent calculation and comparison are facilitated. The components corresponding to different standard parameters can be calculated by combining the parameter weights, so that a high-dimensional feature vector is obtained, different features can be combined by the high-dimensional feature vector to form a more complete or representative feature representation, and the performance or effect of a target task is improved.
In the prior art, a deep learning mode is adopted to locate the defective component, so that the result is difficult to interpret and difficult to improve through a 'black box' model such as a BP network and the like. The method can automatically learn the characteristics and rules in the signals by using the neural network and other models, thereby realizing fault diagnosis and positioning. But lacks theoretical basis and interpretability, is easy to over fit and under fit, and is difficult to adapt to new scenes and data. In one implementation manner of this embodiment, to solve the above problem, a training process of the defect detection model includes:
Acquiring training audio and labeling information, and converting the training audio into a training chart;
Extracting features of the training audio to obtain training features;
splitting and splicing the training images according to the working period and the training characteristics to obtain a two-dimensional matrix;
Inputting the two-dimensional matrix into a multi-dimensional cyclic network according to the time sequence corresponding to the two-dimensional matrix, and controlling the multi-dimensional cyclic network to classify the two-dimensional matrix to obtain training classification codes;
and based on the training classification codes and the labeling information, carrying out parameter adjustment on the multi-dimensional circulation network until the multi-dimensional circulation network converges to obtain a defect detection model.
Specifically, a training data set including training audio and corresponding annotation information is prepared in advance. The training audio can be actually acquired or generated in a simulation mode, and the labeling information can be manually labeled or automatically labeled. The labeling information generally includes information such as the type, position, size, etc. of the defect, and may be expressed in text or image form. Meanwhile, the training audio is converted into a training chart, and the conversion mode is described above and is not repeated here.
And then extracting the characteristics of the training audio to obtain training characteristics. The process of extracting the features of the training audio, namely the time-frequency features, the frequency components and the local features in the training audio, can be performed with reference to the previous description.
The work cycle refers to a time corresponding to a single-wheel work, for example, for a rotor of a machine tool, the time elapsed for one rotation of the rotor is a single work cycle. According to the working period and the training characteristics, the training image can be split, for example, the working period is 1 second, the training image is split in a second unit, the periodic characteristics in the audio are determined according to the peak value, the short-time energy and the like in the training characteristics, and the image split according to the working period is further split. And then splicing the images after the two splitting according to the time sequence to form a two-dimensional matrix.
And extracting the characteristics of each two-dimensional matrix to obtain periodic characteristics, and then sequentially inputting the periodic characteristics into a preset multi-dimensional cyclic network (multi-dimensional recurrent network, MDRNN) according to the event sequence corresponding to the two-dimensional matrix. And (3) carrying out time sequence modeling and classification on the periodic characteristics by using a multidimensional circulating network to obtain defect types at each moment. The multi-dimensional cyclic network is a cyclic neural network capable of processing multi-dimensional data, and is composed of a plurality of cyclic units which are scanned along different dimensions, and can capture time sequence dependence and context information in the data. Because the training audio is composed of the acquisition values corresponding to each moment and has a front-back time relation, the training audio is input into a multi-dimensional circulation network based on the sequence of the periodic characteristics, and the periodic characteristics are classified by using the multi-dimensional circulation network to obtain the training classification codes. The general classification depends on a full connection layer, and finally the coded features are mapped to different defect categories through the full connection layer, and corresponding tag probabilities are output. In addition, other types of output layers, such as global pooling layers, may also be substituted for the fully connected layer.
And finally, based on the training classification codes and the labeling information, updating and optimizing parameters of the multidimensional circulation network by using methods such as a loss function, an optimization algorithm and the like, so that the difference between the training classification codes and the labeling information is minimized, and the multidimensional circulation network converges, thereby obtaining a model capable of accurately detecting defects.
According to the scheme, the training diagram is converted into a plurality of two-dimensional matrixes by utilizing the time-frequency characteristics, the frequency components and the local characteristics, so that the periodicity and the variability in the audio can be better captured. The two-dimensional matrix is subjected to feature extraction, so that the audio information of multiple scales can be considered simultaneously, and the expression capability of the features is improved. In addition, the multi-dimensional cyclic network is used for carrying out time sequence modeling and classification on the periodic characteristics, so that time sequence dependence and context information of multi-dimensional data can be processed, and the classification accuracy is improved. The overall detection accuracy is improved through the mode.
In one implementation, the splitting and stitching the training graph according to the training features, to obtain a two-dimensional matrix includes:
Splitting the training diagram according to the working period to obtain a sub-training diagram;
Aiming at each sub-training diagram, splitting the sub-training diagram according to the training characteristics to obtain a plurality of corresponding audio cycle diagrams;
And splicing the audio frequency periodic diagrams according to the time sequence corresponding to the audio frequency periodic diagrams to obtain a two-dimensional matrix.
Specifically, the training diagram is split into a plurality of sub-training diagrams according to the working period. And then, according to the time-frequency characteristics, the frequency components and the local characteristics, carrying out audio period splitting on the sub-training diagram to obtain an audio period diagram. The time-frequency characteristic is a statistic describing the time domain and the frequency domain of the audio signal, such as zero-crossing rate, short-time energy, spectrum center point and spectrum entropy. These features may reflect the tempo and complexity of the audio signal. The frequency components are amplitudes or energy values of the audio signal at different frequencies, and can reflect fundamental frequencies, harmonics, formants, and the like of the audio signal. Local features are features of the audio signal in a small time range, such as instantaneous frequency, instantaneous phase, instantaneous energy, etc. These features may reflect subtle changes in the audio signal. In a splitting mode, the time-frequency characteristic is adopted to determine the time-frequency period in the sub-training diagram, the frequency component is adopted to determine the frequency period in the sub-training diagram, the local characteristic is adopted to determine the local period in the sub-training diagram, and the time period of coincidence among the video period, the frequency period and the local period is taken as the audio period. And splitting the sub-training diagram according to the audio period to obtain the audio period diagram. In another splitting mode, each audio frame corresponding to the sub-training diagram is clustered according to the time-frequency characteristics, the frequency components and the local characteristics, the audio period corresponding to the sub-training diagram is determined according to different categories after clustering, such as the beginning, the middle and the ending, and the sub-training diagram is split according to the audio period to obtain the audio period diagram. And corresponding to the same sub-training diagram, fusing the audio frequency periodic diagrams to obtain a corresponding two-dimensional matrix. Wherein each row in the two-dimensional matrix corresponds to audio values at the same time in different audio periods, for example, the first second of the first period and the first second of the second period, each column in the two-dimensional matrix corresponds to audio values at different times in the same audio period, and different audio period diagrams are arranged in the two-dimensional matrix according to time sequence. The training diagram is split to obtain a plurality of two-dimensional matrixes based on the time-frequency characteristics, the frequency characteristics and the local characteristics, and the characteristics among the periods are more obviously identified through the same row and the same column.
In one implementation manner, the performing parameter adjustment on the multi-dimensional cyclic network based on the training classification code and the labeling information until the multi-dimensional cyclic network converges, and obtaining the defect detection model includes:
Calculating a loss value based on the training classification code and the labeling information;
Reversely inputting the loss value into the multidimensional circulation network, and calculating adjustment parameters corresponding to an output layer and a hidden layer in the multidimensional circulation network;
And according to the adjustment parameters, carrying out parameter adjustment on the multi-dimensional circulation network until the multi-dimensional circulation network converges to obtain a defect detection model.
Specifically, the spatial features are sequentially input into a multi-dimensional cyclic network model, and output values corresponding to each training audio are obtained. The output value represents a predicted class of whether the model is defective for the component or not and the type of defect. The loss value, i.e. the difference between the model predicted value and the true value, is then calculated based on the labeling information. One commonly used loss function is the cross entropy loss function. It can measure the degree of similarity between two probability distributions. The cross entropy loss function is calculated by taking the logarithm of each element in the true value and the predicted value, multiplying the true value by the predicted value after the logarithm, adding all the elements and taking the negative number. The smaller the cross entropy loss function, the more accurate the model prediction.
To optimize the performance of the model, the weight matrix in the model needs to be adjusted according to the loss values. The present embodiment employs a back propagation algorithm that is capable of calculating the partial derivative of the loss function with respect to the weight matrix and updating the weight matrix. Since in a multi-dimensional cyclic network model the back propagation algorithm needs to take into account the characteristics of the time series, i.e. the output value of each audio signal depends not only on the current input value but also on the values of the previous hidden layers. Thus, the present embodiment calculates the error gradient step by step, starting from the last training audio, and determines the weight matrix for each parameter in the model. The multidimensional circulation network can be split into the input layer, the hidden layer and the output layer, and the adjustment parameters corresponding to the output layer and the hidden layer can be calculated in stages, so that the specific parameters are adjusted.
And finally, according to the adjustment parameters, carrying out parameter adjustment on the multi-dimensional circulation network until the multi-dimensional circulation network converges to obtain a defect detection model. The adjustment to convergence has been described above, and thus will not be described here.
All parameters in the network are updated through a back propagation algorithm, and the embodiment enables the network to gradually learn the optimal parameter values, so that the prediction performance is improved.
In one implementation manner, the inverting the loss value to the multi-dimensional cyclic network and calculating the adjustment parameters corresponding to the output layer and the hidden layer in the multi-dimensional cyclic network includes:
calculating an output error gradient corresponding to the output layer based on the loss value;
Calculating a hidden error gradient corresponding to the hidden layer based on the loss value;
and calculating the error change rate in the adjustment parameter according to the output error gradient and the hidden error gradient.
Specifically, firstly, deriving a weight matrix V of an output layer by using a loss function to obtain an output error gradient: where L is the loss function and V is the weight matrix of the output layer. This gradient represents the sensitivity of the loss function to the output layer weights, i.e. the effect of the output layer weight variations on the loss function.
Then, the output error gradient is transmitted to the hidden layer by utilizing a chain rule, and the dependency relationship of the state of the hidden layer among different time steps is considered to obtain the hidden error gradient: Wherein S t is the hidden layer state at time t. This gradient indicates the sensitivity of the loss function to the hidden layer state, i.e. the effect of the hidden layer state change on the loss function.
And finally, deriving weight matrixes U and W of the input layer and the circulating layer by utilizing the hidden error gradient to obtain an error change rate: And/> Where U is the input layer to hidden layer weight matrix and W is the cyclic layer to hidden layer weight matrix. These two rates of change represent the sensitivity of the loss function to the input layer and cyclic layer weights, i.e., the effect of the input layer and cyclic layer weight changes on the loss function. The embodiment provides a specific way for calculating the adjustment parameters, simplifies the calculation flow of the adjustment parameters, and improves the efficiency.
Although the region where the defective component is located may be added in the labeling information during the training of the model, the accuracy of the result of the region is not high, so in an implementation manner of this embodiment, the determining the defective component information according to the defect category includes:
Determining a defective component name in the defective component information according to the defect category;
and determining the coordinates of the defective component in the defective component information based on the equipment component distribution information, the defective component name and the defect category.
Specifically, it is necessary to create a device component distribution information base that contains device component distribution information such as names, positions, shapes, sizes, etc. of the respective components in the device. The information can be obtained through a device design drawing or three-dimensional scanning, and can also be generated through manual input or automatic identification. This information will be used to calculate the coordinate range of the defective part based on the defective part name and the defect class. When the defect type is determined, the name of the component having the fault, i.e., the defective component name, is determined according to the defect type. According to the positions of all parts in the equipment, equipment part distribution information is prepared in advance, and after the defect part names and defect types are obtained, the positions of sensors from working audios can be predicted according to the defect part names and defect part types, and therefore the defect part can be accurately positioned.
Further, a visual interface may be designed that may display a three-dimensional model of the device, as well as the defect class and defect part name output by the part defect detection model. Meanwhile, the interface can calculate the coordinate range of the defect part according to the equipment part distribution information base, and the coordinate range is marked by different colors or shapes on the three-dimensional model. In this way, the user can intuitively see which defects are present in the device, as well as their location.
The defect positioning device for the numerical control machine tool part based on the multi-dimensional characteristics is described below, and the defect positioning device for the numerical control machine tool part based on the multi-dimensional characteristics and the defect positioning method for the numerical control machine tool part based on the multi-dimensional characteristics, which are described below, can be correspondingly referred to each other.
As shown in fig. 4, the apparatus includes an acquisition module 410, a feature extraction module 420, a vector generation module 430, a detection module 440, and an information determination module 450.
The acquiring module 410 is configured to acquire working audio and convert the working audio into an audio map;
The feature extraction module 420 is configured to perform feature extraction on the working audio to obtain a time-frequency feature, a frequency component and a local feature;
the vector generation module 430 is configured to generate a multidimensional feature vector based on the audio map, the time-frequency feature, the frequency component, and the local feature;
the detection module 440 is configured to input the multi-dimensional feature vector into a pre-trained defect detection model, and control the defect detection model to perform type recognition on the multi-dimensional feature vector to obtain a defect class;
the information determining module 450 is configured to determine defect component information according to the defect type.
Fig. 5 illustrates a physical schematic diagram of an electronic device, as shown in fig. 5, which may include: processor 510, communication interface (Communications Interface) 520, memory 530, and communication bus 540, wherein processor 510, communication interface 520, memory 530 complete communication with each other through communication bus 540. Processor 510 may invoke logic instructions in memory 530 to perform a method for locating defects in a component of a numerically controlled machine tool based on multidimensional features, the method comprising:
Acquiring working audio and converting the working audio into an audio map;
extracting the characteristics of the working audio to obtain time-frequency characteristics, frequency components and local characteristics;
generating a multi-dimensional feature vector based on the audio map, the time-frequency feature, the frequency component, and the local feature;
inputting the multi-dimensional feature vector into a pre-trained defect detection model, and controlling the defect detection model to conduct type identification on the multi-dimensional feature vector to obtain a defect type;
And determining the defect component information according to the defect category.
Further, the logic instructions in the memory 530 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, where the computer program product includes a computer program, where the computer program can be stored on a non-transitory computer readable storage medium, and when the computer program is executed by a processor, the computer can execute the method for locating defects of a numerically controlled machine tool component based on multidimensional features provided by the above methods, and the method includes:
Acquiring working audio and converting the working audio into an audio map;
extracting the characteristics of the working audio to obtain time-frequency characteristics, frequency components and local characteristics;
generating a multi-dimensional feature vector based on the audio map, the time-frequency feature, the frequency component, and the local feature;
inputting the multi-dimensional feature vector into a pre-trained defect detection model, and controlling the defect detection model to conduct type identification on the multi-dimensional feature vector to obtain a defect type;
And determining the defect component information according to the defect category.
In yet another aspect, the present invention further provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the method for locating defects of a numerically controlled machine tool component based on multidimensional features provided by the above methods, the method comprising:
Acquiring working audio and converting the working audio into an audio map;
extracting the characteristics of the working audio to obtain time-frequency characteristics, frequency components and local characteristics;
generating a multi-dimensional feature vector based on the audio map, the time-frequency feature, the frequency component, and the local feature;
inputting the multi-dimensional feature vector into a pre-trained defect detection model, and controlling the defect detection model to conduct type identification on the multi-dimensional feature vector to obtain a defect type;
And determining the defect component information according to the defect category.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.