Pantograph real-time detection method based on image recognition
Using image recognition technology, combined with ambiguity, structural anomalies and foreign object recognition models, alarm signals are generated, which solves the problem that existing pantograph detection methods fail to fully consider influencing factors and improves the safety of train operations.
Patent Information
- Application Number
- CN202410945954.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-10-22
AI Technical Summary
The existing pantograph detection method only considers the status of the pantograph itself and fails to fully consider other influencing factors, resulting in insufficient comprehensiveness of the detection method and thus affecting the safety of train operation.
Using a real-time detection method based on image recognition, the video data is acquired, pre-processed and then the image is input into the fuzzy recognition model, structural anomaly detection model and foreign object recognition model to generate an alarm signal and separately handle various influencing factors in pantograph detection. .
It improves the comprehensiveness and accuracy of pantograph detection, improves the safety of train operation, and ensures comprehensive monitoring of the pantograph status.
Smart Images

Figure CN118823643A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image processing and recognition, and specifically is a real-time detection method of a pantograph based on image recognition. Background Art
[0002] With the rapid development of urban rail transit, the requirements for the safety and stability of train operation are increasing. As an important part of the train power supply, the operating status of the pantograph is directly related to the safe operation of the train. However, the traditional pantograph detection method mainly relies on manual detection, which has the disadvantages of large workload, low efficiency, and great influence by human factors, and cannot meet the high requirements of modern urban rail transit for safety detection.
[0003] The prior art (invention patent application with publication number CN117710858A) discloses a pantograph state detection method and device thereof, including: identifying position information of a pantograph head area based on a video stream for the pantograph area; determining motion state information of the pantograph based on the position information and preset motion rules; generating a start instruction when it is determined that the motion state information represents the end of pantograph raising, wherein the start instruction is used to start an edge detection model, and the edge detection model is used to determine the displacement information of the contact point from the beginning to the end of pantograph raising and the deflection angle information of the carbon slide board; and generating a termination instruction when it is determined that the state information represents the beginning of pantograph lowering, wherein the termination instruction is used to terminate the edge detection model.
[0004] The above-mentioned pantograph state detection method and device determine the motion state information of the pantograph by identifying the position information of the pantograph head area and the preset motion rules, generate corresponding instructions according to the motion state information of the pantograph and operate the corresponding edge detection model to realize the pantograph state detection; but since the above-mentioned scheme only considers the state detection of the pantograph itself, and does not consider other influencing factors existing in the pantograph state detection, the pantograph detection method is not comprehensive enough, which in turn leads to the problem of low safety during train operation. Therefore, the pantograph detection method still needs to be further improved. Summary of the invention
[0005] The present application aims to solve at least one of the technical problems existing in the prior art; to this end, the present application proposes a real-time pantograph detection method based on image recognition, which is used to solve the technical problem that the prior art only considers the status detection of the pantograph itself, but does not consider other influencing factors existing in the pantograph status detection, resulting in the pantograph detection method being not comprehensive enough, and then resulting in low safety during train operation. The present application obtains detection video data and obtains several detection images according to the detection video data; preprocesses the detection image to obtain a preprocessed image; inputs the preprocessed image into a pantograph recognition model to obtain a detection result; and issues an alarm based on the detection result; the pantograph recognition model in the present application is composed of a fuzzy recognition model, a structural anomaly detection model and a foreign object recognition model. By separately processing the pantograph abnormality detection process, a variety of influencing factors existing in the pantograph detection process are added, which further improves the safety of the train during operation and solves the above-mentioned problems.
[0006] To achieve the above objectives, the first aspect of the present application provides a pantograph real-time detection method based on image recognition, comprising:
[0007] S1: Acquire detection video data, and obtain a number of detection images according to the detection video data;
[0008] S2: preprocessing the detection image to obtain a preprocessed image;
[0009] S3: Inputting the preprocessed image into a fuzzy recognition model to obtain its corresponding fuzziness label; the fuzzy recognition model is constructed based on a random forest algorithm;
[0010] S4: inputting the preprocessed image with a normal fuzzy label into the pantograph structural abnormality model to obtain a structural label; the pantograph structural abnormality model is constructed based on the KCF algorithm;
[0011] S5: Input the preprocessed image with a normal blur label into a foreign body recognition model to obtain a category label; the foreign body recognition model is constructed based on the YoloV5 network model;
[0012] S6: Generate an alarm signal based on several ambiguity labels, structure labels and category labels.
[0013] The present application obtains detection video data, obtains several detection images according to the detection video data; pre-processes the detection image to obtain a pre-processed image; inputs the pre-processed image into a fuzzy recognition model to obtain its corresponding fuzziness label; the fuzzy recognition model is constructed based on a random forest algorithm; inputs the pre-processed image with a normal fuzziness label into a pantograph structural abnormality model to obtain a structural label; the pantograph structural abnormality model is constructed based on a KCF algorithm; inputs the pre-processed image with a normal fuzziness label into a foreign object recognition model to obtain a category label; the foreign object recognition model is constructed based on a YoloV5 network model; generates an alarm signal based on several fuzziness labels, structural labels and category labels, and separately processes the pantograph abnormality detection process, thereby increasing other influencing factors in the pantograph detection process and improving the safety of train operation.
[0014] Furthermore, the preprocessing of the detection image to obtain a preprocessed image includes:
[0015] Obtain a detection image and determine whether the resolution of the detection image is greater than a set resolution threshold;
[0016] If yes, data cleaning is performed on the detection image to obtain a pre-processed image, wherein the data cleaning includes missing, redundant and inconsistent operations, and finally a pre-processed image is obtained;
[0017] If not, the detection image is discarded.
[0018] Furthermore, the fuzzy recognition model is constructed based on the random forest algorithm, comprising the following steps:
[0019] Step 1: Obtain several historical images and their corresponding fuzziness labels; the fuzziness labels are fuzzy and normal;
[0020] Step 2: extracting identification features of each historical image, wherein the identification features include texture features and edge features; dividing the historical images and their corresponding fuzziness labels and identification features into a training set, a validation set, and a test set according to a certain ratio;
[0021] Step 3: Set the number of decision trees and build a random forest model;
[0022] Step 4: Use the training set to train the random forest model; use the validation set to adjust the trained random forest model; use the test set to correct the validated random forest model; and finally obtain a fuzzy recognition model whose input is the preprocessed image and output is the fuzziness label.
[0023] Furthermore, the pantograph structural abnormality model is constructed based on the KCF algorithm, comprising the following steps:
[0024] Step 1: Get a standard frame image, and set the tracking target and initial tracking frame in the standard frame image;
[0025] Step 2: Track several preprocessed images using the KCF algorithm to obtain tracking frames corresponding to the preprocessed images; and mark the scale of the tracking frame as the tracking frame scale of the corresponding preprocessed image;
[0026] Step 3: Obtain the standard frame scale, calculate the scale difference between several tracking frame scales and the standard frame scale; arrange several scale differences in frame order to fit and generate a scale difference discrete function C(i); determine whether the scale difference discrete function is a periodic function;
[0027] If yes, the scale difference coefficient DC1 is calculated by the formula DC1 = (α1 × ∑C(i)) / N + α2 × [max(C(i)) - min(C(i))]; where α1 and α2 are weight coefficients; i∈(0, N), and i is a positive integer; when the scale difference coefficient is greater than the coefficient threshold, the structural label is set to structural abnormality; otherwise, the structural label is set to structural normality;
[0028] If not, the scale difference coefficient DC2 is calculated by the formula DC2=max(C(i))-min(C(i)); when the scale difference coefficient DC2 is greater than the coefficient threshold DC2, the structure label is set to abnormal structure; otherwise, the structure label is set to normal structure.
[0029] Furthermore, the standard frame scale is obtained through several historical images with normal structure labels, including:
[0030] Acquire a number of historical images whose fuzziness labels are normal and whose structure labels are normal, and their corresponding structure labels; the structure labels include abnormal and normal;
[0031] The KCF algorithm is used to track several historical images to obtain their corresponding tracking frames; the corresponding scale of each tracking frame is marked as the normal frame scale ZCj; j is the number of the historical image; the scale of the initial tracking frame is marked as CC;
[0032] The standard frame scale BC is calculated by the formula BC=γ×CC+∑(βj×ZCj); wherein γ and βj are weight coefficients, and γ>∑(βj); j∈(0,m), and j is a positive integer, and m is the total number of historical images whose blur label is normal and whose structure label is normal.
[0033] The present application determines the standard frame scale by obtaining the scale of the initial tracking frame in the historical image and marking the corresponding scales of several tracking frames as normal frame scales, so that the standard frame scale is more in line with the actual situation and improves the accuracy of judging whether the pantograph has structural abnormalities.
[0034] Furthermore, the foreign body recognition model is constructed based on the YoloV5 network model, including the following steps:
[0035] Step 1: Obtain several historical images with normal blur labels and their corresponding category labels; the category labels include no foreign matter and foreign matter categories;
[0036] Step 2: Divide the historical images and their corresponding category labels into a training set, a validation set, and a test set according to a certain ratio;
[0037] Step 3: Select the YoloV5 network model as the basic model;
[0038] Step 4: Use the training set to train the basic model; use the validation set to adjust the trained basic model; use the test set to correct the verified basic model; and finally obtain a foreign body recognition model whose input is the preprocessed image and output is the category label.
[0039] Further, generating an alarm signal based on the ambiguity label, the structure label and the category label includes:
[0040] When the number of ambiguity labels being ambiguity is greater than an upper threshold of one, a ambiguity alarm signal is generated;
[0041] When the structural abnormality tag is structural abnormality, a pantograph structural abnormality alarm is generated;
[0042] When the number of categories labeled as foreign objects is greater than the upper threshold value 2, a foreign object alarm signal is generated; the alarm signal includes a fuzzy alarm signal, a pantograph structure abnormality alarm and a foreign object alarm signal.
[0043] Compared with the prior art, the beneficial effects of this application are:
[0044] 1. The present application obtains detection video data and obtains several detection images according to the detection video data; preprocesses the detection image to obtain a preprocessed image; inputs the preprocessed image into a fuzzy recognition model to obtain its corresponding fuzziness label; inputs the preprocessed image with a normal fuzziness label into a pantograph structural abnormality model to obtain a structure label; inputs the preprocessed image with a normal fuzziness label into a foreign object recognition model to obtain a category label; generates an alarm signal based on several fuzziness labels, structure labels and category labels, and separately processes the pantograph abnormality detection process, thereby increasing other influencing factors in the pantograph detection process and improving the safety of train operation.
[0045] 2. This application determines the standard frame scale by obtaining the scale of the initial tracking frame in the historical image and marking the corresponding scales of several tracking frames as normal frame scales, so that the standard frame scale is more in line with the actual situation and improves the accuracy of judging whether the pantograph has structural abnormalities. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 This is a step diagram of a pantograph real-time detection method based on image recognition in the present application;
[0048] Figure 2 This is a flowchart of alarm generation for a real-time pantograph detection method based on image recognition in the present application. DETAILED DESCRIPTION
[0049] The technical solution of the present application will be described clearly and completely in conjunction with the embodiments below. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
[0050] See also Figure 1 The first aspect of the present application provides a pantograph real-time detection method based on image recognition, including:
[0051] S1: Acquire detection video data, and obtain a number of detection images according to the detection video data; the detection video data is a pantograph status video taken by a camera, and the detection image is an image obtained by dividing the detection video into frames;
[0052] S2: preprocessing the detection image to obtain a preprocessed image;
[0053] S3: Inputting the preprocessed image into a fuzzy recognition model to obtain its corresponding fuzziness label; the fuzzy recognition model is constructed based on a random forest algorithm;
[0054] S4: inputting the preprocessed image with a normal fuzzy label into the pantograph structural abnormality model to obtain a structural label; the pantograph structural abnormality model is constructed based on the KCF algorithm;
[0055] S5: Input the preprocessed image with a normal blur label into a foreign body recognition model to obtain a category label; the foreign body recognition model is constructed based on the YoloV5 network model;
[0056] S6: Generate an alarm signal based on several ambiguity labels, structure labels and category labels.
[0057] This embodiment obtains detection video data, obtains several detection images according to the detection video data; preprocesses the detection image to obtain a preprocessed image; inputs the preprocessed image into a fuzzy recognition model to obtain its corresponding fuzziness label; inputs the preprocessed image with a normal fuzziness label into a pantograph structural abnormality model to obtain a structure label; inputs the preprocessed image with a normal fuzziness label into a foreign object recognition model to obtain a category label; generates an alarm signal based on several fuzziness labels, structure labels and category labels, and increases the multiple influencing factors that may exist in the pantograph detection process by separately processing the pantograph abnormality detection process, thereby further improving the safety of train operation.
[0058] The detection image is preprocessed to obtain a preprocessed image, including:
[0059] Acquire a detection image, and determine whether the resolution of the detection image is greater than a set resolution threshold; wherein pixels per inch (ppi) is selected as the resolution unit, and the resolution threshold is set based on experience, and in this embodiment, the resolution threshold is 300ppi;
[0060] If yes, data cleaning is performed on the detection image to obtain a preprocessed image. Data cleaning includes missing, redundant and inconsistent operations, and finally a preprocessed image is obtained. Missing operation refers to the process of solving the loss of key information in the detection image by filling or deleting methods; redundant operation refers to the process of deleting the repeated continuous content in the detection image; inconsistent operation refers to the process of solving the obvious differences in color, brightness and contrast in the detection image by adjusting methods;
[0061] If not, the detected image is discarded.
[0062] The fuzzy recognition model is constructed based on the random forest algorithm, which includes the following steps:
[0063] Step 1: Obtain several historical images and their corresponding fuzziness labels; the fuzziness labels are fuzzy and normal; the historical images are pantograph images collected historically;
[0064] Step 2: extract the identification features of each historical image, the identification features include texture features and edge features; divide the historical images and their corresponding fuzzy labels and identification features into a training set, a validation set and a test set according to a certain ratio; the division ratio is set according to experience, and the division ratio in this embodiment is 7:2:1;
[0065] Step 3: Set the number of decision trees and build a random forest model; the number of decision trees and the maximum depth of the decision trees are set based on experience. In this embodiment, the number of decision trees is set to 30 and the maximum depth of the decision trees is set to 10;
[0066] Step 4: Use the training set to train the random forest model; use the validation set to adjust the trained random forest model; use the test set to correct the validated random forest model; and finally obtain a fuzzy recognition model whose input is the preprocessed image and output is the fuzziness label.
[0067] The ambiguity labels in this embodiment are first converted to obtain corresponding data labels during training, and then matched to corresponding ambiguity labels according to output data labels during output.
[0068] The pantograph structural anomaly model is constructed based on the KCF algorithm, which includes the following steps:
[0069] Step 1: Obtain a standard frame image, and set the tracking target and initial tracking frame in the standard frame image; the standard frame image is a set normal pantograph image;
[0070] Step 2: Track several preprocessed images using the KCF algorithm to obtain tracking frames corresponding to the preprocessed images; and mark the scale of the tracking frame as the tracking frame scale of the corresponding preprocessed image; the tracking frame scale is usually represented by a scale factor, which represents a multiple of the initial frame scale of the tracked target. The scale factor is a set of arithmetic difference values formed by fixed differences above and below the initial frame scale set to 1; the fixed difference is set based on experience, and the fixed difference in this embodiment is set to 0.005;
[0071] Step 3: Obtain the standard frame scale, calculate the scale difference between several tracking frame scales and the standard frame scale; arrange several scale differences in frame order to fit and generate a scale difference discrete function C(i); determine whether the scale difference discrete function is a periodic function;
[0072] If yes, the scale difference coefficient DC1 is calculated by the formula DC1 = (α1×∑(|C(i)|)) / N+α2×[max(C(i))-min(C(i))]; where α1 and α2 are weight coefficients; i∈(0, N), and i is a positive integer; when the scale difference coefficient is greater than the coefficient threshold, the structural label is set to structural abnormality; otherwise, the structural label is set to structural normality;
[0073] If not, the scale difference coefficient DC2 is calculated by the formula DC2=max(C(i))-min(C(i)); when the scale difference coefficient DC2 is greater than the coefficient threshold 2, the structure label is set to abnormal structure; otherwise, the structure label is set to normal structure; α1 and α2 are set according to experience. In this embodiment, α1 and α2 are set to 0.8 and 0.2 respectively; coefficient threshold 1 and coefficient threshold 2 are set according to experience. In this embodiment, coefficient threshold 1 is set to 0.04 and coefficient threshold 2 is set to 0.02.
[0074] In this embodiment, when the discrete function composed of the scale differences corresponding to several pre-processed images, i.e., pantograph detection images, is a periodic function, the average scale difference of the scale differences corresponding to the pantograph detection images and the maximum difference between the maximum scale difference and the minimum scale difference are calculated; the absolute value of the average scale difference and the maximum difference are weightedly summed to obtain the corresponding scale difference coefficient one; when the average scale difference is larger or the maximum difference is larger, it means that the tracking frame scale deviates more and more from the standard frame scale, that is, the state difference between the detected pantograph and the normal pantograph is larger; the corresponding scale difference coefficient one of the pantograph detection image is larger; when the scale difference coefficient one is greater than the set coefficient threshold one, the structure label is set to structural abnormality; otherwise, it means that the vibration of the train may cause the vibration between the acquisition camera and the pantograph to be out of sync, resulting in regular changes in the scale differences corresponding to each pre-processed image, not the pantograph structure abnormality, so the structure label is set to structural normal.
[0075] When the discrete function composed of the scale differences corresponding to several preprocessed images, i.e., pantograph detection images, is a non-periodic function; the scale difference coefficient 2 is generated according to the maximum gap between the maximum scale difference and the minimum scale difference; the larger the maximum gap, the larger the scale difference coefficient 2; when the scale difference coefficient 2 is greater than the set coefficient threshold 2, it means that the anomaly generated by the pantograph has exceeded the acceptable range; at this time, the structure label is set to structural abnormality, and when the scale difference coefficient 2 is less than or equal to the set coefficient threshold 2; it means that the anomaly generated by the pantograph is within an acceptable range; at this time, the structure label is set to structural normal.
[0076] The improved KCF algorithm needs to meet the following conditions:
[0077] The basic KCF algorithm does not take into account the scale change of the target. Therefore, the scale of the output tracking box of the basic KCF algorithm remains unchanged during the tracking process. Now it is necessary to take the scale change factor into account. This embodiment introduces a scale pooling method to increase the possibility and diversity of scale changes. The scale pool is set at an interval of 0.005. The scale pool is set as follows: {1.030, 1.025, 1.020, 1.015, 1.010, 1.005, 1.000, 0.995, 0.990, 0.985, 0.980, 0.975, 0.970}.
[0078] The feature used by the basic KCF algorithm in the tracking process is the HOG single feature. In this embodiment, by fusing color features, texture features and HOG features as the features of the tracking target, the fusion of multiple features can greatly improve the accuracy and efficiency of target tracking, which plays a great role in the subsequent judgment of the structural abnormality of the pantograph.
[0079] The standard frame scale is obtained through several historical images whose structure labels are normal, including:
[0080] Obtaining a number of historical images whose fuzziness labels are normal and whose structure labels are normal, and their corresponding structure labels; the structure labels include abnormal and normal;
[0081] The KCF algorithm is used to track several historical images to obtain their corresponding tracking frames; the corresponding scale of each tracking frame is marked as the normal frame scale ZCj; j is the number of the historical image; the scale of the initial tracking frame is marked as CC;
[0082] The standard frame scale BC is calculated by the formula BC=γ×CC+∑(βj×ZCj); wherein γ and βj are weight coefficients, and γ>∑(βj), γ+∑(βj)=1; j∈(0,m), and j is a positive integer, and m is the total number of historical images whose blur label is normal and whose structure label is normal; the reason why the scale of the initial tracking frame is given a larger weight in the formula is that the scale set in the initial frame is closest to the reality, and the scale in the subsequent tracking frame is a comprehensive calculation value, which has a great relationship with the difference of the scale factor, so the scale of the subsequent tracking frame is given a smaller weight.
[0083] This embodiment determines the standard frame scale by obtaining the scale of the initial tracking frame in the historical image and marking the corresponding scales of several tracking frames as normal frame scales, so that the standard frame scale is more in line with the actual situation and improves the accuracy of judging whether the pantograph has structural abnormalities.
[0084] It is worth noting that in this embodiment, the subsequent preprocessed images with a blur label of normal and a normal structure label can also be added as historical images with a blur label of normal and a normal structure label to the calculation of the standard frame scale. This can ensure that the standard frame scale is no longer a fixed value, but a standard frame scale with a certain error range, further improving the accuracy of judging whether the pantograph has a structural abnormality.
[0085] The foreign body recognition model is built based on the YoloV5 network model, including the following steps:
[0086] Step 1: Obtain several historical images with normal blur labels and their corresponding category labels; the category labels include no foreign objects and foreign objects categories; the historical images are images of foreign objects on the pantograph, including: ground film, dust net, plastic packaging bag, kite, bird, branch and other categories, and no foreign objects means images without foreign objects;
[0087] Step 2: Divide the historical images and their corresponding category labels into a training set, a validation set, and a test set according to a certain ratio; the division ratio is set based on experience, and the division ratio in this embodiment is 7:2:1;
[0088] Step 3: Select the YoloV5 network model as the basic model;
[0089] Step 4: Use the training set to train the basic model; use the validation set to adjust the trained basic model; use the test set to correct the verified basic model; and finally obtain a foreign body recognition model whose input is the preprocessed image and output is the category label.
[0090] See also Figure 2 , generating alarm signals based on ambiguity labels, structure labels and category labels, including:
[0091] When the number of blur labels is greater than the upper threshold value 1, a blur alarm signal is generated; otherwise, no alarm signal is generated; the upper threshold value 1 is related to the total number of detection images divided by the detection video, and is set according to experience. In this embodiment, the upper threshold value 1 is set to 5% of the total number;
[0092] When the structural abnormality tag is structural abnormality, a pantograph structural abnormality alarm is generated; otherwise, no alarm signal is generated;
[0093] When the number of images with the category label of foreign matter is greater than the upper threshold value 2, a foreign matter alarm signal is generated; otherwise, no alarm signal is generated; the upper threshold value 2 is related to the total number of images with the blur label of normal matter, and is set according to experience. In this embodiment, the upper threshold value 2 is set to 3% of the total number;
[0094] The alarm signals include fuzzy alarm signals, pantograph structure abnormality alarms and foreign object alarm signals.
[0095] Part of the data in the above formula is calculated by removing the dimension and taking its numerical value. The formula is a formula closest to the actual situation obtained by software simulation of a large amount of collected data; the preset parameters and preset thresholds in the formula are set by technical personnel in this field according to actual conditions or obtained through simulation of a large amount of data.
[0096] The working principle of the present application is as follows: by acquiring detection video data, a number of detection images are obtained according to the detection video data; the detection image is preprocessed to obtain a preprocessed image; the preprocessed image is input into a fuzzy recognition model to obtain its corresponding fuzziness label; the preprocessed image with a normal fuzziness label is input into a pantograph structural abnormality model to obtain a structural label; the preprocessed image with a normal fuzziness label is input into a foreign object recognition model to obtain a category label; an alarm signal is generated based on a number of fuzziness labels, structural labels and category labels, and the pantograph abnormality detection process is processed separately to increase other influencing factors in the pantograph detection process, thereby avoiding only considering the status detection of the pantograph itself, and not considering other influencing factors in the pantograph status detection, resulting in the lack of comprehensiveness of the pantograph detection method, and further leading to the problem of low safety during train operation.
[0097] The above embodiments are only used to illustrate the technical method of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical method of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical method of the present application.
Claims
1. A real-time detection method for pantograph based on image recognition, It is characterized in that include: S1: Acquire detection video data, and obtain a number of detection images according to the detection video data; S2: preprocessing the detection image to obtain a preprocessed image; S3: input the preprocessed image into the fuzzy recognition model to obtain its corresponding fuzziness label; The fuzzy recognition model is constructed based on the random forest algorithm; S4: inputting the preprocessed image with a normal fuzzy label into the pantograph structural abnormality model to obtain a structural label; the pantograph structural abnormality model is constructed based on the KCF algorithm; S5: Input the preprocessed image with a normal blur label into a foreign body recognition model to obtain a category label; the foreign body recognition model is constructed based on the YoloV5 network model; S6: Generate an alarm signal based on several ambiguity labels, structure labels and category labels.
2. According to claim 1, a real-time detection method of pantograph based on image recognition, It is characterized in that The preprocessing of the detection image to obtain a preprocessed image includes: Obtain a detection image and determine whether the resolution of the detection image is greater than a set resolution threshold; If yes, data cleaning is performed on the detection image to obtain a pre-processed image, wherein the data cleaning includes missing, redundant and inconsistent operations, and finally a pre-processed image is obtained; If not, the detection image is discarded.
3. According to the method for real-time detection of pantograph based on image recognition according to claim 1, It is characterized in that The fuzzy recognition model is constructed based on the random forest algorithm and includes the following steps: Step 1: Obtain several historical images and their corresponding fuzziness labels; the fuzziness labels are fuzzy and normal; Step 2: extracting identification features of each historical image, wherein the identification features include texture features and edge features; dividing the historical images and their corresponding fuzziness labels and identification features into a training set, a validation set, and a test set; Step 3: Set the number of decision trees and build a random forest model; Step 4: Use the training set to train the random forest model; use the validation set to adjust the trained random forest model; use the test set to correct the validated random forest model; and finally obtain a fuzzy recognition model whose input is the preprocessed image and output is the fuzziness label.
4. The pantograph real-time detection method based on image recognition according to claim 1, It is characterized in that The pantograph structural abnormality model is constructed based on the KCF algorithm, and includes the following steps: Step 1: Get a standard frame image and set the final target and initial tracking frame in the standard frame image; Step 2: Track several preprocessed images using the KCF algorithm to obtain tracking frames corresponding to the preprocessed images; and mark the scale of the tracking frame as the tracking frame scale of the corresponding preprocessed image; Step 3: Obtain the standard frame scale, calculate the scale difference between several tracking frame scales and the standard frame scale; arrange several scale differences in frame order and fit them to generate a scale difference discrete function C(i); determine whether the scale difference discrete function is a periodic function; If yes, the scale difference coefficient DC1 is calculated by the formula DC1 = (α1 × ∑C(i)) / N + α2 × [max(C(i)) - min(C(i))]; where α1 and α2 are weight coefficients; i∈(0, N), and i is a positive integer; when the scale difference coefficient is greater than the coefficient threshold, the structural label is set to structural abnormality; otherwise, the structural label is set to structural normality; If not, the scale difference coefficient DC2 is calculated by the formula DC2=max(C(i))-min(C(i)); when the scale difference coefficient DC2 is greater than the coefficient threshold DC2, the structure label is set to abnormal structure; otherwise, the structure label is set to normal structure.
5. The method for real-time detection of pantograph based on image recognition according to claim 4, It is characterized in that The standard frame scale is obtained through several historical images with normal structure labels, including: Acquire a number of historical images whose fuzziness labels are normal and whose structure labels are normal, and their corresponding structure labels; the structure labels include abnormal and normal; The KCF algorithm is used to track several historical images to obtain their corresponding tracking frames; the corresponding scale of each tracking frame is marked as the normal frame scale ZCj; j is the number of the historical image; the scale of the initial tracking frame is marked as CC; The standard frame scale BC is calculated by the formula BC=γ×CC+∑(βj×ZCj); wherein γ and βj are weight coefficients, and γ>∑(βj); j∈(0,m), and j is a positive integer, and m is the total number of historical images whose blur label is normal and whose structure label is normal.
6. The method for real-time detection of pantograph based on image recognition according to claim 1, It is characterized in that The foreign body recognition model is constructed based on the YoloV5 network model and includes the following steps: Step 1: Obtain several historical images with normal blur labels and their corresponding category labels; the category labels include no foreign matter and foreign matter categories; Step 2: Divide the historical images and their corresponding category labels into a training set, a validation set, and a test set; Step 3: Select the YoloV5 network model as the basic model; Step 4: Use the training set to train the basic model; use the validation set to adjust the trained basic model; use the test set to correct the verified basic model; and finally obtain a foreign body recognition model whose input is the preprocessed image and output is the category label.
7. The method for real-time detection of pantograph based on image recognition according to claim 1, It is characterized in that Generating an alarm signal based on the ambiguity label, the structure label and the category label comprises: When the number of ambiguity labels being ambiguity is greater than an upper threshold of one, a ambiguity alarm signal is generated; When the structural abnormality tag is structural abnormality, a pantograph structural abnormality alarm is generated; When the number of categories labeled as foreign objects is greater than the upper threshold value 2, a foreign object alarm signal is generated; the alarm signal includes a fuzzy alarm signal, a pantograph structure abnormality alarm and a foreign object alarm signal.
