CN117809078A - Training method and device for LED abnormality detection model of switch - Google Patents

Training method and device for LED abnormality detection model of switch Download PDF

Info

Publication number
CN117809078A
CN117809078A CN202311605940.9A CN202311605940A CN117809078A CN 117809078 A CN117809078 A CN 117809078A CN 202311605940 A CN202311605940 A CN 202311605940A CN 117809078 A CN117809078 A CN 117809078A
Authority
CN
China
Prior art keywords
led
network
training
sub
switch
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311605940.9A
Other languages
Chinese (zh)
Inventor
王新智
张广乐
郭月俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Metabrain Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Metabrain Intelligent Technology Co Ltd filed Critical Suzhou Metabrain Intelligent Technology Co Ltd
Priority to CN202311605940.9A priority Critical patent/CN117809078A/en
Publication of CN117809078A publication Critical patent/CN117809078A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The invention relates to the technical field of artificial intelligence, in particular to a training method and device for an LED abnormality detection model of a switch, wherein the method comprises the following steps: inputting an LED image training sample into an LED identification sub-network to carry out LED identification to obtain a first LED identification result; inputting the first LED identification result into an LED abnormal detection sub-network, and judging the abnormal state of the LED to obtain a first LED state judgment result; training the LED recognition sub-network based on the first LED recognition result and the corresponding LED recognition result training mark; training the LED identification sub-network and the LED abnormality detection sub-network based on the first LED state judging result and the corresponding LED state training mark, so as to obtain an exchanger LED abnormality detection model. The method can obtain the switch LED abnormality detection model with higher accuracy, and realize accurate abnormality detection of the switch LED.

Description

