Permanent magnet demagnetization detection method, electronic equipment and device

By using deep learning models to identify the magnetic field intensity distribution image of the permanent magnet, the problem of inaccurate judgment of whether the permanent magnet is demagnetized in the prior art is solved, and high-precision and high-efficiency demagnetization detection is achieved.

CN120219336AActive Publication Date: 2025-06-27ANHUI UNIV

Patent Information

Application Number
CN202510304529.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-14
Publication Date
2025-06-27
Estimated Expiration
2045-03-14

AI Technical Summary

Technical Problem

The existing permanent magnet demagnetization detection methods cannot accurately determine whether the permanent magnet is demagnetized, and the degree of demagnetization cannot be detected.

Method used

By acquiring the magnetic field intensity distribution image of the permanent magnet and identifying the image using the deep learning-based DMG-IncepNeXt demagnetization detection model, the demagnetization state of the permanent magnet is predicted.

Benefits of technology

The accuracy of permanent magnet demagnetization detection is improved, and it can accurately determine whether the permanent magnet is demagnetized, and provides an evaluation of the degree of demagnetization to achieve high accuracy and high-speed demagnetization detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120219336A_ABST
    Figure CN120219336A_ABST
Patent Text Reader

Abstract

The invention relates to a demagnetization detection method of a permanent magnet, electronic equipment and a device, and the method comprises the steps: obtaining a magnetic field intensity distribution image of a to-be-detected permanent magnet; identifying the magnetic field intensity distribution image through a demagnetization detection model based on deep learning DMG-IncepNeXt, and predicting the demagnetization state of the permanent magnet to be detected; wherein the demagnetization detection model comprises an input layer, a plurality of feature extraction networks and an output layer which are connected in sequence, and each feature extraction network comprises a plurality of feature extraction modules which are connected in sequence. According to the demagnetization detection method, the magnetic field intensity distribution image of the permanent magnet is adopted to judge the demagnetization state of the permanent magnet, compared with a demagnetization detection method according to the surface image of the permanent magnet, higher detection precision is achieved, and the problem that whether the permanent magnet is demagnetized or not cannot be accurately judged through an existing permanent magnet demagnetization detection method is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of permanent magnets, and in particular, to a method for detecting demagnetization of a permanent magnet, an electronic device, and a device. Background Art

[0002] Due to characteristics such as high coercivity and good temperature stability of permanent magnets, they can relatively stably maintain their magnetic properties under different working environments and temperature conditions, providing a strong guarantee for the long-term stable operation of the devices or systems they are in. Due to the natural aging of permanent magnets, the complexity of the actual operating conditions of the devices they are in, and the high-temperature and humid working environment, etc., irreversible demagnetization of permanent magnets is likely to occur. However, after a permanent magnet is demagnetized, it may lead to a decline in the performance of the associated devices, energy waste, production downtime, increased maintenance costs, and potential safety hazards. Therefore, it is necessary to regularly detect the demagnetization of permanent magnets.

[0003] Currently, it is mainly through methods such as using a camera to photograph cracks, depressions, etc. on the surface of a permanent magnet to determine whether the permanent magnet is demagnetized. However, since there is no strong correlation between the surface state of a permanent magnet and its demagnetization, for example, the surface of some demagnetized permanent magnets remains intact, and thus this demagnetization detection method has the problem of inaccurate demagnetization detection. At the same time, since there is no necessary connection between the degree of demagnetization of a permanent magnet and its surface state, the above demagnetization detection method cannot detect the degree of demagnetization of a permanent magnet.

[0004] Regarding the problem that the current permanent magnet demagnetization detection method cannot accurately determine whether a permanent magnet is demagnetized, no effective solution has been proposed yet. Summary of the Invention

[0005] In the present invention, a method for detecting demagnetization of a permanent magnet, an electronic device, and a device are provided to solve the problem that the current permanent magnet demagnetization detection method cannot accurately determine whether a permanent magnet is demagnetized.

[0006] In a first aspect, the present invention provides a method for detecting demagnetization of a permanent magnet, including:

[0007] Obtaining a magnetic field intensity distribution image of the permanent magnet to be detected;

[0008] Identifying the magnetic field intensity distribution image through a demagnetization detection model based on deep learning DMG-IncepNeXt to predict the demagnetization state of the permanent magnet to be detected;

[0009] Wherein, the demagnetization detection model includes an input layer, a plurality of feature extraction networks, and an output layer connected in sequence, and each feature extraction network includes a plurality of feature extraction modules connected in sequence;

[0010] Each of the feature extraction modules includes a depthwise separable convolutional layer, a normalization layer, a DMG module, and a multi-layer perceptron connected in sequence. The depthwise separable convolutional layer includes four branches, namely a first depthwise separable convolution, a second depthwise separable convolution, a third depthwise separable convolution, and an identity mapping. The convolutional kernel size of the first depthwise separable convolution is n*n, the convolutional kernel size of the second depthwise separable convolution is 1*m, and the convolutional kernel size of the third depthwise separable convolution is m*1, where m is greater than n.

