Patent ID: 12198320

DETAILED DESCRIPTION

It will be appreciated that for simplicity and clarity of illustration, where appropriate, reference numerals have been repeated among the different figures to indicate corresponding or analogous elements. In addition, numerous specific details are set forth in order to provide a thorough understanding of the embodiments described herein. However, it will be understood by those of ordinary skill in the art that the embodiments described herein can be practiced without these specific details. In other instances, methods, procedures, and components have not been described in detail so as not to obscure the related relevant feature being described. Also, the description is not to be considered as limiting the scope of the embodiments described herein. The drawings are not necessarily to scale and the proportions of certain parts have been exaggerated to better illustrate details and features of the presented disclosure.

The presented disclosure, including the accompanying drawings, is illustrated by way of examples and not by way of limitation. Several definitions that apply throughout this disclosure will now be presented. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean “at least one.”

Furthermore, the term “module”, as used herein, refers to logic embodied in hardware or firmware, or to a acquiring of software instructions, written in a programming language, such as Java, C, or assembly. One or more software instructions in the modules can be embedded in firmware, such as in an EPROM. The modules described herein can be implemented as either software and/or hardware modules and can be stored in any type of non-transitory computer-readable medium or another storage device. Some non-limiting examples of non-transitory computer-readable media include CDs, DVDs, BLU-RAY, flash memory, and hard disk drives. The term “comprising” means “including, but not necessarily limited to”; it in detail indicates open-ended inclusion or membership in a so-described combination, group, series, and the like.

Referring toFIG.1, an electronic device (electronic device1) may communicate with at least one CNC device2through a network. In one embodiment, the network may be a wired network or a wireless network. The wireless network may be radio, WI-FI, cellular, satellite, broadcast, etc.

In one embodiment, the electronic device1runs tool detection programs. The electronic device1may be a personal computer or a server. The sever may be a single server, a server cluster, or a cloud server.

The CNC device2at least includes a number of tools201. The tool201is used for processing workpieces. The CNC device2controls the tools201to work.

FIG.2illustrates the electronic device1in one embodiment. The electronic device1includes, but is not limited to, a processor10, a storage device20, a computer program30, and an acquiring device40.FIG.2illustrates only one example of the electronic device1. Other examples may include more or fewer components than as illustrated or have a different configuration of the various components in other embodiments.

The processor10can be a central processing unit (CPU), a microprocessor, or other data processor chip that performs functions in the electronic device1.

In one embodiment, the storage device20may include various types of non-transitory computer-readable storage mediums. For example, the storage device20may be an internal storage system, such as a flash memory, a random access memory (RAM) for the temporary storage of information, and/or a read-only memory (ROM) for permanent storage of information. The storage device20may also be an external storage system, such as a hard disk, a storage card, or a data storage medium. The processor10can execute the computer program30to implement the tool detecting method.

In one embodiment, the acquiring device40may be a sound sensor. The acquiring device40aligns with each of the number of tools201and acquires a sound generated by each tool201during a cutting process. A sensitivity of the sound sensor may be 50 mV/Pa, a frequency band sensing accuracy may be 1*10−12, and an effective working range may be 40 dB-120 dB. In other embodiments, the acquiring device40may also be a microphone.

As illustrated inFIG.3, the electronic device1runs a tool detecting system100. The tool detecting system100at least includes an acquiring module101, a dividing module102, an extracting module103, a forming module104, a generating module105, and a detecting module106. The modules101-106may be collections of software instructions stored in the storage device20of the electronic device1and executed by the processor10. The modules101-106may also include functionality represented by hardware or integrated circuits, or by software and hardware combinations, such as a special-purpose processor or a general-purpose processor with special-purpose firmware.

The acquiring module101is configured to control the acquiring device40to acquire a cutting sound of the tool201during the cutting process.

In one embodiment, the acquiring module101controls the acquiring device40to acquire and record the sounds generated by the tool201during the cutting process, the acquired sounds may include the cutting sound or the sound of other operation carried out by the tool201, the sound of other operation carried out by the tool201is taken as a non-cutting sound, and filters out the non-cutting sound in the acquired sounds to retain the cutting sound. That is, the non-cutting sound may be the sound acquired by the acquiring device40when the tool201is not performing its cutting process, the cutting sound may be the sound acquired by the acquiring device40when the tool201is performing the cutting process.