Training method and device for LED abnormality detection model of switch
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a training method and device for an LED abnormality detection model of a switch.
Background
An LED (Light Emitting Diode ) is a common semiconductor device, which can convert electric energy into visible light, and has the advantages of energy saving, long service life, small volume and the like, so that the LED is widely applied to equipment such as switches and plays a role in prompting and the like. When the LED is applied to the switch, by controlling the on-off, brightness, color, blinking pattern, etc. of the LED, it is possible to prompt the relevant person about the state of the switch, etc.
At present, a manual visual inspection mode is generally adopted to observe whether an LED is abnormal or not, and then whether a switch port corresponding to the LED is abnormal or not is determined. However, there are a number of drawbacks to the manual visual approach. First, due to visual fatigue, color weakness, achromatopsia, and other artifacts, the state of the LED of the switch is easily misjudged by manual visual inspection, or abnormal states such as missing part of the LED, and the like. Secondly, for larger switch equipment, the manual visual inspection method needs to consume a great deal of time and labor, and the accuracy of detection is low. Finally, the manual visual inspection is easily affected by subjective consciousness and experience of the inspector, and misjudgment may occur in the state judgment of the LED or the like of the switch due to subjective difference of individuals.
Disclosure of Invention
The invention provides a training method and device for an LED abnormality detection model of a switch, which are used for solving the problems that in the prior art, a manual visual inspection mode is adopted to observe LEDs of the switch, so that the monitoring accuracy is low, and a large amount of time and labor are consumed.
The invention provides a training method for an LED abnormality detection model of a switch, which comprises the following steps:
Obtaining a training set, the training set comprising: LED image training samples of a plurality of switches, and training marks corresponding to the LED image training samples one by one, wherein the training marks comprise: LED recognition result training marks and LED state training marks;
inputting the LED image training sample into a preset LED identification sub-network to carry out LED identification to obtain a first LED identification result;
inputting the first LED identification result into a preset LED abnormal detection sub-network, and judging the abnormal state of the LEDs to obtain a first LED state judgment result;
training the LED recognition sub-network based on the difference between the first LED recognition result and the corresponding LED recognition result training mark; training the LED identification sub-network and the LED abnormality detection sub-network based on the difference between the first LED state judgment result and the corresponding LED state training identifier to obtain a target LED identification sub-network and a target LED abnormality detection sub-network;
and obtaining an LED abnormality detection model of the switch based on the target LED identification sub-network and the target LED abnormality detection sub-network.
According to the training method for the LED abnormality detection model of the switch, the first LED identification result comprises the following steps: the LED lamp color recognition method comprises the steps of a first LED lamp color recognition result and a first LED behavior recognition result, wherein the first LED behavior recognition result is flickering, long-bright or long-dark; the first LED state judging result is normal or abnormal; and under the condition that the first LED state judging result is abnormal, the output result of the LED abnormality detection sub-network further comprises abnormal port marking information, wherein the abnormal port marking information is information of a switch port corresponding to the abnormal LED.
According to the training method for the LED abnormality detection model of the switch, provided by the invention, the steps of obtaining the LED abnormality detection model of the switch based on the target LED identification sub-network and the target LED abnormality detection sub-network comprise the following steps:
acquiring a target LED image of the switch, and acquiring current signals and voltage signals of each LED of the switch, wherein the current signals correspond to the LEDs one by one, and the voltage signals correspond to the LEDs one by one;
inputting the target LED image into the target LED identification sub-network, and carrying out LED identification to obtain a second LED identification result, wherein the second LED identification result comprises: the second LED lamp color recognition result and the second LED behavior recognition result are flickering, long-bright or long-dark;
determining a standard lamp color of the corresponding LED based on the current signal;
determining standard behavior information of the corresponding LED based on the voltage signal, wherein the standard behavior information is flickering, long-bright or long-dark;
carrying out parameter correction on the target LED identification sub-network under the condition that the second LED lamp color identification result is different from the standard lamp color or the second LED behavior identification result is different from the standard behavior information;
And obtaining the switch LED abnormality detection model based on the target LED abnormality detection sub-network and the corrected target LED identification sub-network.
According to the training method for the LED abnormality detection model of the switch, provided by the invention, the step of obtaining the LED abnormality detection model of the switch based on the target LED abnormality detection sub-network and the corrected target LED identification sub-network comprises the following steps:
obtaining a check set, the check set comprising: LED image check samples of a plurality of switches and check marks corresponding to the LED image check samples one by one, wherein the check marks comprise: the LED identification result verification mark and the LED state verification mark;
using the verification set to verify the target LED abnormal detection sub-network and the corrected target LED identification sub-network;
and determining the target LED identification sub-network and the target LED abnormality detection sub-network which pass verification as the switch LED abnormality detection model.
According to the training method for the LED abnormality detection model of the switch, the step of utilizing the verification set to verify the target LED abnormality detection sub-network and the corrected target LED identification sub-network comprises the following steps:
Inputting the LED image verification sample into the corrected target LED identification sub-network to carry out LED identification to obtain a third LED identification result, wherein the third LED identification result comprises: the third LED lamp color recognition result and the third LED behavior recognition result are flickering, long-bright or long-dark;
inputting the third LED identification result into the corrected target LED abnormal detection sub-network, and judging the abnormal state of the LEDs to obtain a second LED state judgment result;
determining that the first LED is passed when the third LED identification result is the same as the corresponding LED identification result verification identifier and the second LED state judgment result is the same as the corresponding LED state verification identifier;
and under the condition that the continuous accumulated times of the one pass exceeds a preset verification threshold, determining that the target LED identification sub-network and the target LED abnormality detection sub-network pass the verification.
The invention also provides a training device for the LED abnormality detection model of the switch, which comprises the following steps:
the training set acquisition module is used for acquiring a training set, and the training set comprises: LED image training samples of a plurality of switches, and training marks corresponding to the LED image training samples one by one, wherein the training marks comprise: LED recognition result training marks and LED state training marks;
The LED recognition module is used for inputting the LED image training sample into a preset LED recognition sub-network to carry out LED recognition so as to obtain a first LED recognition result;
the LED abnormal state judging module is used for inputting the first LED identification result into a preset LED abnormal detection sub-network to judge the LED abnormal state so as to obtain a first LED state judging result;
the training module is used for training the LED recognition sub-network based on the difference between the first LED recognition result and the corresponding LED recognition result training mark; training the LED identification sub-network and the LED abnormality detection sub-network based on the difference between the first LED state judgment result and the corresponding LED state training identifier to obtain a target LED identification sub-network and a target LED abnormality detection sub-network;
and the processing module is used for obtaining the switch LED abnormality detection model based on the target LED identification sub-network and the target LED abnormality detection sub-network.
The invention also provides a method for detecting the LED abnormality of the switch, which comprises the following steps:
acquiring an LED image to be detected of a switch;
inputting the LED image to be detected into a preset switch LED abnormal detection model, and sequentially carrying out LED identification and LED abnormal state judgment to obtain a final LED state judgment result; the switch LED abnormality detection model is obtained by training based on the switch LED abnormality detection model training method according to any one of the above;
And when the final LED state judging result is abnormal, an alarm is sent out.
The invention also provides a device for detecting the LED abnormality of the switch, which comprises:
the LED image acquisition module to be detected is used for acquiring an LED image to be detected of the switch;
the abnormality detection module is used for inputting the LED image to be detected into a preset switch LED abnormality detection model, and sequentially carrying out LED identification and LED abnormal state judgment to obtain a final LED state judgment result; the switch LED abnormality detection model is obtained by training based on the switch LED abnormality detection model training method according to any one of the above;
and the alarm module is used for sending out an alarm when the final LED state judgment result is abnormal.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the training method of the LED abnormality detection model of the switch or the LED abnormality detection method of the switch when executing the program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a switch LED anomaly detection model training method as described in any one of the above, or a switch LED anomaly detection method.
The invention has the beneficial effects that: according to the training method and device for the LED abnormality detection model of the switch, the training set is obtained, and comprises the following steps: LED image training samples of a plurality of switches, and training marks corresponding to the LED image training samples one by one, wherein the training marks comprise: LED recognition result training marks and LED state training marks; inputting an LED image training sample into a preset LED identification sub-network to carry out LED identification to obtain a first LED identification result; inputting the first LED identification result into a preset LED abnormal detection sub-network, and judging the abnormal state of the LEDs to obtain a first LED state judgment result; training the LED recognition sub-network based on the difference between the first LED recognition result and the corresponding LED recognition result training mark; training the LED identification sub-network and the LED anomaly detection sub-network based on the difference between the first LED state judgment result and the corresponding LED state training mark to obtain a target LED identification sub-network and a target LED anomaly detection sub-network; and based on the target LED recognition sub-network and the target LED abnormality detection sub-network, obtaining an exchanger LED abnormality detection model. The method can obtain the switch LED abnormality detection model with higher accuracy, realizes accurate abnormality detection of the switch LED, effectively reduces labor cost, has higher degree of automation and stronger feasibility.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a training method for a switch LED anomaly detection model provided by the invention;
FIG. 2 is a schematic diagram of a flow chart for collecting data in the training method of the LED anomaly detection model of the switch;
FIG. 3 is a schematic flow chart of data labeling in the training method of the LED anomaly detection model of the switch;
fig. 4 is a schematic structural diagram of a training device for a switch LED anomaly detection model provided by the present invention;
fig. 5 is a schematic flow chart of a method for detecting LED abnormality of a switch according to the present invention;
fig. 6 is a schematic structural diagram of the switch LED anomaly detection device provided by the present invention;
fig. 7 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In order to facilitate understanding of the training method and device for the LED abnormality detection model of the switch, the invention relates to a part of technical terms for explanation.
TensorFlow: tensorFlow is an open-source deep learning framework developed and maintained by Google, supports two modes of a dynamic calculation graph and a static calculation graph, uses the static calculation graph to define the whole calculation graph first and then carries out calculation, and the dynamic calculation graph is more flexible and can better support a model of a dynamic structure.
CNN: CNN is known as Convolutional Neural Network, a convolutional neural network. Convolutional neural networks are an artificial neural network dedicated to processing data with a grid-like structure, mostly for image recognition tasks. The core idea is to construct a multi-layer network through a convolution layer (convolutional layer), a pooling layer (pooling layer) and a full connection layer (fully connected layer), so as to effectively extract features in input data and classify, identify or predict the features.
VGG: visual Geometry Group, a set of visual geometries. The visual geometry group is a very classical neural network model in the field of deep learning, and is commonly used for image recognition and computer vision tasks.
By way of example, the method and apparatus for training the switch LED anomaly detection model provided by the invention are described below with reference to FIGS. 1-7.
Referring to fig. 1, the training method for the switch LED anomaly detection model provided in the present embodiment includes:
s110: obtaining a training set, the training set comprising: LED image training samples of a plurality of switches, and training marks corresponding to the LED image training samples one by one, wherein the training marks comprise: LED recognition result training identification and LED state training identification.
The training set is a preprocessed training set, and the preprocessing comprises image graying processing and denoising processing. The LED recognition result training mark comprises: lamp color signs such as red, green, yellow, etc. The LED recognition result training mark further comprises: LED behavior marks such as green light flashing, red light flashing, long bright and long dark (long bright indicates long-time LED bright behavior, long dark indicates long-time LED dark behavior), and in the process of LED identification by the subsequent LED identification sub-network, the determination about "long time" can be set according to actual conditions, such as determining that all three consecutive pictures are bright as long bright, etc.), and the like. The LED status training identifier is normal or abnormal, and it can be understood that the LED status training identifier indicates that the corresponding LED is in a normal state or an abnormal state. By acquiring the training set, the LED recognition sub-network and the LED abnormality detection sub-network are convenient to train subsequently.
S120: and inputting the LED image training sample into a preset LED identification sub-network to carry out LED identification, so as to obtain a first LED identification result.
It should be noted that, the LED recognition sub-network is configured to perform LED recognition on an input image to obtain a first LED recognition result, which is a lamp color and behavior (such as green light flashing, red light flashing, long-light, and long-dark) of an LED in the image.
S130: and inputting the first LED identification result into a preset LED abnormal detection sub-network, and judging the abnormal state of the LEDs to obtain a first LED state judgment result.
The LED abnormality detection sub-network is configured to determine, based on an output result of the LED identification sub-network, an abnormal state of the LED, that is, determine, based on a lamp color and a behavior of the LED, whether the LED is in a normal state or in an abnormal state.
It should be further noted that, the LED identification sub-network and the LED anomaly detection sub-network in this embodiment are built based on a VGG pre-training model, that is, on the basis of the VGG pre-training model, the VGG pre-training model is fine-tuned by using a TensorFlow deep learning framework, so as to obtain a model framework composed of the LED identification sub-network and the LED anomaly detection sub-network in this embodiment, where the model framework belongs to the category of convolutional neural network models. Therefore, the LED recognition sub-network in the embodiment supports calculation of a dynamic calculation graph and a static calculation graph, and can well realize accurate recognition of LED lamp colors and behaviors in an LED image.
S140: training the LED recognition sub-network based on the difference between the first LED recognition result and the corresponding LED recognition result training mark; and training the LED identification sub-network and the LED abnormality detection sub-network based on the difference between the first LED state judging result and the corresponding LED state training identifier so as to obtain a target LED identification sub-network and a target LED abnormality detection sub-network.
The LED identification sub-network is trained based on the difference between the first LED identification result and the corresponding LED identification result training identifier, so that the LED identification sub-network with higher accuracy can be obtained. By training the LED identification sub-network and the LED abnormality detection sub-network based on the difference between the first LED state judgment result and the corresponding LED state training identifier, the accuracy of the LED identification sub-network can be further improved, and the accuracy of the LED abnormality detection sub-network can be improved. And determining the LED recognition sub-network with the training as a target LED recognition sub-network, and determining the LED abnormality detection sub-network with the training as a target LED abnormality detection sub-network.
It should be further noted that, based on the difference between the first LED identification result and the corresponding LED identification result training identifier, training is performed on the LED identification sub-network, where the mathematical expression of the first loss function adopted in the training process is:
L1(y(i),t(i))=-(t(i)·ln(y(i)))+(1-t(i))·ln(1-y(i))
wherein L1 (y (i), t (i)) represents a first loss function, t (i) represents an LED identification result of an ith port in the LED image training sample, y (i) represents a first LED identification result corresponding to the ith port in the LED image training sample, ln (·) represents natural logarithm operation, i has a value of (1, n), and n represents the number of ports in the LED image training sample. It will be appreciated that each port in the switch is typically associated with a respective LED for indicating the status of the current port.
It should be mentioned that by continuously minimizing the first loss function, a higher accuracy of the LED identification sub-network can be obtained.
In addition, in the above embodiment, based on the difference between the first LED status determination result and the corresponding LED status training identifier, the LED identification sub-network and the LED abnormality detection sub-network are trained, and the mathematical expression of the second loss function adopted in the training step is:
L2(X(i),r(i))=-9r(i)·ln(X(i)))+(1-r(i))·ln(1-X(i))
Wherein L2 (X (i), r (i)) represents a second loss function, X (i) represents a first LED state determination result corresponding to the i-th port in the LED image training sample, that is, normal or abnormal, and r (i) represents an LED state training identifier corresponding to the i-th port in the LED image training sample. And training the LED identification sub-network and the LED abnormality detection sub-network based on the second loss function, namely performing multiple iterations to obtain the LED identification sub-network and the LED abnormality detection sub-network with higher accuracy. And determining the LED recognition sub-network obtained based on the second loss function as a target LED recognition sub-network, and determining the LED abnormality detection sub-network obtained based on the second loss function as a target LED abnormality detection sub-network.
S150: and obtaining an LED abnormality detection model of the switch based on the target LED identification sub-network and the target LED abnormality detection sub-network. It should be noted that, the training method for the abnormal detection model of the switch LED in this embodiment can obtain the abnormal detection model of the switch LED with higher accuracy, so as to realize the accurate abnormal detection of the switch LED, effectively reduce the labor cost, and has higher automation degree, stronger feasibility and higher feasibility.
In some embodiments, the first LED identification result includes: the LED lamp color recognition method comprises the steps of a first LED lamp color recognition result and a first LED behavior recognition result, wherein the first LED behavior recognition result is flickering, long-bright or long-dark; the first LED state judging result is normal or abnormal; and under the condition that the first LED state judging result is abnormal, the output result of the LED abnormality detection sub-network further comprises abnormal port marking information, wherein the abnormal port marking information is information of a switch port corresponding to the abnormal LED.
Under the condition that the LED state is judged to be abnormal, corresponding abnormal port marking information is output, so that the abnormal ports are effectively positioned, the abnormal ports are conveniently overhauled and processed by related personnel, and the troubleshooting difficulty of the abnormal ports is reduced.
In some embodiments, the step of obtaining the switch LED anomaly detection model based on the target LED identification sub-network and the target LED anomaly detection sub-network includes:
s1501: the method comprises the steps of obtaining a target LED image of the switch, and obtaining current signals and voltage signals of each LED of the switch, wherein the current signals correspond to the LEDs one by one, and the voltage signals correspond to the LEDs one by one.
S1502: inputting the target LED image into the target LED identification sub-network, and carrying out LED identification to obtain a second LED identification result, wherein the second LED identification result comprises: the second LED lamp color recognition result and the second LED behavior recognition result are flickering, long-bright or long-dark.
S1503: based on the current signal, a standard lamp color of the corresponding LED is determined.
The wavelength information of the LED can be obtained based on the current signal of the LED, and the standard lamp color of the LED can be determined based on the wavelength information of the LED.
S1504: and determining standard behavior information of the corresponding LED based on the voltage signal, wherein the standard behavior information is flickering, long-bright or long-dark.
When the voltage signal is at a continuous high level, the standard behavior information of the LED is determined to be bright, when the voltage signal is at a continuous low level, the standard behavior information of the LED is determined to be dark, and when the voltage signal is in a state in which the voltage signal is frequently changed at a high and low level, the standard behavior information of the LED is determined to be blinking.
S1505: and carrying out parameter correction on the target LED identification sub-network under the condition that the second LED lamp color identification result is different from the standard lamp color or the second LED behavior identification result is different from the standard behavior information.
It should be noted that, when the second LED lamp color recognition result is different from the standard lamp color, or the second LED behavior recognition result is different from the standard behavior information, the parameter correction is performed on the target LED recognition sub-network, which can help to improve the accuracy of the target LED recognition sub-network.
S1506: and obtaining the switch LED abnormality detection model based on the target LED abnormality detection sub-network and the corrected target LED identification sub-network.
In some embodiments, the step of obtaining the switch LED anomaly detection model based on the target LED anomaly detection sub-network and the corrected target LED identification sub-network comprises:
s15061: obtaining a check set, the check set comprising: LED image check samples of a plurality of switches and check marks corresponding to the LED image check samples one by one, wherein the check marks comprise: and the LED identification result verification mark and the LED state verification mark.
It should be mentioned that the check set and the training set in the above embodiment are obtained in the same manner.
S15062: and utilizing the verification set to verify the target LED abnormal detection sub-network and the corrected target LED identification sub-network.
S15063: and determining the target LED identification sub-network and the target LED abnormality detection sub-network which pass verification as the switch LED abnormality detection model.
By using the verification set to verify the target LED anomaly detection sub-network and the corrected target LED identification sub-network, the accuracy and stability of the finally obtained target LED anomaly detection sub-network and target LED identification sub-network can be ensured.
Further, the step of verifying the target LED anomaly detection sub-network and the corrected target LED identification sub-network by using the verification set includes:
firstly, inputting the LED image verification sample into the corrected target LED identification sub-network to carry out LED identification to obtain a third LED identification result, wherein the third LED identification result comprises: and the third LED lamp color recognition result and the third LED behavior recognition result are flickering, long-bright or long-dark.
Second, the method is characterized by the following steps. And inputting the third LED identification result into the corrected target LED abnormal detection subnetwork, and judging the abnormal state of the LEDs to obtain a second LED state judgment result.
Then, determining that the first LED is passed when the third LED identification result is the same as the corresponding LED identification result verification identifier and the second LED status determination result is the same as the corresponding LED status verification identifier.
And finally, under the condition that the continuous accumulated times of the one pass exceeds a preset verification threshold, determining that the target LED identification sub-network and the target LED abnormality detection sub-network pass through verification. It should be noted that, the verification threshold may be set according to practical situations, such as 100 times.
It should be noted that, regarding the collection of image data in the training set and the calibration set in the above embodiment, the flow is as follows, please refer to fig. 2:
s210: the camera device and the driver are installed. Specifically, the image pickup device may be mounted at a position of the LED facing the switch.
S220: recording the imaging parameters and the driving parameters of the imaging device.
S230: and starting the image pickup device and driving, and shooting LEDs of the switch to obtain a plurality of LED images.
In addition, regarding the image data labeling in the training set and the verification set in the above embodiment, the flow is as follows, please refer to fig. 3:
s310: labeling rules are defined. Specifically, it is defined how to annotate, for example: the LEDs, LED lamp colors, and LED behaviors in each LED image are labeled, and the LED image in which the LEDs that are bright in red, the LEDs that are red and flash, and the LEDs that are yellow and flash, etc. are labeled as abnormal, and the other LED images are labeled as normal.
S320: and respectively labeling each LED image based on the labeling rule.
S330: and (5) quality control. The quality control mode can adopt a manual screening mode.
The device for training the abnormal detection model of the switch LED provided by the invention is described below, and the device for training the abnormal detection model of the switch LED described below and the method for training the abnormal detection model of the switch LED described above can be correspondingly referred to each other.
Referring to fig. 4, the training device for the abnormal detection model of the switch LED provided in this embodiment includes:
a training set obtaining module 410, configured to obtain a training set, where the training set includes: LED image training samples of a plurality of switches, and training marks corresponding to the LED image training samples one by one, wherein the training marks comprise: LED recognition result training marks and LED state training marks;
the LED identification module 420 is configured to input the LED image training sample into a preset LED identification sub-network, and perform LED identification to obtain a first LED identification result;
the LED abnormal state judging module 430 is configured to input the first LED identification result into a preset LED abnormal detection sub-network, and perform LED abnormal state judgment to obtain a first LED state judgment result;
The training module 440 is configured to train the LED identification sub-network based on a gap between the first LED identification result and the corresponding LED identification result training identifier, to obtain a target LED identification sub-network; training the LED identification sub-network and the LED abnormality detection sub-network based on the difference between the first LED state judgment result and the corresponding LED state training identifier to obtain a target LED abnormality detection sub-network;
and the processing module 450 is configured to obtain a switch LED anomaly detection model based on the target LED identification sub-network and the target LED anomaly detection sub-network. The training set acquisition module 410, the LED identification module 420, the LED abnormal state determination module 430, the training module 440, and the processing module 450 are connected. According to the switch LED abnormal detection model training device, the switch LED abnormal detection model with higher accuracy can be obtained, accurate abnormal detection of the switch LED is achieved, labor cost is effectively reduced, the degree of automation is higher, the feasibility is stronger, and the stability is higher.
In some embodiments, the processing module 450 is specifically configured to obtain a target LED image of the switch, and obtain a current signal and a voltage signal of each LED of the switch, where the current signal corresponds to the LEDs one by one, and the voltage signal corresponds to the LEDs one by one;
Inputting the target LED image into the target LED identification sub-network, and carrying out LED identification to obtain a second LED identification result, wherein the second LED identification result comprises: the second LED lamp color recognition result and the second LED behavior recognition result are flickering, long-bright or long-dark;
determining a standard lamp color of the corresponding LED based on the current signal;
determining standard behavior information of the corresponding LED based on the voltage signal, wherein the standard behavior information is flickering, long-bright or long-dark;
carrying out parameter correction on the target LED identification sub-network under the condition that the second LED lamp color identification result is different from the standard lamp color or the second LED behavior identification result is different from the standard behavior information;
and obtaining the switch LED abnormality detection model based on the target LED abnormality detection sub-network and the corrected target LED identification sub-network.
In some embodiments, the processing module 450 is further specifically configured to obtain a check set, where the check set includes: LED image check samples of a plurality of switches and check marks corresponding to the LED image check samples one by one, wherein the check marks comprise: the LED identification result verification mark and the LED state verification mark;
Using the verification set to verify the target LED abnormal detection sub-network and the corrected target LED identification sub-network;
and determining the target LED identification sub-network and the target LED abnormality detection sub-network which pass verification as the switch LED abnormality detection model.
In some embodiments, the processing module 450 is further specifically configured to input the LED image verification sample into the corrected target LED identification sub-network, perform LED identification, and obtain a third LED identification result, where the third LED identification result includes: the third LED lamp color recognition result and the third LED behavior recognition result are flickering, long-bright or long-dark;
inputting the third LED identification result into the corrected target LED abnormal detection sub-network, and judging the abnormal state of the LEDs to obtain a second LED state judgment result;
determining that the first LED is passed when the third LED identification result is the same as the corresponding LED identification result verification identifier and the second LED state judgment result is the same as the corresponding LED state verification identifier;
and under the condition that the continuous accumulated times of the one pass exceeds a preset verification threshold, determining that the target LED identification sub-network and the target LED abnormality detection sub-network pass the verification.
The following describes a method for detecting the abnormality of the switch LED.
Referring to fig. 5, the method for detecting LED abnormality of a switch provided in this embodiment includes:
s510: and acquiring an LED image to be detected of the switch.
S520: inputting the LED image to be detected into a preset switch LED abnormal detection model, and sequentially carrying out LED identification and LED abnormal state judgment to obtain a final LED state judgment result; the switch LED abnormality detection model is trained based on the switch LED abnormality detection model training method according to any one of the above.
S530: and when the final LED state judging result is abnormal, an alarm is sent out. The method for detecting the abnormality of the switch LED in the embodiment can automatically detect and alarm the abnormality of the switch LED, has higher accuracy, stronger embodiments and lower cost. The false judgment and omission caused by visual fatigue, color weakness, color blindness and other artificial factors are greatly reduced, the manpower and time resources can be saved, and the result error caused by subjectivity is avoided. The state of the switch LED can be monitored in real time, and the LED abnormality detection can be performed in time, so that the comprehensiveness and reliability of the switch LED monitoring are improved.
The method for sending out the alarm includes sending out alarm information and visually displaying the alarm information besides sending out the sound alarm. The method is convenient for relevant personnel to carry out maintenance treatment in time under the condition of hearing the sound alarm or seeing the alarm information.
The switch LED abnormality detection device provided by the present invention will be described below, and the switch LED abnormality detection device described below and the switch LED abnormality detection method described above may be referred to correspondingly to each other.
Referring to fig. 6, the device for detecting LED abnormality of a switch provided in this embodiment includes:
the to-be-detected LED image obtaining module 610 is configured to obtain an to-be-detected LED image of the switch;
the anomaly detection module 620 is configured to input the to-be-detected LED image into a preset switch LED anomaly detection model, and sequentially perform LED identification and LED anomaly state determination to obtain a final LED state determination result; the switch LED abnormality detection model is obtained by training based on the switch LED abnormality detection model training method according to any one of the above;
and an alarm module 630, configured to issue an alarm when the final LED status determination result is abnormal. The LED image to be detected acquisition module 610, the anomaly detection module 620 and the alarm module 630 are connected. The switch LED abnormality detection device in the embodiment can realize automatic abnormality detection and alarm of the switch LED, and has the advantages of higher accuracy, stronger practical embodiment, lower cost and stronger stability.
Fig. 7 illustrates a physical schematic diagram of an electronic device, as shown in fig. 7, which may include: processor 710, communication interface (Communications Interface) 720, memory 730, and communication bus 740, wherein processor 710, communication interface 720, memory 730 communicate with each other via communication bus 740. Processor 710 may invoke logic instructions in memory 730 to perform a switch LED anomaly detection model training method or a switch LED anomaly detection method, the switch LED anomaly detection model training method comprising: obtaining a training set, wherein the training set comprises: LED image training samples of a plurality of switches, and training marks corresponding to the LED image training samples one by one, wherein the training marks comprise: LED recognition result training marks and LED state training marks; inputting an LED image training sample into a preset LED identification sub-network to carry out LED identification to obtain a first LED identification result; inputting the first LED identification result into a preset LED abnormal detection sub-network, and judging the abnormal state of the LEDs to obtain a first LED state judgment result; training the LED recognition sub-network based on the difference between the first LED recognition result and the corresponding LED recognition result training mark to obtain a target LED recognition sub-network; training the LED recognition sub-network and the LED abnormality detection sub-network based on the difference between the first LED state judging result and the corresponding LED state training mark to obtain a target LED abnormality detection sub-network; and based on the target LED recognition sub-network and the target LED abnormality detection sub-network, obtaining an exchanger LED abnormality detection model. The switch LED abnormality detection method comprises the following steps: acquiring an LED image to be detected of a switch; inputting the LED image to be detected into a preset switch LED abnormal detection model, and sequentially carrying out LED identification and LED abnormal state judgment to obtain a final LED state judgment result; the switch LED abnormality detection model is obtained by training based on the switch LED abnormality detection model training method according to any one of the above; and when the final LED state judgment result is abnormal, an alarm is sent out.
Further, the logic instructions in the memory 730 described above may be implemented in the form of software functional units and may be stored in a computer readable storage medium when sold or used as a stand alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In still another aspect, the present invention further provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the switch LED anomaly detection model training method or the switch LED anomaly detection method provided by the above methods, the switch LED anomaly detection model training method comprising: obtaining a training set, wherein the training set comprises: LED image training samples of a plurality of switches, and training marks corresponding to the LED image training samples one by one, wherein the training marks comprise: LED recognition result training marks and LED state training marks; inputting an LED image training sample into a preset LED identification sub-network to carry out LED identification to obtain a first LED identification result; inputting the first LED identification result into a preset LED abnormal detection sub-network, and judging the abnormal state of the LEDs to obtain a first LED state judgment result; training the LED recognition sub-network based on the difference between the first LED recognition result and the corresponding LED recognition result training mark to obtain a target LED recognition sub-network; training the LED recognition sub-network and the LED abnormality detection sub-network based on the difference between the first LED state judging result and the corresponding LED state training mark to obtain a target LED abnormality detection sub-network; and based on the target LED recognition sub-network and the target LED abnormality detection sub-network, obtaining an exchanger LED abnormality detection model. The switch LED abnormality detection method comprises the following steps: acquiring an LED image to be detected of a switch; inputting the LED image to be detected into a preset switch LED abnormal detection model, and sequentially carrying out LED identification and LED abnormal state judgment to obtain a final LED state judgment result; the switch LED abnormality detection model is obtained by training based on the switch LED abnormality detection model training method according to any one of the above; and when the final LED state judgment result is abnormal, an alarm is sent out.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. The training method for the LED abnormality detection model of the switch is characterized by comprising the following steps of:
obtaining a training set, the training set comprising: LED image training samples of a plurality of switches, and training marks corresponding to the LED image training samples one by one, wherein the training marks comprise: LED recognition result training marks and LED state training marks;
inputting the LED image training sample into a preset LED identification sub-network to carry out LED identification to obtain a first LED identification result;
inputting the first LED identification result into a preset LED abnormal detection sub-network, and judging the abnormal state of the LEDs to obtain a first LED state judgment result;
Training the LED recognition sub-network based on the difference between the first LED recognition result and the corresponding LED recognition result training mark; training the LED identification sub-network and the LED abnormality detection sub-network based on the difference between the first LED state judgment result and the corresponding LED state training identifier to obtain a target LED identification sub-network and a target LED abnormality detection sub-network;
and obtaining an LED abnormality detection model of the switch based on the target LED identification sub-network and the target LED abnormality detection sub-network.
2. The method for training the switch LED anomaly detection model of claim 1, wherein the first LED identification result comprises: the LED lamp color recognition method comprises the steps of a first LED lamp color recognition result and a first LED behavior recognition result, wherein the first LED behavior recognition result is flickering, long-bright or long-dark; the first LED state judging result is normal or abnormal; and under the condition that the first LED state judging result is abnormal, the output result of the LED abnormality detection sub-network further comprises abnormal port marking information, wherein the abnormal port marking information is information of a switch port corresponding to the abnormal LED.
3. The method for training the abnormality detection model of the switch LED according to claim 1, wherein the step of obtaining the abnormality detection model of the switch LED based on the target LED identification sub-network and the target LED abnormality detection sub-network comprises:
acquiring a target LED image of the switch, and acquiring current signals and voltage signals of each LED of the switch, wherein the current signals correspond to the LEDs one by one, and the voltage signals correspond to the LEDs one by one;
inputting the target LED image into the target LED identification sub-network, and carrying out LED identification to obtain a second LED identification result, wherein the second LED identification result comprises: the second LED lamp color recognition result and the second LED behavior recognition result are flickering, long-bright or long-dark;
determining a standard lamp color of the corresponding LED based on the current signal;
determining standard behavior information of the corresponding LED based on the voltage signal, wherein the standard behavior information is flickering, long-bright or long-dark;
carrying out parameter correction on the target LED identification sub-network under the condition that the second LED lamp color identification result is different from the standard lamp color or the second LED behavior identification result is different from the standard behavior information;
And obtaining the switch LED abnormality detection model based on the target LED abnormality detection sub-network and the corrected target LED identification sub-network.
4. The method of training a switch LED anomaly detection model of claim 3, wherein the step of obtaining the switch LED anomaly detection model based on the target LED anomaly detection sub-network and the corrected target LED identification sub-network comprises:
obtaining a check set, the check set comprising: LED image check samples of a plurality of switches and check marks corresponding to the LED image check samples one by one, wherein the check marks comprise: the LED identification result verification mark and the LED state verification mark;
using the verification set to verify the target LED abnormal detection sub-network and the corrected target LED identification sub-network;
and determining the target LED identification sub-network and the target LED abnormality detection sub-network which pass verification as the switch LED abnormality detection model.
5. The method of training the switch LED anomaly detection model of claim 4, wherein the step of verifying the target LED anomaly detection subnetwork and the corrected target LED identification subnetwork using the verification set comprises:
Inputting the LED image verification sample into the corrected target LED identification sub-network to carry out LED identification to obtain a third LED identification result, wherein the third LED identification result comprises: the third LED lamp color recognition result and the third LED behavior recognition result are flickering, long-bright or long-dark;
inputting the third LED identification result into the corrected target LED abnormal detection sub-network, and judging the abnormal state of the LEDs to obtain a second LED state judgment result;
determining that the first LED is passed when the third LED identification result is the same as the corresponding LED identification result verification identifier and the second LED state judgment result is the same as the corresponding LED state verification identifier;
and under the condition that the continuous accumulated times of the one pass exceeds a preset verification threshold, determining that the target LED identification sub-network and the target LED abnormality detection sub-network pass the verification.
6. The utility model provides a switch LED anomaly detection model trainer which characterized in that includes:
the training set acquisition module is used for acquiring a training set, and the training set comprises: LED image training samples of a plurality of switches, and training marks corresponding to the LED image training samples one by one, wherein the training marks comprise: LED recognition result training marks and LED state training marks;
The LED recognition module is used for inputting the LED image training sample into a preset LED recognition sub-network to carry out LED recognition so as to obtain a first LED recognition result;
the LED abnormal state judging module is used for inputting the first LED identification result into a preset LED abnormal detection sub-network to judge the LED abnormal state so as to obtain a first LED state judging result;
the training module is used for training the LED recognition sub-network based on the difference between the first LED recognition result and the corresponding LED recognition result training mark; training the LED identification sub-network and the LED abnormality detection sub-network based on the difference between the first LED state judgment result and the corresponding LED state training identifier to obtain a target LED identification sub-network and a target LED abnormality detection sub-network;
and the processing module is used for obtaining the switch LED abnormality detection model based on the target LED identification sub-network and the target LED abnormality detection sub-network.
7. A method for detecting LED anomalies in a switch, comprising:
acquiring an LED image to be detected of a switch;
inputting the LED image to be detected into a preset switch LED abnormal detection model, and sequentially carrying out LED identification and LED abnormal state judgment to obtain a final LED state judgment result; the switch LED abnormality detection model is trained based on the switch LED abnormality detection model training method according to any one of claims 1 to 5;
And when the final LED state judging result is abnormal, an alarm is sent out.
8. An abnormality detection device for an LED of a switch, comprising:
the LED image acquisition module to be detected is used for acquiring an LED image to be detected of the switch;
the abnormality detection module is used for inputting the LED image to be detected into a preset switch LED abnormality detection model, and sequentially carrying out LED identification and LED abnormal state judgment to obtain a final LED state judgment result; the switch LED abnormality detection model is trained based on the switch LED abnormality detection model training method according to any one of claims 1 to 5;
and the alarm module is used for sending out an alarm when the final LED state judgment result is abnormal.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the switch LED anomaly detection model training method of any one of claims 1 to 5 or the switch LED anomaly detection method of claim 7 when the program is executed by the processor.
10. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the switch LED anomaly detection model training method of any one of claims 1 to 5 or the switch LED anomaly detection method of claim 7.
CN202311605940.9A 2023-11-28 2023-11-28 Training method and device for LED abnormality detection model of switch Pending CN117809078A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311605940.9A CN117809078A (en) 2023-11-28 2023-11-28 Training method and device for LED abnormality detection model of switch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311605940.9A CN117809078A (en) 2023-11-28 2023-11-28 Training method and device for LED abnormality detection model of switch

