Tool detection method, electronic device and storage medium

By collecting and processing the time-frequency characteristics of tool processing sounds and generating detection models, the problems of high tool detection cost and difficulty in real-time detection in the prior art are solved, and efficient and non-interference tool status detection is achieved.

CN114078473BActive Publication Date: 2024-11-19FU TAI HUA IND SHENZHEN +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010815084.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-13
Publication Date
2024-11-19
Estimated Expiration
2040-08-13

AI Technical Summary

Technical Problem

The existing tool detection methods are costly and cannot realize real-time state detection, interfering with the original processing operation.

Method used

By collecting cutting sounds during tool processing, short-time Fourier transform, wavelet transform and Gabor transform are used to extract time-frequency features to form a fusion feature map, and a convolutional neural network is used to generate a detection model for state detection.

Benefits of technology

It realizes the simplicity and ease of tool status detection, improves processing accuracy, and avoids interference to the original processing operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114078473B_ABST
    Figure CN114078473B_ABST
Patent Text Reader

Abstract

The present invention provides a tool detection method, comprising: collecting cutting sounds during tool processing; dividing the collected cutting sounds into multiple audios according to a preset time interval; extracting the time-frequency features of the multiple audios respectively according to a plurality of feature transformation methods; forming a fusion feature map of the cutting sounds according to the extracted time-frequency features; training the fusion feature map to generate a tool detection model; and detecting the state of the tool to be detected according to the tool detection model. The present invention also provides an electronic device and a storage medium. The tool detection process of the present invention is simple and easy to implement, does not interfere with the original processing operation of the tool, and improves the accuracy of tool processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of numerical control machining, and in particular to a tool detection method, an electronic device and a storage medium. Background Art

[0002] With the development of industrial technology, CNC (Computerized Numerical Control) equipment has been widely used in industrial production. CNC equipment is equipped with tools for processing workpieces, materials and other products. Due to the high quality requirements for product processing, the quality control of tools is becoming increasingly important. Tool detection generally uses the features extracted from vibration signals and related high-frequency audio signals for modeling and identification, but the cost of construction is high and cannot be effectively promoted, and it is impossible to perform real-time processing detection of the tool status. Summary of the invention

[0003] In view of this, it is necessary to provide a tool detection method, an electronic device and a storage medium, which can perform status detection during tool processing without interfering with the original processing operation.

[0004] A first aspect of the present invention provides a tool detection method, the method comprising:

[0005] Collect cutting sounds during tool processing;

[0006] Segmenting the collected cutting sound into multiple audios according to a preset time interval;

[0007] Extracting time-frequency features of the plurality of audios respectively according to a plurality of feature transformation methods;

[0008] forming a fusion feature map of the cutting sound according to the extracted time-frequency features;

[0009] Training the fused feature map to generate a tool detection model; and

[0010] The state of the tool to be detected is detected according to the tool detection model.

[0011] Preferably, the collecting of cutting sounds during tool processing includes:

[0012] collecting the sound of the tool during the machining process; and

[0013] The non-cutting sounds in the collected sounds are filtered out to retain the cutting sounds.

[0014] Preferably, the plurality of feature transformation methods include short-time Fourier transform, wavelet transform and Gabor transform, and extracting the time-frequency features of the plurality of audios respectively according to the plurality of feature transformation methods includes:

[0015] Calculate the frequency f corresponding to the maximum energy of the multiple audio frequencies by Fourier transform;

[0016] Determine the x-fold frequency xf according to the harmonics of the frequency f;

[0017] Processing the plurality of audios by short-time Fourier transform, wavelet transform and Gabor transform respectively to extract the time-frequency features; and

[0018] The features with a frequency greater than x times the frequency xf in the time-frequency features are filtered out.

[0019] Preferably, the processing of the plurality of audios by respectively using short-time Fourier transform, wavelet transform and Gabor transform to extract the time-frequency features comprises:

[0020] Performing short-time Fourier transform, wavelet transform and Gabor transform on the multiple audios to generate corresponding time-frequency graphs;

[0021] Determining a frequency interval from 0 to xf in the matrix of the time-frequency diagram;

[0022] Searching for the minimum value in the vertical axis range 0 to xf and the horizontal axis range t to t+k of the time-frequency graph, where t is the current processing time and k is the size of each audio frame; and