[0011] In a second aspect, the present invention provides a computer, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the demagnetization detection method of the permanent magnet described in the first aspect.

[0012] In a third aspect, the present invention provides a demagnetization detection device for a permanent magnet, including an image acquisition device and the computer described in the second aspect. The image acquisition device includes a transmission device, a camera device, and a visual magnetic field color display sheet.

[0013] The transmission device provides a transmission path for transmitting the permanent magnet.

[0014] The visual magnetic field color display sheet is arranged directly above the transmission path and parallel to the transmission path.

[0015] The camera device is arranged directly above the visual magnetic field color display sheet, and the optical center line is perpendicular to the visual magnetic field color display sheet.

[0016] The computer acquires the magnetic field intensity distribution image of the permanent magnet through the camera device.

[0017] Compared with the related art, the demagnetization detection method in the present invention uses the magnetic field intensity distribution image of the permanent magnet to judge its demagnetization state. Compared with the demagnetization detection method based on the surface image of the permanent magnet, it has higher detection accuracy and solves the problem that the current demagnetization detection method of the permanent magnet cannot accurately judge whether the permanent magnet is demagnetized. At the same time, the demagnetization detection method also uses a demagnetization detection model to identify the magnetic field intensity distribution image and provides a new specific architecture of the demagnetization detection model. Through this demagnetization detection model, high-accuracy demagnetization detection and relatively high-speed demagnetization detection can be further realized.

[0018] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more concise and understandable. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1It is a flowchart of the demagnetization detection method of the permanent magnet provided in this embodiment;

[0020] Figure 2 It is a composition diagram of the demagnetization detection device of the permanent magnet provided in this embodiment;

[0021] Figure 3 It is an architecture diagram of the demagnetization detection model provided in this embodiment;

[0022] Figure 4 It is an architecture diagram of the feature extraction module provided in this embodiment;

[0023] Figure 5 It is an architecture diagram of the DMG module provided in this embodiment. Detailed implementation manners

[0024] For a clearer understanding of the purpose, technical solutions, and advantages of this application, the following describes and explains this application in combination with the accompanying drawings and embodiments.

[0025] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by those with ordinary skills in the technical field to which this application belongs. In this application, words such as "a", "one", "a kind of", "the", "these", etc. do not indicate a limitation in quantity, and they can be singular or plural. The terms "including", "comprising", "having" and any variants thereof involved in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device including a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent in these processes, methods, products, or devices. The terms "connected", "linked", "coupled", etc. involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether directly or indirectly connected. The term "plurality" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" may represent: A exists alone, A and B exist simultaneously, and B exists alone. Usually, the character " / " indicates that the objects associated before and after are an "or" relationship. The terms "first", "second", "third", etc. involved in this application only distinguish similar objects and do not represent a specific sorting of the objects.

[0026] In this embodiment, a demagnetization detection method of a permanent magnet is provided. Figure 1 It is a flowchart of the demagnetization detection method of the permanent magnet provided in this embodiment. As Figure 1 shown, this process includes step S110 and step S120.

[0027] Step S110, obtain the magnetic field intensity distribution image of the permanent magnet to be detected.

[0028] In the prior art, the surface image of the permanent magnet to be detected is usually used for demagnetization detection. As introduced in the background art, there is a problem that it is impossible to accurately judge whether the permanent magnet is demagnetized. In this embodiment, the magnetic field intensity distribution image of the permanent magnet to be detected is used for demagnetization detection. The principle is that the magnetic field intensity distribution of the permanent magnet will change before and after demagnetization. Therefore, based on the magnetic field intensity distribution image for demagnetization detection, it can effectively judge whether the permanent magnet to be detected is demagnetized. Among them, the permanent magnet can be a neodymium iron boron permanent magnet.

[0029] Specifically, in this embodiment, an image acquisition device is also provided, which is used to acquire the magnetic field intensity distribution image of the permanent magnet. The magnetic field intensity distribution image in this embodiment is acquired by this image acquisition device.

[0030] Refer to Figure 2 , the image acquisition device includes a transmission device 10, a camera device 30 and a visual magnetic field color display sheet 20.

[0031] The transmission device 10 provides a transmission path for transmitting the permanent magnet 00. The visual magnetic field color display sheet 20 is arranged directly above the transmission path and parallel to the transmission path. The camera device 30 is arranged directly above the visual magnetic field color display sheet 20 and the optical center line is perpendicular to the visual magnetic field color display sheet 20; the computer obtains the magnetic field intensity distribution image of the permanent magnet 00 through the camera device 30.