At this time, a state of the tool201is known, that is, the tool201is taken to have no defects, or have at least one defect, or have at least one defect with a known defect type, the known defect type can be chipping, wear, or the like.

The dividing module102is configured to divide the acquired cutting sound into a number of recordings of audio according to a preset time interval.

In one embodiment, the preset time interval may be 3 seconds, that is, the duration of each recording of audio is 3 seconds. In other embodiments, the preset time interval may also be other required value.

The extracting module103is configured to extract time-frequency features of the number of recordings of audio according to multiple feature transformation methods.

In one embodiment, the multiple feature transformation methods include, but are not limited to, a short-time Fourier transform, a wavelet transform, and a Gabor transform.

In one embodiment, the extracting module103calculates a frequency f corresponding to a maximum amplitude of the number of recordings of audio using a Fourier transform, and determines an x-fold frequency xf according to harmonics of the frequency f. Preferably, x may be 3, that is, the extracting module103determines a triple frequency 3f according to the harmonics of the frequency f. In other embodiments, x may also be 2.

Referring toFIG.4, a first feature transformation method may be the short-time Fourier transform. The extracting module103performs the short-time Fourier transform on the number of recordings of audio to extract the time-frequency features of the cutting sound. The extracting module103further filters out time-frequency features above the triple frequency 3f (i.e., greater than the triple frequency 3f) in the time-frequency features.

In detail, the extracting module103performs the short-time Fourier transform on the number of recordings of audio to generate a corresponding time-frequency image, determines a frequency range from 0 to 3f in a matrix of the time-frequency image, and searches for a minimum value in the frequency range of 0 to 3f on a vertical axis of the time-frequency image and a time range t to t+k on a horizontal axis of the time-frequency image.

In one embodiment, t is a current time and k is a size of each segment of audio frames in milliseconds. The extracting module103further replaces energy values corresponding to the frequency above 3f with −1 to filter out the time-frequency features above the triple frequency 3f. It should be noted that, the time-frequency image may be a two-dimensional image, and while the time-frequency image is generated, replacing the energy values above the triple frequency 3f with −1 may uniformly adjust a color of areas where above the triple frequency belongs to in the time-frequency image to be black, the benefit is equivalent to removing the effect of the audios in the triple or more frequency in image learning.

In one embodiment, the extracting module103further uses the wavelet transform (a second feature transform method inFIG.4) and the Gabor transform to extract the time-frequency features corresponding to the number of recordings of audio through the above process.

The forming module104is configured to form a fusion feature image of the cutting sound according to the extracted time-frequency features.

Referring toFIG.5, in one embodiment, the forming module104calculates a total number of pixels N according to the number of pixels of the time-frequency image generated by each feature transformation method, and determines a closest square root n of the total number of pixels N. In one embodiment, n represents the number of pixels in the horizontal and vertical directions of the fusion feature image. The forming module104sequentially arranges the pixels of the time-frequency image generated by each feature transformation method to form the fusion feature image with the number of pixels n*n.

In detail, the forming module104generates a square containing N pixels according to the square root n that is the closest to the total number of pixels N, and then performs a normalization process on pixel values of the pixels in the time-frequency image. The normalization process may be a normalization processing of 0-255, thereby avoiding the differences in different feature metrics. The calculation formula of the normalization process is x=255(x−min)/max−min. In this formula, min is the minimum value 0, max is the maximum value 255, and x is the pixel value after the normalization process. The forming module104further fills the first pixel value in the first pixel grid which is located at the upper left corner of the square, and then arranges other pixel values sequentially from top to bottom, so as to form the fusion feature image.

The forming module104forms the time-frequency image according to a sequence of feature transformation, and obtains the pixel values of the pixels in the time-frequency image according to a sequence 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 image. The first pixel value is the pixel value of the first pixel in the time-frequency image generated by the above-mentioned first feature transformation method (i.e. the short-time Fourier transform) processing the number of recordings of audio, and the pixel value filled in each pixel grid is the pixel value of each pixel of the time-frequency images generated by the various feature transformation methods.