[0023] The energy values ​​corresponding to the frequencies above xf in the time-frequency diagram are replaced with -1 to filter out the features above the x times frequency xf.

[0024] Preferably, forming the fusion feature map of the cutting sound according to the extracted time-frequency features comprises:

[0025] Calculate the total number of pixels N according to the number of pixels corresponding to the time-frequency graph generated by each feature transformation method;

[0026] Determine the square root n closest to the total number of pixels N; and

[0027] The pixel points corresponding to the time-frequency graph generated by each feature transformation method are arranged in sequence to form the fused feature graph with n*n pixel number.

[0028] Preferably, the step of arranging the pixel points corresponding to the time-frequency graph generated by each feature transformation method in order to form the fused feature graph with n*n pixels comprises:

[0029] Create a square containing N pixels according to the square root n closest to the total number of pixels N;

[0030] Performing a uniform processing on the pixel values ​​of the pixel points in the time-frequency graph; and

[0031] The first pixel grid in the upper left corner of the square is filled with the first value, and then arranged in sequence from top to bottom to form the fused feature map.

[0032] Preferably, the training of the fused feature image to generate a tool detection model comprises:

[0033] The fused feature maps corresponding to the tools in multiple known states are input as training sets into a convolutional neural network model for training to generate the tool detection model.

[0034] Preferably, detecting the state of the tool to be detected according to the tool detection model includes:

[0035] The fusion feature map corresponding to the cutting sound of the tool to be detected is input into the tool detection model to determine whether the tool to be detected has defects and the type of defects when defects exist.

[0036] A second aspect of the present invention provides an electronic device, comprising:

[0037] Processor; and

[0038] A memory, wherein a plurality of program modules are stored in the memory, and the plurality of program modules are loaded by the processor and execute the above-mentioned tool detection method.

[0039] A third aspect of the present invention provides a storage medium having at least one computer instruction stored thereon, wherein the instruction is loaded by a processor to execute the above-mentioned tool detection method.

[0040] The above-mentioned tool detection method, electronic device and storage medium can generate a tool detection model based on the characteristic map of the cutting sound generated during the tool processing to detect the tool status. The detection process is simple and easy to implement, will not interfere with the original processing operation of the tool, and improves the accuracy of tool processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0042] Figure 1 It is a schematic diagram of the application environment architecture of the tool detection method provided by the preferred embodiment of the present invention.

[0043] Figure 2 It is a schematic diagram of the structure of an electronic device provided by a preferred embodiment of the present invention.

[0044] Figure 3 It is a structural schematic diagram of a tool detection system provided by a preferred embodiment of the present invention.

[0045] Figure 4 It is a time-frequency diagram formed by feature transformation of audio provided by a preferred embodiment of the present invention.

[0046] Figure 5 It is a fusion feature map of tool cutting sound provided by a preferred embodiment of the present invention.

[0047] Figure 6 It is a flow chart of a tool detection method provided by a preferred embodiment of the present invention.

[0048] Main component symbols

[0049] Electronic device 1

[0050] Processor 10

[0051] Tool detection system 100

[0052] Acquisition Module 101

[0053] Segmentation module 102

[0054] Extraction module 103

[0055] Forming module 104

[0056] Generation module 105

[0057] Detection module 106

[0058] Memory 20

[0059] Computer Program 30

[0060] Collection unit 40

[0061] CNC Machine Tools 2

[0062] Knife 201

[0063] Steps S601-S606

[0064] The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION

[0065] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0066] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. The embodiments described are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0067] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0068] See also Figure 1 , which is a schematic diagram of the application environment architecture of the tool detection method provided in a preferred embodiment of the present invention.

[0069] The tool detection method of the present invention is applied in an electronic device 1, and the electronic device 1 establishes a communication connection with a numerical control machine tool 2 through a network. The network can be a wired network or a wireless network, such as radio, wireless fidelity (WIFI), cellular, satellite, broadcast, etc.

[0070] The electronic device 1 may be an electronic device installed with a tool detection program, such as a personal computer, a server, etc., wherein the server may be a single server, a server cluster, or a cloud server, etc.

[0071] The numerical control machine tool 2 includes, but is not limited to, a plurality of cutting tools 201. The cutting tools 201 are used to perform cutting processing on a workpiece. The numerical control machine tool 2 is used to control the operation of the cutting tools 201.