[0032] In this embodiment, the transmission device 10 includes an ultrasonic sensor 12 and a non-magnetic transmission belt 11. The upper surface of the transmission belt 11 constitutes the transmission path, and the middle part of the transmission path is the transmission pause position. The visual magnetic field color display sheet 20 is arranged directly above the transmission pause position. The ultrasonic sensor 12 is arranged on the side plate of the transmission belt 11 and is used to detect the position of the permanent magnet 00; the transmission belt 11 is configured to: according to the detection signal of the ultrasonic sensor 12, pause the transmission action when there is a permanent magnet 00 moving to the transmission pause position.

[0033] An installation frame higher than the conveyor belt 11 can be fixedly arranged on one side of the transmission device 10, and the visual magnetic field color display sheet 20 and the imaging device 30 are both fixedly installed on this installation frame. The transmission path is usually a horizontal path. When it is necessary to obtain the magnetic field intensity distribution image of the permanent magnet 00 to be detected, the permanent magnet 00 to be detected is placed on the upper surface of the conveyor belt 11, and the conveyor belt 11 will transport the permanent magnet 00 to be detected from one end to the other end. When the permanent magnet 00 moves to the transmission pause position (i.e., the middle of the conveyor belt 11), the conveyor belt 11 can pause once, so as to facilitate the imaging device 30 to capture the magnetic field intensity distribution image of the permanent magnet 00 at the transmission pause position through the visual magnetic field color display sheet 20, and this image is a color image. Specifically, the magnetic field intensity distribution image on the surface of the permanent magnet refers to placing the visual magnetic field color display sheet on the surface of the permanent magnet. According to the strength of the magnetic field intensity, seven colors (orange, yellow, light green, green, dark green, blue, dark blue) will appear on the visual magnetic field color display sheet, and each color represents a gradual decrease in the strength of the magnetic field intensity.

[0034] For the pause control of the conveyor belt 11, it can be directly detected by the ultrasonic sensor 12 whether there is a permanent magnet 00 at the transmission pause position. When the ultrasonic sensor 12 detects the appearance (from none to present) of the permanent magnet 00 at the transmission pause position, the conveyor belt 11 pauses. Also, the ultrasonic sensor 12 can be arranged at an interval from the transmission pause position (the distance between the two is known). By adjusting the transmission direction, the permanent magnet 00 first passes through the ultrasonic sensor. Since the distance between the ultrasonic sensor 12 and the transmission pause position and the transmission speed of the conveyor belt 11 are both known, when the ultrasonic sensor 12 detects that there is a permanent magnet 00 in its direct facing direction, the time point when the permanent magnet 00 reaches the transmission pause position can be calculated, and thus the conveyor belt 11 is paused at this time point. During the pause of the conveyor belt, the imaging device 30 captures the permanent magnet through the visual magnetic field color display sheet 20 to obtain its magnetic field intensity distribution image.

[0035] Step S120, identify the magnetic field intensity distribution image through the demagnetization detection model based on deep learning DMG-IncepNeXt, and predict the demagnetization state of the permanent magnet to be detected.

[0036] Among them, referring to Figure 3 , the demagnetization detection model includes an input layer, multiple feature extraction networks connected in sequence, and an output layer connected in sequence. Each feature extraction network includes multiple feature extraction modules connected in sequence. Multiple feature extraction networks are stacked to form an intermediate layer.

[0037] In this embodiment, the input layer includes one convolutional layer and one batch normalization layer. The convolutional layer performs convolution processing on the magnetic field intensity distribution image, and then gives the convolution result to the batch normalization layer. The batch normalization layer performs batch normalization on the convolution result and inputs it into the middle layer, that is, as the input of the first feature extraction network. The output of the previous feature extraction network is used as the input of the next feature extraction network, and the output of the last feature extraction network is used as the input of the output layer. The output layer is stacked by two linear layers (the first linear layer and the second linear layer), one ReLU activation function, and one layer normalization layer. The input of the output layer is the input of the first linear layer, and the output of the second linear layer is the output of the output layer. The output of the output layer is the demagnetization state of the permanent magnet. In this embodiment, the demagnetization state includes not only whether demagnetization occurs but also the demagnetization ratio.

[0038] Looking from the data flow direction, the functions of the above parts are as follows:

[0039] In the input layer, the convolutional layer performs local feature extraction on the magnetic field intensity distribution image X m to obtain the feature map Z1. The batch normalization layer performs batch normalization processing on Z1 to obtain the feature map Z2; the first feature extraction network performs feature extraction in the width and height directions on Z2 to obtain the feature map Z3; the second feature extraction network performs feature extraction in the width and height directions on Z3 to obtain the feature map Z4; the third feature extraction network performs feature extraction in the width and height directions on Z4 to obtain the feature map Z5; the fourth feature extraction network performs feature extraction in the width and height directions on Z5 to obtain the feature map Z6; in the output layer, the first linear layer performs dimensional transformation and non-linear combination of features on Z6 to obtain the feature vector Z7. The ReLU activation function introduces non-linearity to Z7 to obtain the feature vector Z8. The layer normalization layer performs layer normalization processing on Z8 to obtain the feature vector Z9. The second linear layer further maps Z9 to the final regression target value and outputs a continuous numerical value to represent the result of the regression prediction.

