Transformer identification method, device, computer equipment, readable storage medium and program product
Through the method of extracting and classifying the transformer pictures, the traditional manual identification problems are solved, and the efficient, accurate identification and operating status monitoring of the transformer are achieved, and the reliability of the power grid is improved.
Patent Information
- Application Number
- CN202411712484.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-04-01
AI Technical Summary
Traditional manual transformer identification methods are inefficient, low accuracy and safety risks, making it difficult to realize real-time monitoring of the operating status of the transformer and timely detection and handling of potential faults.
A transformer recognition method is adopted to generate transformer recognition results by obtaining transformer pictures and inputting the recognition model for feature extraction and classification processing, including preliminary feature extraction, feature re-extraction, multi-scale fusion and classification processing.
It realizes efficient and accurate identification of transformers, can monitor the operating status of the transformer in real time, timely detect and handle potential faults, and improves the reliable operation of the power grid.
Smart Images

Figure CN119741531A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart grid technology, and in particular to a transformer identification method, device, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] Smart grids integrate advanced communication, control and information technologies to achieve real-time monitoring, optimized dispatching and efficient management of all aspects of the power system. As a vital device in the power system, the operating status of the transformer directly affects the stability and safety of the entire power grid. Therefore, intelligent identification of transformers, real-time monitoring of their operating status, and timely detection and handling of potential faults are of great significance to ensure the reliable operation of the power grid.
[0003] Traditional manual identification methods are inefficient, inaccurate, and pose safety risks to workers during inspections. Summary of the invention
[0004] Based on this, it is necessary to provide a transformer identification method, device, computer equipment, computer-readable storage medium and computer program product that can efficiently identify transformers in response to the above technical problems.
[0005] In a first aspect, the present application provides a transformer identification method, comprising:
[0006] Get the transformer image;
[0007] Input the transformer image into the initial extraction layer of the transformer recognition model for preliminary feature extraction to obtain the initial features of the transformer; the transformer recognition model also includes: a preset number of feature extraction blocks, a multi-scale fusion layer, a vector layer and a classification layer;
[0008] Inputting the transformer initial features into a preset number of feature extraction blocks for feature re-extraction to obtain transformer features output by each feature extraction block, wherein transformer features output by different feature extraction blocks have different scales;
[0009] Input the transformer features output by each feature extraction block into the multi-scale fusion layer, fuse the transformer features of different scales, and obtain fused features;
[0010] The fused features are input into the vector layer to generate a transformer vector; the transformer vector is input into the classification layer for classification processing to obtain a transformer recognition result.
[0011] In one embodiment, the preset number of feature extraction blocks are stacked, and any feature extraction block includes: a channel expansion layer, a depth separable layer, a channel compression layer and a residual link layer; the process of re-extracting features by any feature extraction block is:
[0012] Get the transformer features output by the previous feature extraction block as the input features of the current feature extraction block;
[0013] Inputting the input feature into the channel expansion layer in the current feature extraction block to obtain an expansion feature;
[0014] Inputting the expanded features into the depth-separable layer of the current feature extraction block to obtain features of the depth-separable layer;
[0015] Inputting the features of the depth-separable layer into the channel compression layer of the current feature extraction block to obtain compressed features;
[0016] The compressed features are input into the residual connection layer of the current feature extraction block to obtain the transformer features output by the current feature extraction block.
[0017] In one embodiment, the step of inputting the dilated features into the depth-separable layer of the current feature extraction block to obtain the features of the depth-separable layer includes:
[0018] Input the expanded features into a deep convolution layer, and perform convolution on the feature map of each channel in the expanded features using a separate convolution kernel to obtain a deep feature map;
[0019] The depth feature map is input into a point-by-point convolutional layer, the number of channels of the depth feature map is changed, and the features of the depth separable layer are obtained.
[0020] In one embodiment, the step of inputting the transformer features output by each feature extraction block into a multi-scale fusion layer, fusing transformer features of different scales, and obtaining fused features includes:
[0021] The transformer features output by the last feature extraction block are sequentially fused with the transformer features output by the previous feature extraction block to obtain fused features.
[0022] In one embodiment, the training step of the transformer identification model includes:
[0023] Acquire a transformer image, and manually annotate the transformer image to form a transformer data set;
[0024] Based on the transformer data set, an adaptive learning strategy is adopted to train the transformer recognition model to be trained to obtain the transformer model.
[0025] In one embodiment, the adopting of an adaptive learning strategy to train the transformer recognition model to be trained includes:
[0026] At the initial stage of training, set the initial learning rate;
[0027] During the training process, the learning rate is gradually reduced in an exponential decay manner until the training is completed.
[0028] In a second aspect, the present application also provides a transformer identification device, comprising:
[0029] Acquisition module, used to obtain transformer images;
[0030] The initial extraction module is used to input the transformer image into the initial extraction layer of the transformer recognition model to perform preliminary feature extraction to obtain the initial features of the transformer; the transformer recognition model also includes: a preset number of feature extraction blocks, a multi-scale fusion layer, a vector layer and a classification layer;
[0031] A re-extraction module, used for inputting the initial features of the transformer into a preset number of feature extraction blocks for feature re-extraction, to obtain transformer features output by each feature extraction block, wherein transformer features output by different feature extraction blocks have different scales;
[0032] A fusion module, used for inputting the transformer features output by each feature extraction block into a multi-scale fusion layer, fusing transformer features of different scales, and obtaining fused features;
[0033] The output module is used to input the fusion feature into the vector layer to generate a transformer vector; input the transformer vector into the classification layer for classification processing to obtain a transformer recognition result.
[0034] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0035] Get the transformer image;
[0036] Input the transformer image into the initial extraction layer of the transformer recognition model for preliminary feature extraction to obtain the initial features of the transformer; the transformer recognition model also includes: a preset number of feature extraction blocks, a multi-scale fusion layer, a vector layer and a classification layer;
[0037] Inputting the transformer initial features into a preset number of feature extraction blocks for feature re-extraction to obtain transformer features output by each feature extraction block, wherein transformer features output by different feature extraction blocks have different scales;
[0038] Input the transformer features output by each feature extraction block into the multi-scale fusion layer, fuse the transformer features of different scales, and obtain fused features;
[0039] The fused features are input into the vector layer to generate a transformer vector; the transformer vector is input into the classification layer for classification processing to obtain a transformer recognition result.
[0040] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0041] Get the transformer image;
[0042] Input the transformer image into the initial extraction layer of the transformer recognition model for preliminary feature extraction to obtain the initial features of the transformer; the transformer recognition model also includes: a preset number of feature extraction blocks, a multi-scale fusion layer, a vector layer and a classification layer;
[0043] Inputting the transformer initial features into a preset number of feature extraction blocks for feature re-extraction to obtain transformer features output by each feature extraction block, wherein transformer features output by different feature extraction blocks have different scales;
[0044] Input the transformer features output by each feature extraction block into the multi-scale fusion layer, fuse the transformer features of different scales, and obtain fused features;
[0045] The fused features are input into the vector layer to generate a transformer vector; the transformer vector is input into the classification layer for classification processing to obtain a transformer recognition result.
[0046] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0047] Get the transformer image;
[0048] Input the transformer image into the initial extraction layer of the transformer recognition model for preliminary feature extraction to obtain the initial features of the transformer; the transformer recognition model also includes: a preset number of feature extraction blocks, a multi-scale fusion layer, a vector layer and a classification layer;
[0049] Inputting the transformer initial features into a preset number of feature extraction blocks for feature re-extraction to obtain transformer features output by each feature extraction block, wherein transformer features output by different feature extraction blocks have different scales;
[0050] Input the transformer features output by each feature extraction block into the multi-scale fusion layer, fuse the transformer features of different scales, and obtain fused features;
[0051] The fused features are input into the vector layer to generate a transformer vector; the transformer vector is input into the classification layer for classification processing to obtain a transformer recognition result.
[0052] The transformer identification method, device, computer equipment, computer-readable storage medium and computer program product described above first obtain a transformer image; input the transformer image into the initial extraction layer of the transformer identification model for preliminary feature extraction to obtain the transformer initial feature; the transformer identification model also includes: a preset number of feature extraction blocks, a multi-scale fusion layer, a vector layer and a classification layer; secondly, input the transformer initial feature into a preset number of feature extraction blocks for feature re-extraction to obtain the transformer feature output by each feature extraction block, and the transformer feature scales output by different feature extraction blocks are different; fusion, input the transformer feature output by each feature extraction block into the multi-scale fusion layer, fuse the transformer features of different scales, and obtain the fusion feature; finally, input the fusion feature into the vector layer to generate a transformer vector; input the transformer vector into the classification layer for classification processing to obtain the transformer identification result. By identifying the transformer through the model, the transformer identification result can be obtained more efficiently and accurately. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0054] Figure 1 1 is a flow chart of a transformer identification method in one embodiment;
[0055] Figure 2 is a flow chart of a feature extraction block in one embodiment;
[0056] Figure 3 A schematic diagram of a process of a depth-separable layer in one embodiment;
[0057] Figure 4 is a structural block diagram of a transformer identification device in one embodiment;
[0058] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0059] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0060] In one embodiment, Figure 1As shown, a transformer identification method is provided. This embodiment uses the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0061] Step 102, obtaining a transformer image.
[0062] Optionally, transformer images can be taken by devices such as drones, or obtained from the Internet.
[0063] Exemplarily, multiple original pictures taken by a drone of a transformer are obtained, invalid pictures are removed, and the remaining pictures are used as the transformer pictures in the embodiment of the present application.
[0064] Among them, invalid images include duplicate images and damaged images.
[0065] Step 104, input the transformer image into the initial extraction layer of the transformer recognition model to perform preliminary feature extraction to obtain the initial features of the transformer; the transformer recognition model also includes: a preset number of feature extraction blocks, a multi-scale fusion layer, a vector layer and a classification layer.
[0066] Optionally, the initial extraction layer can be a convolutional layer.
[0067] Exemplarily, the transformer image is input into the initial extraction layer of the transformer recognition model, and preliminary feature extraction is performed on the transformer image to obtain initial transformer features; the transformer recognition model also includes: a preset number of feature extraction blocks, a multi-scale fusion layer, a vector layer and a classification layer.
[0068] Step 106, inputting the transformer initial features into a preset number of feature extraction blocks for feature re-extraction, and obtaining transformer features output by each feature extraction block, wherein transformer features output by different feature extraction blocks have different scales.
[0069] The different scales refer to the different sizes of the transformer characteristics.
[0070] Optionally, the preset number may be 37; the feature extraction block may be composed of convolutional layers.
[0071] Exemplarily, the initial features of the transformer are input into 37 consecutive feature extraction blocks for feature re-extraction to obtain the transformer features output by each feature extraction block. The transformer features output by different feature extraction blocks have different scales.
[0072] Step 108: Input the transformer features output by each feature extraction block into a multi-scale fusion layer to fuse transformer features of different scales to obtain fused features.
[0073] Optionally, the multi-scale fusion layer consists of convolutional layers.
[0074] Exemplarily, transformer features of different scales output by each feature extraction block are input into a multi-scale fusion layer, and transformer features of different scales are fused to obtain fused features.
[0075] Step 110, input the fused features into a vector layer to generate a transformer vector; input the transformer vector into a classification layer for classification processing to obtain a transformer recognition result.
[0076] Optionally, the vector layer may be a global average pooling layer, a global maximum pooling layer, etc.; the classification layer may be a fully connected layer.
[0077] Exemplarily, the fused features are input into the vector layer, global average pooling is performed, and a transformer vector is generated; the transformer vector is input into the classification layer, classification processing is performed, and a transformer recognition result is obtained.
[0078] The transformer identification method, device, computer equipment, computer-readable storage medium and computer program product described above first obtain a transformer image; input the transformer image into the initial extraction layer of the transformer identification model for preliminary feature extraction to obtain the transformer initial feature; the transformer identification model also includes: a preset number of feature extraction blocks, a multi-scale fusion layer, a vector layer and a classification layer; secondly, input the transformer initial feature into a preset number of feature extraction blocks for feature re-extraction to obtain the transformer feature output by each feature extraction block, and the transformer feature scales output by different feature extraction blocks are different; fusion, input the transformer feature output by each feature extraction block into the multi-scale fusion layer, fuse the transformer features of different scales, and obtain the fusion feature; finally, input the fusion feature into the vector layer to generate a transformer vector; input the transformer vector into the classification layer for classification processing to obtain the transformer identification result. By identifying the transformer through the model, the transformer identification result can be obtained more efficiently and accurately.
[0079] In an exemplary embodiment, the preset number of feature extraction blocks are stacked, and any feature extraction block includes: a channel expansion layer, a depth separable layer, a channel compression layer, and a residual link layer; the process of re-extracting features by any feature extraction block is:
[0080] The transformer feature output by the previous feature extraction block is obtained as the input feature of the current feature extraction block; the input feature is input into the channel expansion layer in the current feature extraction block to obtain the expansion feature; the expansion feature is input into the depth separable layer of the current feature extraction block to obtain the feature of the depth separable layer; the feature of the depth separable layer is input into the channel compression layer of the current feature extraction block to obtain the compression feature; the compression feature is input into the residual connection layer of the current feature extraction block to obtain the transformer feature output by the current feature extraction block.
[0081] Optionally, the channel expansion layer can be composed of The convolutional layer, BatchNorm layer and Relu6 activation function of the compression layer can be composed of It consists of a convolutional layer, a BatchNorm layer, and a Relu6 activation function.
[0082] Among them, BatchNorm is the normalization layer.
[0083] Among them, the Relu6 activation function is a variant of Relu, which limits the output between 0 and 6. This limitation helps prevent gradient explosion and improves the stability and convergence speed of the network. Relu6 can suppress the maximum value of Relu, and when x>6, its derivative is also 0; it is mainly to have good numerical resolution when the mobile end float16 is low-precision. If the output value of ReLu is not restricted, then the output range is 0 to positive infinity, and the low-precision float16 cannot accurately describe its value, resulting in precision loss.
[0084] For example, Figure 2 As shown, taking a certain feature extraction block as an example, the transformer feature output by the previous feature extraction block is obtained as the input feature of the current feature extraction block; the input feature is input into the channel expansion layer in the current feature extraction block to obtain the expansion feature; the expansion feature is input into the depth separable layer of the current feature extraction block to obtain the feature of the depth separable layer; the feature of the depth separable layer is input into the channel compression layer of the current feature extraction block, and added to the input feature of the current feature extraction block to obtain the compression feature; the compression feature is input into the residual connection layer of the current feature extraction block to obtain the transformer feature output by the current feature extraction block as the input feature of the next feature extraction block.
[0085] In this embodiment, by setting multiple feature extractions to extract features in a refined manner, more detailed transformer features can be obtained.
[0086] In an exemplary embodiment, inputting the dilated features into the depth-separable layer of the current feature extraction block to obtain features of the depth-separable layer includes:
[0087] The expanded features are input into a deep convolutional layer, and a feature map of each channel in the expanded features is convolved with a separate convolution kernel to obtain a deep feature map; the deep feature map is input into a point-by-point convolutional layer, and the number of channels of the deep feature map is changed to obtain the features of a deep separable layer.
[0088] Optionally, the depthwise separable layer is a depthwise separable convolution; the depthwise convolutional layer can be composed of The convolution layer, BatchNorm layer and Relu6 activation function are composed of; the point-by-point convolution layer can be composed of It consists of a convolutional layer, a BatchNorm layer, and a Relu6 activation function.
[0089] For example, Figure 3 As shown in the figure, taking the depth separable layer in a feature extraction block as an example, the dilated feature is input into the depth convolution layer, and a separate convolution kernel is used to perform a convolution operation on the feature map of each channel in the dilated feature to obtain a depth feature map; the depth feature map is input into the point-by-point convolution layer, and feature fusion is performed on the depth feature map and the number of channels of the depth feature map is changed. The result is input into the residual layer, and the input dilated feature is added to obtain the feature of the depth separable layer.
[0090] In this embodiment, by first using The convolution kernel is used for convolution, and then The convolutional layer is used to fuse features and change the number of channels, which can reduce the parameters and calculation amount of the model and speed up the model.
[0091] In an exemplary embodiment, the step of inputting the transformer features output by each feature extraction block into a multi-scale fusion layer, fusing transformer features of different scales, and obtaining fused features includes:
[0092] The transformer features output by the last feature extraction block are sequentially fused with the transformer features output by the previous feature extraction block to obtain fused features.
[0093] Exemplarily, the transformer features output by the last feature extraction block are upsampled so that the transformer feature scale output by the last feature extraction block is the same as the transformer feature scale output by the previous feature extraction block, and then the two transformer features are added to obtain the first fused features; the transformer features output by the previous feature extraction block are sequentially sampled in the same manner to obtain the final fused features.
[0094] In this embodiment, by fusing features of different scales extracted by different feature extraction blocks, the model's ability to recognize transformers of different types and states can be effectively enhanced, overcoming the problem that a single scale feature may ignore important information and improving the recognition accuracy.
[0095] In an exemplary embodiment, the training step of the transformer identification model includes:
[0096] A transformer image is obtained, and the transformer image is manually annotated to form a transformer data set; based on the transformer data set, an adaptive learning strategy is adopted to train a transformer recognition model to be trained to obtain the transformer model.
[0097] Among them, the transformer dataset includes a training set and a test set.
[0098] Exemplarily, a transformer image is obtained, the transformer image is manually labeled with categories, and the transformer image and category are divided into a training set and a test set in a ratio of 7 to 3 to form a transformer data set; based on the transformer data set, an adaptive learning strategy is used to train the transformer recognition model to be trained to obtain a transformer model.
[0099] In this embodiment, by training the model, a transformer model for transformer identification can be obtained, which is used to identify transformer images, thereby alleviating the problems of low efficiency and low accuracy caused by manual identification.
[0100] In an exemplary embodiment, the step of using an adaptive learning strategy to train a transformer recognition model to be trained includes:
[0101] At the initial stage of training, the initial learning rate is set; during the training process, the learning rate is gradually reduced using an exponential decay method until the training is completed.
[0102] For example, at the beginning of training, in order to allow the model to quickly capture the general characteristics and trends of the data, we choose a relatively large learning rate. After experiments and experience, the initial learning rate is set to lr0=0.001. As the training progresses, the model gradually approaches the optimal solution. At this time, the learning rate needs to be reduced for more precise parameter adjustments. We use exponential decay to adjust the learning rate. The formula is as follows:
[0103]
[0104] in, is the learning rate during the tth round of training, is the decay rate of the tth round, and t is the number of training rounds. Check the model's loss value and accuracy and other indicators every certain number of training rounds, and judge whether the learning rate needs to be adjusted based on these indicators. Specifically, every 10 epochs, calculate the average loss value and accuracy of the model on the validation set. The learning rate adjustment needs to be dynamically adjusted according to the loss value and the prediction confidence.
[0105] In this embodiment, by dynamically adjusting the learning rate during training, a transformer recognition model with more powerful performance can be obtained, thereby improving the recognition accuracy.
[0106] In an exemplary embodiment, a transformer image is obtained; the transformer image is input into the initial extraction layer of the transformer recognition model, and preliminary feature extraction is performed on the transformer image to obtain the initial transformer feature; the transformer recognition model also includes: a preset number of feature extraction blocks, a multi-scale fusion layer, a vector layer, and a classification layer. The initial transformer feature is input into 37 consecutive feature extraction blocks for feature re-extraction to obtain the transformer feature output by each feature extraction block, and the transformer feature scales output by different feature extraction blocks are different. Taking a certain feature extraction block as an example, the transformer features output by the previous feature extraction block are obtained as the input features of the current feature extraction block; the input features are input into the channel expansion layer in the current feature extraction block to obtain the expansion features; the expansion features are input into the depth convolution layer, and a separate convolution kernel is used to perform a convolution operation on the feature map of each channel in the expansion features to obtain a depth feature map; the depth feature map is input into the point-by-point convolution layer, and feature fusion is performed on the depth feature map and the number of channels of the depth feature map is changed, and the result is added with the input features, i.e., the expansion features, to obtain the features of the depth separable layer; the features of the depth separable layer are input into the channel compression layer of the current feature extraction block, and added to the input features of the current feature extraction block to obtain the compression features; the compression features are input into the residual connection layer of the current feature extraction block to obtain the transformer features output by the current feature extraction block as the input features of the next feature extraction block. The transformer features of different scales output by each feature extraction block are input into the multi-scale fusion layer, and the transformer features output by the last feature extraction block are upsampled so that the transformer feature scale output by the last feature extraction block is the same as that output by the previous feature extraction block. Then, the two transformer features are added to obtain the first fused features; the transformer features output by the previous feature extraction block are sampled in the same way to obtain the final fused features. The fused features are input into the vector layer for global average pooling to generate transformer vectors; the transformer vectors are input into the classification layer for classification processing to obtain transformer recognition results. The training steps of the transformer recognition model include: obtaining transformer images, manually annotating transformer images, dividing transformer images and categories into training sets and test sets in a ratio of 7 to 3 to form a transformer data set; based on the transformer data set, an adaptive learning strategy is used to train the transformer recognition model to be trained. At the beginning of the training, in order to enable the model to quickly capture the general characteristics and trends of the data, we choose a relatively large learning rate. After experiments and experience, the initial learning rate is set to lr0=0.001. As training progresses, the model gradually approaches the optimal solution. At this time, the learning rate needs to be reduced to make more precise parameter adjustments. We use exponential decay to adjust the learning rate. The formula is as follows:
[0107]
[0108] in, is the learning rate during the tth round of training, is the decay rate of the tth round, and t is the number of training rounds. Check the model's loss value and accuracy and other indicators every certain number of training rounds, and judge whether the learning rate needs to be adjusted based on these indicators. Specifically, every 10 epochs, calculate the average loss value and accuracy of the model on the validation set. The learning rate adjustment needs to be dynamically adjusted according to the loss value and the prediction confidence.
[0109] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0110] In an exemplary embodiment, Figure 4 As shown, a transformer identification device is provided, including: an acquisition module, a primary extraction module, a re-extraction module, a fusion module and an output module, wherein:
[0111] Acquisition module, used to obtain transformer images;
[0112] The initial extraction module is used to input the transformer image into the initial extraction layer of the transformer recognition model to perform preliminary feature extraction to obtain the initial features of the transformer; the transformer recognition model also includes: a preset number of feature extraction blocks, a multi-scale fusion layer, a vector layer and a classification layer;
[0113] A re-extraction module, used for inputting the initial features of the transformer into a preset number of feature extraction blocks for feature re-extraction, to obtain transformer features output by each feature extraction block, wherein transformer features output by different feature extraction blocks have different scales;
[0114] A fusion module, used for inputting the transformer features output by each feature extraction block into a multi-scale fusion layer, fusing transformer features of different scales, and obtaining fused features;
[0115] The output module is used to input the fusion feature into the vector layer to generate a transformer vector; input the transformer vector into the classification layer for classification processing to obtain a transformer recognition result.
[0116] In an exemplary embodiment, the re-extraction module is further configured to:
[0117] The preset number of feature extraction blocks are stacked, and any feature extraction block includes: a channel expansion layer, a depth separable layer, a channel compression layer and a residual link layer; the process of re-extracting features by any feature extraction block is:
[0118] The transformer feature output by the previous feature extraction block is obtained as the input feature of the current feature extraction block; the input feature is input into the channel expansion layer in the current feature extraction block to obtain the expansion feature; the expansion feature is input into the depth separable layer of the current feature extraction block to obtain the feature of the depth separable layer; the feature of the depth separable layer is input into the channel compression layer of the current feature extraction block to obtain the compression feature; the compression feature is input into the residual connection layer of the current feature extraction block to obtain the transformer feature output by the current feature extraction block.
[0119] In an exemplary embodiment, the re-extraction module is further configured to:
[0120] The expanded features are input into a deep convolutional layer, and a feature map of each channel in the expanded features is convolved with a separate convolution kernel to obtain a deep feature map; the deep feature map is input into a point-by-point convolutional layer, and the number of channels of the deep feature map is changed to obtain the features of a deep separable layer.
[0121] In an exemplary embodiment, the fusion module is further configured to:
[0122] The transformer features output by the last feature extraction block are sequentially fused with the transformer features output by the previous feature extraction block to obtain fused features.
[0123] In an exemplary embodiment, the system further includes a training module for:
[0124] A transformer image is obtained, and the transformer image is manually annotated to form a transformer data set; based on the transformer data set, an adaptive learning strategy is adopted to train a transformer recognition model to be trained to obtain the transformer model.
[0125] In an exemplary embodiment, the training module is further configured to:
[0126] At the initial stage of training, the initial learning rate is set; during the training process, the learning rate is gradually reduced using an exponential decay method until the training is completed.
[0127] Each module in the above transformer identification device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0128] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 5 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store transformer identification results. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a transformer identification method is implemented.
[0129] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0130] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0131] Get the transformer image;
[0132] Input the transformer image into the initial extraction layer of the transformer recognition model for preliminary feature extraction to obtain the initial features of the transformer; the transformer recognition model also includes: a preset number of feature extraction blocks, a multi-scale fusion layer, a vector layer and a classification layer;
[0133] Inputting the transformer initial features into a preset number of feature extraction blocks for feature re-extraction to obtain transformer features output by each feature extraction block, wherein transformer features output by different feature extraction blocks have different scales;
[0134] Input the transformer features output by each feature extraction block into the multi-scale fusion layer, fuse the transformer features of different scales, and obtain fused features;
[0135] The fused features are input into the vector layer to generate a transformer vector; the transformer vector is input into the classification layer for classification processing to obtain a transformer recognition result.
[0136] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0137] The preset number of feature extraction blocks are stacked, and any feature extraction block includes: a channel expansion layer, a depth separable layer, a channel compression layer and a residual link layer; the process of re-extracting features by any feature extraction block is:
[0138] The transformer feature output by the previous feature extraction block is obtained as the input feature of the current feature extraction block; the input feature is input into the channel expansion layer in the current feature extraction block to obtain the expansion feature; the expansion feature is input into the depth separable layer of the current feature extraction block to obtain the feature of the depth separable layer; the feature of the depth separable layer is input into the channel compression layer of the current feature extraction block to obtain the compression feature; the compression feature is input into the residual connection layer of the current feature extraction block to obtain the transformer feature output by the current feature extraction block.
[0139] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0140] The expanded features are input into a deep convolutional layer, and a feature map of each channel in the expanded features is convolved with a separate convolution kernel to obtain a deep feature map; the deep feature map is input into a point-by-point convolutional layer, and the number of channels of the deep feature map is changed to obtain the features of a deep separable layer.
[0141] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0142] The transformer features output by the last feature extraction block are sequentially fused with the transformer features output by the previous feature extraction block to obtain fused features.
[0143] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0144] A transformer image is obtained, and the transformer image is manually annotated to form a transformer data set; based on the transformer data set, an adaptive learning strategy is adopted to train a transformer recognition model to be trained to obtain the transformer model.
[0145] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0146] At the initial stage of training, the initial learning rate is set; during the training process, the learning rate is gradually reduced using an exponential decay method until the training is completed.
[0147] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0148] Get the transformer image;
[0149] Input the transformer image into the initial extraction layer of the transformer recognition model for preliminary feature extraction to obtain the initial features of the transformer; the transformer recognition model also includes: a preset number of feature extraction blocks, a multi-scale fusion layer, a vector layer and a classification layer;
[0150] Inputting the transformer initial features into a preset number of feature extraction blocks for feature re-extraction to obtain transformer features output by each feature extraction block, wherein transformer features output by different feature extraction blocks have different scales;
[0151] Input the transformer features output by each feature extraction block into the multi-scale fusion layer, fuse the transformer features of different scales, and obtain fused features;
[0152] The fused features are input into the vector layer to generate a transformer vector; the transformer vector is input into the classification layer for classification processing to obtain a transformer recognition result.
[0153] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0154] The preset number of feature extraction blocks are stacked, and any feature extraction block includes: a channel expansion layer, a depth separable layer, a channel compression layer and a residual link layer; the process of re-extracting features by any feature extraction block is:
[0155] The transformer feature output by the previous feature extraction block is obtained as the input feature of the current feature extraction block; the input feature is input into the channel expansion layer in the current feature extraction block to obtain the expansion feature; the expansion feature is input into the depth separable layer of the current feature extraction block to obtain the feature of the depth separable layer; the feature of the depth separable layer is input into the channel compression layer of the current feature extraction block to obtain the compression feature; the compression feature is input into the residual connection layer of the current feature extraction block to obtain the transformer feature output by the current feature extraction block.
[0156] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0157] The expanded features are input into a deep convolutional layer, and a feature map of each channel in the expanded features is convolved with a separate convolution kernel to obtain a deep feature map; the deep feature map is input into a point-by-point convolutional layer, and the number of channels of the deep feature map is changed to obtain the features of a deep separable layer.
[0158] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0159] The transformer features output by the last feature extraction block are sequentially fused with the transformer features output by the previous feature extraction block to obtain fused features.
[0160] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0161] A transformer image is obtained, and the transformer image is manually annotated to form a transformer data set; based on the transformer data set, an adaptive learning strategy is adopted to train a transformer recognition model to be trained to obtain the transformer model.
[0162] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0163] At the initial stage of training, the initial learning rate is set; during the training process, the learning rate is gradually reduced using an exponential decay method until the training is completed.
[0164] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0165] Get the transformer image;
[0166] Input the transformer image into the initial extraction layer of the transformer recognition model for preliminary feature extraction to obtain the initial features of the transformer; the transformer recognition model also includes: a preset number of feature extraction blocks, a multi-scale fusion layer, a vector layer and a classification layer;
[0167] Inputting the transformer initial features into a preset number of feature extraction blocks for feature re-extraction to obtain transformer features output by each feature extraction block, wherein transformer features output by different feature extraction blocks have different scales;
[0168] Input the transformer features output by each feature extraction block into the multi-scale fusion layer, fuse the transformer features of different scales, and obtain fused features;
[0169] The fused features are input into the vector layer to generate a transformer vector; the transformer vector is input into the classification layer for classification processing to obtain a transformer recognition result.
[0170] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0171] The preset number of feature extraction blocks are stacked, and any feature extraction block includes: a channel expansion layer, a depth separable layer, a channel compression layer and a residual link layer; the process of re-extracting features by any feature extraction block is:
[0172] The transformer feature output by the previous feature extraction block is obtained as the input feature of the current feature extraction block; the input feature is input into the channel expansion layer in the current feature extraction block to obtain the expansion feature; the expansion feature is input into the depth separable layer of the current feature extraction block to obtain the feature of the depth separable layer; the feature of the depth separable layer is input into the channel compression layer of the current feature extraction block to obtain the compression feature; the compression feature is input into the residual connection layer of the current feature extraction block to obtain the transformer feature output by the current feature extraction block.
[0173] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0174] The expanded features are input into a deep convolutional layer, and a feature map of each channel in the expanded features is convolved with a separate convolution kernel to obtain a deep feature map; the deep feature map is input into a point-by-point convolutional layer, and the number of channels of the deep feature map is changed to obtain the features of a deep separable layer.
[0175] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0176] The transformer features output by the last feature extraction block are sequentially fused with the transformer features output by the previous feature extraction block to obtain fused features.
[0177] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0178] A transformer image is obtained, and the transformer image is manually annotated to form a transformer data set; based on the transformer data set, an adaptive learning strategy is adopted to train a transformer recognition model to be trained to obtain the transformer model.
[0179] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0180] At the initial stage of training, the initial learning rate is set; during the training process, the learning rate is gradually reduced using an exponential decay method until the training is completed.
[0181] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can 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 can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. 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, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0182] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0183] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A transformer identification method, characterized in that: The method comprises: Get the transformer image; Input the transformer image into the initial extraction layer of the transformer recognition model for preliminary feature extraction to obtain the initial features of the transformer; the transformer recognition model also includes: a preset number of feature extraction blocks, a multi-scale fusion layer, a vector layer and a classification layer; Inputting the transformer initial features into a preset number of feature extraction blocks for feature re-extraction to obtain transformer features output by each feature extraction block, wherein transformer features output by different feature extraction blocks have different scales; Input the transformer features output by each feature extraction block into the multi-scale fusion layer, fuse the transformer features of different scales, and obtain fused features; The fused features are input into the vector layer to generate a transformer vector; the transformer vector is input into the classification layer for classification processing to obtain a transformer recognition result.
2. The method according to claim 1, characterized in that The preset number of feature extraction blocks are stacked, and any feature extraction block includes: a channel expansion layer, a depth separable layer, a channel compression layer and a residual link layer; the process of re-extracting features by any feature extraction block is: Get the transformer features output by the previous feature extraction block as the input features of the current feature extraction block; Inputting the input feature into the channel expansion layer in the current feature extraction block to obtain an expansion feature; Inputting the expanded features into the depth-separable layer of the current feature extraction block to obtain features of the depth-separable layer; Inputting the features of the depth-separable layer into the channel compression layer of the current feature extraction block to obtain compressed features; The compressed features are input into the residual connection layer of the current feature extraction block to obtain the transformer features output by the current feature extraction block.
3. The method according to claim 2, characterized in that The step of inputting the expanded features into the depth-separable layer of the current feature extraction block to obtain features of the depth-separable layer includes: Input the expanded features into a deep convolution layer, and perform convolution on the feature map of each channel in the expanded features using a separate convolution kernel to obtain a deep feature map; The depth feature map is input into a point-by-point convolutional layer, the number of channels of the depth feature map is changed, and the features of the depth separable layer are obtained.
4. The method according to claim 1, characterized in that The step of inputting the transformer features output by each feature extraction block into a multi-scale fusion layer, fusing transformer features of different scales, and obtaining fused features includes: The transformer features output by the last feature extraction block are sequentially fused with the transformer features output by the previous feature extraction block to obtain fused features.
5. The method according to any one of claims 1 to 4, characterized in that: The training steps of the transformer identification model include: Acquire a transformer image, and manually annotate the transformer image to form a transformer data set; Based on the transformer data set, an adaptive learning strategy is adopted to train the transformer recognition model to be trained to obtain the transformer model.
6. The method according to claim 5, characterized in that The adaptive learning strategy is used to train the transformer recognition model to be trained, including: At the initial stage of training, set the initial learning rate; During the training process, the learning rate is gradually reduced in an exponential decay manner until the training is completed.
7. A transformer identification device, characterized in that: The device comprises: Acquisition module, used to obtain transformer images; The initial extraction module is used to input the transformer image into the initial extraction layer of the transformer recognition model to perform preliminary feature extraction to obtain the initial features of the transformer; the transformer recognition model also includes: a preset number of feature extraction blocks, a multi-scale fusion layer, a vector layer and a classification layer; A re-extraction module, used for inputting the initial features of the transformer into a preset number of feature extraction blocks for feature re-extraction, to obtain transformer features output by each feature extraction block, wherein transformer features output by different feature extraction blocks have different scales; A fusion module, used for inputting the transformer features output by each feature extraction block into a multi-scale fusion layer, fusing transformer features of different scales, and obtaining fused features; The output module is used to input the fusion feature into the vector layer to generate a transformer vector; input the transformer vector into the classification layer for classification processing to obtain a transformer recognition result.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.