[0072] See also Figure 2 FIG. 1 is a schematic diagram of the structure of a preferred embodiment of the electronic device of the present invention.

[0073] The electronic device 1 includes, but is not limited to, a processor 10, a memory 20, a computer program 30 stored in the memory 20 and executable on the processor 10, and a collection unit 40. For example, the computer program 30 is a tool detection program. When the processor 10 executes the computer program 30, steps in the tool detection method are implemented, such as Figure 6 Alternatively, when the processor 10 executes the computer program 30, the functions of each module / unit in the tool detection system are realized, for example Figure 3 Modules 101-106 in.

[0074] Exemplarily, the computer program 30 may be divided into one or more modules / units, which are stored in the memory 20 and executed by the processor 10 to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program 30 in the electronic device 1. For example, the computer program 30 may be divided into Figure 3 The acquisition module 101, the segmentation module 102, the extraction module 103, the formation module 104, the generation module 105 and the detection module 106 in the tool detection system. The specific functions of each module refer to the functions of each module in the tool detection system embodiment.

[0075] Those skilled in the art will understand that the schematic diagram is merely an example of the electronic device 1 and does not constitute a limitation of the electronic device 1. The electronic device 1 may include more or fewer components than shown in the diagram, or a combination of certain components, or different components. For example, the electronic device 1 may also include input and output devices, network access devices, buses, etc.

[0076] The processor 10 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor 10 may be any conventional processor, etc. The processor 10 is the control center of the electronic device 1, and uses various interfaces and lines to connect various parts of the entire electronic device 1.

[0077] The memory 20 can be used to store the computer program 30 and / or modules / units. The processor 10 implements various functions of the electronic device 1 by running or executing the computer program and / or modules / units stored in the memory 20 and calling the data stored in the memory 20. The memory 20 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the electronic device 1 (such as audio data, a phone book, etc.), etc. In addition, the memory 20 can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0078] In this embodiment, the acquisition unit 40 is a sound sensor, which is aimed at the tool 201 and is used to collect the sound generated by the tool 201 during the processing. The sensitivity of the sound sensor is 50mV / Pa, and the frequency band sensing accuracy is 1*10 -12 , the effective working range is 40dB-120dB. In other embodiments, the acquisition unit 40 may also be a microphone.

[0079] See also Figure 3 As shown, this is a functional module diagram of a preferred embodiment of a tool detection system of the present invention.

[0080] In some embodiments, the tool detection system 100 runs in the electronic device 1. The tool detection system 100 may include a plurality of functional modules composed of program code segments. The program code of each program segment in the tool detection system 100 may be stored in the memory 20 of the electronic device 1 and executed by the at least one processor 10 to implement the tool detection function.

[0081] In this embodiment, the tool detection system 100 can be divided into a plurality of functional modules according to the functions it performs. Figure 3As shown, the functional modules may include an acquisition module 101, a segmentation module 102, an extraction module 103, a formation module 104, a generation module 105 and a detection module 106. The module referred to in the present invention refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which are stored in the memory 20. It can be understood that in other embodiments, the above modules may also be program instructions or firmware solidified in the processor 10.

[0082] The collection module 101 is used to control the collection unit 40 to collect the cutting sound of the tool 201 during the processing.

[0083] In this embodiment, the acquisition module 101 first controls the acquisition unit 40 to acquire the sound generated by the tool 201 during the cutting process, and then filters out the non-cutting sound in the acquired sound to retain the cutting sound. The non-cutting sound is the sound acquired by the acquisition unit 40 when the tool 201 is not performing a cutting action, and the cutting sound is the sound acquired by the acquisition unit 40 when the tool 201 is performing a cutting action.

[0084] It should be noted that at this time, the state of the tool 201 is known, that is, the tool 201 is known to have no defects, or is known to have at least one type of defect, such as chipping, wear, etc.

[0085] The segmentation module 102 is used to segment the collected cutting sound into multiple audios according to a preset time interval.

[0086] In this embodiment, the preset time interval is 3 seconds, that is, the duration of each audio is 3 seconds. In other embodiments, the time interval can also be set to other values ​​according to requirements.

[0087] The extraction module 103 is used to extract the time-frequency features of the multiple audios respectively according to multiple feature transformation methods.