Publications (1)

Publication Number Publication Date
CN117809078A true CN117809078A (en) 2024-04-02

Family

ID=90430841

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311605940.9A Pending CN117809078A (en) 2023-11-28 2023-11-28 Training method and device for LED abnormality detection model of switch

Country Status (1)

Country Link
CN (1) CN117809078A (en)

Similar Documents

Publication Publication Date Title
US11380232B2 (en) Display screen quality detection method, apparatus, electronic device and storage medium
CN107103330A (en) A kind of LED status recognition methods and device
CN112364740B (en) Unmanned aerial vehicle room monitoring method and system based on computer vision
CN113469953A (en) Transmission line insulator defect detection method based on improved YOLOv4 algorithm
CN104897367A (en) Indicating light optical state automatic test method and system
CN110738164A (en) Part abnormity detection method, model training method and device
CN116630319B (en) Machine learning-based data acquisition board card welding defect detection method
KR20190120958A (en) Methods and system for vision-based automatic fault notification and classification of system lighting
CN116297199B (en) Detection system for automatically detecting lithium battery parameters based on machine vision
CN112070749A (en) Paper defect detection method and device
CN111062941B (en) Point light source fault detection device and method
CN109684900B (en) Method and apparatus for outputting color information
CN110567967B (en) Display panel detection method, system, terminal device and computer readable medium
CN117437227B (en) Image generation and defect detection method, device, medium, equipment and product
CN117809078A (en) Training method and device for LED abnormality detection model of switch
CN113325299A (en) Quality inspection method for PCBA (printed circuit board assembly) and related components thereof
CN116629465A (en) Smart power grids video monitoring and risk prediction response system
CN111028250A (en) Real-time intelligent cloth inspecting method and system
CN107727366B (en) Detection method, device, system and the storage medium of motor car inspection and repair depositary management corridor illumination
CN111415326A (en) Method and system for detecting abnormal state of railway contact net bolt
CN116363397A (en) Equipment fault checking method, device and inspection system
CN115147386A (en) Defect detection method and device for U-shaped pipe and electronic equipment
CN113709065A (en) Automatic detection method, system, equipment and storage medium for panel light of switch
CN112070164A (en) Dry and wet sludge classification method and device
CN114820616B (en) Equipment state detection method and device for flashing mode indicator light

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination