Method and system for detecting the state of a voltage switch
By using the YOLO model and inspection robots to identify the position information of voltage switching switches and switch indicator arrows, and combining geometric relationships to determine the switch status, the problem of automated detection of electrical equipment has been solved, and management efficiency has been improved.
Patent Information
- Application Number
- CN202310190106.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-27
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2043-02-27
AI Technical Summary
Existing technologies make it difficult to automate the detection of the voltage switching indicator status of electrical equipment, which affects equipment management efficiency.
A target prediction model is constructed using the YOLO model. The inspection robot collects dashboard images, identifies and judges the position information of the voltage switching switch and the switch indicator arrow, and judges the indicator status of the switch by combining geometric relationships.
It enables automated detection of the voltage switching status indication of electrical equipment, improving the efficiency of remote control for equipment management.
Smart Images

Figure CN116168381B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, specifically to a method and system for detecting the state of a voltage switching switch. Background Technology
[0002] A voltage transfer switch is a low-voltage switch that switches multiple circuits. Multiple moving contacts are welded onto a shaft. As the shaft rotates, the moving contacts sequentially connect or disconnect with the stationary contacts, switching the circuit. Taking the standard electrical equipment in a digital standard production workshop as an example, there are four text labels on the top, right, bottom, and left sides. Starting from the top label and rotating clockwise, the labels are sequentially 0, U, etc. AB U BC U CA During operation, the indicator switch is in both horizontal and vertical positions, with the position indicated by the red arrow indicating the switch status. Automated detection of the voltage changeover switch indicator status on electrical equipment is part of a digital factory equipment management system, enabling effective monitoring of equipment operation and improving management efficiency.
[0003] To improve the effectiveness of electrical equipment operation and management, how to automatically detect the voltage switching indicator status of electrical equipment is a technical problem that needs to be solved. Summary of the Invention
[0004] The technical objective of this invention is to address the above-mentioned shortcomings by providing a method and system for detecting the status of voltage switching switches, thereby solving the technical problem of how to automatically detect the indication status of voltage switching switches in electrical equipment.
[0005] In a first aspect, the present invention provides a method for detecting the state of a voltage switching switch, comprising the following steps:
[0006] For each electrical device, historical dashboard images of the electrical device are collected, and the historical dashboard images include voltage switching switches;
[0007] For each historical dashboard image, the detection objects in the historical dashboard image are divided into two categories: voltage switching switches and switch indicator arrows. For each detection object, based on the visual characteristics of the detection object, the detection bounding box of the detection object in the corresponding historical dashboard image is marked and the coordinate information of the detection object is obtained.
[0008] A target prediction model is constructed based on the YOLO model. The target prediction model is used to predict the category information and location information of the detected objects in the dashboard image as input.
[0009] Using historical dashboard images as sample images, the target prediction model is trained based on the sample images and the category and coordinate information of the detected objects in the sample images to obtain the trained target prediction model.
[0010] For each electrical device, the instrument panel image of the electrical device is acquired as the image to be tested. The instrument panel image contains a voltage switching switch. The image to be tested is predicted by a trained target prediction model to obtain the category information and location information of the detected object in the image to be tested.
[0011] The indication status of the voltage switch is determined based on the position information of the voltage switch and the indicator arrow, as well as their geometric relationship.
[0012] Preferably, for each electrical device, the inspection robot collects historical dashboard images of the electrical device, collects the device ID of the electrical device, and establishes a mapping relationship between historical dashboard images and device IDs;
[0013] For each electrical device, the inspection robot collects the instrument panel image of the electrical device as the image to be tested, collects the device ID of the electrical device, and establishes a mapping relationship between the instrument panel image and the device ID;
[0014] The inspection robot travels along a predetermined planned path and captures dashboard images of electrical equipment using a camera.
[0015] Preferably, the target prediction model is trained based on the sample image and the category and coordinate information of the detected objects in the sample image, including the following steps:
[0016] The sample images are divided into a training set and a test set;
[0017] Based on the sample images in the training set and the category and coordinate information of the detected objects in the sample images, the target prediction model is pre-trained to obtain the pre-trained target prediction model.
[0018] The target prediction model is pre-trained to predict the sample images in the test set, thereby obtaining the category and location information of the detected objects in the sample images in the test set.
[0019] The predicted category and location information are compared with the actual labeled category and location information to obtain the comparison difference. Based on minimizing the comparison difference, the parameters of the pre-trained target prediction model are optimized to obtain the trained target prediction model.
[0020] Preferably, the visual characteristics of the voltage switching switch include:
[0021] The overall outline is square, the rotating handle is long and narrow, and its length and shape are asymmetrical with respect to the central axis of rotation. The indicator arrow is small and pointed.
[0022] In dashboard images captured by inspection robots, the shape transformation of squares caused by affine transformations does not affect the detection of square regions;
[0023] During the process of capturing dashboard images based on the inspection robot, the resulting image distortion is relatively small and will not affect the relative position of the switch indicator arrows;
[0024] The visual characteristics of the switch indicator arrow include:
[0025] On the side of the rotary handle indicator, there is a pointed shape with a thin, elongated triangular mark, and it is marked with a predetermined color;
[0026] The rotating shaft is located at the geometric center of the voltage switching switch.
[0027] Preferably, based on the positional information of the voltage switching switch and the switch indicator arrow, as well as their geometric relationship, the relative positional state of the switch indicator arrow relative to the voltage switching switch is determined, and the indication state of the voltage switching switch is determined based on the relative positional relationship, including the following steps:
[0028] For the rectangular switching detection frame formed by the position information of the voltage switching switch, select the coordinates of the lower left point (x1, y1) and the upper right point (x2, y2) of the switching detection frame, and construct a calculation coordinate system with the lower left point as the origin. In the calculation coordinate system, the coordinates of the lower left point are (0, 0) and the coordinates of the upper right point are (m2, n2).
[0029] For the indicator arrow detection frame formed by the position information of the switch indicator arrow, calculate the coordinates of the center point of the indicator arrow detection frame in the calculated coordinate system to obtain the center point coordinates (x, y). ca ,y ca );
[0030] The voltage switching detection area is divided into four quadrants. Starting from the upper quadrant, rotate clockwise and label the four quadrants as areas A, B, C, and D respectively.
[0031] The dividing lines of the four quadrants are:
[0032]
[0033] Based on the coordinates of the center point (x) in the calculated coordinate system ca ,y caThe geometric relationship between the lower left point (0,0) and the upper right point (m2,n2) is determined, and the quadrant setting is combined with the preset judgment rules to determine the relative position of the switch indicator arrow relative to the voltage switch, and the indication state of the voltage switch is determined based on the relative position state.
[0034] The determination rule is as follows:
[0035] when and At that time, it is area B, indicating U. AB state;
[0036] when and At that time, it is area C, indicating U. BC state;
[0037] when and When it is region D, it indicates U. CA state;
[0038] In other cases, or when and When the time is right, it is area A, indicating state 0.
[0039] In a second aspect, the present invention provides a state detection system for a voltage switching switch, used to detect the state of a voltage switching switch by means of the state detection method for a voltage switching switch as described in any one of the first aspects, the system comprising:
[0040] The data acquisition module, for each electrical device, is used to acquire historical instrument panel images of the electrical device, the historical instrument panel images containing voltage switching switches; and to acquire instrument panel images of the electrical device as images to be tested, the instrument panel images containing voltage switching switches;
[0041] The detection object identification module is used to divide the detection objects in the historical dashboard image into two categories for each historical dashboard image: voltage switching switches and switch indicator arrows. For each detection object, based on the visual characteristics of the detection object, the detection bounding box of the detection object in the corresponding historical dashboard image is marked and the coordinate information of the detection object is obtained.
[0042] The model building and training module is used to build a target prediction model based on the YOLO model. The target prediction model is used to predict the category information and location information of the detected objects in the dashboard image as input. It is also used to train the target prediction model based on historical dashboard images and the category information and coordinate information of the detected objects in the sample images to obtain the trained target prediction model.
[0043] The object prediction module is used to predict the image to be tested using a trained target prediction model to obtain the category information and location information of the objects to be detected in the image to be tested.
[0044] A voltage switching switch indication judgment module is used to determine the indication state of the voltage switching switch based on the position information of the voltage switching switch and the switch indication arrow, as well as the geometric relationship between the voltage switching switch and the switch indication arrow.
[0045] Preferably, for each electrical device, the data acquisition module is used to collect historical dashboard images of the electrical device based on the inspection robot, collect the device ID of the electrical device, and establish a mapping relationship between the historical dashboard images and the device ID;
[0046] For each electrical device, the data acquisition module is used to collect the instrument panel image of the electrical device as the image to be tested based on the inspection robot, and to collect the device ID of the electrical device and establish a mapping relationship between the instrument panel image and the device ID;
[0047] The inspection robot travels along a predetermined planned path and captures dashboard images of electrical equipment using a camera.
[0048] Preferably, the model building and training module is used to perform the following model training on the target prediction model:
[0049] The sample images are divided into a training set and a test set;
[0050] Based on the sample images in the training set and the category and coordinate information of the detected objects in the sample images, the target prediction model is pre-trained to obtain the pre-trained target prediction model.
[0051] The target prediction model is pre-trained to predict the sample images in the test set, thereby obtaining the category and location information of the detected objects in the sample images in the test set.
[0052] The predicted category and location information are compared with the actual labeled category and location information to obtain the comparison difference. Based on minimizing the comparison difference, the parameters of the pre-trained target prediction model are optimized to obtain the trained target prediction model.
[0053] Preferably, the visual characteristics of the voltage switching switch include:
[0054] The overall outline is square, the rotating handle is long and narrow, and its length and shape are asymmetrical with respect to the central axis of rotation. The indicator arrow is small and pointed.
[0055] In dashboard images captured by inspection robots, the shape transformation of squares caused by affine transformations does not affect the detection of square regions;
[0056] During the process of capturing dashboard images based on the inspection robot, the resulting image distortion is relatively small and will not affect the relative position of the switch indicator arrows;
[0057] The visual characteristics of the switch indicator arrow include:
[0058] On the side of the rotary handle indicator, there is a pointed shape with a thin, elongated triangular mark, and it is marked with a predetermined color;
[0059] The rotating shaft is located at the geometric center of the voltage switching switch.
[0060] Preferably, the voltage switching switch indication judgment module is used to determine the relative position state of the switch indication arrow relative to the voltage switching switch based on the position information of the voltage switching switch and the switch indication arrow and the geometric relationship between the voltage switching switch and the switch indication arrow, and to determine the indication state of the voltage switching switch based on the relative position relationship.
[0061] The voltage switching indicator judgment module is used to perform the following judgment on the indication status of the voltage switching switch:
[0062] For the rectangular switching detection frame formed by the position information of the voltage switching switch, select the coordinates of the lower left point (x1, y1) and the upper right point (x2, y2) of the switching detection frame, and construct a calculation coordinate system with the lower left point as the origin. In the calculation coordinate system, the coordinates of the lower left point are (0, 0) and the coordinates of the upper right point are (m2, n2).
[0063] For the indicator arrow detection frame formed by the position information of the switch indicator arrow, calculate the coordinates of the center point of the indicator arrow detection frame in the calculated coordinate system to obtain the center point coordinates (x, y). ca ,y ca );
[0064] The voltage switching detection area is divided into four quadrants. Starting from the upper quadrant, rotate clockwise and label the four quadrants as areas A, B, C, and D respectively.
[0065] The dividing lines of the four quadrants are:
[0066]
[0067]
[0068] Based on the coordinates of the center point (x) in the calculated coordinate system ca ,y ca The geometric relationship between the lower left point (0,0) and the upper right point (m2,n2) is determined, and the quadrant setting is combined with the preset judgment rules to determine the relative position of the switch indicator arrow relative to the voltage switch, and the indication state of the voltage switch is determined based on the relative position state.
[0069] The determination rule is as follows:
[0070] when and At that time, it is area B, indicating U. AB state;
[0071] when and At that time, it is area C, indicating U. BC state;
[0072] when and When it is region D, it indicates U. CA state;
[0073] In other cases, or when and When the time is right, it is area A, indicating state 0.
[0074] The voltage switching switch status detection method and system of the present invention have the following advantages: based on the inspection robot to acquire the instrument panel image containing the voltage switching switch, the target prediction model after training is used to predict the detection object in the instrument panel image, and obtain the category information and coordinate information of the voltage switching switch and the switch indicator arrow. With the help of the coordinate information and the geometric relationship between the two, the indicator status of the switch is determined, which effectively improves the efficiency of remote management and control of electrical equipment. Attached Figure Description
[0075] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0076] The invention will be further described below with reference to the accompanying drawings.
[0077] Figure 1 This is a flowchart of the state detection method for the voltage switching switch in Example 1;
[0078] Figure 2 This is a schematic diagram comparing the quadrant settings with the voltage switching switch in the state detection method of the voltage switching switch in Example 1. Detailed Implementation
[0079] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments are not intended to limit the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.
[0080] This invention provides a method and system for detecting the state of a voltage switching switch, which solves the technical problem of how to automatically detect the indication state of a voltage switching switch in electrical equipment.
[0081] Example 1:
[0082] The present invention provides a method for detecting the state of a voltage switching switch, comprising the following steps:
[0083] S100. For each electrical device, acquire a historical dashboard image of the electrical device, the historical dashboard image containing a voltage switching switch;
[0084] S200. For each historical dashboard image, the detection objects in the historical dashboard image are divided into two categories: voltage switching switches and switch indicator arrows. For each detection object, based on the visual characteristics of the detection object, the detection bounding box of the detection object in the corresponding historical dashboard image is marked and the coordinate information of the detection object is obtained.
[0085] S300. Construct a target prediction model based on the YOLO model. The target prediction model is used to predict the category information and location information of the detected objects in the dashboard image as input.
[0086] Using historical dashboard images as sample images, the target prediction model is trained based on the sample images and the category and coordinate information of the detected objects in the sample images to obtain the trained target prediction model.
[0087] S400. For each electrical device, the instrument panel image of the electrical device is acquired as the image to be tested. The instrument panel image contains a voltage switching switch. The image to be tested is predicted by a trained target prediction model to obtain the category information and location information of the detected object in the image to be tested.
[0088] S500: Based on the position information of the voltage switching switch and the switch indicator arrow, as well as the geometric relationship between the voltage switching switch and the switch indicator arrow, determine the indication status of the voltage switching switch.
[0089] In step S100 of this embodiment, for each electrical device, the historical dashboard image of the electrical device is collected based on the inspection robot, and the device ID of the electrical device is collected, and a mapping relationship between the historical dashboard image and the device ID is established.
[0090] In the corresponding step S400, for each electrical device, the instrument panel image of the electrical device is collected by the inspection robot as the image to be tested, and the device ID of the electrical device is collected, and a mapping relationship between the instrument panel image and the device ID is established.
[0091] The inspection robot travels along a predetermined planned path and captures dashboard images of electrical equipment using a camera.
[0092] The inspection robot is equipped with a 6-megapixel fixed-focus camera. Following path planning and a pre-configured robot control algorithm, when inspecting the production line in the workshop, the robot controls the camera shutter and sets the exposure time when it reaches a certain distance in front of electrical equipment. This ensures that the front of the equipment's instrument panel can be photographed for online detection and processing. The image may contain one or more voltage switching switches.
[0093] In step S200 of this embodiment, the objects to be detected in the instrument panel image are divided into two categories: voltage switching switches and indicator arrows, which are labeled as voltmeter switch and indicating arrow, respectively. Visual characteristic analysis is then performed on the two objects to be detected.
[0094] The visual characteristics of the voltage switching switch are: (1) The overall external outline is square, the rotating handle is long and narrow, and its length and shape are asymmetrical relative to the central rotation axis. The indicator arrow is small and pointed; (2) In the image captured by the robot, the square shape transformation caused by affine transformation does not affect the detection of the square area; (3) The image distortion formed during the shooting process is relatively small and will not affect the relative position of the indicator arrow.
[0095] The visual characteristics of the switch indicator arrow are: (1) On the side of the rotating handle, there is a pointed shape and a long, thin triangular mark, which is usually red for easy reading; (2) The rotating shaft is located at the geometric center of the voltage switching switch.
[0096] In this embodiment, the detection of the target object includes the detection of the voltage switching switch and the switch indicator arrow. For ease of labeling, the voltage switching switch and the switch indicator arrow are simplified and labeled as switch and arrow, respectively.
[0097] Considering the visual characteristics of the targets to be detected, the voltage switching switch has a relatively standardized external contour shape, and the switch indicator arrow has relatively simple external geometric features, belonging to small targets with inconspicuous visual characteristics. Simultaneously, given the real-time requirements of the inspection robot, the detection model needs to have fast detection and inference speeds. Therefore, the selection of the detection model must balance accuracy and real-time performance. The YOLO series of detection models are high-performing models for target detection tasks, and with the continuous efforts of researchers, new generations of YOLO series detection models are constantly being released, continuously improving detection accuracy and speed.
[0098] The YOLOv7 detection algorithm, compared to other models, significantly reduces the number of parameters and computational cost, greatly improving inference speed and detection accuracy. Its speed and accuracy within the 5FPS to 160FPS range surpass those of currently known object detection algorithms, offering significant advantages in practical object detection engineering applications. In this embodiment, the YOLOv7 detection algorithm is used to construct a template prediction model.
[0099] In this embodiment, step S300 executes the following process to train the target prediction model:
[0100] (1) Divide the sample images into a training set and a test set;
[0101] (2) Based on the sample images in the training set and the category information and coordinate information of the detected objects in the sample images, the target prediction model is pre-trained to obtain the pre-trained target prediction model;
[0102] (3) Predict the sample images in the test set by using the pre-trained target prediction model to obtain the category information and location information of the detected objects in the sample images in the test set;
[0103] (4) Compare the predicted category information and location information with the actual labeled category information and location information to obtain the comparison difference. Based on minimizing the comparison difference, optimize the parameters of the pre-trained target prediction model to obtain the trained target prediction model.
[0104] In practice, the 800 collected images were divided into a training set and a test set (validation set) in an 8:2 ratio. Appropriate training parameters, such as the learning rate and number of training epochs, were set. The model was trained separately on the training set and on the entire dataset (including both the training and test / validation sets) to obtain the optimal training model.
[0105] Step S400 uses the trained target prediction model to perform target detection on the acquired dashboard image containing the voltage switching switch, and outputs the category information and coordinate information of the detected object. The coordinate information is denoted as (x, y, w, h). Based on the coordinate information, the detection bounding box of each detected object can be obtained. The above coordinate information is based on the coordinate values of the original dashboard image.
[0106] Step S500 determines the relative position of the switch indicator arrow with respect to the voltage switch based on the position information of the voltage switch and the switch indicator arrow and the geometric relationship between the voltage switch and the switch indicator arrow, and determines the indication state of the voltage switch based on the relative position relationship.
[0107] In a specific implementation, step S500 includes the following operations:
[0108] (1) For the rectangular switching detection frame formed by the position information of the voltage switching switch, select the coordinates of the lower left point (x1, y1) and the upper right point (x2, y2) of the switching detection frame, and construct a calculation coordinate system with the lower left point as the origin. In the calculation coordinate system, the coordinates of the lower left point are (0, 0) and the coordinates of the upper right point are (m2, n2).
[0109] (2) For the indicator arrow detection frame formed by the position information of the switch indicator arrow, calculate the coordinates of the center point of the indicator arrow detection frame in the calculated coordinates to obtain the center point coordinates (x, y). ca ,y ca );
[0110] (3) Divide the voltage switching detection area into four quadrants. Starting from the upper quadrant, rotate clockwise and label the four quadrants as A, B, C and D areas respectively.
[0111] The dividing lines of the four quadrants are:
[0112]
[0113] Based on the coordinates of the center point (x) in the calculated coordinate system ca ,y ca The geometric relationship between the lower left point (0,0) and the upper right point (m2,n2) is determined, and the quadrant setting is combined with the preset judgment rules to determine the relative position of the switch indicator arrow relative to the voltage switch, and the indication state of the voltage switch is determined based on the relative position state.
[0114] The determination rule is as follows:
[0115] when and At that time, it is area B, indicating U. AB state;
[0116] when and At that time, it is area C, indicating U. BC state;
[0117] when and When it is region D, it indicates U. CA state;
[0118] In other cases, or when and When the time is right, it is area A, indicating state 0.
[0119] Based on the above operations, the indication status of the voltage switching switch can be obtained. If there is more than one voltage switching switch, the detection results are given in sequence from the top left to the bottom right.
[0120] When the inspection robot moves to each electrical cabinet, it records the equipment number of that machine and establishes a mapping relationship between the equipment number and the dashboard image.
[0121] Example 2:
[0122] The present invention discloses a voltage switching switch state detection system, comprising a data acquisition module, a detection object identification module, a model construction and training module, a detection object prediction module, and a voltage switching switch indication judgment module. The system is used to execute the method disclosed in Embodiment 1 to realize the state detection of the voltage switching switch.
[0123] For each electrical device, the data acquisition module is used to acquire historical instrument panel images of the electrical device, the historical instrument panel images containing voltage switching switches; and to acquire instrument panel images of the electrical device as images to be tested, the instrument panel images containing voltage switching switches.
[0124] In this embodiment, the data acquisition module is used to collect historical dashboard images of electrical equipment based on the inspection robot, and to collect the device ID of the electrical equipment, and to establish a mapping relationship between the historical dashboard images and the device ID; at the same time, the data acquisition module is used to collect dashboard images of the electrical equipment based on the inspection robot as images to be tested, and to collect the device ID of the electrical equipment, and to establish a mapping relationship between the dashboard images and the device ID.
[0125] The inspection robot is equipped with a 6-megapixel fixed-focus camera. Following path planning and a pre-configured robot control algorithm, when inspecting the production line in the workshop, the robot controls the camera shutter and sets the exposure time when it reaches a certain distance in front of electrical equipment. This ensures that the front of the equipment's instrument panel can be photographed for online detection and processing. The image may contain one or more voltage switching switches.
[0126] For each historical dashboard image, the detection object identification module is used to divide the detection objects in the historical dashboard image into two categories: voltage switching switches and switch indicator arrows. For each detection object, based on the visual characteristics of the detection object, the detection bounding box of the detection object in the corresponding historical dashboard image is marked and the coordinate information of the detection object is obtained.
[0127] The objects detected in the dashboard image are divided into two categories: voltage switching switches and indicator arrows, labeled as voltmeter switch and indicating arrow, respectively. Visual characteristics of these two objects are then analyzed.
[0128] The visual characteristics of the voltage switching switch are: (1) The overall external outline is square, the rotating handle is long and narrow, and its length and shape are asymmetrical relative to the central rotation axis. The indicator arrow is small and pointed; (2) In the image captured by the robot, the square shape transformation caused by affine transformation does not affect the detection of the square area; (3) The image distortion formed during the shooting process is relatively small and will not affect the relative position of the indicator arrow.
[0129] The visual characteristics of the switch indicator arrow are: (1) On the side of the rotating handle, there is a pointed shape and a long, thin triangular mark, which is usually red for easy reading; (2) The rotating shaft is located at the geometric center of the voltage switching switch.
[0130] In this embodiment, the detection of the target object includes the detection of the voltage switching switch and the switch indicator arrow. For ease of labeling, the voltage switching switch and the switch indicator arrow are simplified and labeled as switch and arrow, respectively.
[0131] The model building and training module is used to build a target prediction model based on the YOLO model. The target prediction model is used to take the dashboard image as input and predict the category information and location information of the detected objects in the dashboard image. It is also used to train the target prediction model based on historical dashboard images and the category information and coordinate information of the detected objects in the sample images, so as to obtain the trained target prediction model.
[0132] Considering the visual characteristics of the targets to be detected, the voltage switching switch has a relatively standardized external contour shape, and the switch indicator arrow has relatively simple external geometric features, belonging to small targets with inconspicuous visual characteristics. Simultaneously, given the real-time requirements of the inspection robot, the detection model needs to have fast detection and inference speeds. Therefore, the selection of the detection model must balance accuracy and real-time performance. The YOLO series of detection models are high-performing models for target detection tasks, and with the continuous efforts of researchers, new generations of YOLO series detection models are constantly being released, continuously improving detection accuracy and speed.
[0133] The YOLOv7 detection algorithm, compared to other models, significantly reduces the number of parameters and computational cost, greatly improving inference speed and detection accuracy. Its speed and accuracy within the 5FPS to 160FPS range surpass those of currently known object detection algorithms, offering significant advantages in practical object detection engineering applications. In this embodiment, the YOLOv7 detection algorithm is used to construct a template prediction model.
[0134] In this embodiment, the model building and training module is used to execute the following process to train the target prediction model:
[0135] (1) Divide the sample images into a training set and a test set;
[0136] (2) Based on the sample images in the training set and the category information and coordinate information of the detected objects in the sample images, the target prediction model is pre-trained to obtain the pre-trained target prediction model;
[0137] (3) Predict the sample images in the test set by using the pre-trained target prediction model to obtain the category information and location information of the detected objects in the sample images in the test set;
[0138] (4) Compare the predicted category information and location information with the actual labeled category information and location information to obtain the comparison difference. Based on minimizing the comparison difference, optimize the parameters of the pre-trained target prediction model to obtain the trained target prediction model.
[0139] In practice, the 800 collected images were divided into a training set and a test set (validation set) in an 8:2 ratio. Appropriate training parameters, such as the learning rate and number of training epochs, were set. The model was trained separately on the training set and on the entire dataset (including both the training and test / validation sets) to obtain the optimal training model.
[0140] The object detection prediction module is used to predict the image to be tested using a trained target prediction model, thereby obtaining the category and location information of the objects to be detected in the image to be tested.
[0141] The voltage switching switch indication judgment module is used to determine the indication status of the voltage switching switch based on the position information of the voltage switching switch and the switch indication arrow, as well as the geometric relationship between the voltage switching switch and the switch indication arrow.
[0142] In this embodiment, the voltage switching switch indication judgment module is used to determine the relative position state of the switch indication arrow relative to the voltage switching switch based on the position information of the voltage switching switch and the switch indication arrow and the geometric relationship between the voltage switching switch and the switch indication arrow, and to determine the indication state of the voltage switching switch based on the relative position relationship.
[0143] In a specific implementation, this module is used to determine the indication status of the voltage switch as follows:
[0144] (1) For the rectangular switching detection frame formed by the position information of the voltage switching switch, select the coordinates of the lower left point (x1, y1) and the upper right point (x2, y2) of the switching detection frame, and construct a calculation coordinate system with the lower left point as the origin. In the calculation coordinate system, the coordinates of the lower left point are (0, 0) and the coordinates of the upper right point are (m2, n2).
[0145] (2) For the indicator arrow detection frame formed by the position information of the switch indicator arrow, calculate the coordinates of the center point of the indicator arrow detection frame in the calculated coordinates to obtain the center point coordinates (x, y). ca ,y ca );
[0146] (3) Divide the voltage switching detection area into four quadrants. Starting from the upper quadrant, rotate clockwise and label the four quadrants as A, B, C and D areas respectively.
[0147] The dividing lines of the four quadrants are:
[0148]
[0149] Based on the coordinates of the center point (x) in the calculated coordinate system ca ,y ca The geometric relationship between the lower left point (0,0) and the upper right point (m2,n2) is determined, and the quadrant setting is combined with the preset judgment rules to determine the relative position of the switch indicator arrow relative to the voltage switch, and the indication state of the voltage switch is determined based on the relative position state.
[0150] The determination rule is as follows:
[0151] when and At that time, it is area B, indicating U. AB state;
[0152] when and At that time, it is area C, indicating U. BC state;
[0153] when and When it is region D, it indicates U. CA state;
[0154] In other cases, or when and When the time is right, it is area A, indicating state 0.
[0155] The system in this embodiment can be inserted into the electrical equipment control system as a module to realize online detection of voltage switching switches, so as to obtain the indication status of the voltage switching switches. If there are more than one voltage switching switch, the detection results are given in sequence from the top left to the bottom right.
[0156] When the inspection robot moves to each electrical cabinet, it records the equipment number of that machine and establishes a mapping relationship between the equipment number and the dashboard image.
[0157] The present invention has been shown and described in detail above with reference to the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above embodiments, those skilled in the art will know that more embodiments of the present invention can be obtained by combining the code review methods in the different embodiments. These embodiments are also within the protection scope of the present invention.
Claims
1. A method for detecting the state of a voltage switching switch, characterized in that, Includes the following steps: For each electrical device, historical dashboard images of the electrical device are collected, and the historical dashboard images include voltage switching switches; For each historical dashboard image, the detection objects in the historical dashboard image are divided into two categories: voltage switching switches and switch indicator arrows. For each detection object, based on the visual characteristics of the detection object, the detection bounding box of the detection object in the corresponding historical dashboard image is marked and the coordinate information of the detection object is obtained. A target prediction model is constructed based on the YOLO model. The target prediction model is used to predict the category information and location information of the detected objects in the dashboard image as input. Using historical dashboard images as sample images, the target prediction model is trained based on the sample images and the category and coordinate information of the detected objects in the sample images to obtain the trained target prediction model. For each electrical device, the instrument panel image of the electrical device is acquired as the image to be tested. The instrument panel image contains a voltage switching switch. The image to be tested is predicted by a trained target prediction model to obtain the category information and location information of the detected object in the image to be tested. Based on the positional information of the voltage switching switch and the indicator arrow, as well as the geometric relationship between the voltage switching switch and the indicator arrow, the indication state of the voltage switching switch is determined. The visual characteristics of the voltage switching switch include: The overall outline is square, the rotating handle is long and narrow, and its length and shape are asymmetrical with respect to the central axis of rotation. The indicator arrow is small and pointed. In dashboard images captured by inspection robots, the shape transformation of squares caused by affine transformations does not affect the detection of square regions; During the process of capturing dashboard images based on the inspection robot, the resulting image distortion is relatively small and will not affect the relative position of the switch indicator arrows; The visual characteristics of the switch indicator arrow include: On the side of the rotary handle indicator, there is a pointed shape with a thin, elongated triangular mark, and it is marked with a predetermined color; The rotating shaft is located at the geometric center of the voltage switching switch; The process of determining the relative position of the switch indicator arrow with respect to the voltage switch, based on the position information of the voltage switch and the switch indicator arrow, as well as their geometric relationship, and then determining the indication state of the voltage switch based on the relative position relationship, includes the following steps: For the rectangular switching detection frame formed by the position information of the voltage switching switch, select the coordinates of the lower left point (x1, y1) and the upper right point (x2, y2) of the switching detection frame, and construct a calculation coordinate system with the lower left point as the origin. In the calculation coordinate system, the coordinates of the lower left point are (0, 0) and the coordinates of the upper right point are (m2, n2). For the indicator arrow detection frame formed by the position information of the switch indicator arrow, calculate the coordinates of the center point of the indicator arrow detection frame in the calculated coordinate system to obtain the center point coordinates (x, y). ca ,y ca ); The voltage switching detection area is divided into four quadrants. Starting from the upper quadrant, rotate clockwise and label the four quadrants as areas A, B, C, and D respectively. The dividing lines of the four quadrants are: Based on the coordinates of the center point (x) in the calculated coordinate system ca ,y ca The geometric relationship between the lower left point (0,0) and the upper right point (m2,n2) is determined, and the quadrant setting is combined with the preset judgment rules to determine the relative position of the switch indicator arrow relative to the voltage switch, and the indication state of the voltage switch is determined based on the relative position state. The determination rule is as follows: when and At that time, it is area B, indicating U. AB state; when and At that time, it is area C, indicating U. BC state; when and When it is region D, it indicates U. CA state; In other cases, or when and When the time is right, it is area A, indicating state 0.
2. The state detection method for a voltage switching switch according to claim 1, characterized in that, For each electrical device, the inspection robot collects historical dashboard images of the electrical device, collects the device ID of the electrical device, and establishes a mapping relationship between historical dashboard images and device IDs; For each electrical device, the inspection robot collects the instrument panel image of the electrical device as the image to be tested, collects the device ID of the electrical device, and establishes a mapping relationship between the instrument panel image and the device ID; The inspection robot travels along a predetermined planned path and captures dashboard images of electrical equipment using a camera.
3. The state detection method for a voltage switching switch according to claim 1, characterized in that, Based on the sample images and the category and coordinate information of the detected objects in the sample images, the target prediction model is trained, including the following steps: The sample images are divided into a training set and a test set; Based on the sample images in the training set and the category and coordinate information of the detected objects in the sample images, the target prediction model is pre-trained to obtain the pre-trained target prediction model. The target prediction model is pre-trained to predict the sample images in the test set, thereby obtaining the category and location information of the detected objects in the sample images in the test set. The predicted category and location information are compared with the actual labeled category and location information to obtain the comparison difference. Based on minimizing the comparison difference, the parameters of the pre-trained target prediction model are optimized to obtain the trained target prediction model.
4. A state detection system for a voltage switching switch, characterized in that, The system includes: The data acquisition module, for each electrical device, is used to acquire historical instrument panel images of the electrical device, the historical instrument panel images containing voltage switching switches; and to acquire instrument panel images of the electrical device as images to be tested, the instrument panel images containing voltage switching switches; The detection object identification module is used to divide the detection objects in the historical dashboard image into two categories for each historical dashboard image: voltage switching switches and switch indicator arrows. For each detection object, based on the visual characteristics of the detection object, the detection bounding box of the detection object in the corresponding historical dashboard image is marked and the coordinate information of the detection object is obtained. The model building and training module is used to build a target prediction model based on the YOLO model. The target prediction model is used to predict the category information and location information of the detected objects in the dashboard image as input. It is also used to train the target prediction model based on historical dashboard images and the category information and coordinate information of the detected objects in the sample images to obtain the trained target prediction model. The object prediction module is used to predict the image to be tested using a trained target prediction model to obtain the category information and location information of the objects to be detected in the image to be tested. A voltage switching switch indication judgment module is used to determine the indication state of the voltage switching switch based on the position information of the voltage switching switch and the switch indication arrow, as well as the geometric relationship between the voltage switching switch and the switch indication arrow. The visual characteristics of the voltage switching switch include: The overall outline is square, the rotating handle is long and narrow, and its length and shape are asymmetrical with respect to the central axis of rotation. The indicator arrow is small and pointed. In dashboard images captured by inspection robots, the shape transformation of squares caused by affine transformations does not affect the detection of square regions; During the process of capturing dashboard images based on the inspection robot, the resulting image distortion is relatively small and will not affect the relative position of the switch indicator arrows; The visual characteristics of the switch indicator arrow include: On the side of the rotary handle indicator, there is a pointed shape with a thin, elongated triangular mark, and it is marked with a predetermined color; The rotating shaft is located at the geometric center of the voltage switching switch; The voltage switching switch indication judgment module is used to determine the relative position state of the switch indication arrow relative to the voltage switching switch based on the position information of the voltage switching switch and the switch indication arrow and the geometric relationship between the voltage switching switch and the switch indication arrow, and to determine the indication state of the voltage switching switch based on the relative position relationship. The voltage switching indicator judgment module is used to perform the following judgment on the indication status of the voltage switching switch: For the rectangular switching detection frame formed by the position information of the voltage switching switch, select the coordinates of the lower left point (x1, y1) and the upper right point (x2, y2) of the switching detection frame, and construct a calculation coordinate system with the lower left point as the origin. In the calculation coordinate system, the coordinates of the lower left point are (0, 0) and the coordinates of the upper right point are (m2, n2). For the indicator arrow detection frame formed by the position information of the switch indicator arrow, calculate the coordinates of the center point of the indicator arrow detection frame in the calculated coordinate system to obtain the center point coordinates (x, y). ca ,y ca ); The voltage switching detection area is divided into four quadrants. Starting from the upper quadrant, rotate clockwise and label the four quadrants as areas A, B, C, and D respectively. The dividing lines of the four quadrants are: Based on the coordinates of the center point (x) in the calculated coordinate system ca ,y ca The geometric relationship between the lower left point (0,0) and the upper right point (m2,n2) is determined, and the quadrant setting is combined with the preset judgment rules to determine the relative position of the switch indicator arrow relative to the voltage switch, and the indication state of the voltage switch is determined based on the relative position state. The determination rule is as follows: when and At that time, it is area B, indicating U. AB state; when and At that time, it is area C, indicating U. BC state; when and When it is region D, it indicates U. CA state; In other cases, or when and When the time is right, it is area A, indicating state 0.
5. The voltage switching switch status detection system according to claim 4, characterized in that, For each electrical device, the data acquisition module is used to collect historical dashboard images of the electrical device based on the inspection robot, collect the device ID of the electrical device, and establish a mapping relationship between historical dashboard images and device IDs; For each electrical device, the data acquisition module is used to collect the instrument panel image of the electrical device as the image to be tested based on the inspection robot, and to collect the device ID of the electrical device and establish a mapping relationship between the instrument panel image and the device ID; The inspection robot travels along a predetermined planned path and captures dashboard images of electrical equipment using a camera.
6. The voltage switching switch status detection system according to claim 4, characterized in that, The model building and training module is used to perform the following training on the target prediction model: The sample images are divided into a training set and a test set; Based on the sample images in the training set and the category and coordinate information of the detected objects in the sample images, the target prediction model is pre-trained to obtain the pre-trained target prediction model. The target prediction model is pre-trained to predict the sample images in the test set, thereby obtaining the category and location information of the detected objects in the sample images in the test set. The predicted category and location information are compared with the actual labeled category and location information to obtain the comparison difference. Based on minimizing the comparison difference, the parameters of the pre-trained target prediction model are optimized to obtain the trained target prediction model.
Citation Information
Patent Citations
Pointer instrument detection and reading identification method based on mobile robot
CN110807355A
Radar shielding blind area calibration method and device
CN112799061A