[0088] In this embodiment, the plurality of feature transformation methods include, but are not limited to, short-time Fourier transform, wavelet transform and Gabor transform.

[0089] In this embodiment, the extraction module 103 first uses Fourier transform to calculate the frequency f corresponding to the maximum amplitude of the multiple audio frequencies, and determines the x-fold frequency xf according to the harmonics of the frequency f. Preferably, in this embodiment, x is 3, that is, the extraction module 103 determines the triple frequency 3f according to the harmonics of the frequency f. In other embodiments, x may also be 2.

[0090] See also Figure 4As shown, the first feature transformation method is short-time Fourier transform. The extraction module 103 performs short-time Fourier transform on the multiple audios to extract the time-frequency features of the cutting sound. The extraction module 103 also filters out the features above the triple frequency 3f (i.e., greater than the triple frequency) in the time-frequency features.

[0091] Specifically, the extraction module 103 performs a short-time Fourier transform on the multiple audios to generate a corresponding time-frequency graph, determines the frequency interval of 0 to 3f in the matrix of the time-frequency graph, and searches for the minimum value in the vertical axis range of 0 to 3f and the horizontal axis range of t to t+k in the time-frequency graph. Wherein, t is the current processing time, and k is the size of each audio frame, in ms. The extraction module 103 further replaces the energy value corresponding to the frequency above 3f with -1 to filter out the features above the triple frequency 3f. It should be noted that the time-frequency graph is a two-dimensional image. When the time-frequency graph is produced, the energy value above the triple frequency is replaced with -1, and the corresponding area above the triple frequency in the time-frequency graph can be uniformly assigned to black. In image learning, its effect is equivalent to removing the influence of the triple 3f audio frequency.

