State recognition method and device for anti-tripping relay and storage medium
By collecting and processing image data of anti-hop relays, using a generative adversarial network or support vector machine for binary classification, the status of anti-hop relays is automatically identified, which solves the problems of high labor costs and time-consuming in the existing methods, and achieves efficient state recognition.
Patent Information
- Application Number
- CN202411862189.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-04-11
AI Technical Summary
When performing anti-hop tests in a substation, the existing method requires two staff members, one operating indoors in the relay room and the other to check the status of the anti-hop relay outdoors, resulting in high labor costs, long time and low efficiency.
By collecting image data of the anti-hop relay, performing preprocessing, the original image features are extracted from the image data, and binary classification is performed using a generative adversarial network or a support vector machine to automatically identify the status of the anti-hop relay.
The automatic identification of the status of the anti-hop relay is realized, which reduces labor costs, shortens time consumption, and improves the identification efficiency, thereby improving the efficiency of the anti-hop test.
Smart Images

Figure CN119810743A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electric power technology, and in particular to a state identification method, a device and a storage medium for an anti-tripping relay. Background Art
[0002] With the rapid development of power systems, the automation level of substations is constantly improving, and the requirements for power supply reliability are getting higher and higher. In the operation and maintenance process of substations, anti-tripping test is one of the links to ensure the safe operation of circuit breakers.
[0003] At present, when conducting anti-tripping tests in substations, one staff member operates in the relay protection room, and the other staff member goes to the outdoor site to check whether the anti-tripping relay in the circuit breaker mechanism box is in the energized state. This mode not only has high labor costs, but also takes a long time, resulting in low efficiency. Summary of the invention
[0004] In view of this, the present invention provides a state identification method, device and storage medium of an anti-tripping relay, so as to improve the efficiency of identifying the state of an anti-tripping relay.
[0005] A first aspect of the present invention provides a state identification method of an anti-tripping relay, comprising:
[0006] Collect image data for anti-trip relay;
[0007] Preprocessing the image data;
[0008] If the preprocessing is completed, then in the process of determining the authenticity of the image data, the original image features are extracted from the image data;
[0009] The anti-trip relay is classified into two categories according to the original image features to obtain the state of the anti-trip relay.
[0010] Optionally, the preprocessing the image data includes:
[0011] The image data is grayed using the following formula:
[0012] Gray=w R ·R+w G ·G+w B ·B
[0013] Where Gray is the grayscale value of the pixel in the image data after grayscale conversion, R, G, and B are the values of the pixel in the image data in the red channel, green channel, and blue channel, respectively, and w R , w G , w B All are weights.
[0014] Optionally, the preprocessing the image data includes:
[0015] The image data is normalized using the following formula:
[0016]
[0017] Among them, Norm is the normalized pixel value of the pixel in the image data, Pixel is the pixel value of the pixel in the image data, Min and Max are the minimum value and maximum value of each pixel in the image data respectively.
[0018] Optionally, the preprocessing the image data includes:
[0019] The image data is contrast enhanced using the following formula:
[0020]
[0021] Among them, s k is the pixel value of the image data after contrast enhancement, n j is the number of pixels whose pixel value is the jth specified value, and n is the number of all pixels in the image data.
[0022] Optionally, in the process of determining the authenticity of the image data, extracting original image features from the image data includes:
[0023] Determine a generative adversarial network; the generative adversarial network has a generator and a discriminator, the generator is used to generate image data of the anti-trip relay; the discriminator is used to determine the authenticity of the image data;
[0024] The image data is input into the discriminator to output raw image features at an intermediate layer.
[0025] Optionally, determining a generative adversarial network includes:
[0026] Inputting random noise into the generator to generate image data of the anti-trip relay;
[0027] Inputting real or forged image data into the discriminator to generate a probability that the image data is real;
[0028] Generating a first loss value for the discriminator and a second loss value for the generator respectively according to the probability;
[0029] updating the discriminator according to the first loss value, and updating the generator according to the second loss value;
[0030] Wherein, the first loss value is:
[0031]
[0032] The second loss value is:
[0033]
[0034] Among them, L D is the first loss value, L G is the second loss value, is the expectation, x~p data (x) represents the image data x, z~p sampled from the true distribution z (z) represents the noise signal z sampled from the noise distribution, D(x) is the probability of the discriminator outputting the real image data, G(z) is the image data forged by the generator, and D(G(z)) is the probability of the discriminator outputting the forged image data.
[0035] Optionally, the binary classification of the anti-trip relay according to the original image feature to obtain the state of the anti-trip relay includes:
[0036] Determine a support vector machine; the support vector machine has a kernel function and a decision function;
[0037] Using the kernel function to nonlinearly map the original image features to target image features;
[0038] The target image feature is input into the decision function for binary classification to obtain the state of the anti-trip relay.
[0039] Optionally, the kernel function is:
[0040]
[0041] Wherein, k is the target image feature, xc is the center of the kernel function, σ is the width parameter of the kernel function, ||xy-xc|| is the distance between the original image feature xy and the center of the kernel function, and exp is the natural exponential function;
[0042] The decision function is:
[0043] f(x)=sign(w·x+b)
[0044] Wherein, x is the target image feature, w is the weight, b is the bias, sign is the sign function, if f(x)=1, the state of the anti-trip relay is energized, if f(x)=-1, the state of the anti-trip relay is not energized.
[0045] A second aspect of the present invention provides a state identification device for an anti-tripping relay, comprising:
[0046] An image data acquisition module is used to collect image data of the anti-trip relay;
[0047] A preprocessing module, used for preprocessing the image data;
[0048] An original image feature extraction module, for extracting original image features from the image data in the process of determining the authenticity of the image data if the preprocessing is completed;
[0049] The state recognition module is used to perform binary classification on the anti-tripping relay according to the original image features to obtain the state of the anti-tripping relay.
[0050] Optionally, the preprocessing module includes:
[0051] The grayscale module is used to grayscale the image data using the following formula:
[0052] Gray=w R ·R+w G ·G+w B ·B
[0053] Where Gray is the grayscale value of the pixel in the image data after grayscale conversion, R, G, and B are the values of the pixel in the image data in the red channel, green channel, and blue channel, respectively, and w R , w G , w B All are weights.
[0054] Optionally, the preprocessing module includes:
[0055] The normalization module is used to normalize the image data using the following formula:
[0056]
[0057] Among them, Norm is the normalized pixel value of the pixel in the image data, Pixel is the pixel value of the pixel in the image data, Min and Max are the minimum value and maximum value of each pixel in the image data respectively.
[0058] Optionally, the preprocessing module includes:
[0059] The contrast enhancement module is used to enhance the contrast of the image data using the following formula:
[0060]
[0061] Among them, sk is the pixel value of the image data after contrast enhancement, n j is the number of pixels whose pixel value is the jth specified value, and n is the number of all pixels in the image data.
[0062] Optionally, the original image feature extraction module includes:
[0063] A generative adversarial network determination module is used to determine a generative adversarial network; the generative adversarial network has a generator and a discriminator, the generator is used to generate image data of the anti-trip relay; the discriminator is used to determine the authenticity of the image data;
[0064] The intermediate layer feature output module is used to input the image data into the discriminator to output the original image features at the intermediate layer.
[0065] Optionally, the generative adversarial network determination module includes:
[0066] An image data generating module, used for inputting random noise into the generator to generate image data of the anti-trip relay;
[0067] A probability calculation module, used for inputting real or forged image data into the discriminator to generate a probability that the image data is real;
[0068] A loss value calculation module, used to generate a first loss value for the discriminator and a second loss value for the generator according to the probability;
[0069] A network updating module, configured to update the discriminator according to the first loss value and update the generator according to the second loss value;
[0070] Wherein, the first loss value is:
[0071]
[0072] The second loss value is:
[0073]
[0074] Among them, L D is the first loss value, L G is the second loss value, is the expectation, x~p data (x) represents the image data x, z~p sampled from the true distribution z(z) represents the noise signal z sampled from the noise distribution, D(x) is the probability of the discriminator outputting the real image data, G(z) is the image data forged by the generator, and D(G(z)) is the probability of the discriminator outputting the forged image data.
[0075] Optionally, the state identification module includes:
[0076] A support vector machine determination module, used to determine a support vector machine; the support vector machine has a kernel function and a decision function;
[0077] A target image feature mapping module, used to nonlinearly map the original image features to target image features using the kernel function;
[0078] The classification decision module is used to input the target image features into the decision function for binary classification to obtain the state of the anti-trip relay.
[0079] In one embodiment of the present invention, the kernel function is:
[0080]
[0081] Wherein, k is the target image feature, xc is the center of the kernel function, σ is the width parameter of the kernel function, ||xy-xc|| is the distance between the original image feature xy and the center of the kernel function, and exp is the natural exponential function;
[0082] The decision function is:
[0083] f(x)=sign(w·x+b)
[0084] Wherein, x is the target image feature, w is the weight, b is the bias, sign is the sign function, if f(x)=1, the state of the anti-trip relay is energized, if f(x)=-1, the state of the anti-trip relay is not energized.
[0085] A third aspect of the present invention provides an electronic device, the electronic device comprising:
[0086] at least one processor; and
[0087] a memory communicatively connected to the at least one processor; wherein,
[0088] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the state identification method of the anti-tripping relay as described in the first aspect above.
[0089] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the state identification method of the anti-tripping relay as described in the first aspect above.
[0090] A fifth aspect of the present invention provides a computer program product, the computer program product comprising a computer program, and when the computer program is executed by a processor, the state identification method of the anti-tripping relay as described in the first aspect above is implemented.
[0091] In this embodiment, image data of the anti-trip relay is collected; the image data is preprocessed; if the preprocessing is completed, in the process of distinguishing the authenticity of the image data, the original image features are extracted from the image data; the anti-trip relay is classified into two categories based on the original image features to obtain the state of the anti-trip relay. This embodiment classifies the anti-trip relay into two categories based on the image features for distinguishing the authenticity, which can ensure the accuracy of identifying the state of the anti-trip relay, realize automatic identification of the state of the anti-trip relay, effectively reduce the labor cost, and shorten the time consumption, thereby improving the efficiency of identifying the state of the anti-trip relay, thereby improving the efficiency of the anti-trip test.
[0092] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0093] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0094] Figure 1 This is a flow chart of a state identification method of an anti-tripping relay provided in Embodiment 1 of the present invention.
[0095] Figure 2 It is a structural schematic diagram of a state identification device for an anti-tripping relay provided in Embodiment 2 of the present invention.
[0096] Figure 3 It is a structural schematic diagram of an electronic device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0097] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0098] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can cover sequential implementations other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0099] Embodiment 1
[0100] See also Figure 1 , shows a flow chart of a state identification method of an anti-tripping relay provided in the first embodiment of the present invention, the method can be executed by a state identification device of an anti-tripping relay, the state identification device of the anti-tripping relay can be implemented in the form of hardware and / or software, and the state identification device of the anti-tripping relay can be configured in an electronic device. Figure 1 As shown, the method includes:
[0101] Step 101: Collect image data of the anti-trip relay.
[0102] In scenarios such as anti-tripping tests, fixed cameras, robots (such as tracked robots, automatic flying vehicles, etc.), etc. can be used to collect image data for anti-tripping relays.
[0103] Step 102: pre-process the image data.
[0104] In this embodiment, one or more pre-processing steps may be performed on the image data according to the requirements of subsequent processing, thereby improving the quality of the image data.
[0105] In one case, when identifying the state of an anti-trip relay, the color information does not have a significant impact on the identification result. Therefore, the image data can be grayed out during preprocessing, that is, the image data is converted into a grayscale image. This can reduce the complexity of model operations (such as generative adversarial networks, support vector machines, etc.) and increase the processing speed.
[0106] Generally speaking, grayscale is achieved by weighted averaging the values of the red, green, and blue color channels in an RGB image in a certain proportion.
[0107] Specifically, the image data can be grayed out using the following formula:
[0108] Gray=w R ·R+w G ·G+w B ·B
[0109] Among them, Gray is the gray value of the pixel in the grayscale image data, R, G, B are the values of the pixel in the red channel, green channel, and blue channel in the image data respectively, and w R , w G , w B All are weights.
[0110] In another case, the image data can be normalized during preprocessing to scale the pixel values in the image data to a specific range, such as [0, 1] or [-1, 1], to improve the stability and convergence speed of model training (such as generative adversarial networks, support vector machines, etc.).
[0111] Specifically, the image data can be normalized using the following formula:
[0112]
[0113] Among them, Norm is the pixel value of the pixel in the normalized image data, Pixel is the pixel value of the pixel in the image data, Min and Max are the minimum and maximum values of each pixel in the image data, respectively.
[0114] In another case, the lighting conditions of some anti-trip relays are poor. Therefore, the contrast of the image data can be enhanced during preprocessing to highlight the outline and details of the anti-trip relays and improve the recognition accuracy of the model (such as generative adversarial network, support vector machine, etc.).
[0115] Specifically, the following formula can be used to enhance the contrast of image data:
[0116]
[0117] Among them, sk is the pixel value of the image data after contrast enhancement, n j is the number of pixels whose pixel value is the jth (j∈k) specified value, and n is the number of all pixels in the image data.
[0118] Of course, the above pre-processing is only used as an example. When implementing this embodiment, other pre-processing can be set according to actual conditions, and this embodiment does not limit this. In addition, in addition to the above pre-processing, those skilled in the art can also use other pre-processing according to actual needs, and this embodiment does not limit this either.
[0119] Step 103: If the preprocessing is completed, in the process of determining the authenticity of the image data, the original image features are extracted from the image data.
[0120] For the pre-processed image data, feature engineering can be performed on the image data to extract original image features from the image data. The original image features are features constructed in the process of determining the authenticity of the image data.
[0121] The so-called authenticity refers to determining whether the current image data is real image data or forged image data.
[0122] In one embodiment of the present invention, step 103 may include the following steps:
[0123] Step 1031: Determine a generative adversarial network.
[0124] In this embodiment, a generative adversarial network (GAN) can be constructed and trained in an offline environment. The generative adversarial network has a generator and a discriminator, wherein the generator is used to generate image data of anti-trip relay content, and the discriminator is used to determine the authenticity of the image data, that is, to judge the image.
[0125] During the training process, real image data of anti-trip relays can be collected as samples, and the samples can be used to train the generative adversarial network, so that the generator needs to continuously optimize its parameters so that the generated image data makes it difficult for the discriminator to determine the authenticity. The discriminator also continuously optimizes its parameters to make the authenticity determination more accurate.
[0126] In a specific implementation, random noise may be input into a generator to generate (forge) image data whose content is an anti-trip relay.
[0127] The real or forged image data is input into the discriminator to generate the probability that the image data is real, and the first loss value is generated for the discriminator and the second loss value is generated for the generator according to the probability.
[0128] Exemplarily, the first loss value is:
[0129]
[0130] The second loss value is:
[0131]
[0132] Among them, L D is the first loss value, L G is the second loss value, is the expectation, x~p data (x) represents the image data x, z~p sampled from the true distribution z (z) represents the noise signal z sampled from the noise distribution, D(x) is the probability of the discriminator outputting the real image data, G(z) is the image data forged by the generator, and D(G(z)) is the probability of the discriminator outputting the forged image data.
[0133] In the first loss value, Encourage the discriminator to give high probability to real image data, The discriminator is encouraged to give low probability to fake image data.
[0134] In the second loss value, the generator is encouraged to generate (forge) image data that can make the discriminator output a high probability.
[0135] The discriminator is updated according to the first loss value, and the generator is updated according to the second loss value until the discriminator and the generator are trained.
[0136] By leveraging deep learning and adversarial training mechanisms, GAN is able to grasp the complex characteristics of the anti-trip relay state and achieve highly accurate state recognition.
[0137] Moreover, GAN can effectively process image data of anti-jump relays in different backgrounds, including under conditions of lighting changes and occlusion, and shows sufficient robustness.
[0138] In addition, after training, GAN can quickly identify the state of the image data of the new anti-trip relay to meet the needs of real-time processing.
[0139] Step 1032: Input the image data into the discriminator to output the original image features in the middle layer.
[0140] When the generative adversarial network completes training, the image data of the current anti-trip relay can be input into the discriminator, and the image features can be output in the middle layer of the discriminator.
[0141] During the training of the adversarial network, the middle layer of the discriminator has already mastered the features for classifying image data. Therefore, for the image data of a specific anti-trip relay, the image features output by the middle layer of the discriminator can ensure the quality of the image features.
[0142] Step 104: perform binary classification on the anti-trip relay according to the original image features to obtain the state of the anti-trip relay.
[0143] In practical applications, machine learning or deep learning can be used to classify the anti-trip relay according to the original image features to obtain the state of the anti-trip relay, that is, whether the anti-trip relay is energized or not energized.
[0144] In one embodiment of the present invention, step 104 may include the following steps:
[0145] Step 1041: Determine a support vector machine.
[0146] In this embodiment, a support vector machine (SVM) is selected as a classifier for identifying the state of the anti-trip relay. SVM is a classification technology based on statistical learning theory, and its basic concept is to find an optimal hyperplane to maximize the distinction between samples of different categories.
[0147] In the application scenario of anti-trip relay status recognition, GAN can be used to extract the original image features of image data. Therefore, the input received by SVM is these original image features rather than the original image data. These features contain the main information of the anti-trip relay status, so that SVM can perform effective classification based on this information.
[0148] Among them, the support vector machine has a kernel function and a decision function.
[0149] A significant advantage of SVM is that it can handle nonlinear problems through kernel techniques. When dealing with the practical application of anti-trip relay state recognition, choosing a suitable kernel function can help improve the accuracy of identifying the state of the anti-trip relay. The role of the kernel function is to map the original image features to a higher-dimensional space, in which the original image features that are difficult to linearly segment may be easier to distinguish.
[0150] During the classification process, the original image features of the anti-trip relay can be input into the trained SVM, and the classification result can be obtained through the decision function. The output value of the decision function will indicate the category to which the original image features belong, thereby realizing accurate identification of the state of the anti-trip relay. By combining the original image features extracted by GAN and the efficient classification performance of SVM, the state of the anti-trip relay can be efficiently identified, providing data support for related applications.
[0151] Step 1042: Use a kernel function to nonlinearly map the original image features to target image features.
[0152] In the state recognition task of anti-trip relay, the generative adversarial network is used to extract the original image features of the anti-trip relay. These original image features are then used as the input of the support vector machine (classifier). The SVM selects a suitable kernel function to nonlinearly map the original image features to the target image features, so that the SVM is capable of handling complex nonlinear classification tasks and effectively finding the optimal decision boundary in high-dimensional space.
[0153] Exemplarily, the kernel function is:
[0154]
[0155] Among them, k is the target image feature, xc is the center of the kernel function, σ is the width parameter of the kernel function, ||xy-xc|| is the distance between the original image feature xy and the center of the kernel function, and exp is the natural exponential function, which maps the similarity measure to a value between 0 and 1 as the probability that the target image feature xy belongs to a certain category.
[0156] The kernel function is a function defined based on the Euclidean distance between any point xy in space and the center xc. It is a monotonic function of distance.
[0157] In the state recognition process of the anti-trip relay, the support vector machine uses the kernel function to map the original feature space to a higher-dimensional feature space, which helps to distinguish different target image data more easily in a linear manner in the new feature space. SVM constructs a decision function by evaluating the distance between each target image feature and the support vector. This decision function can determine which category the target image belongs to based on its features, that is, "closed" or "unclosed".
[0158] In this task, the combination of the original image features extracted by GAN and the kernel function of SVM can make full use of the rich feature information extracted by GAN and process the nonlinear relationship between the original image features through the kernel function. This combination enables the system to accurately identify the state of the anti-trip relay.
[0159] Step 1043: Input the target image features into the decision function for binary classification to obtain the state of the anti-trip relay.
[0160] For the target image features of the anti-trip relay, the state of the anti-trip relay can be judged by the decision function.
[0161] Exemplarily, the decision function is:
[0162] f(x)=sign(w·x+b)
[0163] Wherein, x is the target image feature, w is the weight, b is the bias, sign is the sign function, if f(x)=1, the state of the anti-trip relay is energized, if f(x)=-1, the state of the anti-trip relay is not energized.
[0164] In this embodiment, image data of the anti-trip relay is collected; the image data is preprocessed; if the preprocessing is completed, in the process of distinguishing the authenticity of the image data, the original image features are extracted from the image data; the anti-trip relay is classified into two categories based on the original image features to obtain the state of the anti-trip relay. This embodiment classifies the anti-trip relay into two categories based on the image features for distinguishing the authenticity, which can ensure the accuracy of identifying the state of the anti-trip relay, realize automatic identification of the state of the anti-trip relay, effectively reduce the labor cost, and shorten the time consumption, thereby improving the efficiency of identifying the state of the anti-trip relay, thereby improving the efficiency of the anti-trip test.
[0165] Embodiment 2
[0166] See also Figure 2 , shows a schematic diagram of the structure of a state identification device for an anti-trip relay provided in the second embodiment of the present invention. Figure 2 As shown, the device comprises:
[0167] An image data acquisition module 201 is used to collect image data of the anti-trip relay;
[0168] A preprocessing module 202, used for preprocessing the image data;
[0169] The original image feature extraction module 203 is used to extract the original image features from the image data in the process of determining the authenticity of the image data if the preprocessing is completed;
[0170] The state recognition module 204 is used to perform binary classification on the anti-tripping relay according to the original image features to obtain the state of the anti-tripping relay.
[0171] In one embodiment of the present invention, the preprocessing module 202 includes:
[0172] The grayscale module is used to grayscale the image data using the following formula:
[0173] Gray=w R ·R+w G ·G+w B ·B
[0174] Where Gray is the grayscale value of the pixel in the image data after grayscale conversion, R, G, and B are the values of the pixel in the image data in the red channel, green channel, and blue channel, respectively, and w R , w G , w B All are weights.
[0175] In another embodiment of the present invention, the preprocessing module 202 includes:
[0176] The normalization module is used to normalize the image data using the following formula:
[0177]
[0178] Among them, Norm is the normalized pixel value of the pixel in the image data, Pixel is the pixel value of the pixel in the image data, Min and Max are the minimum value and maximum value of each pixel in the image data respectively.
[0179] In yet another embodiment of the present invention, the preprocessing module 202 includes:
[0180] The contrast enhancement module is used to enhance the contrast of the image data using the following formula:
[0181]
[0182] Among them, s k is the pixel value of the image data after contrast enhancement, n j is the number of pixels whose pixel value is the jth specified value, and n is the number of all pixels in the image data.
[0183] In one embodiment of the present invention, the original image feature extraction module 203 includes:
[0184] A generative adversarial network determination module is used to determine a generative adversarial network; the generative adversarial network has a generator and a discriminator, the generator is used to generate image data of the anti-trip relay; the discriminator is used to determine the authenticity of the image data;
[0185] The intermediate layer feature output module is used to input the image data into the discriminator to output the original image features at the intermediate layer.
[0186] In one embodiment of the present invention, the generative adversarial network determination module includes:
[0187] An image data generating module, used for inputting random noise into the generator to generate image data of the anti-trip relay;
[0188] A probability calculation module, used for inputting real or forged image data into the discriminator to generate a probability that the image data is real;
[0189] A loss value calculation module, used to generate a first loss value for the discriminator and a second loss value for the generator according to the probability;
[0190] A network updating module, configured to update the discriminator according to the first loss value and update the generator according to the second loss value;
[0191] Wherein, the first loss value is:
[0192]
[0193] The second loss value is:
[0194]
[0195] Among them, L D is the first loss value, L G is the second loss value, is the expectation, x~p data (x) represents the image data x, z~p sampled from the true distribution z (z) represents the noise signal z sampled from the noise distribution, D(x) is the probability of the discriminator outputting the real image data, G(z) is the image data forged by the generator, and D(G(z)) is the probability of the discriminator outputting the forged image data.
[0196] In one embodiment of the present invention, the state identification module 204 includes:
[0197] A support vector machine determination module, used to determine a support vector machine; the support vector machine has a kernel function and a decision function;
[0198] A target image feature mapping module, used to nonlinearly map the original image features to target image features using the kernel function;
[0199] The classification decision module is used to input the target image features into the decision function for binary classification to obtain the state of the anti-trip relay.
[0200] In one embodiment of the present invention, the kernel function is:
[0201]
[0202] Wherein, k is the target image feature, xc is the center of the kernel function, σ is the width parameter of the kernel function, ||xy-xc|| is the distance between the original image feature xy and the center of the kernel function, and exp is the natural exponential function;
[0203] The decision function is:
[0204] f(x)=sign(w·x+b)
[0205] Wherein, x is the target image feature, w is the weight, b is the bias, sign is the sign function, if f(x)=1, the state of the anti-trip relay is energized, if f(x)=-1, the state of the anti-trip relay is not energized.
[0206] The state identification device for the anti-tripping relay provided in the embodiment of the present invention can execute the state identification method for the anti-tripping relay provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the state identification method for the anti-tripping relay.
[0207] Embodiment 3
[0208] See also Figure 3 , showing a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0209] like Figure 3 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0210] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0211] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the state recognition method of the anti-trip relay.
[0212] In some embodiments, the state identification method of the anti-trip relay can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the state identification method of the anti-trip relay described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the state identification method of the anti-trip relay in any other appropriate manner (for example, by means of firmware).
[0213] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0214] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0215] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0216] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0217] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0218] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0219] Embodiment 4
[0220] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the state identification method of the anti-tripping relay provided in any embodiment of the present invention is implemented.
[0221] In the process of implementation, the computer program product can be written in one or more programming languages or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0222] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0223] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A state identification method for an anti-tripping relay, characterized in that: include: Collect image data for anti-trip relay; Preprocessing the image data; If the preprocessing is completed, then in the process of determining the authenticity of the image data, the original image features are extracted from the image data; The anti-trip relay is classified into two categories according to the original image features to obtain the state of the anti-trip relay.
2. The method according to claim 1, characterized in that The preprocessing of the image data comprises: The image data is grayed using the following formula: Gray=w R ·R+w G ·G+w B ·B Where Gray is the grayscale value of the pixel in the image data after grayscale conversion, R, G, and B are the values of the pixel in the image data in the red channel, green channel, and blue channel, respectively, and w R , w G , w B All are weights.
3. The method according to claim 1, characterized in that The preprocessing of the image data comprises: The image data is normalized using the following formula: Among them, Norm is the normalized pixel value of the pixel in the image data, Pixel is the pixel value of the pixel in the image data, Min and Max are the minimum value and maximum value of each pixel in the image data respectively.
4. The method according to claim 1, characterized in that: The preprocessing of the image data comprises: The image data is contrast enhanced using the following formula: Among them, s k is the pixel value of the image data after contrast enhancement, n j is the number of pixels whose pixel value is the jth specified value, and n is the number of all pixels in the image data.
5. The method according to any one of claims 1 to 4, characterized in that In the process of determining the authenticity of the image data, extracting original image features from the image data includes: Determine a generative adversarial network; the generative adversarial network has a generator and a discriminator, the generator is used to generate image data of the anti-trip relay; the discriminator is used to determine the authenticity of the image data; The image data is input into the discriminator to output raw image features at an intermediate layer.
6. The method according to claim 5, characterized in that The determining of generating a confrontation network comprises: Inputting random noise into the generator to generate image data of the anti-trip relay; Inputting real or forged image data into the discriminator to generate a probability that the image data is real; Generating a first loss value for the discriminator and a second loss value for the generator respectively according to the probability; updating the discriminator according to the first loss value, and updating the generator according to the second loss value; Wherein, the first loss value is: The second loss value is: Among them, L D is the first loss value, L G is the second loss value, is the expectation, x~p data (x) represents the image data x, z~p sampled from the true distribution z (z) represents the noise signal z sampled from the noise distribution, D(x) is the probability of the discriminator outputting the real image data, G(z) is the image data forged by the generator, and D(G(z)) is the probability of the discriminator outputting the forged image data.
7. The method according to claim 5, characterized in that The step of performing binary classification on the anti-trip relay according to the original image feature to obtain the state of the anti-trip relay includes: Determine a support vector machine; the support vector machine has a kernel function and a decision function; Using the kernel function to nonlinearly map the original image features to target image features; The target image feature is input into the decision function for binary classification to obtain the state of the anti-trip relay.
8. The method according to claim 7, characterized in that The kernel function is: Wherein, k is the target image feature, xc is the center of the kernel function, σ is the width parameter of the kernel function, ||xy-xc|| is the distance between the original image feature xy and the center of the kernel function, and exp is the natural exponential function; The decision function is: f(x)=sign(w·x+b) Wherein, x is the target image feature, w is the weight, b is the bias, sign is the sign function, if f(x)=1, the state of the anti-trip relay is energized, if f(x)=-1, the state of the anti-trip relay is not energized.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the state identification method of the anti-tripping relay according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the state identification method of the anti-tripping relay according to any one of claims 1 to 8 is implemented.