[0040] In this embodiment, the specifications of Z1 to Z3 are all (H / 4, W / 4, 96); the specification of Z4 is (H / 8, W / 8, 192); the specification of Z5 is (H / 16, W / 16, 384); the specification of Z6 is (H / 32, W / 32, 768); Z7 to Z9 are feature vectors with a dimension of 512; Z 10 is a vector with a dimension of 1.

[0041] Among them, for the position with coordinates (i, j) on the output feature map Z1 of the convolutional layer, its calculation formula is:

[0042]

[0043] Where weight is the weight of the convolutional kernel, which is a multi-dimensional tensor representing the weight value at each position in the convolution operation. bias is the bias term, which is a vector used to adjust the value of the convolution output. The role of the bias is to add a learnable offset to each output feature map. input is the input image, which is a multi-dimensional tensor representing the data input to the convolutional layer. i and j are the coordinate values of the output feature map Z1, representing the index of a certain position in the output feature map. m and n are index values used to traverse the local regions of the convolutional kernel weights and the input feature map.

[0044] Calculation formulas for relevant parameters in the batch normalization layer:

[0045]

[0046] Where μ c is the mean of channel c, representing the mean of the c-th channel of all samples in the batch. N is the batch size, representing the number of samples input in one training. x b,c is the value of the c-th channel of the b-th sample in the batch. is the variance of channel c, representing the variance of the c-th channel of all samples in the batch. ∈ is a small constant to prevent the denominator from being 0 (here it is 1e-05). is the normalized value, representing the result of normalizing x b,c after standardization. γ c is a learnable scaling parameter used to adjust the scale of the normalized value. β c is a learnable translation parameter used to adjust the offset of the normalized value. y b,c is the final output value after batch normalization, that is, the feature map Z2.

[0047] Among them, for each element x in the vector, the ReLU activation function i has the transformation formula:

[0048] ReLU(x i ) = max(0, x i )

[0049] Where x i is the i-th element in the input vector, representing the value input to the activation function. ReLU(x i ) is the output value of the ReLU activation function, representing the result of the non-linear transformation of x i .

[0050] Among them, the linear transformation formula of the linear layer:

[0051] y = Wx + b

[0052] Where x is the input vector, representing the data input to the linear layer. W is the weight matrix, representing the weight parameters of the linear transformation. The size of the weight matrix is determined by the dimensions of the input vector and the output vector x. b is the bias vector, representing the bias parameters of the linear transformation. y is the output vector after the linear transformation.

[0053] It should be noted that the above is only an exemplary description of the convolutional layer and batch normalization layer in the input layer, as well as the ReLU activation function and linear layer in the output layer. As mature structures in the prior art, if there are other specific structural forms in the prior art, they can also be applied to other embodiments of the present invention.

[0054] For the intermediate layer part, the purpose of using multiple feature extraction networks stacked continuously in this embodiment is to achieve multi-scale feature extraction. Downsampling at different stages can take into account both local details and global semantic features, adapting to targets of different scales. Progressive feature abstraction and fusion are carried out to gradually construct high-level understanding and synthesize features at different levels. At the same time, the model capacity and expression ability are increased, information bottlenecks and overfitting are avoided, and the fitting and generalization abilities for complex data are improved.

[0055] In this embodiment, there are four feature extraction networks. The numbers of feature extraction modules in the four feature extraction networks are three, three, nine, and three respectively in the connection order. The purpose of using multiple feature extraction modules is to repeatedly capture features from multiple spatial dimensions in the same network, from the texture features in the horizontal and vertical directions of a certain area in the image to further capturing the interaction features between this area and the surrounding areas, so as to more comprehensively mine the information in the input feature map.

[0056] It should be noted that in each feature extraction network, in addition to including feature extraction modules, it may also include at least one other layer structure for cooperation. Specifically, for the first feature extraction network, it is composed of an identity mapping layer and three feature extraction modules stacked in sequence. For the second feature extraction network, it is composed of a batch normalization layer, a two-by-two convolutional layer, and three feature extraction modules stacked in sequence. For the third feature extraction network, it is composed of a batch normalization layer, a two-by-two convolutional layer, and nine feature extraction modules stacked in sequence. For the fourth feature extraction module, it is composed of a batch normalization layer, a two-by-two convolutional layer, and three feature extraction modules stacked in sequence.

[0057] Further, referring to Figure 4, each feature extraction module includes a depthwise separable convolutional layer, a normalization layer, a DMG module, and a multi-layer perceptron connected in sequence. The depthwise separable convolutional layer includes four branches, namely the first depthwise separable convolution, the second depthwise separable convolution, the third depthwise separable convolution, and the identity mapping. The convolutional kernel size of the first depthwise separable convolution is n*n, the convolutional kernel size of the second depthwise separable convolution is 1*m, and the convolutional kernel size of the third depthwise separable convolution is m*1, where m is greater than n. In this embodiment, n is 3 and m is 11.

