Crane small sample damage diagnosis method and system based on contrast learning
By combining comparative learning with Gaussian radial basis function kernels, a damage diagnosis model was developed to solve the problem of small-sample damage diagnosis for tower cranes, achieving efficient and accurate damage detection and improving the stability and accuracy of tower crane damage diagnosis.
Patent Information
- Application Number
- CN202410255364.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-06
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2044-03-06
AI Technical Summary
Damage diagnosis of tower cranes with small sample sizes faces challenges such as insufficient data and significant noise impact, resulting in poor stability and accuracy of intelligent damage diagnosis models, making it difficult to achieve efficient and accurate damage detection.
A contrastive learning-based approach, combining machine learning techniques and signal analysis, is employed to construct an injury diagnosis model. A contrastive loss function is built using the Gaussian radial basis function kernel and multi-kernel computation method, and then trained in conjunction with a classification loss function. This approach improves the model's training efficiency and diagnostic accuracy under small sample conditions.
It achieves high efficiency and accuracy in tower crane damage diagnosis under small sample conditions, improves the accuracy of model classification and diagnosis, and supports the safe operation of tower cranes.
Smart Images

Figure CN118228100B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fault diagnosis technology, and in particular to a method and system for diagnosing small-sample damage to tower cranes based on contrastive learning. Background Technology
[0002] Tower cranes, as crucial equipment in modern engineering, are responsible for the heavy material handling on construction sites, and their safe operation is of paramount importance for protecting life and property. However, due to their harsh working environment and alternating loads, tower crane standard sections, especially the connecting bolts, are frequently damaged. Failure to diagnose and address these damages promptly can lead to serious accidents such as tower crane collapse. Therefore, efficient and accurate damage detection and diagnosis of tower cranes is of utmost importance.
[0003] Analyzing signals such as displacement and acceleration at the top of the tower crane and the boom is a traditional method for tower crane damage diagnosis, typically employing methods such as wavelet analysis, transfer rate function, and sine function fitting. However, this method heavily relies on the professional knowledge and experience of the diagnostic personnel; interpreting and analyzing signals requires certain skills and fundamental knowledge. Furthermore, signal analysis-based methods often require significant time and effort to process and analyze data, and can sometimes struggle to accurately assess complex and variable damage conditions.
[0004] With the development of deep learning technology, data-driven intelligent damage diagnosis methods have gradually attracted attention. These methods utilize a large amount of labeled information to aid in learning and identifying damage features, improving the accuracy and efficiency of diagnosis. Compared to signal analysis-based methods, data-driven methods are more efficient and accurate, and can handle more complex data. However, for tower crane damage, due to its strict maintenance procedures, the actual damage samples are relatively few, posing a challenge to training data-driven intelligent damage diagnosis models. The small sample size makes training an effective diagnostic model very difficult. Furthermore, data under small sample conditions is significantly affected by random noise and outliers, impacting the model's stability and accuracy, resulting in poor damage diagnosis performance from the intelligent damage diagnosis model. Summary of the Invention
[0005] To address the shortcomings of the existing technologies, this invention provides a tower crane damage diagnosis method and system based on comparative learning for small samples. By constructing a data-driven intelligent damage diagnosis model and combining it with machine learning techniques and signal analysis methods, the invention solves the problem of tower crane damage diagnosis under small sample conditions, achieving more accurate tower crane damage diagnosis.
[0006] In a first aspect, the present invention provides a method for diagnosing small-sample damage to tower cranes based on contrastive learning.
[0007] A small-sample damage diagnosis method for tower cranes based on contrastive learning includes:
[0008] Acquire the trajectory data of the top of the tower crane as the tower crane boom rotates one revolution under a constant load;
[0009] The tower crane top trajectory data is input into the damage diagnosis model, a one-dimensional feature vector is extracted, and the tower crane damage classification result is output based on the feature vector; the construction of the damage diagnosis model includes:
[0010] Obtain small sample data of the tower crane top trajectory and damage type labels as training samples, and organize and divide the positive and negative sample sets.
[0011] Multi-scale one-dimensional feature vectors of training samples are extracted through feature extraction and classification networks, and a classification loss function is constructed based on the feature vectors;
[0012] The Gaussian radial basis kernel function and multi-kernel calculation method are used to calculate the similarity between the feature vectors of positive and negative sample pairs, thereby constructing a contrastive loss function.
[0013] The network parameters are updated based on the classification loss function and the contrastive loss function to obtain the completed damage diagnosis model.
[0014] Secondly, the present invention provides a tower crane small sample damage diagnosis system based on contrastive learning.
[0015] A tower crane small-sample damage diagnosis system based on contrastive learning, comprising:
[0016] The data acquisition module is used to acquire the trajectory data of the top of the tower crane as the tower crane boom rotates one revolution under a constant load;
[0017] The tower crane damage diagnosis module is used to input the tower crane top trajectory data into the damage diagnosis model, extract a one-dimensional feature vector, and output the tower crane damage classification result based on the feature vector; the construction of the damage diagnosis model includes:
[0018] Obtain small sample data of the tower crane top trajectory and damage type labels as training samples, and organize and divide the positive and negative sample sets.
[0019] Multi-scale one-dimensional feature vectors of training samples are extracted through feature extraction and classification networks, and a classification loss function is constructed based on the feature vectors;
[0020] The Gaussian radial basis kernel function and multi-kernel calculation method are used to calculate the similarity between the feature vectors of positive and negative sample pairs, thereby constructing a contrastive loss function.
[0021] The network parameters are updated based on the classification loss function and the contrastive loss function to obtain the completed damage diagnosis model.
[0022] Thirdly, the present invention also provides an electronic device, including a memory and a processor, and computer instructions stored in the memory and running on the processor, wherein the computer instructions, when executed by the processor, perform the steps of the method described in the first aspect.
[0023] Fourthly, the present invention also provides a computer-readable storage medium for storing computer instructions, which, when executed by a processor, perform the steps of the method described in the first aspect.
[0024] The above one or more technical solutions have the following beneficial effects:
[0025] 1. This invention provides a tower crane damage diagnosis method and system based on contrastive learning for small sample damage. By constructing a data-driven intelligent damage diagnosis model, this model is combined with machine learning technology and signal analysis methods. During the training process, contrastive learning and Gaussian radial basis function are introduced to construct a contrastive loss function, which is then combined with a classification loss function for learning and training. This solves the problem of tower crane damage diagnosis under small sample conditions, improves the model training efficiency under small sample data, and improves the accuracy of model classification diagnosis, thus achieving more accurate tower crane damage diagnosis.
[0026] 2. In this invention, when training the network model based on contrastive learning, the idea of multi-layer optimization is adopted. The contrastive loss is applied to the two layers of features output by the network model. Contrast loss functions are constructed for the two layers of features respectively for training, thereby further improving the accuracy of the damage diagnosis model classification. Attached Figure Description
[0027] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0028] Figure 1 This is an overall flowchart of the tower crane small sample damage diagnosis method based on contrastive learning as described in an embodiment of the present invention;
[0029] Figure 2 This is a flowchart of the damage diagnosis model construction and training in an embodiment of the present invention. Detailed Implementation
[0030] It should be noted that the following detailed descriptions are exemplary and are intended only to describe specific embodiments and to provide further explanation of the invention, and are not intended to limit the scope of exemplary embodiments of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0031] Example 1
[0032] This embodiment provides a small-sample damage diagnosis method for tower cranes based on contrastive learning, such as... Figure 1 As shown, the method includes the following steps:
[0033] Acquire the trajectory data of the top of the tower crane as the tower crane boom rotates one revolution under a constant load;
[0034] The tower crane top trajectory data is input into the damage diagnosis model, a one-dimensional feature vector is extracted, and the tower crane damage classification result is output based on the feature vector; the construction of the damage diagnosis model includes:
[0035] Obtain small sample data of the tower crane top trajectory and damage type labels as training samples, and organize and divide the positive and negative sample sets.
[0036] Multi-scale one-dimensional feature vectors of training samples are extracted through feature extraction and classification networks, and a classification loss function is constructed based on the feature vectors;
[0037] The Gaussian radial basis kernel function and multi-kernel calculation method are used to calculate the similarity between the feature vectors of positive and negative sample pairs, thereby constructing a contrastive loss function.
[0038] The network parameters are updated based on the classification loss function and the contrastive loss function to obtain the completed damage diagnosis model.
[0039] The tower crane damage diagnosis method based on contrastive learning proposed in this embodiment improves the training efficiency of the model with small sample data and enhances the accuracy of model classification and diagnosis by constructing and training a data-driven damage diagnosis model and introducing contrastive learning and Gaussian radial basis function kernel function during training. This, combined with the classification loss function, improves the training efficiency of the model with small sample data. The construction and training of the damage diagnosis model are as follows: Figure 2 As shown, the specific steps include:
[0040] Step S1: Obtain small sample tower crane top trajectory data and damage type labels as training samples, and organize and divide the positive and negative sample sets.
[0041] Specifically, the trajectory data of the tower crane's top end as the jib rotates one revolution under a constant load is acquired. This acquired data is a small sample. Damage type labels are then labeled onto this trajectory data, which is used as training samples to construct a dataset. In this embodiment, n labeled training samples {x} are acquired. i ,y i} i=1,2,…,n The training sample has a dimension of 48 and a total of C damage types, i.e., y i =1,2,…,C. Then, the dataset is divided into positive and negative sample sets according to the damage type. Specifically, sample data of a certain damage type is assigned to the positive sample set of that class, and sample data of other different damage types are assigned to the negative sample set of that class. Specifically, the positive sample set X... + Any pair of samples in the middle is a positive pair {x} i ,x j}, and y i =y j Conversely, the negative sample set X - Any pair of samples in the middle is a negative pair {x} i ,x j}, and y i ≠y j .
[0042] Step S2: Extract multi-scale one-dimensional feature vectors of training samples through feature extraction and classification networks, and construct a classification loss function based on the feature vectors.
[0043] Specifically, one-dimensional convolutional neural networks (1-D-CNNs) are commonly used network models for extracting features from one-dimensional data, typically containing convolutional layers and fully connected layers. The damage diagnosis model constructed in this embodiment includes a feature extraction and classification network model. This network model uses 1-D-CNN, containing four sequentially connected convolutional layers and two fully connected layers. Detailed parameters for each layer are shown in Table 1 below, and all parameters of the model are represented by θ.
[0044] Table 1 Network Model Parameter Settings
[0045] Layer / Feature operate Parameter size Activation function Output Dimension Enter / x / / / 48 <![CDATA[C1 / v1]]> Convolutional layer 5×1×32 ReLU 48×32 <![CDATA[C2 / v2]]> Convolutional layer 5×32×32 ReLU 48×32 <![CDATA[C3 / v3]]> Convolutional layer 5×32×16 ReLU 48×16 <![CDATA[C4 / v4]]> Convolutional layer 5×16×8 ReLU 48×8 <![CDATA[FO / u1]]> Flatten / / 384 <![CDATA[F1 / u2]]> Fully connected 384×128 ReLU 128 F2 / o Fully connected 128×C SoftMax C
[0046] In the above network model, all convolutional layers use the ReLU activation function to extract feature vectors; the two fully connected layers use the ReLU activation function and the SoftMax activation function, respectively, to extract multi-scale one-dimensional feature vectors and for damage classification. Specifically, the features of the l-th convolutional layer can be obtained using the following formula:
[0047] v l =f(v l-1 *kl +b l )
[0048] In the above formula, The kernel is K, and K l M is the length of the convolution kernel. l-1 M represents the number of channels in the previous feature layer. l This represents the number of channels in the current layer. It is the output feature of the previous feature layer, and N l-1 b is the feature dimension; l v is the bias vector; f(·) is the activation function, and the convolutional layer uses ReLU (Rectified Linear Unit) as the activation function; l-1 *k l For convolution operations, the following formula can be used for calculation:
[0049]
[0050] In the above formula, the subscripts within "[·]" represent the indexes of elements in the matrix or vector. In this embodiment, the stride of the convolution operation is 1, therefore, v l The dimension is (N) l-1 -K l +1)×M l .
[0051] The input sample data, after passing through multiple convolutional layers, has its extracted features flattened into a one-dimensional vector u1, which is then used for damage diagnosis via a fully connected layer. The forward propagation of the fully connected layer is as follows:
[0052] u l+1 =f(w l u l +b l )
[0053] In the above formula, w l and b l These are the weight matrix and bias vector of the fully connected layer, respectively.
[0054] The activation function of the preceding fully connected layer is ReLU, and the features of the last fully connected layer are activated by Softmax to obtain the model's output. (C represents the number of categories of health / damage status), that is, the elements in output o can be calculated using the following formula:
[0055]
[0056] In the above formula, This represents the characteristics of the output layer that have not undergone the Softmax activation function.
[0057] The model's output o represents the posterior probability of a sample belonging to each healthy / damaged state. Therefore, the damage type of a sample can be determined based on the model's output.
[0058] Based on the above feature extraction and classification output, a classification loss function is constructed and trained using labeled training data, enabling the model to effectively diagnose input samples. This classification loss function adopts the form of standard cross-entropy, where the label y... i First, it is transformed into a C-dimensional One-Hot encoded vector y. i Then the classification loss function is defined as:
[0059]
[0060] In the above formula, o i For sample x i The output after inputting the model, with the superscript T indicating the transpose of the vector.
[0061] Step S3: Using the Gaussian radial basis function kernel and multi-kernel calculation method, calculate the similarity between the feature vectors of positive and negative sample pairs, and construct the contrastive loss function accordingly.
[0062] Specifically, considering that existing damage classification models are trained under small sample conditions, and that small sample training will affect the stability and accuracy of the model, this embodiment proposes a model training method combining contrastive learning. Contrastive learning is a branch of self-supervised learning. In contrastive learning, the model learns a mapping that maps input samples to a feature space, minimizing the distance between samples of the same class and maximizing the distance between samples of different classes, thus achieving a clustering effect. The setting of positive and negative sample pairs is the foundation of contrastive learning, and sample pairs are usually constructed according to preset rules, such as damage state, true / false data, etc. Let {x} i ,x j If} represents a positive sample pair defined according to the rules, then the set of all positive sample pairs is called the positive sample set, denoted as X. + Similarly, the set of all negative sample pairs is called the negative sample set, denoted as X. - After establishing the positive and negative sample sets, measuring the distance between sample pairs and constructing the objective function is the core of the contrastive learning method. The main objective functions include Euclidean distance, Triplet loss, Noise Contrastive Estimation (NCE) loss, and InfoNCE loss. Their main function is to reduce the distance between features of positive sample pairs and increase the distance between features of negative sample pairs.
[0063] Furthermore, since linearly inseparable problems in low-dimensional spaces can potentially become linearly separable by nonlinear mapping to high-dimensional feature spaces, this indicates that high-dimensional spaces can more easily identify the differences between feature vectors. However, directly using this technique for classification or regression in high-dimensional spaces presents challenges such as determining the form and parameters of the nonlinear mapping function and the dimensionality of the feature space. The biggest obstacle, however, is the "curse of dimensionality" that occurs during computation in high-dimensional feature spaces. Kernel functions attempt to bypass the transformation process of nonlinear high-dimensional mappings and directly calculate the inner product of vectors in high-dimensional spaces, thereby resolving the uncertainty of mappings and the "curse of dimensionality." Therefore, this embodiment also employs kernel functions during the model's classification learning process to avoid the "curse of dimensionality" problem in high-dimensional feature classification.
[0064] The definition of the kernel function above is: if there exists a kernel from R n Transformation φ:R to Reproducing kernel Hilbert space (RKHS) n →H, making R n Vectors x and y in the vectors satisfy the following formula:
[0065] k(x,y)=<φ(x),φ(y)>
[0066] Where <·> represents the inner product in space. Then, in R, it is said that... n ×R n k(x,y) is the kernel function. Theoretically, a kernel function defines an RKHS.
[0067] In this embodiment, a contrastive learning model is trained. The goal of this contrastive learning is to learn a feature space that brings the feature vectors of similar samples closer together, while pushing the feature vectors of different samples further apart. Furthermore, the inner product is used to represent the similarity *s* of sample pairs. Simultaneously, a Gaussian radial basis function (RBF) is used to map the features to an infinite-dimensional RKHS, increasing the robustness of the similarity calculation. The calculation formula is as follows:
[0068]
[0069] Here, σ is an adjustable parameter. This adjustable parameter plays a major role in performance. If σ is overestimated, the exponent will be almost linear, and the high-dimensional projection will begin to lose its nonlinear function. If σ is underestimated, the function will lack regularization, and the decision boundary will be highly sensitive to noise in the training data.
[0070] To avoid the challenge of parameter selection, this embodiment proposes a multi-core computation method, employing five different σ-based RBFs to address the parameter selection risk inherent in single kernel functions. Furthermore, the five parameters are adaptively selected, eliminating subjective interference from human selection. Specifically, the RBF requires calculating the Euclidean distance between vectors. Therefore, during optimization, the mean of the feature vectors ||xy|| participating in the kernel function calculation is first obtained. Then, the five parameters σ are set to expand and shrink at intervals of two times the mean. For example, if the mean is 1, the five σs are 0.25, 0.5, 1, 2, and 4.
[0071] Therefore, the two features are related to u a and u b Similarity s i The calculation formula is:
[0072]
[0073] Where u represents the output feature of the fully connected layer, i.e., u a u b Both represent one-dimensional feature vectors output by the fully connected layer, k G () represents the Gaussian radial basis function kernel. Furthermore, in this embodiment, the last convolutional layer in the network model outputs a one-dimensional feature vector u1, and the first fully connected layer outputs a one-dimensional feature vector u2. Since the one-dimensional feature vectors u1 and u2 have different scales, a multi-layer optimization approach is adopted, applying contrastive loss to the u1 and u2 feature layers to construct contrastive loss functions respectively.
[0074] Furthermore, a hyperparameter λ is introduced into the contrastive loss function. + , λ - During training, it is hoped that the similarity of all positive sample pairs within a batch will eventually tend towards s > λ. + hyperparameter λ + The tightness of positive sample pairs can be controlled, λ + The larger the value, the denser the distribution of positive samples; correspondingly, we hope that the similarity of all negative sample pairs within the batch will eventually tend towards s < λ. - hyperparameter λ - The tightness of negative sample pairs can be controlled, λ - The smaller the value, the denser the distribution of negative samples.
[0075] For negative sample pairs, higher similarity indicates that the samples are more difficult to identify, and also implies greater information content and learning significance. The loss function contains a weighting factor: s-λ -As the similarity *s* of negative sample pairs decreases with optimization, the weight factor also decreases. To avoid the weight factor becoming negative, an exponential function is constructed using the weight factor. Similarly, for positive sample pairs, the goal of training is to increase their similarity, and its weight factor is -(s-λ). + The contrastive loss function can then be expressed as:
[0076]
[0077] Where, n + and n - These represent the number of sample pairs in the positive and negative sample sets, respectively.
[0078] Step S4: Update the network parameters based on the classification loss function and the contrastive loss function to obtain the completed damage diagnosis model.
[0079] Specifically, to improve the model's training efficiency, the traditional method of training upstream and downstream tasks separately in contrastive learning is abandoned. Instead, a method of training both the contrastive loss function and the classification loss function simultaneously is adopted. Therefore, the overall loss function can be expressed as:
[0080]
[0081] in, and Let s represent the similarity s between the feature vectors of layers u1 and u2, respectively. i The corresponding contrastive loss function, L c The classification loss function is represented. Backpropagation training is performed based on the total loss function, and stochastic gradient descent is used to iteratively train the network model parameters until the maximum number of iterations is reached. The network parameters are then updated, completing the training and construction of the damage diagnosis model. Considering that this embodiment deals with a small sample size, limited data volume, and short iteration time, the maximum number of iterations is no less than 1000. The model training is complete when the maximum number of backpropagation iterations is reached. Based on this trained model, tower crane damage diagnosis can be performed according to the model output after input data.
[0082] Furthermore, to verify the feasibility of the above method, the actual parameters of the QTZ40 tower crane were reduced by a factor of 22, and a physical test bench for simulating tower crane body damage was established. This test bench was used to collect and verify experimental data. Specifically, a stiffness meter was used to record the top displacement of the test bench under static load during rotation. The collected data consisted of two-dimensional coordinates of the tower crane top position when the crane boom rotated 15°. A complete single sample contained 48 sample points; the damage types included 5 types: 4 single-limb injuries and adjacent double-limb injuries in the first standard section of the tower crane; and 6 healthy / damaged state types, including no-damage types. 100 damage data points were collected for each experiment, of which 80% were used as test samples, and the remaining 20% were used to design small-sample verification experiments.
[0083] The following seven methods were selected as comparative methods to verify the effectiveness of the method described in this embodiment. The selected methods include:
[0084] (1) SVM: Commonly used for classification tasks. Compared with methods such as KNN and Naive Bayes, SVM is usually insensitive to data distribution and has good generalization performance. In addition, SVM can use various kernel functions to effectively solve nonlinear problems.
[0085] (2) ANN: A model composed of multiple layers of neurons usually includes several layers such as input layer, hidden layer, and output layer. Information is transmitted through the weights of neurons.
[0086] (3) 1D-CNN: A one-dimensional convolutional neural network with the same structure as the method proposed in this embodiment, that is, only L is retained during training. c Loss function.
[0087] (4) InfoNCE: Replace the contrast loss function of the method proposed in this embodiment with the InfoNCE loss function.
[0088] (5)PM-S: The method proposed in this embodiment does not use kernel function when calculating similarity, but directly uses inner product.
[0089] (6) PM-T: During training, the method proposed in this embodiment will be used... Remove the loss function.
[0090] (7)PM: The method proposed in this embodiment.
[0091] All of the above methods have undergone parameter optimization. Each experiment was conducted 10 times. The performance of the models was evaluated and compared using metrics such as accuracy, recall, and F1 score. The mean and standard deviation of each model classification were calculated, and the results are shown in Table 2.
[0092] Table 2 Classification results of multiple methods
[0093]
[0094] As can be seen from Table 2 above, the damage diagnosis model constructed by the method described in this embodiment has a better damage classification effect, effectively improves the accuracy of classification diagnosis, has good practicality and application prospects, and can provide strong support for the safe operation of tower cranes.
[0095] Example 2
[0096] This embodiment provides a tower crane small-sample damage diagnosis system based on contrastive learning. The system includes:
[0097] The data acquisition module is used to acquire the trajectory data of the top of the tower crane as the tower crane boom rotates one revolution under a constant load;
[0098] The tower crane damage diagnosis module is used to input the tower crane top trajectory data into the damage diagnosis model, extract a one-dimensional feature vector, and output the tower crane damage classification result based on the feature vector; the construction of the damage diagnosis model includes:
[0099] Obtain small sample data of the tower crane top trajectory and damage type labels as training samples, and organize and divide the positive and negative sample sets.
[0100] Multi-scale one-dimensional feature vectors of training samples are extracted through feature extraction and classification networks, and a classification loss function is constructed based on the feature vectors;
[0101] The Gaussian radial basis kernel function and multi-kernel calculation method are used to calculate the similarity between the feature vectors of positive and negative sample pairs, thereby constructing a contrastive loss function.
[0102] The network parameters are updated based on the classification loss function and the contrastive loss function to obtain the completed damage diagnosis model.
[0103] Example 3
[0104] This embodiment provides an electronic device, including a memory and a processor, as well as computer instructions stored in the memory and running on the processor. When the processor executes the computer instructions, it completes the steps in the tower crane small sample damage diagnosis method based on contrastive learning as described above.
[0105] Example 4
[0106] This embodiment also provides a computer-readable storage medium for storing computer instructions, which, when executed by a processor, complete the steps in the tower crane small-sample damage diagnosis method based on contrastive learning as described above.
[0107] The steps and methods involved in Embodiments 2 to 4 above correspond to those in Embodiment 1. For specific implementation details, please refer to the relevant description section of Embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood as including any medium capable of storing, encoding, or carrying an instruction set for execution by a processor and enabling the processor to perform any of the methods in this invention.
[0108] Those skilled in the art will understand that the modules or steps of the present invention described above can be implemented using general-purpose computer devices. Optionally, they can be implemented using computer-executable program code, thereby allowing them to be stored in a storage device for execution by a computer device, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. The present invention is not limited to any particular combination of hardware and software.
[0109] The above description is only a preferred embodiment of the present invention. Although the specific implementation of the present invention has been described in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that, based on the technical solution of the present invention, various modifications or variations that can be made by those skilled in the art without creative effort are still within the scope of protection of the present invention.
Claims
1. A method for diagnosing small-sample damage to tower cranes based on contrastive learning, characterized in that, include: Acquire the trajectory data of the top of the tower crane as the tower crane boom rotates one revolution under a constant load; The tower crane top trajectory data is input into the damage diagnosis model, a one-dimensional feature vector is extracted, and the tower crane damage classification result is output based on the feature vector. The construction of the injury diagnosis model includes: Obtain small sample data of the tower crane top trajectory and damage type labels as training samples, and organize and divide the positive and negative sample sets. Multi-scale one-dimensional feature vectors of training samples are extracted through feature extraction and classification networks, and a classification loss function is constructed based on the feature vectors; The Gaussian radial basis function kernel and multi-kernel calculation method are used to calculate the similarity between the feature vectors of positive and negative sample pairs, thereby constructing a contrastive loss function; the similarity is calculated as follows: A multi-core computing approach is adopted, with multiple adjustable parameters set for the kernel functions; Obtain two feature vectors that participate in the kernel function calculation, calculate the mean of the two feature vectors, and use this mean as the center to expand and shrink the kernel function by multiple intervals to obtain multiple adjustable parameters. Based on multiple adjustable parameters of the kernel function, the similarity between two feature vectors is calculated using the Gaussian radial basis function calculation formula; the formula for calculating the similarity is: ; In the above formula, Both represent one-dimensional eigenvectors. It is an adjustable parameter. Represents the Gaussian radial basis kernel function; The contrastive loss function is: ; In the above formula, and These represent the number of sample pairs in the positive and negative sample sets, respectively. Indicates similarity. , Indicates hyperparameters; The network parameters are updated based on the classification loss function and the contrastive loss function to obtain the completed damage diagnosis model.
2. The tower crane small-sample damage diagnosis method based on contrastive learning as described in claim 1, characterized in that, The feature extraction and classification network adopts a one-dimensional convolutional neural network, which includes four convolutional layers and two fully connected layers connected in sequence. All convolutional layers employ the ReLU activation function to extract feature vectors; The fully connected layers employ ReLU and SoftMax activation functions to extract multi-scale one-dimensional feature vectors and classify damage.
3. The tower crane small-sample damage diagnosis method based on contrastive learning as described in claim 1, characterized in that, The final convolutional layer outputs a one-dimensional feature vector. The first fully connected layer outputs a one-dimensional feature vector. One-dimensional feature vector and Different scales; A multi-layer optimization approach is adopted, applying contrastive loss to multi-scale one-dimensional feature vectors. and Construct contrastive loss functions for each function.
4. The tower crane small-sample damage diagnosis method based on contrastive learning as described in claim 1, characterized in that, Based on the classification loss function and the contrastive loss function, the total loss function is constructed as follows: In the above formula, and They represent calculations respectively. and Similarity between two layers of feature vectors The corresponding contrastive loss function, Represents the classification loss function; Based on the total loss function, the network model parameters are iteratively trained using stochastic gradient descent until the maximum number of iterations is reached. The network parameters are then updated to complete the training and construction of the damage diagnosis model.
5. A tower crane small-sample damage diagnosis system based on contrastive learning, characterized in that, include: The data acquisition module is used to acquire the trajectory data of the top of the tower crane as the tower crane boom rotates one revolution under a constant load; The tower crane damage diagnosis module is used to input the tower crane top trajectory data into the damage diagnosis model, extract a one-dimensional feature vector, and output the tower crane damage classification result based on the feature vector. The construction of the injury diagnosis model includes: Obtain small sample data of the tower crane top trajectory and damage type labels as training samples, and organize and divide the positive and negative sample sets. Multi-scale one-dimensional feature vectors of training samples are extracted through feature extraction and classification networks, and a classification loss function is constructed based on the feature vectors; The Gaussian radial basis function kernel and multi-kernel calculation method are used to calculate the similarity between the feature vectors of positive and negative sample pairs, thereby constructing a contrastive loss function; the similarity is calculated as follows: A multi-core computing approach is adopted, with multiple adjustable parameters set for the kernel functions; Obtain two feature vectors that participate in the kernel function calculation, calculate the mean of the two feature vectors, and use this mean as the center to expand and shrink the kernel function by multiple intervals to obtain multiple adjustable parameters. Based on multiple adjustable parameters of the kernel function, the similarity between two feature vectors is calculated using the Gaussian radial basis function calculation formula; the formula for calculating the similarity is: ; In the above formula, Both represent one-dimensional eigenvectors. It is an adjustable parameter. Represents the Gaussian radial basis kernel function; The contrastive loss function is: ; In the above formula, and These represent the number of sample pairs in the positive and negative sample sets, respectively. Indicates similarity. , Indicates hyperparameters; The network parameters are updated based on the classification loss function and the contrastive loss function to obtain the completed damage diagnosis model.
6. An electronic device, characterized in that, It includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, which, when executed by the processor, complete the steps of a tower crane small-sample damage diagnosis method based on contrastive learning as described in any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, Used to store computer instructions, which, when executed by a processor, complete the steps of a tower crane small-sample damage diagnosis method based on contrastive learning as described in any one of claims 1-4.
