Relay combination state identification method and system
By constructing a state recognition model and generating adversarial network training technology, efficient identification and real-time monitoring of the relay status combination in the railway switch switch switch machine is achieved, solving the problem of relay status combination recognition and improving the safety of railway transportation.
Patent Information
- Application Number
- CN202410152709.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-03
- Publication Date
- 2025-08-05
AI Technical Summary
How to realize real-time monitoring and identification of the relay status combination of railway switch switch switch machines to improve railway transportation safety.
By using image recognition technology, by constructing a state recognition model, the original image of the relay group is obtained, the status of each relay is identified and the color block division is divided, the color block diagram is generated, the color block diagram is analyzed to determine the working state of the relay group, and the recognition accuracy is improved by using the generative adversarial network training model.
It realizes efficient identification of relay status combinations, reduces data processing volume, improves recognition accuracy, and can monitor the operation of the switch switch machine in real time to detect faults in a timely manner.
Smart Images

Figure CN120431345A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and in particular to a relay combination state recognition method and system. Background Art
[0002] A turnout switch is a crucial signaling infrastructure used to change turnout positions, alter the direction of turnout opening, lock the switch point rail, and reflect turnout position. It effectively ensures driving safety and improves transportation efficiency. Multiple relays are typically used in a turnout switch to control turnout changes. Specifically, when the turnout switch receives a drive command, the control circuit sends a signal to the relay. Upon receiving the signal, the relay's contacts activate, connecting the positive terminal of the power supply to the motor, thereby driving the motor's rotation. This rotation drives a series of mechanical transmission devices, ultimately changing the turnout position.
[0003] With the rapid development of high-speed rail signaling technology, the number of unmanned railway stations is increasing. To improve railway transportation safety, real-time monitoring of turnout switches is necessary. Relays are key components in controlling turnout switches, and timely and comprehensive understanding of relay status is crucial for troubleshooting. Therefore, identifying relay status combinations is a pressing issue. Summary of the Invention
[0004] In order to facilitate the identification of relay state combinations, the present application provides a relay combination state identification method and system.
[0005] In the first aspect, the present application provides a method for identifying a relay combination state, which adopts the following technical solution:
[0006] A method for identifying a relay combination state, comprising:
[0007] Acquire an original image of a relay group for controlling the operation of a turnout machine; wherein the relay group includes at least one relay;
[0008] Build a state recognition model;
[0009] Inputting the original image into the state recognition model, identifying the state of each relay in the original image through the state recognition model, and dividing the original image into color blocks based on the state of each relay to generate a color block map;
[0010] The color blocks in the color block image are analyzed to generate the working status of the relay group in the original image; the working status includes the relative position information and state attributes of each relay in the relay group.
[0011] By adopting the above technical solution, the state of each relay is identified through the constructed state recognition model, and the original image is divided into color blocks based on each relay state to obtain a color block map. The color block map is relatively simple in structure and can characterize the state of each relay in the relay group, so as to reduce the amount of subsequent data processing. The color blocks in the color block map are then analyzed to obtain the working state of the relay group in the original image, thereby achieving the effect of identifying the relay state combination.
[0012] Optionally, the step of constructing the state recognition model specifically includes a step of training a preset network model to obtain the state recognition model; the preset network model includes a generator and a discriminator;
[0013] The training step includes:
[0014] Obtaining a training sample set, marking the position frames and states of the relay groups in a plurality of sample images included in the training sample set, and coloring the marked position frames in the sample images according to the marked states to obtain a marked image;
[0015] Use the generator to segment the sample image to generate a color block prediction image;
[0016] The discriminator is used to verify the authenticity of the color block prediction image and the corresponding sample image respectively, so as to generate a first true probability that the labeled image is a true image and a second true probability that the color block prediction image is a true image;
[0017] Constructing a discriminant loss function of the discriminator based on the first true probability and the second true probability;
[0018] According to the pixel difference between the color block prediction image and the annotated image, a pixel loss index is constructed, and the generation loss function of the generator is constructed based on the pixel loss index and the discriminant loss function;
[0019] According to the discriminant loss function and the generative loss function, the generator and the discriminator are trained alternately until the Nash equilibrium is reached to obtain the state recognition model.
[0020] By adopting the above technical solution, the position box is filled with color according to the annotated state to obtain an annotated image, and the annotated content is presented in the form of an image to facilitate subsequent processing. The discriminator is used to verify the authenticity of the color block prediction image and the corresponding sample image, and the first true probability and the second true probability obtained from the authenticity verification are used to construct the discriminant loss function of the discriminator, so that the discriminant loss function used to train the discriminator comprehensively considers the predicted image and the sample image. The generator is then used to translate the sample image to generate a color block prediction image. The generator loss function is constructed based on the pixel difference between the color block prediction image and the annotated image and the discriminant loss function, so that the generator loss function used to train the generator comprehensively considers the actual pixel difference and the discriminant difference. Then, based on the discriminant loss function and the generation loss function, the generator and discriminator are alternately trained until a Nash equilibrium is reached, that is, the generator and discriminator are adversarially trained, and the model performance is continuously optimized to obtain a state recognition model, thereby facilitating the improvement of the trained state recognition model's recognition accuracy for the relay state.
[0021] Optionally, the training sample set includes sample images of relay group working states corresponding to all action combinations in the turnout machine collected under different viewing angles and light conditions.
[0022] By adopting the above technical solution, the training sample set includes sample images of the working status of the relay group corresponding to all action combinations in the turnout machine collected under different viewing angles and light conditions, making the sample images more comprehensive and facilitating improving the performance of the state recognition model trained using the training sample set.
[0023] Optionally, the marked state includes a raised state and a lowered state of the relay; and filling the marked position frame in the sample image according to the marked state to obtain the marked image specifically includes:
[0024] If the marked state is the sucked-up state, filling the marked position box in the sample image with the first color;
[0025] If the marked state is a dropped state, filling the marked position box in the sample image with a second color;
[0026] The area outside the position box in the sample image is filled with a third color to obtain a marked image.
[0027] By adopting the above technical solution, different standard states are filled with different colors to distinguish the state of the relay corresponding to each color block. At the same time, the annotation content is displayed on the annotated image corresponding to the sample image, which facilitates the use of the annotated image to train the model.
[0028] Optionally, analyzing the color blocks in the color block image to generate the working status of the relay group in the original image specifically includes:
[0029] Identify the bounding box of each color block in the color block image respectively;
[0030] Identify the color attribute that occupies the largest area within the bounding box;
[0031] Determine the relative position information of each relay according to the position of the external border in the color block diagram;
[0032] According to the color attribute, determine the state attribute corresponding to each relay;
[0033] The working status of the relay group in the original image is generated based on the relative position information and state attributes.
[0034] By adopting the above technical solution, the outer bounding box of each color block in the color block image is identified to determine the relative position information of each relay, and the state attribute corresponding to each relay is determined by identifying the color attribute that occupies the largest area within the outer bounding box. The state attribute and corresponding relative position signal of each relay in the relay group in the original image are obtained, thereby realizing the generation of the working state of the relay in the original image.
[0035] Optionally, also include:
[0036] Calculate the intersection-over-union ratio of each bounding box and the corresponding color block in the color block image;
[0037] Determine whether the intersection-to-combination ratio is greater than a preset threshold. If so, determine that the relative position information and state attributes of the corresponding relay are accurate, and output the relative position information and state attributes of the corresponding relay.
[0038] By adopting the above technical solution, by judging whether the intersection-and-union ratio of the external border and the corresponding color block in the color block image is greater than a preset threshold, it is convenient to verify the relative position information and status attributes of each identified relay, so as to output only the relative position information and status attributes of relays with high accuracy, thereby improving the accuracy of recognition.
[0039] Optionally, the obtaining of the original image of the relay for controlling the operation of the turnout machine specifically includes:
[0040] Acquire video data of relays used to control the operation of turnout machines;
[0041] Each frame of the video data is taken as an original image.
[0042] By adopting the above technical solution, each frame of the video data of the relay used to control the switch machine action combination is used as the original image, so as to realize the real-time monitoring and recognition of the switch machine action.
[0043] Optionally, also include:
[0044] Obtain the working status of the relay group for each original image in the video data;
[0045] Sort the working status of the relay group in chronological order and analyze the time sequence of the working status change of the relay group;
[0046] According to the time sequence of working status changes, the fault type of the turnout machine is identified.
[0047] By adopting the above technical solution, the working status of the relay group in each original image in the video data is obtained and sorted to analyze the working status change timing of the relay group each time the working status is switched. These change timings are analyzed to obtain the fault type of the turnout machine.
[0048] In a second aspect, the present application provides a relay combination state identification system, which adopts the following technical solutions:
[0049] A relay combination state recognition system, comprising:
[0050] An image acquisition module is configured to acquire an original image of a relay group for controlling the operation of a turnout machine; wherein the relay group includes at least one relay;
[0051] Model building module, building state recognition model;
[0052] The color block analysis module inputs the original image into the state recognition model, identifies the state of each relay in the original image through the state recognition model, and divides the original image into color blocks based on the state of each relay to generate a color block map;
[0053] The working state generation module analyzes the color block image and generates the working state of the relay group in the original image; the working state includes the relative position information and state attributes of each relay in the relay group.
[0054] In a third aspect, the present application provides a computer device that adopts the following technical solution:
[0055] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program according to any one of the above methods.
[0056] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution:
[0057] A computer-readable storage medium stores a computer program that can be loaded by a processor and executed in any of the above methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 This is a flowchart of a relay combination state identification method according to one embodiment of the present application.
[0059] Figure 2 This is a schematic diagram of an image showing the combination status identification of a relay according to one embodiment of the present application.
[0060] Figure 3 This is a flow chart of the method for training the state recognition model in one embodiment of the present application.
[0061] Figure 4 This is an image diagram of the state recognition model training in one embodiment of the present application.
[0062] Figure 5 This is an image diagram of a color block image analysis according to one embodiment of the present application.
[0063] Figure 6 This is a flow chart of a method for identifying a relay combination state according to one embodiment of the present application. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0065] The embodiment of the present application discloses a method for identifying a relay combination state. Figure 1 、 2 , a relay combination state identification method, comprising:
[0066] Step S101: obtaining an original image of a relay group for controlling the operation of a turnout machine;
[0067] The relay group includes at least one relay.
[0068] It should be understood that the number of relays included in the relay group of different models of turnout machines is different, and the turnout machine is controlled to perform different actions by changing the state of each relay in the relay group.
[0069] Step S102: constructing a state recognition model;
[0070] Step S103: Inputting the original image into the state recognition model, identifying the state of each relay in the original image through the state recognition model, and dividing the original image into color blocks based on the state of each relay to generate a color block map;
[0071] Step S104: analyzing the color blocks in the color block image to generate the working status of the relay group in the original image;
[0072] The working status includes the relative position information and status attributes of each relay in the relay group.
[0073] In the above embodiment, the state of each relay is identified by the constructed state recognition model, and the original image is divided into color blocks based on each relay state to obtain a color block diagram. The color block diagram is relatively simple in structure and can characterize the state of each relay in the relay group, so as to reduce the amount of subsequent data processing. The color blocks in the color block diagram are then analyzed to obtain the working state of the relay group in the original image, thereby achieving the effect of identifying the relay state combination.
[0074] Reference Figure 3 、 4 As an implementation of step S102, step S102 specifically includes a training step of training a preset network model to obtain a state recognition model; the preset network model includes a generator and a discriminator;
[0075] Specifically, the training steps include:
[0076] Step S1021: obtaining a training sample set, marking the position frames and states of the relay groups in a plurality of sample images included in the training sample set, and coloring the marked position frames in the sample images according to the marked states to obtain a marked image;
[0077] Among them, the marked states include the relay's picked-up state and dropped state;
[0078] The training sample set includes sample images of the relay group's operating states corresponding to all action combinations in the switch machine, captured under different viewing angles and lighting conditions. This makes the sample images more comprehensive, facilitating improved performance of the state recognition model trained using the training sample set.
[0079] It should be noted that, after obtaining the training sample set, a step of filtering the sample images in the training sample set is also included to screen out sample images with clearer relay group images for subsequent labeling.
[0080] Furthermore, after obtaining the sample training set, the method further includes the step of partitioning the dataset, that is, dividing the training set into a training set, a validation set, and a test set in a preset ratio. For example, the training set, validation set, and test set can be divided in a ratio of 7:2:1. In addition, the sample images in the training set can also be subjected to data augmentation processing, that is, rotating and flipping the sample images in the training set, and randomly modifying the brightness, contrast, saturation, and hue of the sample images in the training set to augment the training set. The purpose is to obtain more training set data, making the trained state recognition network more robust and having better generalization ability.
[0081] Specifically, step S1021 can be processed using the OpenCV (Open Source Computer Vision Library) image processing tool library.
[0082] Step S1022: segmenting the sample image using the generator to generate a color block prediction image;
[0083] In this embodiment, the generator is a U-net network model. U-net is a deep learning network model composed of two parts: an encoder (downsampling) and a decoder (upsampling). The encoder extracts image features layer by layer, while the decoder is responsible for restoring image details. In each layer of the U-net, there are jump connections between feature maps. These connections can fuse high-level features obtained in the encoder with low-level features in the decoder, thereby improving the generator's segmentation accuracy for sample images.
[0084] Step S1023: using a discriminator to perform authenticity verification on the color block prediction image and the corresponding sample image, respectively, to generate a first true probability that the labeled image is a true image and a second true probability that the color block prediction image is a true image;
[0085] In this embodiment, the discriminator is a Markov discriminator (PatchGAN), which is a discriminator of a generative adversarial network (GAN) based on a convolutional neural network, and is used to determine whether the color block prediction image is generated by the generator.
[0086] Step S1024: constructing a discriminant loss function of the discriminator according to the first true probability and the second true probability;
[0087] Specifically, the discriminant loss function of the discriminator is:
[0088] L cGAN (G, D) = E x,y [log(D(x,y)]+E x,z [log(1-D(x, G(x, z)))]
[0089] Where: D(x, y) is the probability that the discriminator believes that the labeled image is the true image; D(x, G(x, z)) is the probability that the discriminator believes that the color block predicted image is the true image.
[0090] Step S1025: constructing a pixel loss index based on the pixel difference between the color block prediction image and the annotated image, and constructing a generation loss function of the generator based on the pixel loss index and the discriminant loss function;
[0091] Specifically, the pixel loss index is: L L1 (G)=E x,y,z [||yG(x,z)||];
[0092] Where: y is the labeled image; G(x, z) is the image generated by the generator.
[0093] Then the generation loss function of the generator is:
[0094] G * =arg min_G max_D L cGAN (G, D) + λL L1 (G);
[0095] Where λ is a hyperparameter, which is a learnable parameter of the neural network; when λ = 0, it means that the L1 loss function is not used; min_G is the minimum L1 loss function when training the generator. cGAN (G, D), max_D is the maximum L when training the discriminator cGAN (G, D).
[0096] Step S1026: According to the discriminant loss function and the generator loss function, the generator and the discriminator are alternately trained until a Nash equilibrium is reached to obtain a state recognition model.
[0097] Reference Figure 4 , Figure 4 It is a schematic diagram of images during the training process. Figure 4 Where x represents the sample image. The sample image is input into the generator G to obtain the color block prediction map G(x). At this time, the discriminator D judges the probability that the color block prediction map G(x) is a true image based on the color block prediction map G(x) and the sample image. At the same time, it judges the probability that the labeled image y is a true image based on the labeled image y and the color block prediction map G(x).
[0098] It should be understood that in this embodiment, the state recognition model is the Pix2pix conditional generative adversarial network (cGAN, Condition Generative Adversarial Networks), which segments the sample image x through the generator G and uses the Markov discriminator D (PatchGAN) to discriminate the authenticity of the generated image G(x). At this time, the generator G and the discriminator D are trained alternately until the Nash equilibrium is reached and the training is stopped. The discriminator D of the trained state recognition model cannot distinguish the authenticity of the color block prediction map G(x) generated by the generator, indicating that the color block prediction map G(x) generated by the generator based on the sample image is realistic enough, and thus the training is stopped.
[0099] Among them, in this embodiment, achieving Nash equilibrium means that the strategy of the generator to generate the color block prediction map and the strategy of the discriminator to judge the labeled image and the color block prediction map are mutually optimal, that is, the goal of the generator is to maximize the probability that the discriminator mistakenly marks the generated sample as a real sample, so that the generated sample is as close to the real sample as possible, while the goal of the discriminator is to maximize the probability of correctly identifying the real sample and the generated sample, so as to try to distinguish the two. That is, for the discriminant loss function of the discriminator, it is hoped that D(x, G(x, z)) is as small as possible, that is, it is hoped that L cGAN The larger (G, D) is, the better. This way, the discriminator can easily judge the authenticity of the color block prediction map. On the contrary, for the generator, it is hoped that the generated color block prediction map is as real as possible, that is, D(x, G(x, z)) is as large as possible, that is, it is hoped that L cGAN The smaller (G, D) is, the better, so that the discriminator will find it difficult to judge the authenticity of the generated color block prediction map.
[0100] Specifically, during training, if the loss function values of both the generator and the discriminator stabilize and no longer decrease significantly, a Nash equilibrium can be determined. Alternatively, if the discriminator's accuracy stabilizes when it cannot further improve its ability to distinguish between labeled images and color block predictions, a Nash equilibrium can be determined. Alternatively, if the generator and discriminator reach a dynamic equilibrium during training, meaning their performance can no longer be significantly improved through optimization, a Nash equilibrium can be determined.
[0101] In the above embodiment, the position box is filled with color by annotating the state to obtain an annotated image, and the annotated content is presented in the form of an image to facilitate subsequent processing. A discriminator is used to verify the authenticity of the color block prediction image and the corresponding sample image, and the first true probability and the second true probability obtained by the authenticity verification are used to construct the discriminant loss function of the discriminator, so that the discriminant loss function used to train the discriminator comprehensively considers the predicted image and the sample image; a generator is then used to translate the sample image to generate a color block prediction image, and a generator loss function is constructed based on the pixel difference between the color block prediction image and the annotated image and the discriminant loss function, so that the generator loss function used to train the generator comprehensively considers the actual pixel difference and the discrimination difference. Then, based on the discriminant loss function and the generation loss function, the generator and the discriminator are alternately trained until a Nash equilibrium is reached, that is, the generator and the discriminator are adversarially trained to continuously optimize the model performance to obtain a state recognition model, thereby facilitating improving the recognition accuracy of the trained state recognition model for the relay state.
[0102] As an implementation of step S1021, step S1021 specifically includes:
[0103] If the marked state is the sucked-up state, filling the marked position box in the sample image with the first color;
[0104] If the marked state is a dropped state, filling the marked position box in the sample image with a second color;
[0105] The area outside the position box in the sample image is filled with a third color to obtain a marked image.
[0106] Specifically, the first, second, and third colors should have significantly different color values. For example, the first color should be green, the second color should be red, and the third color should be black. The area outside the location box in the sample image is the background color. The annotated image obtained by coloring corresponds one-to-one with the sample image.
[0107] In the above embodiment, different standard states are filled with different colors to distinguish the state of the relay corresponding to each color block, and the annotation content is displayed on the annotated image corresponding to the sample image, which facilitates the use of the annotated image to train the model.
[0108] As an implementation of step S104, step S104 specifically includes:
[0109] Step S1041: identifying the outer bounding box of each color block in the color block image;
[0110] It should be understood that the color block image generated by the state recognition model is a color block containing the first color, the second color and the third color. At this time, the outer bounding boxes of these color blocks can be calculated according to the OpenCV tool library.
[0111] Step S1042: identifying the color attribute that occupies the largest area within the outer bounding box;
[0112] Step S1043: determining the relative position information of each relay according to the position of the external frame in the color block diagram;
[0113] Step S1044: Determine the state attribute corresponding to each relay based on the color attribute;
[0114] It should be understood that the color value can be calculated based on the ratio of the first color and the second color within the outer frame, and the color value can represent the corresponding state attribute of the relay. In this embodiment, the color value of the second color represents the fallen state of the relay, and the color value of the first color represents the attracted state of the relay.
[0115] Step S1045: Generate the working status of the relay group in the original image according to the relative position information and the status attributes.
[0116] Reference Figure 5 , Figure 5 This is a schematic diagram of analyzing the color block diagram. It can be seen that each color block has an external border. Based on these external borders, the position attributes of the color block can be determined to obtain the phase position information of each relay. The state attributes corresponding to each relay are represented according to the color attributes. For example, in Figure 5 In the example, the relay group contains five relays, and the states of the relay group are [up, up, up, up, up, down, down].
[0117] In the above embodiment, the outer bounding box of each color block in the color block image is identified to determine the relative position information of each relay, and the state attribute corresponding to each relay is determined by identifying the color attribute that occupies the largest area within the outer bounding box. The state attribute and the corresponding relative position signal of each relay in the relay group in the original image are obtained, thereby realizing the generation of the working state of the relay in the original image.
[0118] As an implementation of the relay combination state identification method, the relay combination state identification method further includes:
[0119] Calculate the intersection-over-union ratio of each bounding box and the corresponding color block in the color block image;
[0120] Determine whether the intersection-to-combination ratio is greater than a preset threshold. If so, determine that the relative position information and state attributes of the corresponding relay are accurate, and output the relative position information and state attributes of the corresponding relay.
[0121] Reference Figure 5 , the outer border of each color block cannot completely cover the color block. At this time, the intersection over union ratio of each outer border and the corresponding color block in the color block diagram is calculated. The intersection over union ratio, or IOU (Intersection over Union), is a commonly used evaluation indicator. In this embodiment, the intersection over union ratio = intersection area / union area. The intersection area is the area of the overlapping part of the outer border and the corresponding color block, and the union area is the sum of the total area of the outer border and the corresponding color block minus the intersection area. The closer the intersection over union ratio is to 1, the higher the accuracy; the smaller the intersection over union ratio is, the lower the accuracy is.
[0122] The preset threshold of the intersection-over-union ratio can be preset according to actual conditions. For example, the preset threshold can be set to 0.6.
[0123] In the above embodiment, by judging whether the intersection-and-union ratio of the outer bounding box and the corresponding color block in the color block diagram is greater than a preset threshold, it is convenient to verify the relative position information and state attributes of each identified relay, so as to output only the relative position information and state attributes of relays with high accuracy, thereby improving the accuracy of recognition.
[0124] As an implementation of step S101, step S101 specifically includes:
[0125] Video data of a relay for controlling the operation of a turnout machine is obtained; each frame of image in the video data is used as an original image.
[0126] In the above embodiment, each frame of the video data of the relay for controlling the switch machine action combination is used as the original image, so as to realize the real-time monitoring and recognition of the switch machine action.
[0127] Reference Figure 6 As an implementation of the relay combination state identification method, the relay combination state identification method further includes:
[0128] Step S201: obtaining the working status of the relay group of each original image in the video data;
[0129] It should be understood that the instantaneous working state of the relay group can be obtained by the working state of the relay group in each original image.
[0130] It should also be understood that the working status of the relay group in the original image can be generated according to the method of steps S101 to S104, which will not be described in detail here.
[0131] Step S202: sorting the working states of the relay groups in chronological order and analyzing the time sequence of changes in the working states of the relay groups;
[0132] It should be understood that each frame of the video data carries time information, and the working states of the relay groups can be sorted according to the time sequence of the video data.
[0133] The working state change sequence includes the moment when the working state of the relay group switches and the working states before and after the switching.
[0134] Step S203: Identify the fault type of the turnout machine according to the time sequence of the working state change.
[0135] It should be understood that each action of the turnout machine has a corresponding fixed working state of the relay group, that is, the timing of the working state change of the turnout machine should be known. If an abnormality is found in the timing of the working state change, the fault type of the turnout machine can be identified in turn, or reported to the railway management center so that timely measures can be taken.
[0136] In the above embodiment, the working status of the relay group of each original image in the video data is obtained and sorted so as to analyze the working status change sequence of the relay group each time the working status is switched, and these change sequence are analyzed to obtain the fault type of the turnout machine.
[0137] The embodiment of the present application discloses a relay combination state identification system. A relay combination state identification system includes:
[0138] An image acquisition module is configured to acquire an original image of a relay group for controlling the operation of a turnout machine; wherein the relay group includes at least one relay;
[0139] Model building module, building state recognition model;
[0140] The color block analysis module inputs the original image into the state recognition model, identifies the state of each relay in the original image through the state recognition model, and divides the original image into color blocks based on the state of each relay to generate a color block map;
[0141] The working state generation module analyzes the color block image and generates the working state of the relay group in the original image; the working state includes the relative position information and state attributes of each relay in the relay group.
[0142] The relay combination state identification system provided in the present application can implement the above-mentioned relay combination state identification method, and the specific working process of the relay combination state identification system can refer to the corresponding process in the above-mentioned method embodiment.
[0143] It should be noted that, in the above embodiments, the description of each embodiment has different emphases. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0144] Based on the same technical concept, the present invention also discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program according to any of the above methods.
[0145] The present invention also discloses a computer-readable storage medium, which includes a computer program that can be loaded by a processor and executed in any of the above methods.
[0146] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interface, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0147] In addition, the functional modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0148] The above are all preferred embodiments of the present application and are not intended to limit the scope of protection of this application. Unless otherwise stated, any feature disclosed in this specification (including the abstract and drawings) may be replaced by other equivalent or similar features. In other words, unless otherwise stated, each feature is merely an example of a series of equivalent or similar features.
Claims
1. A method for identifying a relay combination state, characterized in that: include: Acquire an original image of a relay group for controlling the operation of a turnout machine; wherein the relay group includes at least one relay; Build a state recognition model; Inputting the original image into the state recognition model, identifying the state of each relay in the original image through the state recognition model, and dividing the original image into color blocks based on the state of each relay to generate a color block map; The color blocks in the color block image are analyzed to generate the working status of the relay group in the original image; the working status includes the relative position information and state attributes of each relay in the relay group.
2. The method according to claim 1, characterized in that The said constructing the state recognition model specifically includes the step of training a preset network model to obtain the said state recognition model; The preset network model includes a generator and a discriminator; The training step includes: Obtaining a training sample set, marking the position frames and states of the relay groups in a plurality of sample images included in the training sample set, and coloring the marked position frames in the sample images according to the marked states to obtain a marked image; Use the generator to segment the sample image to generate a color block prediction image; The discriminator is used to verify the authenticity of the color block prediction image and the corresponding sample image respectively, so as to generate a first true probability that the labeled image is a true image and a second true probability that the color block prediction image is a true image; Constructing a discriminant loss function of the discriminator based on the first true probability and the second true probability; According to the pixel difference between the color block prediction image and the annotated image, a pixel loss index is constructed, and the generation loss function of the generator is constructed based on the pixel loss index and the discriminant loss function; According to the discriminant loss function and the generative loss function, the generator and the discriminator are trained alternately until the Nash equilibrium is reached to obtain the state recognition model.
3. The method according to claim 2, characterized in that The training sample set includes sample images of the working states of the relay groups corresponding to all action combinations in the turnout machine collected under different viewing angles and light.
4. The method according to claim 2, characterized in that The marked states include the picked-up state and the dropped state of the relay; and filling the marked position frame in the sample image according to the marked states to obtain the marked image specifically includes: If the marked state is the sucked-up state, filling the marked position box in the sample image with the first color; If the marked state is a dropped state, filling the marked position box in the sample image with a second color; The area outside the position box in the sample image is filled with a third color to obtain a marked image.
5. The method according to claim 1, wherein The analyzing of the color blocks in the color block image to generate the working state of the relay group in the original image specifically includes: Identify the bounding box of each color block in the color block image respectively; Identify the color attribute that occupies the largest area within the bounding box; Determine the relative position information of each relay according to the position of the external border in the color block diagram; According to the color attribute, determine the state attribute corresponding to each relay; The working status of the relay group in the original image is generated based on the relative position information and state attributes.
6. The method according to claim 5, characterized in that Also includes: Calculate the intersection-over-union ratio of each bounding box and the corresponding color block in the color block image; Determine whether the intersection-to-combination ratio is greater than a preset threshold. If so, determine that the relative position information and state attributes of the corresponding relay are accurate, and output the relative position information and state attributes of the corresponding relay.
7. The method according to claim 1, characterized in that The obtaining of the original image of the relay for controlling the operation of the turnout machine specifically includes: Acquire video data of relays used to control the operation of turnout machines; Each frame of the video data is taken as an original image.
8. The method according to claim 7, characterized in that Also includes: Obtain the working status of the relay group for each original image in the video data; Sort the working status of the relay group in chronological order and analyze the time sequence of the working status change of the relay group; According to the time sequence of working status changes, the fault type of the turnout machine is identified.
9. A relay combination state identification system, characterized in that: include: An image acquisition module is configured to acquire an original image of a relay group for controlling the operation of a turnout machine; wherein the relay group includes at least one relay; Model building module, building state recognition model; The color block analysis module inputs the original image into the state recognition model, identifies the state of each relay in the original image through the state recognition model, and divides the original image into color blocks based on the state of each relay to generate a color block map; The working state generation module analyzes the color block image and generates the working state of the relay group in the original image; the working state includes the relative position information and state attributes of each relay in the relay group.
10. A computer-readable storage medium, characterized in that The method comprises storing a computer program capable of being loaded by a processor and executing the method according to any one of claims 1 to 8.
Citation Information
Cited By
Silicon wafer processing system, method and device for identifying state of silicon wafer in silicon wafer box, and medium
CN120955005A