[0058] For a single feature extraction module, the module input is separated and used as the input of the first depthwise separable convolution, the second depthwise separable convolution, the third depthwise separable convolution, and the identity mapping respectively. The outputs of the first depthwise separable convolution, the second depthwise separable convolution, the third depthwise separable convolution, and the identity mapping are merged and used as the input of the normalization layer.

[0059] Among them, the first depthwise separable convolution uses a 3×3 depthwise separable convolution in the spatial dimension to perform convolution operations independently on each channel, which can effectively capture the feature interaction information within the local square region of the feature map, including finer textures in the image, structural changes in small regions, etc. And since the number of groups is equal to the number of input channels, it ensures that each channel is convolved separately, maximizing the extraction of spatial features corresponding to each channel; the second depthwise separable convolution uses a 1×11 depthwise separable convolution, which focuses on capturing the long-range feature dependencies in the horizontal direction of the feature map, including the continuation of horizontal lines in the image, the distribution characteristics of objects in the horizontal direction, etc.; the third depthwise separable convolution uses an 11×1 depthwise separable convolution, which focuses on extracting the long-range feature dependencies in the vertical direction, such as vertical textures, the arrangement characteristics of objects in the vertical direction, etc.

[0060] Combining these three depthwise separable convolution operations in different dimensions can enrich the spatial representation of features from multiple angles and provide more comprehensive spatial feature information for subsequent processing.

[0061] The identity mapping allows the input to pass through directly without any change, which helps to solve the problems of gradient vanishing and gradient explosion in deep networks, enabling the network to more easily learn the identity mapping, thus ensuring that the network will not experience performance degradation due to information transmission obstacles when deepening, and at the same time promoting the smooth flow of features and the retention of information.

[0062] The normalization layer performs batch normalization on the feature map after depthwise separable convolution. Batch normalization is performed on the input feature map according to the mean and variance statistics in the training stage, making the data distribution more suitable for subsequent convolution operations, and only the data distribution is adjusted.

[0063] In this embodiment, the feature processing steps of the DMG module include:

[0064] Performing feature extraction on the input of the DMG module through depthwise separable convolution to obtain a first local feature map; performing feature extraction on the input of the DMG module through dilated convolution to obtain a second local feature map; performing feature extraction on the input of the DMG module through global average pooling and 1×1 convolution respectively to obtain a global feature map; calculating the mean and variance of the first local feature map, the second local feature map and the global feature map respectively and concatenating them into a six-dimensional vector; processing the six-dimensional vector through a multi-layer perceptron and a softmax function respectively to obtain a 3×3 weight matrix; weighting the first local feature map, the second local feature map and the global feature map through the weight matrix to obtain a fused feature map; performing global pooling on the fused feature map along the horizontal and vertical directions respectively to generate a spatial mask; multiplying the spatial mask and the fused features point by point and adding them to the input of the DMG module through a residual connection to obtain the output of the DMG module.

[0065] As follows, with reference to Figure 5 , through an example, the DMG module proposed in this embodiment is introduced in detail.

[0066] (1) Multi-granularity feature extraction.

[0067] 1. Extract the local detail features from the input feature map X of the DMG module with size C×H×W through a 3×3 depthwise separable convolution to obtain a first local feature map F local , with the size remaining C×H×W unchanged.

[0068] Among them, the calculation formula for extracting local detail features is:

[0069] F local = DWConv 3×3 (X)

[0070] In the formula, DWConv 3×3 is the depthwise separable convolution, which is decomposed into a 3×3 per-channel convolution and a 1×1 pointwise convolution.

[0071] 2. Capture the mid-range context features F mid (the second local feature map) from the input feature map X of the DMG module with size C×H×W through a 5×5 dilated convolution (dilation = 2), and the output feature map size remains C×H×W unchanged.

[0072] Among them, the calculation formula for extracting the context features F mid is:

[0073] F mid = DilatedConv 5×5 (X)

[0074] In the formula, DilatedConv 5×5 is the dilated convolution, the dilation rate is set to 2, and the equivalent receptive field is 9×9.

[0075] 3. After performing global average pooling (GAP) on the input feature map X of the DMG module with size C×H×W, the spatial dimension is restored by 1×1 convolution expansion to generate the global feature map F global , and the size remains unchanged at C×H×W.

[0076] Among them, the calculation formula for extracting the global feature is:

[0077]

[0078] In the formula, H and W are the height and width of the input feature map X respectively, and the two colons in X :,:,i,j represent all channels, that is, all channel dimensions are retained. i and j are the spatial position coordinates, corresponding to the height and width directions respectively. X :,:,i,j represents all channel values at the position (i, j). represents the global average pooling, and the output shape is C×1×1. Conv 1×1 expands C×1×1 to C×H×W to restore the spatial dimension.

