Numerical control machine tool cutter defect diagnosis method and system based on large language model
Through a method based on a large language model, combining tool images and vibration sound data, and using pre-trained language models for diagnosis, the problems of low efficiency, poor accuracy and high cost in traditional methods are solved, and efficient and accurate tool defect identification is achieved. and diagnosis, improving production efficiency and safety performance.
Patent Information
- Application Number
- CN202410862734.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-10-01
AI Technical Summary
Traditional machine tool tool defect diagnosis methods are inefficient and difficult to guarantee accuracy. They rely on manual inspection and are costly. They are difficult to provide quantitative assessment and affect production efficiency and safety performance.
Using a method based on a large language model, a multi-modal data set is constructed by collecting tool images and vibration sound data, extracting Mel spectrograms and image features, and using pre-trained language models for diagnosis to achieve non-invasive, multi-modal information Fusion and real-time analysis.
It improves the accuracy and reliability of tool defect diagnosis, shortens diagnosis time, reduces costs, realizes an automated and intelligent diagnosis process, and improves production efficiency and safety performance.
Smart Images

Figure CN118734133A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of CNC machine tool tool defect diagnosis, and in particular relates to a CNC machine tool tool defect diagnosis method and system based on a large language model. Background Art
[0002] Traditional machine tool tool defect diagnosis methods have some limitations, such as invasiveness, single data source, and manual subjective judgment. Traditional tool defect diagnosis methods mainly rely on manual inspection, which is not only inefficient but also difficult to guarantee accuracy. During manual inspection, due to human subjectivity and fatigue, it is easy to make false detections and missed detections; and it is highly dependent on the experience and skills of the operator, and has high professional requirements for the operator. However, even experienced operators can hardly guarantee that each inspection will be accurate; manual inspection is also easily affected by factors such as the operator's emotions and fatigue, resulting in unstable test results;
[0003] Secondly, traditional inspection methods usually take a long time to complete a comprehensive inspection of the tool. This not only affects production efficiency, but may also cause tool failure during processing due to untimely inspection; it may require the use of professional inspection equipment and tools, which are often expensive. For small and medium-sized enterprises, this may be a considerable expense. In addition, manual inspection also requires the payment of wages and benefits for operators, further increasing the inspection cost.
[0004] Furthermore, traditional detection methods can only provide a qualitative description of tool defects and are difficult to provide specific quantitative indicators, which makes it difficult to accurately evaluate and predict the status of the tool.
[0005] In summary, the problems of traditional machine tool tool defect diagnosis methods are mainly reflected in efficiency, accuracy, labor cost, detection speed and quantitative evaluation. In order to improve the efficiency and accuracy of tool defect diagnosis and reduce detection costs, it is necessary to explore new detection methods and technologies.
[0006] CNC machine tool tool defect diagnosis based on large language models is a field with potential and challenges. Through continuous research and practice, the accuracy and efficiency of diagnosis can be further improved, providing more reliable technical support for the maintenance and management of CNC machine tools. Summary of the invention
[0007] The technical problem to be solved by the present invention is to provide a CNC machine tool tool defect diagnosis method and system based on a large language model to address the deficiencies in the above-mentioned prior art, which is used to solve the technical problems that traditional methods are difficult to capture subtle signals, rely on manual intervention and subjective judgment, and are limited to specific tool defect diagnosis tasks. The method has the advantages of non-intrusiveness, multimodal information fusion, learning ability and real-time performance, and provides more comprehensive and accurate tool defect analysis.
[0008] The present invention adopts the following technical solutions:
[0009] A method for diagnosing tool defects of CNC machine tools based on a large language model comprises the following steps:
[0010] A CNC machine tool tool defect dataset is constructed based on tool images and vibration sounds in different states, and the Mel-spectrogram of vibration sound is extracted from the CNC machine tool tool defect dataset;
[0011] Sound and image features are extracted from the Mel-spectrogram and tool image respectively, and then input into a pre-trained language model based on a large language model to output tool defect diagnosis results including the degree of tool wear.
[0012] Preferably, constructing a CNC machine tool tool defect dataset based on tool images and vibration sounds in different states is specifically as follows:
[0013] Identify the different tool states that need to be collected;
[0014] In each tool state, an image acquisition device is used to acquire an image of the tool surface;
[0015] In each tool state, the corresponding machining task is run, and the vibration and sound data of the tool are recorded using sensors;
[0016] The collected vibration sound data are preprocessed, and the collected data are marked and classified according to the experimental conditions and tool status.
[0017] Preferably, the tool status includes a normal tool, a slightly worn tool, and a heavily worn tool.
[0018] Preferably, the preprocessing method is filtering and denoising.
[0019] Preferably, the marking and classification are specifically:
[0020] The images and corresponding vibration sounds in different states are marked as follows: whether there is wear and the severity of the wear.
[0021] Preferably, the mel-spectrogram of the vibration sound is extracted as follows:
[0022] Divide the preprocessed audio signal into short time frames, select a window length of 20 to 40 milliseconds, and overlap between adjacent frames;
[0023] Apply fast Fourier transform to each frame to convert the time domain signal into frequency domain signal and calculate the amplitude spectrum or power spectrum of each frame;
[0024] Design a Mel filter bank, convolve the frequency domain signal with the Mel filter bank, and calculate the energy of each filter;
[0025] The energy of each filter is logarithmically compressed using the natural logarithm method, and the logarithmic energy value is plotted as a Mel spectrum with the horizontal axis representing time and the vertical axis representing the Mel frequency.
[0026] Preferably, when calculating the energy of each filter, for each frame, a group of energy values equal to the number of filters is obtained.
[0027] Preferably, in the Mel spectrum graph, the energy value in each time frame corresponds to the time point on the horizontal axis and the Mel frequency on the vertical axis.
[0028] Preferably, the pre-trained language model based on the large language model adopts the Vicuna-13B model, and the training process of the Vicuna-13B model is as follows:
[0029] The sound and image features are respectively passed through the two projection layers of the multi-layer perceptron and provided to the large language model as input. The corresponding tool defect conditions are used as target labels. The model is trained using the loss function, and the model parameters are iteratively updated using the stochastic gradient descent algorithm. The parameters of the Vicuna-13B model are frozen, and only the parameters of the image encoder and projection layer are trained.
[0030] In a second aspect, an embodiment of the present invention provides a CNC machine tool tool defect diagnosis system based on a large language model, comprising:
[0031] The data module builds a CNC machine tool tool defect dataset based on tool images and vibration sounds in different states, and extracts the Mel-spectrogram of vibration sounds from the CNC machine tool tool defect dataset;
[0032] The diagnosis module extracts sound and image features from the Mel-spectrogram and tool image respectively, and then inputs them into a pre-trained language model based on a large language model to output tool defect diagnosis results including the degree of tool wear.
[0033] Preferably, constructing a CNC machine tool tool defect dataset is specifically as follows:
[0034] Identify the different tool states that need to be collected;
[0035] In each tool state, an image acquisition device is used to acquire an image of the tool surface;
[0036] In each tool state, the corresponding machining task is run, and the vibration and sound data of the tool are recorded using sensors;
[0037] The collected vibration sound data are preprocessed, and the collected data are marked and classified according to the experimental conditions and tool status.
[0038] Preferably, the mel-spectrogram of the vibration sound is extracted as follows:
[0039] Divide the preprocessed audio signal into short time frames, select a window length of 20 to 40 milliseconds, and overlap between adjacent frames;
[0040] Apply fast Fourier transform to each frame to convert the time domain signal into frequency domain signal and calculate the amplitude spectrum or power spectrum of each frame;
[0041] Design a Mel filter bank, convolve the frequency domain signal with the Mel filter bank, and calculate the energy of each filter;
[0042] The energy of each filter is logarithmically compressed using the natural logarithm method, and the logarithmic energy value is plotted as a Mel spectrum with the horizontal axis representing time and the vertical axis representing the Mel frequency.
[0043] In a third aspect, a computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned CNC machine tool tool defect diagnosis method based on a large language model when executing the computer program.
[0044] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, comprising a computer program, which, when executed by a processor, implements the steps of the above-mentioned CNC machine tool tool defect diagnosis method based on a large language model.
[0045] Compared with the prior art, the present invention has at least the following beneficial effects:
[0046] A CNC machine tool tool defect diagnosis method based on a large language model is proposed. By collecting tool images and vibration sound data in different states, a comprehensive and diverse data set is constructed. The purpose of this is to consider various tool defect conditions when training the model and improve the generalization ability and accuracy of the diagnosis. Mel spectrograms are extracted from the vibration sound data, and the sound data is converted into an image form for subsequent image processing and feature extraction. Mel spectrograms can capture the spectral information of sound and provide more features about sound. The purpose of extracting sound and image features from Mel spectrograms and tool images is to convert the original data into a feature representation with more representational capabilities. By extracting the features of sound and image, the data dimension can be reduced and key information can be retained for the input and processing of subsequent models. The extracted sound and image features are input into a pre-trained language model based on a large language model, and the semantic understanding and generation capabilities of the large language model are used to perform tool defect diagnosis. The large language model can learn complex semantic relationships and contextual information, and perform model reasoning and prediction through input features. According to the training objectives and design of the model, the tool defect diagnosis results are output, including the degree of tool wear. According to the input sound and image features, the defect of the tool is obtained through model prediction and reasoning, and the diagnosis result of the degree of tool wear is provided; the principle of the method of the present invention is based on the following assumptions and mechanisms:
[0047] Hypothesis 1: The defect state of the tool will produce identifiable changes in the vibration sound and image features. By collecting tool data sets in different states, the association between tool defects and vibration sound and image features can be learned.
[0048] Assumption 2: Sound and image features can provide important information about tool defects. Sound features can reflect the vibration characteristics and acoustic characteristics of the tool, and image features can reflect the visual characteristics of the tool, such as wear and cracks. By extracting these features, the signal of tool defects can be captured from different angles.
[0049] As a pre-trained semantic understanding model, the large language model can learn complex semantic relationships and contextual information from the input sound and image features; by inputting features into the large language model, the model can understand and analyze the relationship between sound and image, so as to diagnose tool defects; the design idea of the whole method is to integrate the information of sound and image, and realize accurate diagnosis of tool defects through the combination of feature extraction and large language model. By using the large language model, its powerful semantic understanding and generation capabilities can be fully utilized to improve the accuracy and reliability of tool defect diagnosis. The step setting of the whole method enables the features of sound and image to be fully utilized, thereby improving the effect of tool defect diagnosis.
[0050] Furthermore, by collecting images and vibration sound data under different tool states, the data set is diversified, and the model can be trained to deal with various tool defect situations and improve the generalization ability of the model; by collecting tool surface images and vibration sound data, the model can learn and extract features related to tool defects, which can help the model diagnose and classify tool defects; by labeling and classifying the collected vibration sound data, a labeled data set can be created. This can provide supervised learning samples for model training, so that the model can learn the features and patterns under different tool states; constructing a data set containing different tool states can enable the model to more accurately identify and classify different defect types when diagnosing tool defects, and improve the accuracy and reliability of the diagnosis results; by constructing a CNC machine tool tool defect data set, training data can be provided for the tool defect diagnosis method based on the large language model, so that the model can learn and understand the features and patterns under different tool states, thereby achieving accurate tool defect diagnosis.
[0051] Furthermore, the extraction of Mel spectrogram aims to convert the vibration sound signal in the time domain into a feature representation in the frequency domain, so as to better analyze and understand the spectral characteristics of the vibration signal; Mel spectrogram provides the energy distribution of the vibration sound signal on different frequency components, which can capture the spectral changes caused by tool defects. In this way, the unique characteristics of the vibration signal with tool defects can be extracted, which is helpful for the subsequent diagnosis and classification of tool defects; the traditional spectrum analysis method will generate a high-dimensional spectrum feature vector, while the Mel spectrogram can reduce the dimension of the feature while retaining key information by converting the frequency axis to the Mel frequency scale. This helps to reduce the computational complexity and storage space, and improve the efficiency of subsequent algorithms; the design of Mel spectrogram is based on the perception characteristics of the human ear to sound, which is more in line with the perception of the human auditory system to sound frequency. Therefore, Mel spectrogram can better capture the difference in the perception of the human auditory system to sound, making the subsequent signal processing and model training more in line with the characteristics of human perception; the extraction of Mel spectrogram is based on the characteristics of the human auditory system and the difference in the perception of sound frequency. The perception of the human auditory system to sound frequency is not linear, but is more sensitive in the lower frequency range and less sensitive in the higher frequency range. Mel frequency is a scale that converts linear frequency into one that is more consistent with human hearing characteristics; by extracting the Mel spectrum of vibration sound, the spectral characteristics of the vibration signal can be used as input for subsequent model training, tool defect diagnosis and classification, and other applications. The Mel spectrum can better capture the frequency information of the vibration signal and correspond to the perceptual characteristics of the human auditory system, thereby improving the detection and diagnosis capabilities of tool defects.
[0052] Furthermore, the pre-trained language model has learned extensive language knowledge and semantic relations by training on large-scale text data. This enables the model to better understand the contextual information of the input text, infer semantic relations, and capture implicit language patterns. In tool defect diagnosis, this contextual understanding and semantic relationship modeling can help the system understand tool defect descriptions or related texts more accurately, thereby improving diagnostic accuracy and reliability; the pre-trained language model has strong knowledge transfer and generalization capabilities by learning language structures and knowledge from large-scale text data. This means that the model can apply the knowledge learned in the pre-training stage to new tasks and fields. In tool defect diagnosis, the pre-trained language model can use its learned general knowledge for reasoning and diagnosis, and can adapt and provide accurate diagnostic results even when faced with new tool defect samples or texts in specific fields; the pre-trained language model can be quickly deployed through fine-tuning or transfer learning. By fine-tuning on data in specific fields, the model can better adapt to the specific needs of tool defect diagnosis tasks. This flexibility makes the pre-trained language model based on the large language model a scalable and easy-to-apply solution; Vicuna-13B is trained by fine-tuning LLaMA-13B on user sharing conversations collected by ShareGPT, with a training cost of nearly $300, which is low-cost. With only 13 billion parameters, it can match 90% of the performance of ChatGPT and performs well in tasks such as text classification. By applying the Vicuna-13B model as a pre-trained large language model, the knowledge learned in the pre-training stage can be applied to the tool defect diagnosis task to achieve comprehensive and accurate tool defect diagnosis; overall, the application of pre-trained language models based on large language models in tool defect diagnosis has the benefits of context understanding, semantic relationship modeling, knowledge transfer and generalization capabilities, rapid deployment and flexibility. The use of the Vicuna-13B pre-trained language model helps to improve diagnostic accuracy, expand diagnostic capabilities, and provide support for the performance and efficiency of the tool defect diagnosis system.
[0053] It can be understood that the beneficial effects of the second aspect mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0054] In summary, the present invention can make full use of multimodal information to achieve fast and accurate tool defect identification. It improves the accuracy and reliability of diagnosis, speeds up the diagnosis, and realizes an automated and intelligent diagnosis process. These benefits help to improve production efficiency, reduce costs, and improve production quality and safety performance related to tool defects.
[0055] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 This is the tool wear classification diagram;
[0057] Figure 2 This is an overview of the Vicuna-13B workflow;
[0058] Figure 3 This is a schematic diagram of the overall network architecture;
[0059] Figure 4 A schematic diagram of a computer device provided by an embodiment of the present invention;
[0060] Figure 5 The block diagram of a chip provided according to an embodiment of the present invention. DETAILED DESCRIPTION
[0061] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0062] In the description of the present invention, it should be understood that the terms “include” and “comprises” indicate the presence of described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.
[0063] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0064] It should be further understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present invention generally indicates that the associated objects are in an "or" relationship.
[0065] It should be understood that, although the terms first, second, third, etc. may be used to describe preset ranges, etc. in the embodiments of the present invention, these preset ranges should not be limited to these terms. These terms are only used to distinguish preset ranges from each other. For example, without departing from the scope of the embodiments of the present invention, the first preset range may also be referred to as the second preset range, and similarly, the second preset range may also be referred to as the first preset range.
[0066] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0067] Various structural schematic diagrams of the embodiments disclosed in the present invention are shown in the accompanying drawings. These figures are not drawn to scale, and some details are magnified and some details may be omitted for the purpose of clear expression. The shapes of various regions and layers shown in the figures and the relative sizes and positional relationships therebetween are only exemplary, and may deviate in practice due to manufacturing tolerances or technical limitations, and those skilled in the art may additionally design regions / layers with different shapes, sizes, and relative positions according to actual needs.
[0068] The present invention provides a method for diagnosing tool defects of CNC machine tools based on a large language model. By collecting the vibration sound and image data of the machine tool milling cutter, diagnosis is performed using a large language model, and full use is made of information in both sound and image modes, thereby enabling fast and accurate tool defect identification. In addition, the method based on the large language model also has the characteristics of adaptability and potential automation and intelligence, which can bring higher efficiency and intelligence to industrial production lines.
[0069] The present invention provides a method for diagnosing defects of CNC machine tools based on a large language model, comprising the following steps:
[0070] S1. Collection of CNC machine tool tool defect dataset
[0071] See also Figure 1 , focusing on the defect diagnosis of titanium alloy milling cutters, including diagnosing whether wear exists and evaluating the severity of wear. Wear is divided into two types: light wear and heavy wear. It should be noted that the wear mentioned here refers to a macroscopic concept, including various forms of damage.
[0072] Although the tool wear method based solely on images has higher detection accuracy, it is greatly affected by factors such as lighting, environmental interference, and grayscale of the tool surface. Although the tool wear method based solely on vibration and sound is flexible, it is greatly affected by noise interference and has low accuracy. Based on this, by combining tool images and vibration and sound, the advantages of both methods are fully utilized to improve the accuracy and robustness of tool wear detection. Therefore, the present invention first needs to collect tool images and vibration and sound in different states as data sets.
[0073] Collect tool images and vibration sounds in different states according to the following steps:
[0074] S101. Setting experimental conditions
[0075] Determine the different tool conditions that need to be collected: normal tools, slightly worn tools, and heavily worn tools.
[0076] S102, prepare image acquisition equipment
[0077] Choose the appropriate image acquisition device: a high-resolution camera with a light source to get a clear image of the tool surface. Make sure the device is set up and calibrated correctly and has adequate lighting conditions.
[0078] S103: Capturing images
[0079] In each tool state, use an image acquisition device to photograph the tool surface, ensuring that all angles and areas of the tool surface are captured.
[0080] S104, prepare the sound collection sensor
[0081] Select an appropriate vibration sensor to install on the tool to measure the tool vibration sound. Ensure that the experimental conditions are consistent: use the same workpiece material, cutting parameters and machining process.
[0082] S105, Sound Collection
[0083] In each tool state, run the corresponding machining task and use the sensor to record the vibration sound of the tool. Make sure to record long enough to capture vibration information of different frequencies and repeat it multiple times to obtain reliable data.
[0084] S106, sound preprocessing
[0085] The collected vibration sound data is preprocessed to remove environmental noise as much as possible through filtering and denoising.
[0086] S107, Labeling and Classification
[0087] The collected data are labeled and classified according to the experimental conditions and tool status. The images and corresponding vibration sounds in different states are labeled as follows: whether there is wear and the severity of wear (mild, severe).
[0088] S2. Tool defect diagnosis system based on large language model
[0089] Pre-trained language model Vicuna-13B
[0090] LLaMA (Large Language Model Meta AI) is an open and efficient large-scale basic language model released by Meta AI. It includes four versions, namely 7B, 13B, 33B and 65B (65 billion) parameter models. The training datasets of these models are derived from public datasets, and no custom datasets are used, which ensures their compatibility and reproducibility with open source. After tokenization, the entire training dataset contains 1.4T tokens. The LLaMA model has 13 billion parameters, surpassing GPT-3 (with 175 billion parameters) in most benchmarks, and runs on a single V100 GPU. The largest 65 billion parameter version of the LLaMA model is comparable to Google's Chinchilla-70B and PaLM-540B.
[0091] As an open source model, Vicuna-13B can be used directly without any additional restrictions.
[0092] See also Figure 2 Vicuna-13B is a model fine-tuned using supervised data based on LLaMa-13B. Its dataset comes from user conversation data generated by ShareGPT.com, with a total of 70,000 conversations. ShareGPT is a ChatGPT data sharing website where users can upload ChatGPT answers they think are interesting; preliminary evaluation using GPT-4 shows that Vicuna-13B has reached more than 90% of the quality of OpenAI's ChatGPT and Google's Bard, and outperforms other models such as LLaMA and Stanford's Alpaca in more than 90% of the cases.
[0093] The present invention uses Vicuna-13B as a pre-trained language model (PLM), processes the tool vibration sound and tool image, extracts their features, and provides these features to the PLM, and expects the PLM to output the diagnosis results of the tool defects. This method can apply large language models to tool defect diagnosis tasks in an economical and efficient manner. During the training process, the CNC machine tool tool defect data set is used to enable the pre-trained language model to better understand and learn the characteristics and laws of defect diagnosis; by making full use of the capabilities of the pre-trained language model and migrating it to the specific tool defect diagnosis task, the efficiency and accuracy of defect diagnosis are improved.
[0094] Overall network architecture
[0095] For the tool vibration sound preprocessed in step S1, it is first necessary to extract the Mel spectrum as its feature representation. The process is as follows:
[0096] S201, dividing the audio signal into frames
[0097] Divide the preprocessed audio signal into short time frames, usually with a window length of 20-40 milliseconds, with overlap between adjacent frames. Common window functions include Hanning window, Hamming window, etc.
[0098] S202, Apply Fast Fourier Transform (FFT)
[0099] Apply FFT to each frame to convert the time domain signal into the frequency domain signal and calculate the amplitude spectrum or power spectrum of each frame.
[0100] S203. Design Mel filter bank
[0101] Design a set of Mel filters that are evenly distributed on the Mel frequency scale to simulate the human auditory system's perception of audio frequencies.
[0102] S204, apply Mel filter bank
[0103] The frequency domain signal is convolved with the Mel filter bank and the energy of each filter is calculated. For each frame, a set of energy values equal to the number of filters is obtained.
[0104] S205, Logarithmic Compression
[0105] The energy of each filter is logarithmically compressed using the natural logarithm method to simulate the nonlinear perception of audio intensity by the human auditory system.
[0106] S206, obtain Mel spectrum
[0107] The logarithmic energy values are plotted as a graph, with the horizontal axis representing time and the vertical axis representing the Mel frequency. The energy value on each time frame corresponds to the time point on the horizontal axis and the Mel frequency on the vertical axis.
[0108] The Mel spectrogram of the audio signal is calculated through the above steps. The Mel spectrogram can show the energy distribution information of the audio signal on the Mel frequency scale. The Mel spectrogram has 1 channel and is regarded as a grayscale image. For further processing, its channel is expanded to 3, converted into a "regular RGB image", and processed using a common image encoder to extract more features.
[0109] The present invention selects the pre-trained CLIP Resnet50 image encoder to process the mel-spectrogram and the tool image respectively, and extracts the sound and image features from them. Subsequently, these features will pass through two projection layers to map them to the language space and provide them as input to the large language model. These projection layers are implemented by multi-layer perceptron (MLP).
[0110] In addition, the text instruction input provided to the large language model can be: "Can you evaluate the toolwear condition? For the given titanium alloy milling tool, assess its degree of wear and indicate whether there is mild wear or severe wear." In this way, the system comprehensively considers the sound, image and text information to evaluate the tool wear condition.
[0111] See also Figure 3 During the training process, the parameters of the pre-trained large language model (Vicuna-13B) are frozen, and the parameters of other network modules are adjusted according to the tool defect dataset. The two image encoders that process the tool image and Mel spectrum map and the subsequent two VL projection layers. It should be noted that during the training process, the two image encoders that process the tool image and Mel spectrum map and the subsequent two projection layers are independent of each other, and the weights are not shared. After the training is completed, the system can receive inputs including tool images, tool vibration sounds, and text instructions. The large language model will perform inference and output diagnostic results about the tool wear, including the classification of the degree of wear. The specific training process is as follows:
[0112] Extract the Mel-spectrogram of the tool vibration sound, use the pre-trained CLIP Resnet50 image encoder to process the Mel-spectrogram and tool image respectively, and extract the sound and image features from them;
[0113] Subsequently, these features are passed through two projection layers (implemented by a multi-layer perceptron (MLP)) and provided as input to the large language model. The corresponding tool defect is used as the target label, and the model is trained using an appropriate loss function (such as the cross entropy loss function). The model parameters are iteratively updated using the stochastic gradient descent algorithm, in which the parameters of Vicuna-13B are frozen and only the parameters of the image encoder and projection layer are trained.
[0114] The two image encoders that process the tool image and the Mel-spectrogram and the two subsequent projection layers are independent of each other and their weights are not shared.
[0115] In another embodiment of the present invention, a CNC machine tool tool defect diagnosis system based on a large language model is provided. The system can be used to implement the above-mentioned CNC machine tool tool defect diagnosis method based on a large language model. Specifically, the CNC machine tool tool defect diagnosis system based on a large language model includes a data module and a diagnosis module.
[0116] Among them, the data module builds a CNC machine tool tool defect data set based on tool images and vibration sounds in different states, and extracts the Mel spectrum of vibration sound from the CNC machine tool tool defect data set;
[0117] The diagnosis module extracts sound and image features from the Mel-spectrogram and tool image respectively, and then inputs them into a pre-trained language model based on a large language model to output tool defect diagnosis results including the degree of tool wear.
[0118] In another embodiment of the present invention, a terminal device is provided, which includes a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor 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 gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding function; the processor described in the embodiment of the present invention can be used for the operation of the CNC machine tool tool defect diagnosis method based on a large language model, including:
[0119] A CNC machine tool tool defect dataset is constructed based on tool images and vibration sounds in different states, and the Mel-spectrogram of vibration sound is extracted from the CNC machine tool tool defect dataset. Sound and image features are extracted from the Mel-spectrogram and tool image respectively, and then input into a pre-trained language model based on a large language model to output tool defect diagnosis results including the degree of tool wear.
[0120] In another embodiment of the present invention, the present invention further provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a terminal device for storing programs and data. It can be understood that the computer-readable storage medium here can include both the built-in storage medium in the terminal device and the extended storage medium supported by the terminal device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory, or a non-volatile memory (Non-Volatile Memory), such as at least one disk memory.
[0121] The processor may load and execute one or more instructions stored in a computer-readable storage medium to implement the corresponding steps of the CNC machine tool tool defect diagnosis method based on a large language model in the above embodiment; the processor may load and execute the following steps of one or more instructions in the computer-readable storage medium:
[0122] A CNC machine tool tool defect dataset is constructed based on tool images and vibration sounds in different states, and the Mel-spectrogram of vibration sound is extracted from the CNC machine tool tool defect dataset. Sound and image features are extracted from the Mel-spectrogram and tool image respectively, and then input into a pre-trained language model based on a large language model to output tool defect diagnosis results including the degree of tool wear.
[0123] See also Figure 4 , the terminal device is a computer device, and the computer device 60 of this embodiment includes: a processor 61, a memory 62, and a computer program 63 stored in the memory 62 and executable on the processor 61. When the computer program 63 is executed by the processor 61, the method for calculating the composition of fluid in the reservoir transformation wellbore in the embodiment is realized. To avoid repetition, it is not described one by one here. Alternatively, when the computer program 63 is executed by the processor 61, the functions of each model / unit in the calculation system for the composition of fluid in the reservoir transformation wellbore in the embodiment are realized. To avoid repetition, it is not described one by one here.
[0124] The computer device 60 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The computer device 60 may include, but is not limited to, a processor 61 and a memory 62. Those skilled in the art will appreciate that Figure 4 This is only an example of the computer device 60 and does not constitute a limitation of the computer device 60. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the computer device may also include input and output devices, network access devices, buses, etc.
[0125] The processor 61 may be a central processing unit (CPU), or other general-purpose processors, central processing units, graphics 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, data processing logic based on quantum computing, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0126] The memory 62 may be an internal storage unit of the computer device 60, such as a hard disk or memory of the computer device 60. The memory 62 may also be an external storage device of the computer device 60, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the computer device 60.
[0127] Furthermore, the memory 62 may include both an internal storage unit of the computer device 60 and an external storage device. The memory 62 is used to store computer programs and other programs and data required by the computer device. The memory 62 may also be used to temporarily store data that has been output or is to be output.
[0128] Any reference to memory, database or other media used in the embodiments provided in the present application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0129] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.
[0130] See also Figure 5 , the terminal device is a chip, and the chip 600 of this embodiment includes a processor 622, which may be one or more, and a memory 632 for storing a computer program executable by the processor 622. The computer program stored in the memory 632 may include one or more modules, each corresponding to a set of instructions. In addition, the processor 622 may be configured to execute the computer program to execute the above-mentioned generalizable monocular absolute depth map estimation method.
[0131] In addition, the chip 600 may further include a power supply component 626 and a communication component 650, wherein the power supply component 626 may be configured to perform power management of the chip 600, and the communication component 650 may be configured to implement communication, for example, wired or wireless communication, of the chip 600. In addition, the chip 600 may further include an input / output interface 658. The chip 600 may operate based on an operating system stored in the memory 632.
[0132] In summary, the present invention provides a method and system for diagnosing tool defects of CNC machine tools based on a large language model, which has the following characteristics:
[0133] 1. Comprehensive utilization of multi-modal information: This method combines the vibration sound of the machine tool milling cutter and the milling cutter image data, making full use of the information of the two modes. The vibration sound can provide information such as the working status and vibration frequency of the tool, while the milling cutter image can provide visual features such as the morphology and defects of the tool surface. By comprehensively analyzing the information of these two modes, tool defect identification and diagnosis can be performed more comprehensively and accurately.
[0134] 2. Efficient and fast diagnostic capabilities: The method based on the large language model can use the semantics and language patterns learned by the pre-trained model on large-scale text data, and has strong semantic understanding and context analysis capabilities. This means that this method can quickly and accurately understand and analyze the vibration sound and milling cutter image data characteristics of machine tool milling cutters, and achieve efficient tool defect diagnosis. Compared with traditional methods, it can greatly shorten the diagnosis time and improve production efficiency.
[0135] 3. Improve diagnostic accuracy and reliability: Combined analysis of vibration sound and milling cutter image data can more accurately determine and identify the type and degree of tool defects. This can reduce misjudgments and missed judgments, improve diagnostic accuracy and reliability, and effectively reduce the adverse effects of tool defects on the production process.
[0136] 4. Automated and intelligent diagnosis process: The method based on the large language model can automatically analyze the key features in the tool vibration sound and milling cutter image data, and make comprehensive judgments and diagnoses. This automated and intelligent diagnosis process reduces the need for manual intervention, reduces the burden on operators, and improves the consistency and repeatability of diagnosis.
[0137] Therefore, the present invention can make full use of multimodal information to achieve fast and accurate tool defect identification. It improves the accuracy and reliability of diagnosis, speeds up the diagnosis, and realizes an automated and intelligent diagnosis process; these benefits help to improve production efficiency, reduce costs, and improve production quality and safety performance related to tool defects.
[0138] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0139] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0140] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0141] In the embodiments provided by the present invention, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0142] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0143] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0144] If the integrated module / unit 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), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. 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.
[0145] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0146] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0147] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0148] The above contents are only for explaining the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the claims of the present invention.
Claims
1. A method for diagnosing tool defects of CNC machine tools based on a large language model, characterized in that: The following steps are involved: A CNC machine tool tool defect dataset is constructed based on tool images and vibration sounds in different states, and the Mel-spectrogram of vibration sound is extracted from the CNC machine tool tool defect dataset; Sound and image features are extracted from the Mel-spectrogram and tool image respectively, and then input into a pre-trained language model based on a large language model to output tool defect diagnosis results including the degree of tool wear.
2. The method for diagnosing defects in CNC machine tools based on a large language model according to claim 1, characterized in that: The specific data set of CNC machine tool tool defects is constructed based on tool images and vibration sounds in different states: Identify the different tool states that need to be collected; In each tool state, an image acquisition device is used to acquire an image of the tool surface; In each tool state, the corresponding machining task is run, and the vibration and sound data of the tool are recorded using sensors; The collected vibration sound data are preprocessed, and the collected data are marked and classified according to the experimental conditions and tool status.
3. The CNC machine tool tool defect diagnosis method based on a large language model according to claim 2 is characterized in that: Tool status includes normal tool, slightly worn tool, and heavily worn tool.
4. The method for diagnosing defects in CNC machine tools based on a large language model according to claim 2, characterized in that: The preprocessing method is filtering and denoising.
5. The method for diagnosing defects in CNC machine tools based on a large language model according to claim 2, characterized in that: The specific labels and classifications are: The images and corresponding vibration sounds in different states are marked as follows: whether there is wear and the severity of the wear.
6. The method for diagnosing defects in CNC machine tools based on a large language model according to claim 1, characterized in that: The specific Mel spectrum of the vibration sound is: Divide the preprocessed audio signal into short time frames, select a window length of 20 to 40 milliseconds, and overlap between adjacent frames; Apply fast Fourier transform to each frame to convert the time domain signal into frequency domain signal and calculate the amplitude spectrum or power spectrum of each frame; Design a Mel filter bank, convolve the frequency domain signal with the Mel filter bank, and calculate the energy of each filter; The energy of each filter is logarithmically compressed using the natural logarithm method, and the logarithmic energy value is plotted as a Mel spectrum with the horizontal axis representing time and the vertical axis representing the Mel frequency.
7. The method for diagnosing defects in CNC machine tools based on a large language model according to claim 6, characterized in that: When calculating the energy of each filter, for each frame, a set of energy values equal to the number of filters is obtained.
8. The method for diagnosing defects in CNC machine tools based on a large language model according to claim 6, characterized in that: In the Mel spectrum graph, the energy value at each time frame corresponds to the time point on the horizontal axis and the Mel frequency on the vertical axis.
9. The method for diagnosing defects in CNC machine tools based on a large language model according to claim 1, characterized in that: The pre-trained language model based on the large language model uses the Vicuna-13B model. The training process of the Vicuna-13B model is as follows: The sound and image features are respectively passed through the two projection layers of the multi-layer perceptron and provided to the large language model as input. The corresponding tool defect conditions are used as target labels. The model is trained using the loss function, and the model parameters are iteratively updated using the stochastic gradient descent algorithm. The parameters of the Vicuna-13B model are frozen, and only the parameters of the image encoder and projection layer are trained.
10. A CNC machine tool tool defect diagnosis system based on a large language model, characterized in that: include: The data module builds a CNC machine tool tool defect dataset based on tool images and vibration sounds in different states, and extracts the Mel-spectrogram of vibration sounds from the CNC machine tool tool defect dataset; The diagnosis module extracts sound and image features from the Mel-spectrogram and tool image respectively, and then inputs them into a pre-trained language model based on a large language model to output tool defect diagnosis results including the degree of tool wear.
11. The CNC machine tool tool defect diagnosis system based on large language model according to claim 10, characterized in that: The specific steps for constructing a CNC machine tool defect dataset are as follows: Identify the different tool states that need to be collected; In each tool state, an image acquisition device is used to acquire an image of the tool surface; In each tool state, the corresponding machining task is run, and the vibration and sound data of the tool are recorded using sensors; The collected vibration sound data are preprocessed, and the collected data are marked and classified according to the experimental conditions and tool status.
12. The CNC machine tool tool defect diagnosis system based on large language model according to claim 10, characterized in that: The specific Mel spectrum of the vibration sound is: Divide the preprocessed audio signal into short time frames, select a window length of 20 to 40 milliseconds, and overlap between adjacent frames; Apply fast Fourier transform to each frame to convert the time domain signal into frequency domain signal and calculate the amplitude spectrum or power spectrum of each frame; Design a Mel filter bank, convolve the frequency domain signal with the Mel filter bank, and calculate the energy of each filter; The energy of each filter is logarithmically compressed using the natural logarithm method, and the logarithmic energy value is plotted as a Mel spectrum with the horizontal axis representing time and the vertical axis representing the Mel frequency.
13. A computer-readable storage medium storing one or more programs, characterized in that: The one or more programs include instructions, which, when executed by a computing device, cause the computing device to perform the method of any one of claims 1 to 9.
14. A computing device, characterized in that include: One or more processors, a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include steps for executing the method according to any one of claims 1 to 9.
Citation Information
Cited By
Ship power system abnormity monitoring method based on multi-modal pre-training large model
CN120597152A
Acoustic diagnosis method and device of mechanical unit, program product and electronic equipment
CN121558325A
