Method, device and electronic equipment for identifying state of protective screen pressure plate
By using the target model to identify the status of the protective screen pressure plate in the substation, the problem that the identification results in the prior art are affected by environmental factors is solved, and a more accurate identification of the pressure plate condition is achieved.
Patent Information
- Application Number
- CN202411590686.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-08
AI Technical Summary
When the prior art recognizes the status of the protective screen plate in a substation, it is affected by environmental factors such as lighting conditions, blurred image, dust and occlusion, resulting in inaccurate identification results.
A state recognition method of protective screen pressure plate is adopted. By collecting the target image of the target protection screen, inputting it into the trained target model, the current status of multiple press plates is recognized. The target model trains the preset model through the first image and the second image. The first image is collected at the first preset time, the second image is collected at the second preset time, and the first preset is collected at the first preset time. The time is later than the second preset time. The current state and the first state of each press plate are compared to determine the changing target press plate in the target protection screen.
By inputting the protective screen images at different moments into the training target model, the feature information of the protective screen can be extracted, and the image feature information at the past moment can be compared to the detection frame of the pressure plate position change, thereby accurately identifying the protective screen pressure plate The current status improves the accuracy of the identification results.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of power engineering and computer vision, and in particular to a method, device and electronic device for identifying the state of a protective screen pressure plate. Background Art
[0002] Most of the existing methods for detecting and identifying the position of the pressure plate use traditional image processing methods to obtain the position of the pressure plate, or use deep learning methods for image detection to identify the position or state of the protective screen pressure plate. For example, collect the screen cabinet image, extract the effective color blocks, grayscale and binarization processing, morphological processing, area, size and shape analysis, identify the number of pressure plate areas, identify the state of the pressure plate, determine the pressure plate order and state identification sequence; determine the pressure plate image, match and segment it with the template image, use the SSD deep neural network model for identification, and obtain the pressure plate state.
[0003] However, the existing image detection methods still have shortcomings, as shown below: the image recognition results of the protective screen pressure plate are affected by the image quality, such as lighting conditions, image blur, etc.; the image recognition results of the protective screen pressure plate are affected by environmental factors inside the substation, such as dust, occlusion, etc., which reduce the image clarity and recognition accuracy; the YOLO series network models focus on speed and efficiency. Since its network model needs to minimize the parameters of the network, it is impossible to achieve pixel-by-pixel comparison, which reduces the accuracy of the detection results; the existing image recognition of the protective screen pressure plate does not compare the previous state of the protective screen pressure plate, which makes the model unable to learn the feature information of the same protective screen pressure plate, resulting in low accuracy of the detection results.
[0004] Regarding the problem in the related art of using image recognition technology to identify whether the status of the protective screen pressure plate in the substation has changed, the recognition result is inaccurate due to unclear reflection of the collected image and inability to compare the previous pressure plate status. No effective solution has been proposed yet. Summary of the invention
[0005] The main purpose of the present application is to provide a method, device and electronic device for identifying the status of a protective screen pressure plate, so as to solve the problem in the related art of inaccurate recognition results caused by unclear reflection of the collected image and inability to compare the previous pressure plate status when identifying whether the status of the protective screen pressure plate in the substation has changed through image recognition technology.
[0006] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for identifying the state of a protective screen pressure plate is provided, the method comprising: acquiring a target image of a target protective screen, wherein the target protective screen is deployed with multiple pressure plates, and the states of the pressure plates include: open and closed; inputting the target image into a target model, identifying the current state of each pressure plate among the multiple pressure plates, and obtaining a recognition result, wherein the target model is a model obtained by training a preset model using a first image and a second image, the first image is an image captured of the protective screen at a first preset time, the second image is an image captured of the protective screen at a second preset time, and the first preset time is later than the second preset time; comparing the current state of each pressure plate with the first state of each pressure plate, and determining the target pressure plate with changes in the target protective screen according to the comparison result, wherein the first state of the pressure plate is the pressure plate state obtained after the pressure plate was recognized by the target model last time.
[0007] Furthermore, the target model is trained by the following steps: determining the first image and the second image in an image set based on the acquisition time, wherein the image set is a set of historical images of the protection screen; inputting feature information of the first image and reference feature information of the second image into an encoder for calculation to obtain a first feature, wherein the reference feature information of the second image is feature information extracted by a preset model; calculating the first feature, the detection query feature and the reference query feature through a decoder and a feedforward network to obtain a detection box in the first image and a reference box in the second image; calculating the distance between the detection box and the real box in the first image to obtain a first loss function value, and calculating the distance between the reference box and the real box in the second image to obtain a second loss function value; iteratively training the preset model according to the first loss function value and the second loss function value to obtain the target model.
[0008] Furthermore, the decoder at least includes: a first decoder and a second decoder, and the first feature, the detection query feature and the reference query feature are calculated through the decoder and the feedforward network to obtain the detection frame corresponding to the first image and the reference frame corresponding to the second image, including: inputting the first feature and the detection query feature into the first decoder to extract the target feature; inputting the first feature and the reference query feature into the second decoder to extract the reference feature; updating the reference feature according to the target feature to obtain the updated reference feature; inputting the target feature into the feedforward network to calculate the detection frame; inputting the updated reference feature into the feedforward network to calculate the reference frame.
[0009] Further, calculating the distance between the detection frame and the real frame in the first image to obtain a first loss function value includes: calculating a first value based on the area of a first region and an area of a second region, wherein the first region refers to the intersection area of the detection frame and the real frame of the corresponding pressure plate in the first image, and the second region refers to the union area of the detection frame and the real frame of the corresponding pressure plate in the first image; calculating a second value based on the first value, the area of the second region, and the area of the third region, wherein the third region is the minimum area including the detection frame and the real frame of the corresponding pressure plate in the first image; calculating a second value based on the first value, the length of a first line segment, and the length of a second line segment, wherein the first line segment is the diagonal of the first region, the second line segment is the diagonal of the third region, and the third region is the minimum area including the detection frame and the real frame of the corresponding pressure plate in the first image; calculating the first loss function value based on the second value, the width and height of the detection frame, and the width and height of the real frame of the corresponding pressure plate in the first image.
[0010] Furthermore, the feature information of the first image and the reference feature information of the second image are input into the encoder for calculation to obtain a first feature, including: extracting a second feature of the first image through a convolutional neural network; splicing the second feature and the reference feature information to obtain a third feature; and inputting the third feature into the encoder to extract the first feature.
[0011] Furthermore, the first feature and the detection query feature are input into the first decoder to extract the target feature, including: inputting the detection query feature into a first network structure to extract a fourth feature of the first image, wherein the first network structure at least includes: a self-attention module, an addition module and a normalization module; inputting the fourth feature and the first feature into a second network structure to extract the target feature of the first image, wherein the second network structure at least includes: a cross-attention module, a feedforward network module, an addition module and a normalization module.
[0012] Furthermore, the cross-attention module at least includes: a spatial attention module and a channel attention module, inputs the fourth feature and the first feature into the second network structure, and extracts the target feature of the first image, including: inputting the fourth feature and the first feature into the channel attention module, calculating the weight of each channel, and obtaining the fifth feature, wherein the channel attention module at least includes: an average pooling layer, a maximum pooling layer, a splicing structure, a dimensionality reduction convolution layer, a fully connected layer, and an activation function layer; inputting the fifth feature into the spatial attention module, weighting different areas, and obtaining the sixth feature, wherein the spatial attention module at least includes: an average pooling layer, a maximum pooling layer, a fully connected layer, and an activation function layer; extracting the target feature of the first image from the sixth feature through the feedforward network module, the addition module, and the normalization module.
[0013] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a device for identifying the state of a protection screen pressure plate is provided, the device comprising: an acquisition unit, used to acquire target images of a target transformer target protection screen and a measurement and control screen protection screen pressure plate, wherein the target protection screen is deployed with multiple pressure plates, and the states of the pressure plates include: open and closed; an identification unit, used to input the target image into a target model, identify the current state of each pressure plate in the multiple pressure plates, and obtain an identification result, wherein the target model is a model obtained by training a preset model using a first image and a second image, the first image is an image collected from the protection screen at a first preset time, the second image is an image collected from the protection screen at a second preset time, and the first preset time is later than the second preset time; a comparison unit, used to compare the current state of each pressure plate with the first state of each pressure plate, and determine the target pressure plate with a change in the target protection screen according to the comparison result, wherein the first state of the pressure plate is the pressure plate state obtained after the pressure plate was identified by the target model last time.
[0014] Furthermore, the device also includes: a determination unit, used to determine the first image and the second image in an image set based on the acquisition time, wherein the image set is a set of historical images including the protective screen pressure plate; a first calculation unit, used to input the feature information of the first image and the reference feature information of the second image into an encoder for calculation to obtain a first feature, wherein the reference feature information of the second image is feature information extracted by a preset model; a second calculation unit, used to calculate the first feature, the detection query feature and the reference query feature through a decoder and a feedforward network to obtain a detection box in the first image and a reference box in the second image; a calculation unit, used to calculate the distance between the detection box and the real box in the first image to obtain a first loss function value, and to calculate the distance between the reference box and the real box in the second image to obtain a second loss function value; a training unit, used to iteratively train the preset model according to the first loss function value and the second loss function value to obtain the target model.
[0015] Furthermore, the decoder at least includes: a first decoder and a second decoder, and the second calculation unit includes: a first extraction subunit, used to input the first feature and the detection query feature into the first decoder to extract the target feature; a second extraction subunit, used to input the first feature and the reference query feature into the second decoder to extract the reference feature; an updating subunit, used to update the reference feature according to the target feature to obtain an updated reference feature; a first calculation subunit, used to input the target feature into the feedforward network to calculate the detection box; and a second calculation subunit, used to input the updated reference feature into the feedforward network to calculate the reference box.
[0016] Further, the calculation unit includes: a third calculation subunit, which is used to calculate a first value based on the area of a first area and an area of a second area, wherein the first area refers to the intersection area of the detection frame and the real frame of the corresponding pressure plate in the first image, and the second area refers to the union area of the detection frame and the real frame of the corresponding pressure plate in the first image; a fourth calculation subunit, which is used to calculate a second value based on the first value, the area of the second area and the area of the third area, wherein the third area is the minimum area containing the detection frame and the real frame of the corresponding pressure plate in the first image; a fifth calculation subunit, which is used to calculate the second value based on the first value, the length of a first line segment and the length of a second line segment, wherein the first line segment is the diagonal of the first area, the second line segment is the diagonal of the third area, and the third area is the minimum area containing the detection frame and the real frame of the corresponding pressure plate in the first image; a sixth calculation subunit, which is used to calculate the first loss function value based on the second value, the width and height of the detection frame, and the width and height of the real frame of the corresponding pressure plate in the first image.
[0017] Furthermore, the first computing unit includes: a third extraction subunit, used to extract the second feature of the first image through a convolutional neural network; a splicing subunit, used to splice the second feature and the reference feature information to obtain a third feature; and a fourth extraction subunit, used to input the third feature into the encoder to extract the first feature.
[0018] Furthermore, the first extraction subunit includes: a first extraction module, used to input the detection query feature into a first network structure to extract the fourth feature of the first image, wherein the first network structure includes at least: a self-attention module, an addition module and a normalization module; a second extraction module, used to input the fourth feature and the first feature into a second network structure to extract the target feature of the first image, wherein the second network structure includes at least: a cross-attention module, a feedforward network module, an addition module and a normalization module.
[0019] Furthermore, the cross-attention module at least includes: a spatial attention module and a channel attention module, and the second extraction module includes: a first calculation submodule, used to input the fourth feature and the first feature into the channel attention module, calculate the weight of each channel, and obtain the fifth feature, wherein the channel attention module at least includes: an average pooling layer, a maximum pooling layer, a splicing structure, a dimensionality reduction convolution layer, a fully connected layer, and an activation function layer; a second calculation submodule, used to input the fifth feature into the spatial attention module, weight different areas, and obtain the sixth feature, wherein the spatial attention module at least includes: an average pooling layer, a maximum pooling layer, a fully connected layer, and an activation function layer; an extraction submodule, used to extract the target feature of the first image from the sixth feature through the feedforward network module, the addition module and the normalization module.
[0020] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a computer program product is provided, including a computer program, which, when executed by a processor, implements the method for identifying the state of the protective screen pressure plate described in any one of the above-mentioned items, and which, when executed by a processor, implements the steps of the method for identifying the state of the protective screen pressure plate described in each embodiment of the present application.
[0021] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes stored computer instructions, wherein when the computer instructions are executed by a processor, a method for identifying the state of the protective screen pressure plate described in any one of the above items is implemented.
[0022] In order to achieve the above-mentioned purpose, according to one aspect of the present application, an electronic device is provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement the method for identifying the status of the protective screen pressure plate described in any one of the above-mentioned items.
[0023] Through the present application, the following steps are adopted: collecting a target image of a target protection screen, wherein the target protection screen is deployed with multiple pressure plates, and the states of the pressure plates include: open and closed; inputting the target image into a target model, identifying the current state of each pressure plate in the multiple pressure plates, and obtaining a recognition result, wherein the target model is a model obtained by training a preset model with a first image and a second image, the first image is an image collected from the protection screen at a first preset time, and the second image is an image collected from the protection screen at a second preset time, and the first preset time is later than the second preset time; comparing the current state of each pressure plate with the first state of each pressure plate, and determining the target pressure plate with changes in the target protection screen according to the comparison result, wherein the first state of the pressure plate is the pressure plate state obtained after the pressure plate was identified by the target model last time, which solves the problem in the related art that when the state of the protection screen pressure plate in the substation is identified by image recognition technology, the recognition result is inaccurate due to unclear reflection of the collected image and inability to compare the previous pressure plate state. By inputting images of the protective screen at different moments into the trained target model, the feature information of the target protective screen can be extracted through the target model, and the feature information of the target image of the target protective screen is compared with the image feature information of the target protective screen at past moments, and the pressure plate detection frame of the pressure plate position change is calculated, so as to identify the current state of the target protective screen according to the feature information in the detection frame, and then determine the target pressure plate with changes in the target protective screen, thereby improving the accuracy of identifying the protective screen pressure plate with changes. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0025] Figure 1 is a flow chart of a method for identifying the state of a protective screen pressure plate provided in Embodiment 1 of the present application;
[0026] Figure 2 The following is a schematic diagram of an optional method for identifying the state of the protective screen pressure plate provided in the first embodiment of the present application. Figure 1 ;
[0027] Figure 3 The following is a schematic diagram of an optional method for identifying the state of the protective screen pressure plate provided in the first embodiment of the present application. Figure 2 ;
[0028] Figure 4 The following is a schematic diagram of an optional method for identifying the state of the protective screen pressure plate provided in the first embodiment of the present application. Figure 3 ;
[0029] Figure 5 The following is a schematic diagram of an optional method for identifying the state of the protective screen pressure plate provided in the first embodiment of the present application. Figure 4 ;
[0030] Figure 6 is a schematic diagram of a device for identifying the state of a protective screen pressure plate provided in accordance with the second embodiment of the present application;
[0031] Figure 7 It is a schematic diagram of an electronic device for identifying the status of a protective screen pressure plate provided in Embodiment 5 of the present application. DETAILED DESCRIPTION
[0032] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0033] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application 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 interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. Example
[0035] The present application is described below in conjunction with preferred implementation steps. Figure 1 is a flow chart of a method for identifying the state of a protective screen pressure plate provided in the first embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:
[0036] Step S101 , collecting a target image of a target protection screen, wherein the target protection screen is deployed with a plurality of pressure plates, and the states of the pressure plates include: open and closed.
[0037] The method for identifying the status of the protection screen pressure plate provided in the first embodiment can be used to detect the substation power system. By collecting the target image of the target protection screen containing multiple pressure plates, the target image is input into the trained target model for identification. The current status of each pressure plate in the protection screen pressure plate can be determined, thereby determining the pressure plate in the protection screen pressure plate whose status has changed, and then effectively controlling the output voltage of the protection screen, ensuring the stable operation of the power system and meeting different load requirements.
[0038] It should be noted that the protection screen in the substation can also be called the measurement and control screen. The schematic diagram of the protection screen and the pressure plate in the substation can be as follows: Figure 2 The protective screen is used to monitor and control the working status of electrical equipment, so as to ensure the normal operation of electrical equipment and prevent electrical equipment from being damaged due to overload, short circuit, etc.
[0039] In the first embodiment, in order to identify the current state of each pressure plate in the protective screen, a target image of the target protective screen containing multiple pressure plates can be acquired through an image acquisition device, and feature information in the target image can be extracted through a deep learning model, so that calculation and recognition can be performed based on the feature information extracted from the target image, thereby determining the current state information of each pressure plate in the target protective screen.
[0040] Step S102, input the target image into the target model, identify the current state of each pressure plate in the multiple pressure plates, and obtain a recognition result, wherein the target model is obtained by training a preset model with a first image and a second image, the first image is an image captured of the protective screen at a first preset moment, and the second image is an image captured of the protective screen at a second preset moment, and the first preset moment is later than the second preset moment.
[0041] In the first embodiment, in order to improve the accuracy of the recognition result of the state of the protection screen pressure plate, the collected target image can be input into the trained target model, and the current state of the protection screen pressure plate, that is, open or closed, can be recognized through the target model. The current image of the target protection screen (that is, the first image mentioned above) and the image of the target protection screen at a past time (that is, the second image mentioned above) are input into the preset model to recognize the state of the target protection screen pressure plate.
[0042] Step S103, compare the current state of each pressure plate with the first state of each pressure plate, and determine the target pressure plate with changes in the target protection screen based on the comparison result, wherein the first state of the pressure plate is the pressure plate state obtained after the pressure plate was identified by the target model last time.
[0043] In the first embodiment, in order to determine the pressure plate whose state has changed in the target protection screen, it is necessary to obtain the first state of each pressure plate in the target protection screen at a past moment, and then compare the current state of each pressure plate in the target protection screen with the first state of each pressure plate to determine the target pressure plate whose state has changed in the target protection screen, and then determine the state of the power equipment based on the target pressure plate whose state has changed in the target protection screen.
[0044] In summary, the method for identifying the state of the protective screen pressure plate provided in the first embodiment of the present application collects the target image of the target protective screen, wherein the target protective screen is deployed with multiple pressure plates, and the states of the pressure plates include: open and closed; inputs the target image into the target model, identifies the current state of each pressure plate in the multiple pressure plates, and obtains the recognition result, wherein the target model is a model obtained by training a preset model with a first image and a second image, the first image is an image collected for the protective screen at a first preset time, and the second image is an image collected for the protective screen at a second preset time, and the first preset time is later than the second preset time; compares the current state of each pressure plate with the first state of each pressure plate, and determines the target pressure plate that has changed in the target protective screen according to the comparison result, wherein the first state of the pressure plate is the pressure plate state obtained after the pressure plate is identified by the target model last time, which solves the problem in the related art that when the state of the protective screen pressure plate in the substation is identified by image recognition technology, the recognition result is inaccurate due to unclear reflection of the collected image and inability to compare the previous pressure plate state. By inputting images of the protective screen at different moments into the trained target model, the feature information of the target protective screen can be extracted through the target model, and the feature information of the target image of the target protective screen is compared with the image feature information of the target protective screen at past moments, and the pressure plate detection frame of the pressure plate position change is calculated, so as to identify the current state of the target protective screen according to the feature information in the detection frame, and then determine the target pressure plate with changes in the target protective screen, thereby achieving the effect of improving the accuracy of identifying the protective screen pressure plate with changes.
[0045] Optionally, in the method for identifying the state of the protective screen pressure plate provided in Example 1 of the present application, the above-mentioned target model is trained by the following steps: determining a first image and a second image in an image set based on the acquisition time, wherein the image set is a set of historical images of the protective screen; inputting feature information of the first image and reference feature information of the second image into an encoder for calculation to obtain a first feature, wherein the reference feature information of the second image is feature information extracted by a preset model; calculating the first feature, the detection query feature and the reference query feature through a decoder and a feedforward network to obtain a detection box in the first image and a reference box in the second image; calculating the distance between the detection box and the real box in the first image to obtain a first loss function value, and calculating the distance between the reference box and the real box in the second image to obtain a second loss function value; iteratively training the preset model according to the first loss function value and the second loss function value to obtain a target model.
[0046] In the first embodiment, in order to train the target model, historical images of different protection screens containing multiple pressure plates at different times in the substation can be collected to obtain the above-mentioned image set. For example, images of the protection screen are collected every one week (preset time interval, or other time intervals, which are not specifically limited in the first embodiment), and the above-mentioned first image can be an image of the first protection screen collected at 9:00 last Monday, and the above-mentioned second image is an image of the first protection screen collected at 10:00 this Wednesday.
[0047] In an optional embodiment, the network structure of the preset model can be as follows Figure 3 As shown. Through the convolutional neural network in the preset model (such as Figure 3 The feature information of the first image is extracted by using a CNN in the preset model, and the feature information of the first image and the reference feature information of the second image are input into the encoder for calculation to obtain common feature information, i.e., the first feature mentioned above, wherein the reference feature information of the second image is feature information extracted by the convolutional neural network in the preset model by inputting the second image and the third image into the preset model, the protection screen in the third image is the same as the protection screen in the second image, and the acquisition time of the third image is earlier than that of the second image.
[0048] Then, the first feature, the detection query feature and the reference query feature are input into the decoder and the feedforward network for calculation, and the detection frame of each platen in the first image, the reference frame of each platen in the second image, the state of each platen in the first image and the state of each platen in the second image are obtained. The loss function value of the detection frame of the current platen (i.e., the first loss value mentioned above) is calculated based on the detection frame of each platen in the first image and the real frame of each platen in the first image, and the loss function value of the reference frame of the platen at the past moment (i.e., the second loss value mentioned above) is calculated based on the detection frame of each platen in the second image and the real frame of each platen in the second image, and the preset model is iteratively trained based on the first loss function value and the second loss function value, and the model parameters of the target model are continuously optimized to obtain the target model. It should be noted that the above preset model can be a transformer model.
[0049] By comparing the feature information of the images of the same protective screen pressure plate at different times, the front and rear position changes of the protective screen pressure plate can be compared, and the detection frame where the pressure plate is located can be calculated more accurately, so as to identify the current state of each pressure plate in the target protective screen according to the feature information in the detection frame, thereby achieving the effect of improving the accuracy of identifying the state of the protective screen pressure plate.
[0050] Optionally, in the method for identifying the state of the protective screen pressure plate provided in Example 1 of the present application, the above-mentioned decoder includes at least: a first decoder and a second decoder, and the first feature, the detection query feature and the reference query feature are calculated by the decoder and the feedforward network to obtain a detection frame in the first image and a reference frame in the second image, including: inputting the first feature and the detection query feature into the first decoder to extract the target feature; inputting the first feature and the reference query feature into the second decoder to extract the reference feature; updating the reference feature according to the target feature to obtain an updated reference feature; inputting the target feature into the feedforward network to calculate the detection frame; inputting the updated reference feature into the feedforward network to calculate the reference frame.
[0051] In the first embodiment, the above-mentioned preset model is a model constructed based on Transformer, and the preset model includes a dual decoder, namely the above-mentioned first decoder and the second decoder.
[0052] The first decoder can be used as a detection branch. The detection query feature is a specific random number sequence, which is used as the initial input of the first decoder. The first feature is combined with the above-mentioned first feature as the total input of the first decoder. The target feature is calculated by the first decoder, and the target feature is input into the feedforward network to generate the above-mentioned detection frame. The detection query feature corresponding to the first image is a fixed random number sequence, and the maximum number of detectable pressure plates in the detection image can be set to 100.
[0053] The second decoder can be used as a reference branch, using the reference query feature and the above-mentioned first feature to generate a reference feature, using the target feature to update the reference feature that meets the conditions, and inputting the updated reference feature into the feedforward network to obtain the above-mentioned reference frame, wherein the reference query feature is another set of specific random number sequences, and the reference query feature is used as the initial input of the second decoder, combined with the above-mentioned first feature as the total input of the second decoder, and the above-mentioned reference frame is obtained after the second decoder, and the maximum number of detectable pressure plates in the reference image can be set to 100. It should be noted that after determining the target feature, the reference feature needs to be updated according to the target feature. For example, when the fourth image of the protective screen in the first image is acquired next time, when the fourth image is used to detect the state of each pressure plate in the protective screen, the target feature of the first image is used as a reference feature to assist in identifying the state of each pressure plate of the protective screen in the fourth image.
[0054] In an optional embodiment, the preset model is a model structure based on an encoder and a decoder, and both the encoder and the decoder are composed of a stacked multi-head attention network, a feedforward network and other structures. When the input image of the first decoder is the same as the input image of the encoder, a self-attention structure is formed. If the input image of the first decoder is different from the input image of the encoder, a cross-attention structure is formed. The input of the encoder takes the combined features of the two states of the same protective screen pressure plate before and after (that is, the first feature mentioned above) as input, and the feature information extracted from the current image will be saved and used for the next time. The features generated by the encoder are used as the common feature information of the two decoders, and the first decoder and the second decoder are used for pressure plate detection and pressure plate reference transmission respectively. The decoder uses the above-mentioned first image as the input key to obtain the detection frame; the other decoder uses the second image of the protective screen pressure plate as input to obtain the reference frame of the pressure plate in the second image, and compares the corresponding position in the first image according to the position of the reference frame to determine the detection result of the pressure plate state.
[0055] Optionally, in the method for identifying the state of the protective screen pressure plate provided in the first embodiment of the present application, the distance between the detection frame and the real frame in the first image is calculated to obtain a first loss function value, including: calculating a first value based on the area of a first region and an area of a second region, wherein the first region refers to the intersection area of the detection frame and the real frame of the corresponding pressure plate in the first image, and the second region refers to the union area of the detection frame and the real frame of the corresponding pressure plate in the first image; calculating a second value based on the first value, the area of the second region and the area of the third region, wherein the third region is the minimum area including the detection frame and the real frame of the corresponding pressure plate in the first image; calculating the second value based on the first value, the length of a first line segment and the length of a second line segment, wherein the first line segment is the diagonal of the first region, the second line segment is the diagonal of the third region, and the third region is the minimum area including the detection frame and the real frame of the corresponding pressure plate in the first image; calculating the first loss function value based on the second value, the width and height of the detection frame, and the width and height of the real frame of the corresponding pressure plate in the first image.
[0056] In the prior art, the bounding box regression performance is determined by the intersection over union (IoU) distance between the bounding box of the current frame object and the bounding box of the previous frame object. The calculation formula can be shown in Formula 1. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0057] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0058] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application 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 interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. Example
[0059] The present application is described below in conjunction with preferred implementation steps. Figure 1 is a flow chart of a method for identifying the state of a protective screen pressure plate provided in the first embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:
[0060] Step S101 , collecting a target image of a target protection screen, wherein the target protection screen is deployed with a plurality of pressure plates, and the states of the pressure plates include: open and closed.
[0061] The method for identifying the status of the protection screen pressure plate provided in the first embodiment can be used to detect the substation power system. By collecting the target image of the target protection screen containing multiple pressure plates, the target image is input into the trained target model for identification. The current status of each pressure plate in the protection screen pressure plate can be determined, thereby determining the pressure plate in the protection screen pressure plate whose status has changed, and then effectively controlling the output voltage of the protection screen, ensuring the stable operation of the power system and meeting different load requirements.
[0062] It should be noted that the protection screen in the substation can also be called the measurement and control screen. The schematic diagram of the protection screen and the pressure plate in the substation can be as follows: Figure 2 The protective screen is used to monitor and control the working status of electrical equipment, so as to ensure the normal operation of electrical equipment and prevent electrical equipment from being damaged due to overload, short circuit, etc.
[0063] In the first embodiment, in order to identify the current state of each pressure plate in the protective screen, a target image of the target protective screen containing multiple pressure plates can be acquired through an image acquisition device, and feature information in the target image can be extracted through a deep learning model, so that calculation and recognition can be performed based on the feature information extracted from the target image, thereby determining the current state information of each pressure plate in the target protective screen.
[0064] Step S102, input the target image into the target model, identify the current state of each pressure plate in the multiple pressure plates, and obtain a recognition result, wherein the target model is obtained by training a preset model with a first image and a second image, the first image is an image captured of the protective screen at a first preset moment, and the second image is an image captured of the protective screen at a second preset moment, and the first preset moment is later than the second preset moment.
[0065] In the first embodiment, in order to improve the accuracy of the recognition result of the state of the protection screen pressure plate, the collected target image can be input into the trained target model, and the current state of the protection screen pressure plate, that is, open or closed, can be recognized through the target model. The current image of the target protection screen (that is, the first image mentioned above) and the image of the target protection screen at a past time (that is, the second image mentioned above) are input into the preset model to recognize the state of the target protection screen pressure plate.
[0066] Step S103, compare the current state of each pressure plate with the first state of each pressure plate, and determine the target pressure plate with changes in the target protection screen based on the comparison result, wherein the first state of the pressure plate is the pressure plate state obtained after the pressure plate was identified by the target model last time.
[0067] In the first embodiment, in order to determine the pressure plate whose state has changed in the target protection screen, it is necessary to obtain the first state of each pressure plate in the target protection screen at a past moment, and then compare the current state of each pressure plate in the target protection screen with the first state of each pressure plate to determine the target pressure plate whose state has changed in the target protection screen, and then determine the state of the power equipment based on the target pressure plate whose state has changed in the target protection screen.
[0068] In summary, the method for identifying the state of the protective screen pressure plate provided in the first embodiment of the present application collects the target image of the target protective screen, wherein the target protective screen is deployed with multiple pressure plates, and the states of the pressure plates include: open and closed; inputs the target image into the target model, identifies the current state of each pressure plate in the multiple pressure plates, and obtains the recognition result, wherein the target model is a model obtained by training a preset model with a first image and a second image, the first image is an image collected for the protective screen at a first preset time, and the second image is an image collected for the protective screen at a second preset time, and the first preset time is later than the second preset time; compares the current state of each pressure plate with the first state of each pressure plate, and determines the target pressure plate that has changed in the target protective screen according to the comparison result, wherein the first state of the pressure plate is the pressure plate state obtained after the pressure plate is identified by the target model last time, which solves the problem in the related art that when the state of the protective screen pressure plate in the substation is identified by image recognition technology, the recognition result is inaccurate due to unclear reflection of the collected image and inability to compare the previous pressure plate state. By inputting images of the protective screen at different moments into the trained target model, the feature information of the target protective screen can be extracted through the target model, and the feature information of the target image of the target protective screen is compared with the image feature information of the target protective screen at past moments, and the pressure plate detection frame of the pressure plate position change is calculated, so as to identify the current state of the target protective screen according to the feature information in the detection frame, and then determine the target pressure plate with changes in the target protective screen, thereby achieving the effect of improving the accuracy of identifying the protective screen pressure plate with changes.
[0069] Optionally, in the method for identifying the state of the protective screen pressure plate provided in Example 1 of the present application, the above-mentioned target model is trained by the following steps: determining a first image and a second image in an image set based on the acquisition time, wherein the image set is a set of historical images of the protective screen; inputting feature information of the first image and reference feature information of the second image into an encoder for calculation to obtain a first feature, wherein the reference feature information of the second image is feature information extracted by a preset model; calculating the first feature, the detection query feature and the reference query feature through a decoder and a feedforward network to obtain a detection box in the first image and a reference box in the second image; calculating the distance between the detection box and the real box in the first image to obtain a first loss function value, and calculating the distance between the reference box and the real box in the second image to obtain a second loss function value; iteratively training the preset model according to the first loss function value and the second loss function value to obtain a target model.
[0070] In the first embodiment, in order to train the target model, historical images of different protection screens containing multiple pressure plates at different times in the substation can be collected to obtain the above-mentioned image set. For example, images of the protection screen are collected every one week (preset time interval, or other time intervals, which are not specifically limited in the first embodiment), and the above-mentioned first image can be an image of the first protection screen collected at 9:00 last Monday, and the above-mentioned second image is an image of the first protection screen collected at 10:00 this Wednesday.
[0071] In an optional embodiment, the network structure of the preset model can be as follows Figure 3 As shown. Through the convolutional neural network in the preset model (such as Figure 3 The feature information of the first image is extracted by using a CNN in the preset model, and the feature information of the first image and the reference feature information of the second image are input into the encoder for calculation to obtain common feature information, i.e., the first feature mentioned above, wherein the reference feature information of the second image is feature information extracted by the convolutional neural network in the preset model by inputting the second image and the third image into the preset model, the protection screen in the third image is the same as the protection screen in the second image, and the acquisition time of the third image is earlier than that of the second image.
[0072] Then, the first feature, the detection query feature and the reference query feature are input into the decoder and the feedforward network for calculation, and the detection frame of each platen in the first image, the reference frame of each platen in the second image, the state of each platen in the first image and the state of each platen in the second image are obtained. The loss function value of the detection frame of the current platen (i.e., the first loss value mentioned above) is calculated based on the detection frame of each platen in the first image and the real frame of each platen in the first image, and the loss function value of the reference frame of the platen at the past moment (i.e., the second loss value mentioned above) is calculated based on the detection frame of each platen in the second image and the real frame of each platen in the second image, and the preset model is iteratively trained based on the first loss function value and the second loss function value, and the model parameters of the target model are continuously optimized to obtain the target model. It should be noted that the above preset model can be a transformer model.
[0073] By comparing the feature information of the images of the same protective screen pressure plate at different times, the front and rear position changes of the protective screen pressure plate can be compared, and the detection frame where the pressure plate is located can be calculated more accurately, so as to identify the current state of each pressure plate in the target protective screen according to the feature information in the detection frame, thereby achieving the effect of improving the accuracy of identifying the state of the protective screen pressure plate.
[0074] Optionally, in the method for identifying the state of the protective screen pressure plate provided in Example 1 of the present application, the above-mentioned decoder includes at least: a first decoder and a second decoder, and the first feature, the detection query feature and the reference query feature are calculated by the decoder and the feedforward network to obtain a detection frame in the first image and a reference frame in the second image, including: inputting the first feature and the detection query feature into the first decoder to extract the target feature; inputting the first feature and the reference query feature into the second decoder to extract the reference feature; updating the reference feature according to the target feature to obtain an updated reference feature; inputting the target feature into the feedforward network to calculate the detection frame; inputting the updated reference feature into the feedforward network to calculate the reference frame.
[0075] In the first embodiment, the above-mentioned preset model is a model constructed based on Transformer, and the preset model includes a dual decoder, namely the above-mentioned first decoder and the second decoder.
[0076] The first decoder can be used as a detection branch. The detection query feature is a specific random number sequence, which is used as the initial input of the first decoder. The first feature is combined with the above-mentioned first feature as the total input of the first decoder. The target feature is calculated by the first decoder, and the target feature is input into the feedforward network to generate the above-mentioned detection frame. The detection query feature corresponding to the first image is a fixed random number sequence, and the maximum number of detectable pressure plates in the detection image can be set to 100.
[0077] The second decoder can be used as a reference branch, using the reference query feature and the above-mentioned first feature to generate a reference feature, using the target feature to update the reference feature that meets the conditions, and inputting the updated reference feature into the feedforward network to obtain the above-mentioned reference frame, wherein the reference query feature is another set of specific random number sequences, and the reference query feature is used as the initial input of the second decoder, combined with the above-mentioned first feature as the total input of the second decoder, and the above-mentioned reference frame is obtained after the second decoder, and the maximum number of detectable pressure plates in the reference image can be set to 100. It should be noted that after determining the target feature, the reference feature needs to be updated according to the target feature. For example, when the fourth image of the protective screen in the first image is acquired next time, when the fourth image is used to detect the state of each pressure plate in the protective screen, the target feature of the first image is used as a reference feature to assist in identifying the state of each pressure plate of the protective screen in the fourth image.
[0078] In an optional embodiment, the preset model is a model structure based on an encoder and a decoder, and both the encoder and the decoder are composed of a stacked multi-head attention network, a feedforward network and other structures. When the input image of the first decoder is the same as the input image of the encoder, a self-attention structure is formed. If the input image of the first decoder is different from the input image of the encoder, a cross-attention structure is formed. The input of the encoder takes the combined features of the two states of the same protective screen pressure plate before and after (that is, the first feature mentioned above) as input, and the feature information extracted from the current image will be saved and used for the next time. The features generated by the encoder are used as the common feature information of the two decoders, and the first decoder and the second decoder are used for pressure plate detection and pressure plate reference transmission respectively. The decoder uses the above-mentioned first image as the input key to obtain the detection frame; the other decoder uses the second image of the protective screen pressure plate as input to obtain the reference frame of the pressure plate in the second image, and compares the corresponding position in the first image according to the position of the reference frame to determine the detection result of the pressure plate state.
[0079] Optionally, in the method for identifying the state of the protective screen pressure plate provided in the first embodiment of the present application, the distance between the detection frame and the real frame in the first image is calculated to obtain a first loss function value, including: calculating a first value based on the area of a first region and an area of a second region, wherein the first region refers to the intersection area of the detection frame and the real frame of the corresponding pressure plate in the first image, and the second region refers to the union area of the detection frame and the real frame of the corresponding pressure plate in the first image; calculating a second value based on the first value, the area of the second region and the area of the third region, wherein the third region is the minimum area including the detection frame and the real frame of the corresponding pressure plate in the first image; calculating the second value based on the first value, the length of a first line segment and the length of a second line segment, wherein the first line segment is the diagonal of the first region, the second line segment is the diagonal of the third region, and the third region is the minimum area including the detection frame and the real frame of the corresponding pressure plate in the first image; calculating the first loss function value based on the second value, the width and height of the detection frame, and the width and height of the real frame of the corresponding pressure plate in the first image.
[0080] In the prior art, the bounding box regression performance is determined by the intersection over union (IoU) distance between the bounding box of the current frame object and the bounding box of the previous frame object. The calculation formula can be shown as formula 1:
[0081] (one)
[0082] Among them, A represents the real box, B represents the predicted box, represents the area of the intersection of the real box and the predicted box (that is, the area of the first area mentioned above), represents the area of the union of the true box and the predicted box (i.e. the area of the second area mentioned above), examples of A and B can be as follows Figure 4 However, when the two frames do not overlap, the IoU distance is 0, which cannot reflect the distance between the object frames. Secondly, the IoU distance cannot describe the degree of overlap between different positions, and thus cannot accurately measure the degree of overlap between the two. The GIoU distance is derived based on the IoU distance, and the calculation formula can be shown in Formula 2.
[0083] (two)
[0084] Among them, IoU represents the above-mentioned IoU distance, C represents the area of the minimum bounding box containing A and B (that is, the area of the third region mentioned above), It represents the area of the union of the real box and the predicted box. However, when the width and height of the two boxes are the same and they are on the same horizontal plane, or the relationship between the two boxes is a containment relationship, the GIoU distance will degenerate into the IoU distance, and both the IoU distance and the GIoU distance converge slowly, and the regression result is not accurate enough. Based on the GIoU distance, the CIoU distance is derived, and the calculation formula can be shown in formulas 3 to 6.
[0085] (three)
[0086] (Four)
[0087] (five)
[0088] (six)
[0089] Wherein, IoU represents the above-mentioned IoU distance (i.e., the above-mentioned first value), DIoU represents the DIoU distance (i.e., the above-mentioned second value), and v represent intermediate variables, and Represent the width and height of the real box, w and h represent the width and height of the predicted box, c is the diagonal of the smallest bounding box containing A and B (i.e. the second line segment mentioned above), and d is the diagonal of the intersection of A and B (i.e. the first line segment mentioned above). The DIoU distance avoids the problem that the GIoU distance generates a large outer bounding box when the two boxes are far apart, which makes the loss function difficult to optimize. At the same time, when the c value remains unchanged, the d value can still be effectively measured.
[0090] In the first embodiment, in order to improve the accuracy of the recognition results of the pressure plate state, the first loss function value between the detection frame of each pressure plate in the first image and the real frame of each pressure plate in the first image can be calculated according to the above-mentioned CIoU distance calculation method, and the second loss function value between the reference frame of each pressure plate in the second image and the real frame of each pressure plate in the second image can be calculated.
[0091] In an optional embodiment, the above-mentioned CIoU distance calculation method (i.e., the above-mentioned Formula 3 to Formula 6) can be used to calculate the target distance between the detection frame and the reference frame, so as to determine whether the pressure plate state of each pressure plate in the first image is changed compared to the pressure plate state of each pressure plate in the second image according to the target distance, and obtain the pressure plate state of each pressure plate in the first image.
[0092] In an optional embodiment, the current state of each pressure plate is compared with the first state of each pressure plate, and the target pressure plate that has changed in the target protection screen is determined based on the comparison result, including: calculating the target distance between the detection frame and the reference frame using a calculation method for calculating the first loss function value; comparing the target distance with a preset distance threshold, if the target distance is greater than the preset distance threshold, it is determined that the pressure plate state of the pressure plate corresponding to the detection frame has changed, and the pressure plate state of the pressure plate corresponding to the detection frame is determined based on the pressure plate state of the pressure plate corresponding to the reference frame; if the target distance is less than or equal to the preset distance threshold, it is determined that the pressure plate state of the pressure plate corresponding to the detection frame has not changed, and the pressure plate state of the pressure plate corresponding to the reference frame is determined based on the pressure plate state of the pressure plate corresponding to the detection frame.
[0093] Exemplarily, the pressing plate state of a pressing plate in the second image is closed, and the preset distance threshold is set to 0.5 (which can be adjusted according to actual production conditions and is not specifically limited in this embodiment). If the target distance between the reference frame and the detection frame of the pressing plate is greater than 0.5, it is considered that the before and after states of the pressing plate are consistent, that is, the pressing plate state of the pressing plate in the first image is closed; if the target distance between the reference frame and the detection frame of the pressing plate is less than or equal to 0.5, it is determined that the current state of the pressing plate is opposite to the previous state, that is, the pressing plate state of the pressing plate in the first image is disconnected, and the detection frame of the pressing plate is marked.
[0094] Optionally, in the method for identifying the state of the protective screen pressure plate provided in Example 1 of the present application, feature information of the first image and reference feature information of the second image are input into an encoder for calculation to obtain a first feature, including: extracting the second feature of the first image through a convolutional neural network; splicing the second feature and the reference feature information to obtain a third feature; and inputting the third feature into the encoder to extract the first feature.
[0095] In the first embodiment, in order to improve the accuracy of the recognition result of the protective screen pressure plate, a convolutional neural network can be used to extract the feature information of the first image and the reference feature information of the second image, that is, the second feature of the first image is extracted by the convolutional neural network, and the reference feature information of the second image is extracted by the convolutional neural network, wherein the reference feature information refers to the feature information extracted in the last recognition process of the protective screen pressure plate. Then, the second feature of the first image and the reference feature information are spliced to obtain the third feature mentioned above, and the third feature is input into the encoder to further extract the feature information to obtain the first feature mentioned above.
[0096] Optionally, in the method for identifying the state of the protective screen pressure plate provided in Example 1 of the present application, the first feature and the detection query feature are input into the first decoder to extract the target feature, including: inputting the detection query feature into the first network structure to extract the fourth feature of the first image, wherein the first network structure includes at least: a self-attention module, an addition module and a normalization module; inputting the fourth feature and the first feature into the second network structure to extract the target feature of the first image, wherein the second network structure includes at least: a cross-attention module, a feedforward network module, an addition module and a normalization module.
[0097] In the first embodiment, the process of extracting target features can be as follows: Figure 5 As shown, the detection query feature is processed by a self-attention module, a feature addition module and a normalization module (i.e., the first network structure mentioned above) to obtain the fourth feature mentioned above, and then the fourth feature and the first feature mentioned above are input into the first decoder, wherein the first decoder includes a cross-attention module, a feedforward network module, an addition module and a normalization module.
[0098] In an optional embodiment, the process of extracting reference features is similar to the process of extracting target features, which can be as follows: Figure 5 As shown, the reference query feature is processed by a self-attention module, a feature addition module and a normalization module (i.e., the first network structure mentioned above) to obtain the seventh feature, and then the seventh feature and the first feature mentioned above are input into the second decoder, wherein the second decoder includes a cross-attention module, a feedforward network module, an addition module and a normalization module.
[0099] Optionally, in the method for identifying the state of the protective screen pressure plate provided in Example 1 of the present application, the above-mentioned cross-attention module includes at least: a spatial attention module and a channel attention module, and the fourth feature and the first feature are input into the second network structure to extract the target feature of the first image, including: inputting the fourth feature and the first feature into the channel attention module, calculating the weight of each channel, and obtaining the fifth feature, wherein the channel attention module includes at least: an average pooling layer, a maximum pooling layer, a splicing structure, a dimensionality reduction convolution layer, a fully connected layer, and an activation function layer; inputting the fifth feature into the spatial attention module, weighting different areas to obtain a sixth feature, wherein the spatial attention module includes at least: an average pooling layer, a maximum pooling layer, a fully connected layer, and an activation function layer; extracting the target feature of the first image from the sixth feature through a feedforward network module, an addition module, and a normalization module.
[0100] In the first embodiment, a cross attention module including a spatial attention module and a channel attention module can be used in the first decoder to process the fourth feature and the first feature, wherein the channel attention module is used to strengthen the attention of a specific area, and different areas of the image are weighted to obtain the above-mentioned fifth feature, and the weight of each channel in the fifth feature is calculated by the spatial attention module, and different channels of the image are weighted to obtain the above-mentioned sixth feature. Then, the above-mentioned target feature is extracted from the sixth feature through a feedforward network module, an addition module, and a normalization module.
[0101] In an optional embodiment, the channel attention module first performs global average pooling and maximum pooling operations on the input feature map (i.e., the fourth feature mentioned above), and then converts the dimension of the feature map into , where c represents the number of features in the feature map, R represents the number of convolution kernels, and then after the activation function and the fully connected layer, the output dimension is Finally, the Sigmoid function is used to obtain the output feature map (the fifth feature mentioned above). The calculation process of the channel attention module can be shown in Formula 7.
[0102] (seven)
[0103] in, represents the sigmoid function, represents a fully connected layer with a convolution kernel of 1, Represents the feature map of the input channel attention module, Representation feature map The maximum feature after the maximum pooling operation, Representation feature map The global average feature after the global average pooling operation, Indicates the multiplication of corresponding position values, Feature map representing the output of the channel attention module.
[0104] In an optional embodiment, the spatial attention module acts on each frame of the image and assigns different weights to each part of the extracted feature map, in order to make the model pay more attention to the unobstructed part of the target, so as to better extract the features of the target. That is, the fifth feature mentioned above contains C features, which is used to dynamically weight and reorganize the extracted C features to obtain feature vectors that are more recognizable for different targets. The structure of the spatial attention module can be as follows Figure 5As shown, first, the input feature map is subjected to global average pooling and maximum pooling operations to obtain the global average feature and the maximum feature, the global average feature and the maximum feature are concatenated, and a convolution operation is performed on the concatenated feature vector to reduce the dimension of the feature vector to half of the input feature. The reduced-dimensional feature is first subjected to nonlinear transformation using the ReLU activation function and then convolved to obtain the output feature map (i.e., the sixth feature mentioned above). The calculation process of the spatial attention module can be shown in Formula 8,
[0105] (eight)
[0106] in, represents the sigmoid function, represents a convolution layer with a convolution kernel of 7. Represents the feature map output by the channel attention module, Representation feature map The maximum feature after the maximum pooling operation, Representation feature map The global average feature after the global average pooling operation, Indicates the multiplication of corresponding position values, Feature map representing the output of the spatial attention module.
[0107] Through spatial attention, each part of the feature map can be weighted, which can better capture the feature information in the feature map. At the same time, through the channel attention module, different channels in the feature map can be weighted, which can better express the feature information contained in different channels in the feature map. Spatial attention weights are applied on the basis of the output features of the channel attention module, and each feature is weighted internally, so that the features of the unobstructed parts have a higher activation response in the network, thereby improving the accuracy of the extracted target features and achieving the goal of improving the accuracy of the recognition results of the protective screen pressure plate.
[0108] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0109] The second embodiment of the present application also provides a device for identifying the state of a protective screen pressure plate. It should be noted that the device for identifying the state of a protective screen pressure plate in the second embodiment of the present application can be used to execute the method for identifying the state of a protective screen pressure plate provided in the first embodiment of the present application. The device for identifying the state of a protective screen pressure plate provided in the second embodiment of the present application is introduced below.
[0110] Figure 6Schematic diagram of a device for identifying the state of a protective screen pressure plate according to the second embodiment of the present application. Figure 6 As shown, the device includes: a collection unit 601 and a recognition unit 602.
[0111] Specifically, a target image of a pressure plate of a target protection screen is collected, wherein the target protection screen is deployed with a plurality of pressure plates, and the states of the pressure plates include: open and closed.
[0112] The recognition unit 602 is used to input the target image into the target model, identify the current state of each pressure plate in the multiple pressure plates, and obtain a recognition result, wherein the target model is obtained by training a preset model with a first image and a second image, the first image is an image captured of the protective screen at a first preset time, and the second image is an image captured of the protective screen at a second preset time, and the first preset time is later than the second preset time.
[0113] The comparison unit 603 is used to compare the current state of each pressure plate with the first state of each pressure plate, and determine the target pressure plate with changes in the target protection screen based on the comparison results, wherein the first state of the pressure plate is the state of the pressure plate obtained after the pressure plate was identified by the target model last time.
[0114] The second embodiment of the present application provides a device for identifying the state of a protective screen pressure plate. The acquisition unit 601 acquires a target image of a target protective screen, wherein the target protective screen is deployed with multiple pressure plates, and the states of the pressure plates include: open and closed; the recognition unit 602 inputs the target image into a target model, identifies the current state of each pressure plate in the multiple pressure plates, and obtains a recognition result, wherein the target model is a model obtained by training a preset model using a first image and a second image, the first image is an image acquired from the protective screen at a first preset time, and the second image is an image acquired from the protective screen at a second preset time, and the first preset time is later than the second preset time; the current state of each pressure plate is compared with the first state of each pressure plate, and the target pressure plate that has changed in the target protective screen is determined according to the comparison result, wherein the first state of the pressure plate is the pressure plate state obtained after the pressure plate is recognized by the target model last time, which solves the problem in the related art that when the state of the protective screen pressure plate in the substation is recognized by the image recognition technology, the recognition result is inaccurate due to unclear reflection of the acquired image and inability to compare the previous pressure plate state. By inputting images of the protective screen at different moments into the trained target model, the feature information of the target protective screen can be extracted through the target model, and the feature information of the target image of the target protective screen is compared with the image feature information of the target protective screen at past moments, and the pressure plate detection frame of the pressure plate position change is calculated, so as to identify the current state of the target protective screen according to the feature information in the detection frame, and then determine the target pressure plate with changes in the target protective screen, thereby achieving the effect of improving the accuracy of identifying the protective screen pressure plate with changes.
[0115] Optionally, in the device for identifying the state of the protective screen pressure plate provided in Example 2 of the present application, the device further includes: a determination unit, used to determine the first image and the second image in an image set based on the acquisition time, wherein the image set is a set of historical images of the protective screen; a first calculation unit, used to input the feature information of the first image and the reference feature information of the second image into the encoder for calculation to obtain the first feature, wherein the reference feature information of the second image is the feature information extracted by a preset model; a second calculation unit, used to calculate the first feature, the detection query feature and the reference query feature through a decoder and a feedforward network to obtain a detection box in the first image and a reference box in the second image; a calculation unit, used to calculate the distance between the detection box and the real box in the first image to obtain a first loss function value, and to calculate the distance between the reference box and the real box in the second image to obtain a second loss function value; a training unit, used to iteratively train the preset model based on the first loss function value and the second loss function value to obtain a target model.
[0116] Optionally, in the device for identifying the state of the protective screen pressure plate provided in Example 2 of the present application, the above-mentioned decoder includes at least: a first decoder and a second decoder, and the above-mentioned second calculation unit includes: a first extraction subunit, used to input the first feature and the detection query feature into the first decoder to extract the target feature; a second extraction subunit, used to input the first feature and the reference query feature into the second decoder to extract the reference feature; an updating subunit, used to update the reference feature according to the target feature to obtain an updated reference feature; a first calculation subunit, used to input the target feature into the feedforward network to calculate the detection frame; and a second calculation subunit, used to input the updated reference feature into the feedforward network to calculate the reference frame.
[0117] Optionally, in the device for identifying the state of the protective screen pressure plate provided in the second embodiment of the present application, the above-mentioned calculation unit includes: a third calculation subunit, which is used to calculate the first value based on the area of the first area and the area of the second area, wherein the first area refers to the intersection area of the detection frame and the real frame of the corresponding pressure plate in the first image, and the second area refers to the union area of the detection frame and the real frame of the corresponding pressure plate in the first image; a fourth calculation subunit, which is used to calculate the second value based on the first value, the area of the second area and the area of the third area, wherein the third area is the minimum area including the detection frame and the real frame of the corresponding pressure plate in the first image; a fifth calculation subunit, which is used to calculate the second value based on the first value, the length of the first line segment and the length of the second line segment, wherein the first line segment is the diagonal of the first area, the second line segment is the diagonal of the third area, and the third area is the minimum area including the detection frame and the real frame of the corresponding pressure plate in the first image; a sixth calculation subunit, which is used to calculate the first loss function value based on the second value, the width and height of the detection frame, and the width and height of the real frame of the corresponding pressure plate in the first image.
[0118] Optionally, in the device for identifying the state of the protective screen pressure plate provided in Example 2 of the present application, the above-mentioned first calculation unit includes: a third extraction subunit, used to extract the second feature of the first image through a convolutional neural network; a splicing subunit, used to splice the second feature and reference feature information to obtain a third feature; and a fourth extraction subunit, used to input the third feature into the encoder to extract the first feature.
[0119] Optionally, in the device for identifying the state of the protective screen pressure plate provided in Example 2 of the present application, the above-mentioned first extraction subunit includes: a first extraction module, used to input the detection query feature into the first network structure, and extract the fourth feature of the first image, wherein the first network structure at least includes: a self-attention module, an addition module and a normalization module; a second extraction module, used to input the fourth feature and the first feature into the second network structure, and extract the target feature of the first image, wherein the second network structure at least includes: a cross-attention module, a feedforward network module, an addition module and a normalization module.
[0120] Optionally, in the device for identifying the state of the protective screen pressure plate provided in Example 2 of the present application, the above-mentioned cross-attention module at least includes: a spatial attention module and a channel attention module, and the above-mentioned second extraction module includes: a first calculation submodule, used to input the fourth feature and the first feature into the channel attention module, calculate the weight of each channel, and obtain the fifth feature, wherein the channel attention module at least includes: an average pooling layer, a maximum pooling layer, a splicing structure, a dimensionality reduction convolution layer, a fully connected layer, and an activation function layer; a second calculation submodule, used to input the fifth feature into the spatial attention module, weight different areas, and obtain the sixth feature, wherein the spatial attention module at least includes: an average pooling layer, a maximum pooling layer, a fully connected layer, and an activation function layer; an extraction submodule, used to extract the target feature of the first image from the sixth feature through a feedforward network module, an addition module, and a normalization module.
[0121] The device for identifying the state of the protective screen pressure plate includes a processor and a memory. The above-mentioned acquisition unit 601, identification unit 602 and comparison unit 603 are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0122] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the accuracy of the recognition result can be improved by adjusting the kernel parameters.
[0123] The memory may include non-permanent memory in a computer-readable medium, in the form of a random access memory (RAM), a graphics processing unit (GPU) and / or non-volatile memory, such as a read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0124] Embodiment 3 of the present application provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, a method for identifying the state of a protective screen pressure plate is implemented.
[0125] A fourth embodiment of the present application provides a processor, which is used to run a program, wherein a method for identifying the state of a protective screen pressure plate is executed when the program is running.
[0126] like Figure 7 As shown, embodiment 5 of the present application provides an electronic device, the device includes a processor, a memory and a program stored in the memory and executable on the processor, and the processor implements the following steps when executing the program: acquiring a target image of a target protection screen, wherein the target protection screen is deployed with a plurality of pressure plates, and the states of the pressure plates include: open and closed; inputting the target image into a target model, identifying the current state of each pressure plate in the plurality of pressure plates, and obtaining a recognition result, wherein the target model is a model obtained by training a preset model using a first image and a second image, the first image is an image acquired at a first preset moment for the protection screen, the second image is an image acquired at a second preset moment for the protection screen, and the first preset moment is later than the second preset moment; comparing the current state of each pressure plate with the first state of each pressure plate, and determining the target pressure plate with a change in the target protection screen according to the comparison result, wherein the first state of the pressure plate is the pressure plate state obtained after the pressure plate was recognized by the target model last time.
[0127] When the processor executes the program, the following steps are also implemented: the above-mentioned target model is trained by the following steps: determining the first image and the second image in the image set according to the acquisition time, wherein the image set is a set of historical images of the protection screen; inputting the feature information of the first image and the reference feature information of the second image into the encoder for calculation to obtain the first feature, wherein the reference feature information of the second image is the feature information extracted by the preset model; calculating the first feature, the detection query feature and the reference query feature through the decoder and the feedforward network to obtain the detection frame in the first image and the reference frame in the second image; calculating the distance between the detection frame and the real frame in the first image to obtain the first loss function value, and calculating the distance between the reference frame and the real frame in the second image to obtain the second loss function value; iteratively training the preset model according to the first loss function value and the second loss function value to obtain the target model.
[0128] When the processor executes the program, the following steps are also implemented: the above-mentioned decoder includes at least: a first decoder and a second decoder, and the first feature, the detection query feature and the reference query feature are calculated through the decoder and the feedforward network to obtain the detection frame in the first image and the reference frame in the second image, including: inputting the first feature and the detection query feature into the first decoder to extract the target feature; inputting the first feature and the reference query feature into the second decoder to extract the reference feature; updating the reference feature according to the target feature to obtain the updated reference feature; inputting the target feature into the feedforward network to calculate the detection frame; inputting the updated reference feature into the feedforward network to calculate the reference frame.
[0129] When the processor executes the program, the following steps are also implemented: calculating the distance between the detection frame and the real frame in the first image to obtain a first loss function value, including: calculating a first value based on the area of the first region and the area of the second region, wherein the first region refers to the intersection area of the detection frame and the real frame of the corresponding pressure plate in the first image, and the second region refers to the union area of the detection frame and the real frame of the corresponding pressure plate in the first image; calculating a second value based on the first value, the area of the second region and the area of the third region, wherein the third region is the minimum area including the detection frame and the real frame of the corresponding pressure plate in the first image; calculating the second value based on the first value, the length of the first line segment and the length of the second line segment, wherein the first line segment is the diagonal of the first region, the second line segment is the diagonal of the third region, and the third region is the minimum area including the detection frame and the real frame of the corresponding pressure plate in the first image; calculating the first loss function value based on the second value, the width and height of the detection frame, and the width and height of the real frame of the corresponding pressure plate in the first image.
[0130] When the processor executes the program, the following steps are also implemented: the feature information of the first image and the reference feature information of the second image are input into the encoder for calculation to obtain the first feature, including: extracting the second feature of the first image through a convolutional neural network; splicing the second feature and the reference feature information to obtain the third feature; inputting the third feature into the encoder to extract the first feature.
[0131] When the processor executes the program, the following steps are also implemented: inputting the first feature and the detection query feature into the first decoder to extract the target feature, including: inputting the detection query feature into the first network structure to extract the fourth feature of the first image, wherein the first network structure at least includes: a self-attention module, an addition module and a normalization module; inputting the fourth feature and the first feature into the second network structure to extract the target feature of the first image, wherein the second network structure at least includes: a cross-attention module, a feedforward network module, an addition module and a normalization module.
[0132] When the processor executes the program, the following steps are also implemented: the above-mentioned cross-attention module includes at least: a spatial attention module and a channel attention module, the fourth feature and the first feature are input into the second network structure, and the target feature of the first image is extracted, including: the fourth feature and the first feature are input into the channel attention module, and the weight of each channel is calculated to obtain the fifth feature, wherein the channel attention module includes at least: an average pooling layer, a maximum pooling layer, a splicing structure, a dimensionality reduction convolution layer, a fully connected layer, and an activation function layer; the fifth feature is input into the spatial attention module, and different regions are weighted to obtain a sixth feature, wherein the spatial attention module includes at least: an average pooling layer, a maximum pooling layer, a fully connected layer, and an activation function layer; the target feature of the first image is extracted from the sixth feature through a feedforward network module, an addition module, and a normalization module.
[0133] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0134] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that is initialized with the following method steps: acquiring a target image of a target protective screen, wherein the target protective screen is deployed with multiple pressure plates, and the states of the pressure plates include: open and closed; inputting the target image into a target model, identifying the current state of each of the multiple pressure plates, and obtaining a recognition result, wherein the target model is a model obtained by training a preset model using a first image and a second image, the first image is an image acquired at a first preset moment for the protective screen, and the second image is an image acquired at a second preset moment for the protective screen, and the first preset moment is later than the second preset moment; comparing the current state of each pressure plate with the first state of each pressure plate, and determining the target pressure plate that has changed in the target protective screen based on the comparison result, wherein the first state of the pressure plate is the state of the pressure plate obtained after the pressure plate was recognized by the target model last time.
[0135] When executed on a data processing device, it is also suitable for executing a program initialized with the following method steps: the above-mentioned target model is trained by the following steps: determining the first image and the second image in the image set according to the acquisition time, wherein the image set is a set of historical images of the protection screen; inputting the feature information of the first image and the reference feature information of the second image into the encoder for calculation to obtain the first feature, wherein the reference feature information of the second image is the feature information extracted by the preset model; calculating the first feature, the detection query feature and the reference query feature through the decoder and the feedforward network to obtain the detection frame in the first image and the reference frame in the second image; calculating the distance between the detection frame and the real frame in the first image to obtain the first loss function value, and calculating the distance between the reference frame and the real frame in the second image to obtain the second loss function value; iteratively training the preset model according to the first loss function value and the second loss function value to obtain the target model.
[0136] When executed on a data processing device, it is also suitable for executing a program initialized with the following method steps: the above-mentioned decoder includes at least: a first decoder and a second decoder, and the first feature, the detection query feature and the reference query feature are calculated by the decoder and the feedforward network to obtain the detection frame in the first image and the reference frame in the second image, including: inputting the first feature and the detection query feature into the first decoder to extract the target feature; inputting the first feature and the reference query feature into the second decoder to extract the reference feature; updating the reference feature according to the target feature to obtain the updated reference feature; inputting the target feature into the feedforward network to calculate the detection frame; inputting the updated reference feature into the feedforward network to calculate the reference frame.
[0137] When executed on a data processing device, it is also suitable for executing a program initialized with the following method steps: calculating the distance between the detection frame and the real frame in the first image to obtain a first loss function value, including: calculating a first value based on the area of a first region and an area of a second region, wherein the first region refers to the intersection area of the detection frame and the real frame of the corresponding pressure plate in the first image, and the second region refers to the union area of the detection frame and the real frame of the corresponding pressure plate in the first image; calculating a second value based on the first value, the area of the second region and the area of the third region, wherein the third region is the minimum area including the detection frame and the real frame of the corresponding pressure plate in the first image; calculating the second value based on the first value, the length of the first line segment and the length of the second line segment, wherein the first line segment is the diagonal of the first region, the second line segment is the diagonal of the third region, and the third region is the minimum area including the detection frame and the real frame of the corresponding pressure plate in the first image; calculating the first loss function value based on the second value, the width and height of the detection frame, and the width and height of the real frame of the corresponding pressure plate in the first image.
[0138] When executed on a data processing device, it is also suitable for executing a program initialized with the following method steps: inputting feature information of a first image and reference feature information of a second image into an encoder for calculation to obtain a first feature, including: extracting the second feature of the first image through a convolutional neural network; splicing the second feature and the reference feature information to obtain a third feature; inputting the third feature into the encoder to extract the first feature.
[0139] When executed on a data processing device, it is also suitable for executing a program initialized with the following method steps: inputting the first feature and the detection query feature into the first decoder to extract the target feature, including: inputting the detection query feature into the first network structure to extract the fourth feature of the first image, wherein the first network structure at least includes: a self-attention module, an addition module and a normalization module; inputting the fourth feature and the first feature into the second network structure to extract the target feature of the first image, wherein the second network structure at least includes: a cross-attention module, a feedforward network module, an addition module and a normalization module.
[0140] When executed on a data processing device, it is also suitable for executing a program initialized with the following method steps: the above-mentioned cross-attention module at least includes: a spatial attention module and a channel attention module, the fourth feature and the first feature are input into the second network structure, and the target feature of the first image is extracted, including: the fourth feature and the first feature are input into the channel attention module, and the weight of each channel is calculated to obtain the fifth feature, wherein the channel attention module at least includes: an average pooling layer, a maximum pooling layer, a splicing structure, a dimensionality reduction convolution layer, a fully connected layer, and an activation function layer; the fifth feature is input into the spatial attention module, and different regions are weighted to obtain a sixth feature, wherein the spatial attention module at least includes: an average pooling layer, a maximum pooling layer, a fully connected layer, and an activation function layer; the target feature of the first image is extracted from the sixth feature through a feedforward network module, an addition module, and a normalization module.
[0141] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0142] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0143] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0144] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0145] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0146] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0147] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0148] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0149] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0150] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for identifying the state of a protective screen pressure plate, characterized in that: include: Acquiring a target image of a target protection screen, wherein the target protection screen is deployed with a plurality of pressure plates, and the states of the pressure plates include: open and closed; Input the target image into a target model, identify the current state of each of the plurality of pressure plates, and obtain a recognition result, wherein the target model is a model obtained by training a preset model using a first image and a second image, the first image is an image captured of the protection screen at a first preset time, the second image is an image captured of the protection screen at a second preset time, and the first preset time is later than the second preset time; Comparing the current state of each pressure plate with the first state of each pressure plate, and determining the target pressure plate with changes in the target protection screen according to the comparison result, wherein the first state of the pressure plate is the pressure plate state obtained after the pressure plate is identified by the target model last time; The target model is trained by the following steps: Determining the first image and the second image in an image set according to a collection time, wherein the image set is a set of historical images of the protection screen; Inputting feature information of the first image and reference feature information of the second image into an encoder for calculation to obtain a first feature, wherein the reference feature information of the second image is feature information extracted by a preset model; Calculating the first feature, the detection query feature, and the reference query feature through a decoder and a feedforward network to obtain a detection frame in the first image and a reference frame in the second image; Calculating the distance between the detection frame and the real frame in the first image to obtain a first loss function value, and calculating the distance between the reference frame and the real frame in the second image to obtain a second loss function value; Iteratively training the preset model according to the first loss function value and the second loss function value to obtain the target model; The decoder includes at least: a first decoder and a second decoder, and the first feature, the detection query feature and the reference query feature are calculated by the decoder and the feedforward network to obtain the detection frame in the first image and the reference frame in the second image, including: Inputting the first feature and the detection query feature into the first decoder to extract the target feature; inputting the first feature and the reference query feature into the second decoder to extract the reference feature; updating the reference feature according to the target feature to obtain an updated reference feature; Inputting the target feature into the feedforward network to calculate the detection frame; The updated reference features are input into the feed-forward network to calculate the reference frame.
2. The method according to claim 1, characterized in that Calculating the distance between the detection frame and the real frame in the first image to obtain a first loss function value includes: Calculating a first value according to an area of a first region and an area of a second region, wherein the first region refers to an intersection area of the detection frame and a real frame of the corresponding pressure plate in the first image, and the second region refers to a union area of the detection frame and a real frame of the corresponding pressure plate in the first image; Calculating a second value according to the first value, the area of the second region, and the area of a third region, wherein the third region is a minimum region including the detection frame and a real frame corresponding to the pressure plate in the first image; Calculating a second value according to the first value, a length of a first line segment, and a length of a second line segment, wherein the first line segment is a diagonal line of the first area, the second line segment is a diagonal line of a third area, and the third area is a minimum area including the detection frame and a real frame corresponding to the pressure plate in the first image; The first loss function value is calculated according to the second value, the width and height of the detection frame, and the width and height of the real frame corresponding to the pressure plate in the first image.
3. The method according to claim 1, characterized in that: Inputting the feature information of the first image and the reference feature information of the second image into an encoder for calculation to obtain a first feature includes: Extracting a second feature of the first image by a convolutional neural network; Concatenate the second feature and the reference feature information to obtain a third feature; The third feature is input into the encoder to extract the first feature.
4. The method according to claim 1, characterized in that: Inputting the first feature and the detection query feature into the first decoder to extract the target feature includes: Inputting the detection query feature into a first network structure to extract a fourth feature of the first image, wherein the first network structure at least includes: a self-attention module, an addition module, and a normalization module; The fourth feature and the first feature are input into a second network structure to extract the target feature of the first image, wherein the second network structure at least includes: a cross-attention module, a feedforward network module, an addition module and a normalization module.
5. The method according to claim 4, characterized in that The cross attention module at least includes: a spatial attention module and a channel attention module, inputs the fourth feature and the first feature into a second network structure, and extracts the target feature of the first image, including: Inputting the fourth feature and the first feature into the channel attention module, calculating the weight of each channel, and obtaining the fifth feature, wherein the channel attention module at least includes: an average pooling layer, a maximum pooling layer, a splicing structure, a dimensionality reduction convolution layer, a fully connected layer, and an activation function layer; Inputting the fifth feature into the spatial attention module, weighting different regions, and obtaining a sixth feature, wherein the spatial attention module at least includes: an average pooling layer, a maximum pooling layer, a fully connected layer, and an activation function layer; The target feature of the first image is extracted from the sixth feature through the feedforward network module, the addition module and the normalization module.
6. A device for identifying the state of a protective screen pressure plate, characterized in that: include: The acquisition unit is used to acquire the target image of the target transformer target protection screen and the measurement and control screen protection screen pressure plate, wherein the target protection screen is deployed with multiple pressure plates, and the states of the pressure plates include: open and closed; an identification unit, configured to input the target image into a target model, identify the current state of each of the plurality of pressure plates, and obtain an identification result, wherein the target model is a model obtained by training a preset model with a first image and a second image, the first image is an image captured of the protection screen at a first preset time, the second image is an image captured of the protection screen at a second preset time, and the first preset time is later than the second preset time; a comparison unit, used for comparing the current state of each pressure plate with the first state of each pressure plate, and determining the target pressure plate with changes in the target protection screen according to the comparison result, wherein the first state of the pressure plate is the pressure plate state obtained after the pressure plate is identified by the target model last time; The device further includes: a determination unit, configured to determine the first image and the second image in an image set according to a collection time, wherein the image set is a set of historical images including the protective screen pressure plate; a first calculation unit, configured to input feature information of the first image and reference feature information of the second image into an encoder for calculation to obtain a first feature, wherein the reference feature information of the second image is feature information extracted by a preset model; a second calculation unit, configured to calculate the first feature, the detection query feature and the reference query feature through a decoder and a feedforward network to obtain a detection frame in the first image and a reference frame in the second image; a calculation unit, configured to calculate the distance between the detection frame and the real frame in the first image to obtain a first loss function value, and to calculate the distance between the reference frame and the real frame in the second image to obtain a second loss function value; a training unit, configured to iteratively train the preset model according to the first loss function value and the second loss function value to obtain the target model; Among them, the decoder at least includes: a first decoder and a second decoder, and the second calculation unit includes: a first extraction subunit, used to input the first feature and the detection query feature into the first decoder to extract the target feature; a second extraction subunit, used to input the first feature and the reference query feature into the second decoder to extract the reference feature; an updating subunit, used to update the reference feature according to the target feature to obtain an updated reference feature; a first calculation subunit, used to input the target feature into the feedforward network to calculate the detection box; a second calculation subunit, used to input the updated reference feature into the feedforward network to calculate the reference box.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes stored computer instructions, wherein when the computer instructions are executed by a processor, the method for identifying the state of the protection screen pressure plate according to any one of claims 1 to 5 is implemented.
8. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method for identifying the state of the protective screen pressure plate as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Embedded relay protection pressing plate on-off state identification method and device
CN112801974A