[0079] (2) Dynamic multi-granularity interaction and weight generation.

[0080] ①. For the three groups of features F local , F mid , F global , calculate the mean μ and variance σ respectively.

[0081] Among them, the calculation formulas for the mean μ and variance σ are:

[0082]

[0083] In the formula, k∈{local, mid, global} corresponds to the first local feature, the second local feature, and the global feature respectively. H and W are the height and width of the input feature map X respectively. F k (i,j) refers to all channel values at the spatial position (i, j). μ k is the channel mean of the k-th group of features, reflecting the overall intensity of the features. σ k is the channel variance of the k-th group of features, reflecting the distribution dispersion degree of the features.

[0084] 2. Concatenate the statistics into a vector [μ local ,σ local ,μ mid ,σ mid ,μglobal , σ global , input the lightweight MLP to generate the dynamic weight matrix W ∈ R 3×3 .

[0085] Among them, the calculation formula of the dynamic weight matrix W is:

[0086] W = Softmax(MLP([μ local , σ local , μ mid , σ mid , μ global , σ global ))

[0087] In the formula, the input vector is a 6-dimensional vector, including the mean and variance of three groups of features. MLP is a lightweight multi-layer perceptron that first raises the input vector to 32 dimensions, then reduces it to 9 dimensions, and then reshapes the 9-dimensional output into a 3×3 matrix. Softmax normalizes along the row direction of the weight matrix to ensure that ∑ j W i,j = 1. The weight matrix W represents the interaction relationship between features of different granularities.

[0088] 3. Weightedly fuse the three groups of features through the weight matrix to obtain the fused feature F fusion .

[0089] Among them, the calculation formula for weightedly fusing the weight matrix is:

[0090] F fusion = W 1,1 ·F local + W 1,2 ·F min + W 1,3 ·F global

[0091] In the formula, W i,j represents the interaction weight between features of different granularities, that is, the element in the i-th row and j-th column of the weight matrix W. The feature map F fusion has a size of C×H×W.

[0092] (III) Adaptive Spatial Modulation and Residual Connection.

[0093] 1. Perform global pooling on the fused feature F fusion along the horizontal direction (H) and vertical direction (W) respectively to generate the spatial mask M spatial .

[0094] Among them, the calculation formula for global pooling of features is:

[0095]

[0096] In the formula, Ffusion,x (h,j) represents F fusion The eigenvalue of the cth channel, height h, and width j in F fusion,c (i,w) indicates F fusion The feature value at the cth channel, height i, and width w. Concat is to concatenate the vertical and horizontal pooling results along the channel dimension. 7×7 Capture local spatial dependencies, pad 3 to maintain the size, and generate a feature map of size 1×H×W. σ is a Sigmoid function that compresses the output to [0, 1] as a spatial importance mask.

[0097] 2. Multiply the spatial mask and the fused feature point by point, and perform a residual connection with the original input to obtain the final output feature map Y with a size of C×H×W.

[0098] The calculation formula is:

[0099] Y=X+α·(F fusion ⊙M spatial )

[0100] Where X is the input feature map, ⊙ is the element-by-element multiplication, applying the spatial mask to the fused features. α is a learnable scaling factor, initialized to 0.5, to balance the contribution of the residual term and the original input. Y is the final output feature map, of size C×H×W.

[0101] The above is a detailed description of the DMG module proposed in this embodiment.

[0102] For the multi-layer perceptron in the feature extraction module, in this embodiment, it is composed of two convolutional layers and a ReLU function.

[0103] Specifically, the first convolutional layer uses 1×1 convolution to increase the channel dimension. This process performs more complex nonlinear combinations and mappings on the features, increases the expressive power of the features, and can mine more advanced correlations between features of different channels.

[0104] The ReLU (rectified linear unit) activation function is used to perform nonlinear activation on the features after the first convolutional layer, introducing nonlinear factors into the model. This allows the model to learn more complex feature mapping relationships and enhances the model's nonlinear fitting ability for input features.

[0105] The second convolutional layer uses 1×1 convolution again to reduce the channel dimension, which plays a role in feature integration and compression. It reorganizes and simplifies the complex features after dimensionality increase, nonlinear activation and other operations, and extracts more valuable and critical feature information for subsequent processing.

[0106] The output of the multi-layer perceptron is added to the input of the feature extraction module through a residual connection and then used as the output of the feature extraction module.

[0107] The demagnetization detection module provided in this embodiment has been described in relatively detail above. Of course, as a deep learning model, it should be trained before use.

[0108] In this embodiment, the training steps of the demagnetization detection model include:

[0109] Taking the magnetic field intensity distribution images of non-demagnetized permanent magnets and the magnetic field intensity distribution images of permanent magnets with different demagnetization degrees at different heating temperatures as sample magnetic field intensity distribution images, where different demagnetization degrees include demagnetization from 1% to 99% at intervals of 1%; training the demagnetization detection model with the sample magnetic field intensity distribution images.

[0110] Since it is difficult to customize permanent magnets with demagnetization faults, normal permanent magnets can be heated at different temperature points by a temperature-controlled ceramic sheet, and a Gaussian meter can be used to quantitatively analyze the magnetic flux density to obtain faulty permanent magnets. By this method, a large number of permanent magnets with different demagnetization degrees are obtained, and then a visualization magnetic field color display sheet is used to obtain the magnetic field intensity distribution images on the surface of the faulty permanent magnets. A sample library composed of rich samples with different demagnetization degrees is established, and this sample is used to train the demagnetization detection model.

[0111] The loss function of the demagnetization detection model is the mean squared error loss function, and the optimization algorithm of the demagnetization detection model is the AdamW optimization algorithm.

[0112] The mean squared error loss function is:

[0113]

[0114] In the formula, y i is the true value, is the predicted value of the model, and n is the number of samples.

[0115] Among them, the AdamW optimization algorithm is:

[0116]

[0117] In the formula, w t+1 is the updated parameter value (at time step t + 1), w t is the parameter value at the current time step, η is the learning rate, λ is the weight decay coefficient used to control the intensity of weight decay, ∈ is a very small number used to prevent the denominator from being zero and increase numerical stability. is the second moment estimate (the mean of the squared gradients) at time step t, is the first moment estimate (the mean of the gradients) at time step t.

[0118] As described above, the demagnetization detection method of the permanent magnet proposed by the present invention has been fully introduced through an embodiment. Among them, the demagnetization detection method uses the magnetic field intensity distribution image of the permanent magnet to judge its demagnetization state. Compared with the demagnetization detection method based on the surface image of the permanent magnet, it has higher detection accuracy and solves the problem that the current demagnetization detection method of the permanent magnet cannot accurately judge whether the permanent magnet is demagnetized. At the same time, the demagnetization detection method also uses a demagnetization detection model to identify the magnetic field intensity distribution image and provides a new specific architecture of the demagnetization detection model. Through this demagnetization detection model, high-accuracy demagnetization detection and relatively high-speed demagnetization detection can be further realized.

[0119] In a test experiment, a test set (magnetic field intensity distribution images of NdFeB permanent magnets) was used to test the demagnetization detection model in this embodiment, and the test results are shown in Table 1.

[0120] Table 1 Demagnetization detection effect of the model

[0121] Index Acc(%) Time(s) Index value 96.2 0.02

[0122] Referring to Table 1, it can be seen that the demagnetization detection accuracy of the demagnetization detection model in this embodiment is as high as 96.2%, and at the same time, the inference time for a single magnetic field intensity distribution image is 0.02 s. This shows that the demagnetization detection method of the permanent magnet provided in this embodiment has high demagnetization detection accuracy and speed.

[0123] In this embodiment, a computer is also provided, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the demagnetization detection method of the permanent magnet in this embodiment.

[0124] In this embodiment, a demagnetization detection device for a permanent magnet is also provided, which includes the computer and an image acquisition device provided in this embodiment. Specifically, the image acquisition device includes a transmission device, a camera device, and a visual magnetic field color display sheet; the transmission device provides a transmission path for the permanent magnet; the visual magnetic field color display sheet is arranged directly above the transmission path and parallel to the transmission path; the camera device is arranged directly above the visual magnetic field color display sheet and the optical center line is perpendicular to the visual magnetic field color display sheet; the computer acquires the magnetic field intensity distribution image of the permanent magnet through the camera device. The transmission device is a conveyor belt, the upper surface of the conveyor belt constitutes the transmission path, the middle part of the transmission path is a transmission pause position, and the visual magnetic field color display sheet is arranged directly above the transmission pause position; the demagnetization detection system further includes an ultrasonic sensor, and the ultrasonic sensor is arranged on the side plate of the conveyor belt and used to detect the position of the permanent magnet; the conveyor belt is configured to: according to the detection signal of the ultrasonic sensor, pause the transmission action when a permanent magnet moves to the transmission pause position.

[0125] It should be understood that the specific embodiments described herein are only used to explain this application and not to limit it. All other embodiments obtained by those of ordinary skill in the art without creative efforts according to the embodiments provided in this application fall within the protection scope of this application.

[0126] Obviously, the accompanying drawings are only some examples or embodiments of this application. For those of ordinary skill in the art, this application can also be applied to other similar situations based on these drawings without creative efforts. In addition, it can be understood that although the work done during this development process may be complex and time-consuming, for those of ordinary skill in the art, certain design, manufacturing, or production changes based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient disclosure of this application.

Claims

1. A demagnetization detection method for a permanent magnet, characterized in that: include: Acquire a magnetic field intensity distribution image of a permanent magnet to be detected; The magnetic field intensity distribution image is identified by a demagnetization detection model based on deep learning DMG-IncepNeXt, so as to predict the demagnetization state of the permanent magnet to be detected; The demagnetization detection model includes an input layer, multiple feature extraction networks and an output layer connected in sequence, and each of the feature extraction networks includes multiple feature extraction modules connected in sequence; Each of the feature extraction modules includes a sequentially connected depthwise separable convolution layer, a normalization layer, a DMG module and a multilayer perceptron, the depthwise separable convolution layer includes four branches, the four branches are a first depthwise separable convolution, a second depthwise separable convolution, a third depthwise separable convolution and an identity mapping, the convolution kernel size of the first depthwise separable convolution is n*n, the convolution kernel size of the second depthwise separable convolution is 1*m, the convolution kernel size of the third depthwise separable convolution is m*1, and m is greater than n.

2. The demagnetization detection method of a permanent magnet according to claim 1, characterized in that: The n is 3, and the m is 11.

3. The demagnetization detection method of a permanent magnet according to claim 1, characterized in that: The feature processing steps of the DMG module include: Performing feature extraction on the input of the DMG module through depthwise separable convolution to obtain a first local feature map; Performing feature extraction on the input of the DMG module through dilated convolution to obtain a second local feature map; The input of the DMG module is subjected to feature extraction by global average pooling and 1×1 convolution to obtain a global feature map; Respectively calculating the means and variances of the first local feature map, the second local feature map, and the global feature map and concatenating them into a six-dimensional vector; The six-dimensional vector is processed by a multi-layer perceptron and a softmax function to obtain a three-by-three weight matrix; Weighting the first local feature map, the second local feature map and the global feature map by the weight matrix to obtain a fused feature map; Performing global pooling on the fused feature map in the horizontal direction and the vertical direction respectively to generate a spatial mask; The spatial mask and the fusion feature are multiplied point by point and then added to the input of the DMG module through a residual connection to obtain the output of the DMG module.

4. The demagnetization detection method of a permanent magnet according to claim 1, characterized in that: There are four feature extraction networks, and the numbers of the feature extraction modules in the four feature extraction networks are three, three, nine and three respectively according to the connection order.

5. The demagnetization detection method of a permanent magnet according to claim 1, characterized in that: The input layer includes a convolutional layer and a batch normalization layer connected in sequence, and the output layer includes a first linear layer, a ReLU activation function, a layer normalization layer, and a second linear layer connected in sequence.

6. The demagnetization detection method of a permanent magnet according to claim 1, characterized in that: The training steps of the demagnetization detection model include: Using the magnetic field intensity distribution image of the permanent magnet without demagnetization and the magnetic field intensity distribution images of the permanent magnet with different demagnetization degrees at different heating temperatures as the sample magnetic field intensity distribution image, wherein the different demagnetization degrees include demagnetization 1% to demagnetization 99% with an interval of 1%; The demagnetization detection model is trained using the sample magnetic field intensity distribution image.

7. The demagnetization detection method of a permanent magnet according to claim 6, characterized in that: The loss function of the demagnetization detection model is a mean square error loss function, and the optimization algorithm of the demagnetization detection model is an AdamW optimization algorithm.

8. A computer, comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the demagnetization detection method for a permanent magnet according to any one of claims 1 to 7.

9. A demagnetization detection device for a permanent magnet, characterized in that: It comprises an image acquisition device and the computer as claimed in claim 8, wherein the image acquisition device comprises a transmission device, a camera device and a visual magnetic field color display sheet; The transmission device provides a transmission path for transmitting the permanent magnet; The visualized magnetic field color display sheet is arranged directly above the transmission path and parallel to the transmission path; The camera device is arranged directly above the visualized magnetic field color display sheet and the optical center line is perpendicular to the visualized magnetic field color display sheet; The computer obtains the magnetic field intensity distribution image of the permanent magnet through the imaging device.

10. The demagnetization detection device for a permanent magnet according to claim 9, characterized in that: The transmission device includes a transmission belt and an ultrasonic sensor, the upper surface of the transmission belt constitutes the transmission path, the middle of the transmission path is a transmission pause position, the visual magnetic field color display sheet is arranged just above the transmission pause position, and the ultrasonic sensor is arranged on the side plate of the transmission belt and is used to detect the position of the permanent magnet; The conveyor belt is configured to pause the transmission action when the permanent magnet moves to the transmission pause position according to the detection signal of the ultrasonic sensor.

Citation Information

Patent Citations

  • Landslide identification method and device based on satellite data UNet network model

    CN115131684A

  • Small target detection method based on selectable convolution kernel network and weighted bidirectional feature pyramid

    CN116051953A

  • Aeroengine bearing fault diagnosis method based on STFT-IncepNext

    JP7628356B1

Cited By

  • System and method for detecting magnetization state of hard magnetic material

    CN122085192A

  • A system and method for detecting the magnetization state of hard magnetic materials

    CN122085192B