[0092] In this embodiment, the extraction module 103 further uses wavelet transform ( Figure 4 The second feature transformation method in (the second feature transformation method in) and Gabor transformation etc. are used to extract the time-frequency features corresponding to the multiple audios through the above process.

[0093] The forming module 104 is used to form a fusion feature map of the cutting sound according to the extracted time-frequency features.

[0094] See also Figure 5 As shown, in this embodiment, the forming module 104 calculates the total number of pixels N according to the number of pixels corresponding to the time-frequency graph generated by each feature transformation method, and determines the square root n closest to the total number of pixels N. Wherein, n represents the number of pixels in the horizontal and vertical directions of the fused feature graph. The forming module 104 arranges the pixels corresponding to the time-frequency graph generated by each feature transformation method in sequence to form the fused feature graph with a pixel number of n*n.

[0095] Specifically, the forming module 104 makes a square containing N pixels according to the square root n closest to the total number of pixels N, and then normalizes the pixel values ​​of the characteristic pixels in the time-frequency graph. The normalization process is a 0-255 normalization process, which can effectively avoid the influence of the difference in different feature metrics. The calculation formula is x=255(x-min) / max-min. Min is the minimum value 0, max is the maximum value 255, and x is the pixel value after normalization. The forming module 104 further fills the first value in the first pixel grid in the upper left corner of the square, and then arranges them from top to bottom in sequence to form the fused feature map.

[0096] The forming module 104 obtains the time-frequency graph according to the order of feature transformation, and obtains the pixel values ​​corresponding to the pixel points in the time-frequency graph in order from left to right or from top to bottom, and then arranges the obtained pixel values ​​from top to bottom in the square to form the fusion feature graph. The first value is the pixel value of the first pixel point in the time-frequency graph generated by processing the multiple audios using the first feature transformation method (i.e., short-time Fourier transform), and the value filled in each pixel grid is the pixel value of the pixel point corresponding to the time-frequency graph generated by various feature transformation methods.

[0097] The generating module 105 is used to train the fused feature map to generate a tool detection model.

[0098] In this embodiment, the generating module 105 first performs histogram equalization processing on the fused feature map to enhance contrast.

[0099] In this embodiment, the generation module 105 inputs the fused feature graphs corresponding to the tools in multiple known states as training sets into a convolutional neural network model for training to generate the tool detection model.

[0100] Specifically, the convolutional neural network model includes an input layer, a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer and a softmax layer. Among them, the input layer is the fusion feature map. The input of the first convolutional layer is connected to the input layer, and the output of the first convolutional layer is connected to the first BN layer, the first activation layer, and the first pooling layer in sequence, and then connected to the input of the second convolutional layer; the output of the second convolutional layer is connected to the second BN layer, the second activation layer, and the second pooling layer in sequence, and then connected to the input of the third convolutional layer; the output of the third convolutional layer is connected to the third BN layer and the third activation layer in sequence, and then connected to the input of the fourth convolutional layer; the output of the fourth convolutional layer is connected to the fourth BN layer, the fourth activation layer, and the fourth pooling layer in sequence, and then connected to the input of the softmax layer through three fully connected layers. The activation function of the activation layer connected behind each convolutional layer is a linear rectified function (Rectified Linear Unit, ReLU), which changes the linear mapping into a nonlinear mapping, which is more conducive to the extraction and learning of nonlinear features. The pooling layer MaxPool connected after the activation layer of the first convolutional layer, the second convolutional layer and the fourth convolutional layer is conducive to downsampling to reduce the amount of calculation while improving the extraction effect of the convolutional neural network on regional features. The output results of the convolutional neural network model are two categories, and the discrimination result is the category with a higher score.

[0101] The above-mentioned convolutional neural network training process is divided into two parts: forward propagation and back propagation. The fused feature map in the training set is input, and the predicted value is obtained by the set convolutional neural network model. The weight is updated through the supervised learning method, and then the above-mentioned convolutional neural network model training process is repeated until the error between the predicted value and the target value meets the expected value, thereby generating the tool detection model.

[0102] The detection module 106 is used to detect the state of the tool to be detected 201 according to the tool detection model.

[0103] In this embodiment, the detection module 106 can extract the fusion feature map corresponding to the cutting sound of the tool 201 to be detected through the above method, and then input the fusion feature map into the tool detection model, so as to identify the fusion feature map through the tool detection model to determine whether the tool 201 to be detected has defects and the type of defects when defects exist.

[0104] See also Figure 6 FIG. 1 is a flow chart of the tool detection method provided by the present invention. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted.

[0105] Step S601 , collecting the cutting sound of the tool 201 during the machining process.

[0106] In this embodiment, the collecting unit 40 is first controlled to collect the sound generated by the tool 201 during the cutting process, and then the non-cutting sound in the collected sound is filtered out to retain the cutting sound. The non-cutting sound is the sound collected by the collecting unit 40 when the tool 201 is not performing a cutting action, and the cutting sound is the sound collected by the collecting unit 40 when the tool 201 is performing a cutting action.

[0107] It should be noted that at this time, the state of the tool 201 is known, that is, the tool 201 is known to have no defects, or is known to have at least one type of defect, such as chipping, wear, etc.

[0108] Step S602: dividing the collected cutting sound into multiple audios according to preset time intervals.

[0109] In this embodiment, the preset time interval is 3 seconds, that is, the duration of each audio is 3 seconds. In other embodiments, the time interval can also be set to other values ​​according to requirements.

[0110] Step S603: extracting time-frequency features of the multiple audios respectively according to multiple feature transformation methods.

[0111] In this embodiment, the plurality of feature transformation methods include, but are not limited to, short-time Fourier transform, wavelet transform and Gabor transform.

[0112] In this embodiment, the frequency f corresponding to the maximum amplitude of the multiple audio frequencies is first calculated by Fourier transform, and the x-fold frequency xf is determined according to the harmonics of the frequency f. Preferably, in this embodiment, x is 3, that is, the triple frequency 3f is determined according to the harmonics of the frequency f. In other embodiments, x may also be 2.

[0113] like Figure 4 As shown, the first feature transformation method is short-time Fourier transform. The extraction module 103 performs short-time Fourier transform on the multiple audios to extract the time-frequency features of the cutting sound. The extraction module 103 also filters out the features above the triple frequency 3f (i.e., greater than the triple frequency) in the time-frequency features.

[0114] Specifically, a short-time Fourier transform is performed on the multiple audios to generate a corresponding time-frequency diagram, a frequency range of 0 to 3f is determined in the matrix of the time-frequency diagram, and the minimum value within the vertical axis range of 0 to 3f and the horizontal axis range of t to t+k is searched in the time-frequency diagram. Wherein, t is the current processing time, and k is the size of each audio frame, in ms. Further, the energy value corresponding to the frequency above 3f is replaced with -1 to filter out the features above the triple frequency 3f. It should be noted that the time-frequency diagram is a two-dimensional image. When the time-frequency diagram is produced, the energy value above the triple frequency is replaced with -1, and the corresponding area in the time-frequency diagram can be uniformly assigned to black. In image learning, its effect is equivalent to removing the influence of the triple 3f audio frequency.

[0115] In this embodiment, wavelet transform ( Figure 4 The second feature transformation method in (the second feature transformation method in) and Gabor transformation etc. are used to extract the time-frequency features corresponding to the multiple audios through the above process.

[0116] Step S604: forming a fusion feature map of the cutting sound according to the extracted time-frequency features.

[0117] like Figure 5 As shown, in this embodiment, the total number of pixels N is calculated according to the number of pixels corresponding to the time-frequency graph generated by each feature transformation method, and the square root n closest to the total number of pixels N is determined. Wherein, n represents the number of pixels in the horizontal and vertical directions of the fused feature graph. The pixels corresponding to the time-frequency graph generated by each feature transformation method are arranged in sequence to form the fused feature graph with a pixel number of n*n.

[0118] Specifically, a square containing N pixels is made according to the square root n closest to the total number of pixels N, and then the pixel values ​​of the characteristic pixels in the time-frequency graph are normalized. The normalization process is a 0-255 normalization process, which can effectively avoid the influence of the difference in different feature measurements. The calculation formula is y=255(y-min) / max-min. Min is the minimum value 0, max is the maximum value 255, and y is the pixel value after normalization. Further, the first value is filled in the first pixel grid in the upper left corner of the square, and then arranged from top to bottom in sequence to form the fused feature map.

[0119] The time-frequency graph is obtained according to the order of feature transformation, and the pixel values ​​corresponding to the pixel points in the time-frequency graph are obtained in sequence from left to right or from top to bottom, and then the obtained pixel values ​​are arranged from top to bottom in the square to form the fused feature graph. The first value is the pixel value of the first pixel point in the time-frequency graph generated by processing the multiple audios using the first feature transformation method (i.e., short-time Fourier transform), and the value filled in each pixel grid is the pixel value of the pixel point corresponding to the time-frequency graph generated by various feature transformation methods.

[0120] Step S605: training the fused feature map to generate a tool detection model.

[0121] In this embodiment, the fused feature map is firstly subjected to histogram equalization processing to enhance the contrast.

[0122] In this embodiment, the fused feature maps corresponding to the tools in multiple known states are input as training sets into a convolutional neural network model for training to generate the tool detection model.

[0123] Specifically, the convolutional neural network model includes an input layer, a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer and a softmax layer. Among them, the input layer is the fusion feature map. The input of the first convolutional layer is connected to the input layer, and the output of the first convolutional layer is connected to the first BN layer, the first activation layer, and the first pooling layer in sequence, and then connected to the input of the second convolutional layer; the output of the second convolutional layer is connected to the second BN layer, the second activation layer, and the second pooling layer in sequence, and then connected to the input of the third convolutional layer; the output of the third convolutional layer is connected to the third BN layer and the third activation layer in sequence, and then connected to the input of the fourth convolutional layer; the output of the fourth convolutional layer is connected to the fourth BN layer, the fourth activation layer, and the fourth pooling layer in sequence, and then connected to the input of the softmax layer through three fully connected layers. The activation function of the activation layer connected behind each convolutional layer is a linear rectified function (Rectified Linear Unit, ReLU), which changes the linear mapping into a nonlinear mapping, which is more conducive to the extraction and learning of nonlinear features. The pooling layer MaxPool connected after the activation layer of the first convolutional layer, the second convolutional layer and the fourth convolutional layer is conducive to downsampling to reduce the amount of calculation while improving the extraction effect of the convolutional neural network on regional features. The output results of the convolutional neural network model are two categories, and the discrimination result is the category with a higher score.

[0124] The above-mentioned convolutional neural network training process is divided into two parts: forward propagation and back propagation. The fused feature map in the training set is input, and the predicted value is obtained by the set convolutional neural network model. The weight is updated through the supervised learning method, and then the above-mentioned convolutional neural network model training process is repeated until the error between the output value and the target value meets the expected value, thereby generating the tool detection model.

[0125] Step S606 , detecting the state of the tool 201 to be detected according to the tool detection model.

[0126] In this embodiment, the above method can be used to extract the fusion feature map corresponding to the cutting sound of the tool 201 to be detected, and then the fusion feature map can be input into the tool detection model, so that the fusion feature map can be identified by the tool detection model to determine whether the tool 201 to be detected has defects and the type of defects if defects exist.

[0127] If the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0128] The tool detection method, electronic device and storage medium provided by the present invention can generate a tool detection model based on the characteristic diagram of the cutting sound generated during the tool processing process to detect the tool status. The detection process is simple and easy to implement, will not interfere with the original processing operation of the tool, and improves the accuracy of tool processing.

[0129] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the device claim can also be implemented by the same unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.

[0130] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A tool detection method, characterized in that: The method comprises: Collect cutting sound during tool processing; Segmenting the collected cutting sound into multiple audios according to a preset time interval; Extracting time-frequency features of the plurality of audios respectively according to a plurality of feature transformation methods; Forming the fusion feature map of the cutting sound according to the extracted time-frequency features, including: calculating the total number of pixels N according to the number of pixels corresponding to the time-frequency map generated by each feature transformation method; determining the square root n closest to the total number of pixels N; and arranging the pixels corresponding to the time-frequency map generated by each feature transformation method in sequence to form the fusion feature map with a pixel number of n*n; Training the fused feature map to generate a tool detection model; and The state of the tool to be detected is detected according to the tool detection model.

2. The tool detection method according to claim 1, characterized in that: The collecting of cutting sound during tool processing includes: collecting the sound of the tool during the machining process; and The non-cutting sounds in the collected sounds are filtered out to retain the cutting sounds.

3. The tool detection method according to claim 1, characterized in that: The multiple feature transformation methods include short-time Fourier transform, wavelet transform and Gabor transform, and the time-frequency features of the multiple audios are extracted according to the multiple feature transformation methods respectively, including: Calculate the frequency f corresponding to the maximum energy of the multiple audio frequencies by Fourier transform; Determine the x-fold frequency xf according to the harmonics of the frequency f; Processing the plurality of audios by short-time Fourier transform, wavelet transform and Gabor transform respectively to extract the time-frequency features; and The features with a frequency greater than x times the frequency xf in the time-frequency features are filtered out.

4. The tool detection method according to claim 3, characterized in that: The processing of the plurality of audios by respectively using short-time Fourier transform, wavelet transform and Gabor transform to extract the time-frequency features comprises: Performing short-time Fourier transform, wavelet transform and Gabor transform on the multiple audios to generate corresponding time-frequency graphs; Determining a frequency interval from 0 to xf in the matrix of the time-frequency diagram; Searching for the minimum value in the vertical axis range 0 to xf and the horizontal axis range t to t+k of the time-frequency graph, where t is the current processing time and k is the size of each audio frame; and The energy values ​​corresponding to the frequencies above xf in the time-frequency diagram are replaced with -1 to filter out the features above the x times frequency xf.

5. The tool detection method according to claim 4, characterized in that: The step of arranging the pixel points corresponding to the time-frequency graph generated by each feature transformation method in sequence to form the fused feature graph with n*n pixels comprises: Create a square containing N pixels according to the square root n closest to the total number of pixels N; Performing a uniform processing on the pixel values ​​of the pixel points in the time-frequency graph; and The first pixel grid in the upper left corner of the square is filled with the first value, and then arranged in sequence from top to bottom to form the fused feature map.

6. The tool detection method according to claim 1, characterized in that: The training of the fused feature image to generate a tool detection model comprises: The fused feature maps corresponding to the tools in multiple known states are input as training sets into a convolutional neural network model for training to generate the tool detection model.

7. The tool detection method according to claim 1, characterized in that: The detecting the state of the tool to be detected according to the tool detection model comprises: The fusion feature map corresponding to the cutting sound of the tool to be detected is input into the tool detection model to determine whether the tool to be detected has defects and the type of defects when defects exist.

8. An electronic device, characterized in that: The electronic device comprises: Processor; and A memory, wherein a plurality of program modules are stored in the memory, and the plurality of program modules are loaded by the processor and execute the tool detection method according to any one of claims 1 to 7.

9. A storage medium having at least one computer instruction stored thereon, characterized in that: The instructions are loaded by a processor and execute the tool detection method according to any one of claims 1 to 7.