The generating module105is configured to generate a tool detection model by training the fusion feature image.

In one embodiment, the generating module105performs a histogram equalization process on the fusion feature image, to enhance the contrast of the fusion feature image.

In one embodiment, the generating module105inputs the fusion feature images corresponding to the tools201in a number of known states as a training set into a convolutional neural network model for training, so as to generate the tool detection model. The known states indicates that the defect types of the tools201are known.

In detail, 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. The input layer is the fusion feature image. 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 input of the second convolutional layer after being sequentially connected to a first BN layer, a first activation layer, and a first pooling layer; the output of the second convolutional layer is sequentially connected to a second BN layer, a second activation layer, and a second pooling layer, and then connected to the input of the third convolutional layer; the output of the third convolutional layer is sequentially connected to the input of the fourth convolutional layer after being connected to a third BN layer and a third activation layer; the output of the fourth convolutional layer is connected to a fourth BN layer, a fourth activation layer, and a fourth pooling layer in sequence, after being connected to the input of the softmax layer through a three-layer fully connected layer. The activation function of the activation layer connected behind each convolutional layer can be a linear rectification function (Rectified Linear Unit (ReLU)), which turns 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 layers of the first convolutional layer, the second convolutional layer and the fourth convolutional layer is conducive to downsampling and reducing the amount of calculations, while improving the extraction of regional features by the convolutional neural network Effect. The output results of the convolutional neural network model are two types, and the result of detection is the one with the higher score.

The above-mentioned training process of convolutional neural network model is divided into two parts: forward propagation and back propagation. The fusion feature images in the training set are input into a convolutional neural network, the predicted value is obtained by the convolutional neural network model, and the weighting is updated through a method of supervised learning. The above-mentioned training process of the convolutional neural network model is repeated until an error between the predicted value and a target value meets an expected value, at this time, the tool detection model is generated.

The detecting module106is configured to detect a state of an operating tool201according to the tool detection model.

In one embodiment, the detection module106may extract the fusion feature image corresponding to the cutting sound of the operating tool201by the above method, and then input the fusion feature image into the tool detection model, and determine whether the operating tool201has any defects and if so the types of the defects the operating tool201has, by the tool detection model recognizing and classifying the fusion feature image.

In one embodiment, the tool detection model defines a relationship between the time-frequency features of the cutting sound of the tools201and the defect types of the tools201by the above-mentioned training process. Thus, if the time-frequency feature (i.e. the fusion feature image) of the operating tool is input into the tool detection model, the tool detection model may recognize and classify the time-frequency feature of the operating tool201, and output the defect type of the operating tool201or a result that the operating tool201does not have any defect, the state of the operating tool201is thus determined. For example, the defect type can be at least one of chipping, wear, and breaking.

FIG.6illustrates a flowchart of an embodiment of a tool detecting method. The method is provided by way of example, as there are a variety of ways to carry out the method. The method described below may be carried out using the configurations illustrated inFIGS.1-5, for example, and various elements of these figures are referenced in explaining the example method. Each block shown inFIG.6represents one or more processes, methods, or subroutines carried out in the example method. Furthermore, the illustrated order of blocks is by example only and the order of the blocks can be changed. Additional blocks may be added or fewer blocks may be utilized, without departing from this disclosure. The example method may begin at block601.

At block601, the acquiring module101controls the acquiring device40to acquire a cutting sound of the tool201during the cutting process.

At block602, the dividing module102divides the acquired cutting sound into a number of recordings of audio according to a preset time interval.

At block603, the extracting module103extracts time-frequency features of the number of recordings of audio according to multiple feature transformation methods.

At block604, the forming module104forms a fusion feature image of the cutting sound according to the extracted time-frequency features.

At block605, the generating module105generates a tool detection model by training the fusion feature image.

At block606, the detecting module106detects a state of an operating tool201according to the tool detection model.

It is believed that the present embodiments and their advantages will be understood from the foregoing description, and it will be apparent that various changes may be made thereto without departing from the spirit and scope of the disclosure or sacrificing all of its material advantages, the examples hereinbefore described merely being embodiments of the present disclosure.